edb_config.go 660 B

12345678910111213141516171819202122232425
  1. package data_manage
  2. import (
  3. "eta_gn/eta_api/global"
  4. )
  5. type EdbConfig struct {
  6. ConfigValue string `description:"详情"`
  7. }
  8. // EdbConfigUpdate 修改配置
  9. func EdbConfigUpdate(newValue, configCode string) (err error) {
  10. sql := `UPDATE edb_config SET config_value=? WHERE config_code= ?`
  11. err = global.DmSQL["data"].Exec(sql, newValue, configCode).Error
  12. return
  13. }
  14. // GetConfigDetailByCode 根据配置编码获取配置的值
  15. func GetConfigDetailByCode(configCode string) (item *EdbConfig, err error) {
  16. sql := ` SELECT config_value FROM edb_config WHERE config_code=? `
  17. err = global.DmSQL["data"].Raw(sql, configCode).First(&item).Error
  18. return
  19. }