面包店
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

8 ay önce
7 ay önce
8 ay önce
7 ay önce
8 ay önce
12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. sysCfgDb.SysCfgUpdate("file_bucket", req.FileBucket)
  26. sysCfgDb.SysCfgUpdate("file_bucket_region", req.FileBucketRegion)
  27. sysCfgDb.SysCfgUpdate("file_secret_key", req.FileSecretKey)
  28. sysCfgDb.SysCfgUpdate("file_bucket_host", req.FileBucketHost)
  29. sysCfgDb.SysCfgUpdate("file_access_key", req.FileAccessKey)
  30. e.OutSuc(c, "success", nil)
  31. return
  32. }
  33. func GetCenter(c *gin.Context) {
  34. sysCfgDb := db.SysCfgDb{}
  35. sysCfgDb.Set()
  36. res := sysCfgDb.SysCfgFindWithDb(enum.BigDataScreenAccount, enum.BigDataScreenPassword, enum.ProductionWorkshopAccount, enum.ProductionWorkshopPassword,
  37. "file_bucket", "file_bucket_region", "file_secret_key", "file_bucket_host", "file_access_key")
  38. e.OutSuc(c, res, nil)
  39. return
  40. }