entity.go 588 B

12345678910111213141516171819202122232425262728293031
  1. package hobby
  2. import (
  3. "git.sxidc.com/go-tools/utils/strutils"
  4. )
  5. type Entity struct {
  6. ID string `sqlmapping:"-" sqlresult:"-" check:"required,len=32,when=create/delete/update"`
  7. StudentIDs []string `sqlmapping:"-" sqlresult:"-"`
  8. }
  9. func (e *Entity) GenerateID() error {
  10. e.ID = strutils.SimpleUUID()
  11. return nil
  12. }
  13. func (e *Entity) GetID() string {
  14. return e.ID
  15. }
  16. func (e *Entity) DomainCNName() string {
  17. return "爱好"
  18. }
  19. func (e *Entity) DomainCamelName() string {
  20. return "Hobby"
  21. }
  22. func (e *Entity) GetFieldMap() map[string]string {
  23. return make(map[string]string)
  24. }