面包店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

38 line
1.0 KiB

  1. package hdl
  2. import (
  3. "applet/app/admin/lib/validate"
  4. "applet/app/admin/md"
  5. "applet/app/db"
  6. "applet/app/e"
  7. "applet/app/enum"
  8. "github.com/gin-gonic/gin"
  9. )
  10. func SetCenter(c *gin.Context) {
  11. var req md.SetCenterReq
  12. err := c.ShouldBindJSON(&req)
  13. if err != nil {
  14. err = validate.HandleValidateErr(err)
  15. err1 := err.(e.E)
  16. e.OutErr(c, err1.Code, err1.Error())
  17. return
  18. }
  19. sysCfgDb := db.SysCfgDb{}
  20. sysCfgDb.Set()
  21. sysCfgDb.SysCfgUpdate(enum.BigDataScreenAccount, req.BigDataScreenAccount)
  22. sysCfgDb.SysCfgUpdate(enum.BigDataScreenPassword, req.BigDataScreenPassword)
  23. sysCfgDb.SysCfgUpdate(enum.ProductionWorkshopAccount, req.ProductionWorkshopAccount)
  24. sysCfgDb.SysCfgUpdate(enum.ProductionWorkshopPassword, req.ProductionWorkshopPassword)
  25. e.OutSuc(c, "success", nil)
  26. return
  27. }
  28. func GetCenter(c *gin.Context) {
  29. sysCfgDb := db.SysCfgDb{}
  30. sysCfgDb.Set()
  31. res := sysCfgDb.SysCfgFindWithDb(enum.BigDataScreenAccount, enum.BigDataScreenPassword, enum.ProductionWorkshopAccount, enum.ProductionWorkshopPassword)
  32. e.OutSuc(c, res, nil)
  33. return
  34. }