entity.go 603 B

1234567891011121314151617181920212223242526272829303132
  1. package configuration
  2. import (
  3. "git.sxidc.com/go-tools/utils/strutils"
  4. "git.sxidc.com/service-supports/fserr"
  5. )
  6. const (
  7. tableName = "configurations"
  8. )
  9. const (
  10. ColumnGroup = "group"
  11. ColumnValue = "value"
  12. )
  13. type Entity struct {
  14. Group string `sqlmapping:"column:group;key;notUpdate;" sqlresult:"column:group;"`
  15. Value string `sqlmapping:"column:value;notUpdate;" sqlresult:"column:value;"`
  16. }
  17. func (e *Entity) DomainCNName() string {
  18. return "配置"
  19. }
  20. func (e *Entity) CheckKeyFields() error {
  21. if strutils.IsStringEmpty(e.Group) {
  22. return fserr.New("没有传递配置组")
  23. }
  24. return nil
  25. }