entity.go 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package family
  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. FieldFather = "Father"
  8. FieldMother = "Mother"
  9. )
  10. var (
  11. ColumnFather = domain.ColumnName(FieldFather)
  12. ColumnMother = domain.ColumnName(FieldMother)
  13. )
  14. var fieldMap = map[string]string{
  15. FieldFather: "父亲姓名",
  16. FieldMother: "母亲姓名",
  17. }
  18. type Entity struct {
  19. entity.Base
  20. Father string `sqlmapping:"column:father" sqlresult:"column:father" check:"required,lte=128,when=create/update"`
  21. Mother string `sqlmapping:"column:mother" sqlresult:"column:mother" check:"required,lte=128,when=create/update"`
  22. StudentID string `sqlmapping:"column:student_id" sqlresult:"column:student_id" check:"required,eq=32"`
  23. entity.TimeFields
  24. }
  25. func (e *Entity) DomainCNName() string {
  26. return "家庭"
  27. }
  28. func (e *Entity) DomainCamelName() string {
  29. return "Family"
  30. }
  31. func (e *Entity) GetFieldMap() map[string]string {
  32. return fieldMap
  33. }