base.go 333 B

123456789101112131415161718
  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,when=create/delete/update"`
  7. }
  8. func (e *Base) GenerateID() error {
  9. e.ID = strutils.SimpleUUID()
  10. return nil
  11. }
  12. func (e *Base) GetID() string {
  13. return e.ID
  14. }