mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
19 lines
630 B
Go
19 lines
630 B
Go
package management
|
|
|
|
import "github.com/gin-gonic/gin"
|
|
|
|
// Quota exceeded toggles
|
|
func (h *Handler) GetSwitchProject(c *gin.Context) {
|
|
c.JSON(200, gin.H{"switch-project": h.cfg.QuotaExceeded.SwitchProject})
|
|
}
|
|
func (h *Handler) PutSwitchProject(c *gin.Context) {
|
|
h.updateBoolField(c, func(v bool) { h.cfg.QuotaExceeded.SwitchProject = v })
|
|
}
|
|
|
|
func (h *Handler) GetSwitchPreviewModel(c *gin.Context) {
|
|
c.JSON(200, gin.H{"switch-preview-model": h.cfg.QuotaExceeded.SwitchPreviewModel})
|
|
}
|
|
func (h *Handler) PutSwitchPreviewModel(c *gin.Context) {
|
|
h.updateBoolField(c, func(v bool) { h.cfg.QuotaExceeded.SwitchPreviewModel = v })
|
|
}
|