value_object.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package configuration
  2. import (
  3. "git.sxidc.com/go-framework/baize/framework/core/domain"
  4. "git.sxidc.com/go-framework/baize/framework/core/domain/value_object"
  5. )
  6. const (
  7. FieldScope = "Scope"
  8. FieldGroup = "Group"
  9. FieldValue = "Value"
  10. )
  11. var (
  12. ColumnScope = domain.ColumnName(FieldScope)
  13. ColumnGroup = domain.ColumnName(FieldGroup)
  14. ColumnValue = domain.ColumnName(FieldValue)
  15. )
  16. var fieldMap = map[string]string{
  17. FieldScope: "范围",
  18. FieldGroup: "组",
  19. FieldValue: "值",
  20. }
  21. type ValueObject struct {
  22. value_object.Base
  23. Scope string `sqlmapping:"column:scope;key;notUpdate;" sqlresult:"column:scope;" check:"required,lte=256,when=create/delete"`
  24. Group string `sqlmapping:"column:group;key;notUpdate;" sqlresult:"column:group;" check:"required,lte=256,when=create/delete"`
  25. Value string `sqlmapping:"column:value;notUpdate;" sqlresult:"column:value;" check:"required,lte=256,when=create"`
  26. }
  27. func (valueObject *ValueObject) DomainCNName() string {
  28. return "配置"
  29. }
  30. func (valueObject *ValueObject) DomainCamelName() string {
  31. return "Configuration"
  32. }
  33. func (valueObject *ValueObject) GetFieldMap() map[string]string {
  34. return fieldMap
  35. }