entity.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package role
  2. import (
  3. "git.sxidc.com/go-framework/baize/framework/core/domain"
  4. "git.sxidc.com/go-framework/baize/framework/core/domain/entity"
  5. )
  6. const (
  7. FieldName = "Name"
  8. FieldDescription = "Description"
  9. )
  10. var (
  11. ColumnName = domain.ColumnName(FieldName)
  12. ColumnDescription = domain.ColumnName(FieldDescription)
  13. )
  14. var fieldMap = map[string]string{
  15. FieldName: "角色名称",
  16. FieldDescription: "角色描述",
  17. }
  18. type Entity struct {
  19. entity.Base
  20. Name string `sqlmapping:"column:name" sqlresult:"column:name" check:"required,lte=256,when=create/update"`
  21. Description string `sqlmapping:"column:description;updateClear" sqlresult:"column:description"`
  22. UserIDs []string `sqlmapping:"-" sqlresult:"-"`
  23. PermissionIDs []string `sqlmapping:"-" sqlresult:"-"`
  24. entity.UserIDFields
  25. entity.TimeFields
  26. }
  27. func (e *Entity) DomainCNName() string {
  28. return "角色"
  29. }
  30. func (e *Entity) DomainCamelName() string {
  31. return "Role"
  32. }
  33. func (e *Entity) GetFieldMap() map[string]string {
  34. return fieldMap
  35. }