|
12345678910111213141516171819202122232425262728293031323334353637 |
- package hdl
-
- import (
- "applet/app/admin/lib/validate"
- "applet/app/admin/md"
- "applet/app/db"
- "applet/app/e"
- "applet/app/enum"
- "github.com/gin-gonic/gin"
- )
-
- func SetCenter(c *gin.Context) {
- var req md.SetCenterReq
- err := c.ShouldBindJSON(&req)
- if err != nil {
- err = validate.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- sysCfgDb := db.SysCfgDb{}
- sysCfgDb.Set()
- sysCfgDb.SysCfgUpdate(enum.BigDataScreenAccount, req.BigDataScreenAccount)
- sysCfgDb.SysCfgUpdate(enum.BigDataScreenPassword, req.BigDataScreenPassword)
- sysCfgDb.SysCfgUpdate(enum.ProductionWorkshopAccount, req.ProductionWorkshopAccount)
- sysCfgDb.SysCfgUpdate(enum.ProductionWorkshopPassword, req.ProductionWorkshopPassword)
- e.OutSuc(c, "success", nil)
- return
- }
-
- func GetCenter(c *gin.Context) {
- sysCfgDb := db.SysCfgDb{}
- sysCfgDb.Set()
- res := sysCfgDb.SysCfgFindWithDb(enum.BigDataScreenAccount, enum.BigDataScreenPassword, enum.ProductionWorkshopAccount, enum.ProductionWorkshopPassword)
- e.OutSuc(c, res, nil)
- return
- }
|