config.go 504 B

123456789101112131415161718192021222324
  1. package models
  2. import (
  3. "rdluck_tools/orm"
  4. "time"
  5. )
  6. type CygxConfig struct {
  7. ConfigId int `json:"-" orm:"column(config_id);pk"`
  8. ConfigCode string `json:"-"`
  9. ConfigValue string
  10. Remark string `json:"-"`
  11. CreateTime time.Time `json:"-"`
  12. }
  13. func GetConfigByCode(configCode string) (item *CygxConfig, err error) {
  14. sql := `SELECT * FROM cygx_config WHERE config_code=? `
  15. err = orm.NewOrm().Raw(sql, configCode).QueryRow(&item)
  16. return
  17. }
  18. type ConfigResp struct {
  19. Item *CygxConfig
  20. }