item.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. package quote
  2. import (
  3. "zhiyuan/pkg/db"
  4. "zhiyuan/services/structs"
  5. "github.com/gin-gonic/gin"
  6. )
  7. type Item struct {
  8. ID int64 `json:"id" prop:"add:false"`
  9. Category int64 `json:"category" type:"int" prop:"add edit" default:"0" search:"="`
  10. Name string `json:"name" label:"项目名称" type:"string" prop:"add edit" search:"="`
  11. RoomType int64 `json:"room_type" label:"房间类型" type:"int" prop:"add edit" default:"0" search:"="`
  12. CalcType int64 `json:"calc_type" label:"计算方式" type:"int" prop:"add edit" default:"0"`
  13. CalcParam string `json:"calc_param" label:"参数" type:"string" prop:"edit"`
  14. Description string `json:"description" label:"描述" type:"string" prop:"edit"`
  15. Price float64 `json:"price" label:"价格" type:"float" prop:"add edit"`
  16. ProductTypeId int64 `json:"product_type_id" label:"产品类型" type:"int" prop:"edit" default:"0"`
  17. DefaultProductId int64 `json:"default_product_id" label:"默认产品" type:"int" prop:"edit" default:"0"`
  18. DeletedAt int64 `json:"deleted_at" prop:"add:false select:false"`
  19. CreatedAt int64 `json:"created_at" prop:"add:false select:false"`
  20. UpdatedAt int64 `json:"updated_at" prop:"add:false select:false"`
  21. CalcParamDecode structs.MaterialItemCalcParam `json:"childs" prop:"ignore"`
  22. db.BaseModel
  23. }
  24. func (Item) TableName() string {
  25. return "zy_quote_item"
  26. }
  27. func (Item) ListPrivilege(c *gin.Context, data map[string]interface{}, s *db.Select) bool {
  28. return true
  29. }
  30. func (Item) OnePrivilege(c *gin.Context, id int64) bool {
  31. return true
  32. }
  33. func (Item) AddPrivilege(c *gin.Context, data map[string]interface{}, post map[string]interface{}) error {
  34. return nil
  35. }
  36. func (Item) EditPrivilege(c *gin.Context, id int64, data map[string]interface{}, post map[string]interface{}) error {
  37. return nil
  38. }
  39. func (Item) DelPrivilege(c *gin.Context, id int64) error {
  40. return nil
  41. }
  42. func (Item) Page() bool {
  43. return false
  44. }
  45. func (Item) Count() bool {
  46. return true
  47. }