123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- package dto
- import (
- "cold-delivery/app/admin/model"
- "cold-delivery/common/dto"
- common "cold-delivery/common/model"
- "strings"
- )
- type IceLockerGetPageReq struct {
- dto.Pagination `search:"-"`
- Name string `form:"name" search:"type:contains;column:name;table:ice_locker"` // 冷冻柜名称
- Status string `form:"status" search:"type:exact;column:status;table:ice_locker"` // 状态
- Sn string `form:"sn" search:"type:contains;column:sn;table:ice_locker"` // sn
- ShowTemp bool `form:"showTemp" search:"-"` // 展示最新温度
- IceLockerOrder
- }
- type IceLockerOrder struct {
- CreatedAtOrder string `search:"type:order;column:created_at;table:ice_locker" form:"createdAtOrder" default:"desc"`
- IdOrder string `search:"type:order;column:id;table:ice_locker" form:"idOrder" default:"desc"`
- }
- func (m *IceLockerGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type IceLockerInsertReq struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
- Name string `json:"name" vd:"len($)>0;msg:'冷冻柜不能为空'"` // 冷冻柜名称
- Sn string `json:"sn"` // sn
- Status string `json:"status"` // 1-停用 2-正常
- common.ControlBy `swaggerignore:"true"`
- common.DeptBy `swaggerignore:"true"`
- }
- func (s *IceLockerInsertReq) Generate(model *model.IceLocker) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- model.Sn = strings.TrimSpace(s.Sn)
- 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
- }
- }
- func (s *IceLockerInsertReq) GetId() interface{} {
- return s.Id
- }
- type IceLockerUpdateReq struct {
- Id int `json:"id" comment:"编码"` // 编码
- Name string `json:"name" vd:"len($)>0;msg:'冷冻柜名称不能为空'"` // 冷冻柜名称
- Sn string `json:"sn"` // sn
- Status string `json:"status"` // 1-停用 2-正常
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *IceLockerUpdateReq) Generate(model *model.IceLocker) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- model.Sn = strings.TrimSpace(s.Sn)
- model.Status = s.Status
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- }
- func (s *IceLockerUpdateReq) GetId() interface{} {
- return s.Id
- }
- type IceLockerGetReq struct {
- Id int `uri:"id"`
- }
- func (s *IceLockerGetReq) GetId() interface{} {
- return s.Id
- }
- type IceLockerDeleteReq struct {
- Id int `json:"id"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *IceLockerDeleteReq) GetId() interface{} {
- return s.Id
- }
- type IceLockerBatchInsertReq struct {
- List []IceLockerInsertReq
- Status string `json:"status"` // 1-停用 2-正常
- common.ControlBy `swaggerignore:"true"`
- common.DeptBy `swaggerignore:"true"`
- }
|