product.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package quote
  2. import (
  3. "zhiyuan/pkg/db"
  4. "github.com/gin-gonic/gin"
  5. )
  6. type Product struct {
  7. ID int64 `json:"id" prop:"add:false"`
  8. TypeId int64 `json:"type_id" type:"int" prop:"add" default:"0"`
  9. Name string `json:"name" label:"产品名称" type:"string" prop:"add edit" search:"="`
  10. Price float64 `json:"price" label:"价格" type:"float" prop:"add edit"`
  11. DeletedAt int64 `json:"deleted_at" prop:"add:false select:false"`
  12. CreatedAt int64 `json:"created_at" prop:"add:false select:false"`
  13. UpdatedAt int64 `json:"updated_at" prop:"add:false select:false"`
  14. db.BaseModel
  15. }
  16. func (Product) TableName() string {
  17. return "zy_quote_product"
  18. }
  19. func (Product) ListPrivilege(c *gin.Context, data map[string]interface{}, s *db.Select) bool {
  20. return true
  21. }
  22. func (Product) OnePrivilege(c *gin.Context, id int64) bool {
  23. return true
  24. }
  25. func (Product) AddPrivilege(c *gin.Context, data map[string]interface{}, post map[string]interface{}) error {
  26. return nil
  27. }
  28. func (Product) EditPrivilege(c *gin.Context, id int64, data map[string]interface{}, post map[string]interface{}) error {
  29. return nil
  30. }
  31. func (Product) DelPrivilege(c *gin.Context, id int64) error {
  32. return nil
  33. }
  34. func (Product) Page() bool {
  35. return false
  36. }
  37. func (Product) Count() bool {
  38. return true
  39. }