package dto import ( "gas-cylinder-api/app/admin/model" "gas-cylinder-api/common/dto" common "gas-cylinder-api/common/model" ) type DispatchCostGetPageReq struct { dto.Pagination `search:"-"` Name string `form:"name" search:"type:contains;column:name;table:dispatch_cost"` // 商品名称 DispatchCostOrder } type DispatchCostOrder struct { CreatedAtOrder string `search:"type:order;column:created_at;table:dispatch_cost" form:"createdAtOrder" default:"desc"` } func (m *DispatchCostGetPageReq) GetNeedSearch() interface{} { return *m } type DispatchCostInsertReq struct { Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码 Name string `json:"name" vd:"len($)>0;msg:'名称不能为空'"` // 商品名称 Price float64 `json:"price"` // 价格 Remark string `json:"remark"` // 备注 common.ControlBy `swaggerignore:"true"` common.DeptBy `swaggerignore:"true"` } func (s *DispatchCostInsertReq) Generate(model *model.DispatchCost) { if s.Id != 0 { model.Id = s.Id } model.Name = s.Name model.Price = s.Price model.Remark = s.Remark if s.ControlBy.UpdateBy != 0 { model.UpdateBy = s.UpdateBy } if s.ControlBy.CreateBy != 0 { model.CreateBy = s.CreateBy } if s.DeptBy.DeptId != 0 { model.DeptId = s.DeptId } } func (s *DispatchCostInsertReq) GetId() interface{} { return s.Id } type DispatchCostUpdateReq struct { Id int `json:"id" comment:"编码"` // 编码 Name string `json:"name"` // 商品名称 Price float64 `json:"price"` // 价格 Remark string `json:"remark"` // 备注 common.ControlBy `swaggerignore:"true"` } func (s *DispatchCostUpdateReq) Generate(model *model.DispatchCost) { if s.Id != 0 { model.Id = s.Id } model.Name = s.Name model.Price = s.Price model.Remark = s.Remark if s.ControlBy.UpdateBy != 0 { model.UpdateBy = s.UpdateBy } if s.ControlBy.CreateBy != 0 { model.CreateBy = s.CreateBy } } func (s *DispatchCostUpdateReq) GetId() interface{} { return s.Id } type DispatchCostGetReq struct { Id int `uri:"id"` } func (s *DispatchCostGetReq) GetId() interface{} { return s.Id } type DispatchCostDeleteReq struct { Id int `json:"id"` common.ControlBy `swaggerignore:"true"` } func (s *DispatchCostDeleteReq) GetId() interface{} { return s.Id }