123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- package dto
- import (
- "gas-cylinder-api/app/admin/model"
- "gas-cylinder-api/common/dto"
- common "gas-cylinder-api/common/model"
- )
- type GasCylinderSpecGetPageReq struct {
- dto.Pagination `search:"-"`
- Name string `form:"name" search:"type:contains;column:name;table:gas_cylinder_spec"` // 钢瓶规格名称
- GasCylinderSpecOrder
- }
- type GasCylinderSpecOrder struct {
- CreatedAtOrder string `search:"type:order;column:created_at;table:gas_cylinder_spec" form:"createdAtOrder" default:"desc"`
- }
- func (m *GasCylinderSpecGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type GasCylinderSpecInsertReq struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
- Name string `json:"name" vd:"len($)>0;msg:'钢瓶规格名称不能为空'"` // 钢瓶规格名称
- Remark string `json:"remark"` // 备注
- common.ControlBy `swaggerignore:"true"`
- common.DeptBy `swaggerignore:"true"`
- }
- func (s *GasCylinderSpecInsertReq) Generate(model *model.GasCylinderSpec) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- 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 *GasCylinderSpecInsertReq) GetId() interface{} {
- return s.Id
- }
- type GasCylinderSpecUpdateReq struct {
- Id int `json:"id" comment:"编码"` // 编码
- Name string `json:"name" vd:"len($)>0;msg:'钢瓶规格名称不能为空'"` // 钢瓶规格名称
- Remark string `json:"remark"` // 备注
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *GasCylinderSpecUpdateReq) Generate(model *model.GasCylinderSpec) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- model.Remark = s.Remark
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- }
- func (s *GasCylinderSpecUpdateReq) GetId() interface{} {
- return s.Id
- }
- type GasCylinderSpecGetReq struct {
- Id int `uri:"id" vd:"$>0;msg:'id不能为空'"`
- }
- func (s *GasCylinderSpecGetReq) GetId() interface{} {
- return s.Id
- }
- type GasCylinderSpecDeleteReq struct {
- Id int `json:"id" vd:"$>0;msg:'id不能为空'"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *GasCylinderSpecDeleteReq) GetId() interface{} {
- return s.Id
- }
- type AppletGasCylinderSpecGetPageReq struct {
- dto.Pagination `search:"-"`
- StoreId int `form:"storeId" search:"type:exact;column:dept_id;table:gas_cylinder_spec" vd:"$>0;msg:'门店id不能为空'"`
- Name string `form:"name" search:"type:contains;column:name;table:gas_cylinder_spec"` // 钢瓶规格名称
- GasCylinderSpecOrder
- }
- func (m *AppletGasCylinderSpecGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
|