dispatch_type.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package dispatch
  2. import (
  3. "zhiyuan/pkg/db"
  4. "github.com/gin-gonic/gin"
  5. )
  6. type DispatchType struct {
  7. ID int64 `json:"id" prop:"add:false"`
  8. Name string `json:"name" label:"类别名称" type:"string" prop:"add edit" search:"like"`
  9. WorkTypeId int64 `json:"work_type_id" label:"工种" type:"int" prop:"add edit" search:"="`
  10. DeletedAt int64 `json:"deleted_at" prop:"add:false select:false"`
  11. CreatedAt int64 `json:"created_at" prop:"add:false"`
  12. UpdatedAt int64 `json:"updated_at" prop:"add:false"`
  13. db.BaseModel
  14. }
  15. func (DispatchType) TableName() string {
  16. return "zy_dispatch_type"
  17. }
  18. func (model DispatchType) ListPrivilege(c *gin.Context, data map[string]interface{}, s *db.Select) bool {
  19. return true
  20. }
  21. func (DispatchType) OnePrivilege(c *gin.Context, id int64) bool {
  22. return true
  23. }
  24. func (DispatchType) AddPrivilege(c *gin.Context, data map[string]interface{}, post map[string]interface{}) error {
  25. return nil
  26. }
  27. func (DispatchType) EditPrivilege(c *gin.Context, id int64, data map[string]interface{}, post map[string]interface{}) error {
  28. return nil
  29. }
  30. func (DispatchType) DelPrivilege(c *gin.Context, id int64) error {
  31. return nil
  32. }
  33. func (DispatchType) Page() bool {
  34. return false
  35. }
  36. func (DispatchType) Count() bool {
  37. return true
  38. }
  39. func (model DispatchType) LeftJoin(data map[string]interface{}, s *db.Select) []db.JoinModel {
  40. return []db.JoinModel{}
  41. }