entity.go 622 B

1234567891011121314151617181920212223242526272829303132
  1. package entity
  2. import (
  3. "git.sxidc.com/go-framework/baize/framwork/domain"
  4. )
  5. type Entity interface {
  6. domain.Object
  7. DomainCNName() string
  8. DomainCamelName() string
  9. GenerateID() error
  10. GetID() string
  11. CheckFieldID(domainCNName string) error
  12. ForCreate() error
  13. ForUpdate() error
  14. }
  15. func (e *Base) CheckFieldID(domainCNName string) error {
  16. return CheckID(domainCNName, "ID", e.ID)
  17. }
  18. func (e *Base) IDColumnName() string {
  19. return ColumnID
  20. }
  21. func (e *Base) ForCreate() error {
  22. panic("领域实体没有实现ForCreate接口")
  23. }
  24. func (e *Base) ForUpdate() error {
  25. panic("领域实体没有实现ForUpdate接口")
  26. }