12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- package dto
- import (
- "gas-cylinder-api/app/admin/model"
- "gas-cylinder-api/common/dto"
- common "gas-cylinder-api/common/model"
- )
- type GasCylinderStatusGetPageReq struct {
- dto.Pagination `search:"-"`
- UserId int `form:"userId" search:"-"`
- CompanyId string `form:"companyId" search:"-"`
- InnerCode string `form:"inner_code" search:"type:contains;column:inner_code;table:gas_cylinder_status"` // 1单位内编号
- Status string `form:"status" search:"-"` // 1-重瓶区 2-空瓶区 3-不合格瓶区
- GasCylinderStatusOrder
- }
- type GasCylinderStatusOrder struct {
- CreatedAtOrder string `search:"type:order;column:created_at;table:gas_cylinder_status" form:"createdAtOrder" default:"desc"`
- }
- func (m *GasCylinderStatusGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type GasCylinderStatusInsertReq struct {
- Id int `json:"id" comment:"编码"` // 编码
- InnerCodeList []string `json:"innerCodeList" vd:"len($)>0;msg:'单位内编码不能为空'"`
- Status string `json:"status" vd:"len($)>0;msg:'钢瓶状态不能为空'"` // 钢瓶状态
- Remark string `json:"remark"` // 备注
- common.ControlBy `swaggerignore:"true"`
- common.DeptBy `swaggerignore:"true"`
- }
- func (s *GasCylinderStatusInsertReq) Generate(innerCode string, model *model.GasCylinderStatus) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.InnerCode = innerCode
- model.Status = s.Status
- model.CompanyId = s.DeptId
- 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 *GasCylinderStatusInsertReq) GetId() interface{} {
- return s.Id
- }
- type GasCylinderStatusGetReq struct {
- Id int `uri:"id" vd:"$>0;msg:'id不能为空'"`
- }
- func (s *GasCylinderStatusGetReq) GetId() interface{} {
- return s.Id
- }
- type GasCylinderStatusDeleteReq struct {
- Id int `json:"id" vd:"$>0;msg:'id不能为空'"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *GasCylinderStatusDeleteReq) GetId() interface{} {
- return s.Id
- }
- type GasCylinderStatusUpdateReq struct {
- InnerCodeList []string `json:"innerCodeList" vd:"len($)>0;msg:'单位内编码不能为空'"`
- Status string `json:"status" vd:"len($)>0;msg:'钢瓶状态不能为空'"` // 钢瓶状态
- Remark string `json:"remark"` // 备注
- common.ControlBy `swaggerignore:"true"`
- common.DeptBy `swaggerignore:"true"`
- }
- func (s *GasCylinderStatusUpdateReq) Generate(innerCode string, model *model.GasCylinderStatus) {
- model.InnerCode = innerCode
- model.Status = s.Status
- 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
- }
- }
|