12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- 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"` // 商品名称
- }
- func (m *DispatchCostGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type DispatchCostInsertReq struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
- Name string `json:"name"` // 商品名称
- 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
- }
|