123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package controllers
- import (
- "AIOTCOER/conf"
- "AIOTCOER/lib"
- "AIOTCOER/logs"
- beego "github.com/beego/beego/v2/server/web"
- )
- type SystemController struct {
- beego.Controller
- }
- // 列表 -
- func (c *SystemController) RunTime() {
- lib.PullHandleTime.Mu.RLock()
- c.Data["json"] = lib.JSONR{Code: 200, Msg: "ok!", Data: lib.PullHandleTime.Num}
- lib.PullHandleTime.Mu.RUnlock()
- c.ServeJSON()
- return
- }
- // 列表 -
- func (c *SystemController) SystemConfig() {
- if c.GetString("AdminTokey") != conf.Config_AdminTokey {
- c.Data["json"] = lib.JSONR{Code: lib.Error, Msg: "AdminTokey E!"}
- c.ServeJSON()
- return
- }
- AddProduct, err := c.GetBool("AddProduct")
- if err == nil {
- conf.Config_AddProductType = AddProduct
- logs.Println("Config_AddProductType",AddProduct)
- }
- c.Data["json"] = lib.JSONR{Code: 200, Msg: "ok!", Data: lib.PullHandleTime.Num}
- c.ServeJSON()
- return
- }
|