base.go 356 B

12345678910111213141516171819202122
  1. package entity
  2. import (
  3. "git.sxidc.com/go-tools/utils/strutils"
  4. )
  5. type Base struct {
  6. ID string `sqlmapping:"column:id;key;" sqlresult:"column:id;" check:"required,len=32"`
  7. }
  8. func (e *Base) DBSchema() string {
  9. return ""
  10. }
  11. func (e *Base) GenerateID() error {
  12. e.ID = strutils.SimpleUUID()
  13. return nil
  14. }
  15. func (e *Base) GetID() string {
  16. return e.ID
  17. }