123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- package dto
- import (
- "cold-logistics/app/admin/model"
- "cold-logistics/common/dto"
- common "cold-logistics/common/model"
- )
- type WarehouseGetPageReq struct {
- dto.Pagination `search:"-"`
- //Name string `form:"name" search:"type:contains;column:name;table:warehouse"` // 仓库名称
- Name string `form:"name" search:"-"` // 仓库名称
- Sn string `form:"sn" search:"type:contains;column:sn;table:warehouse"` // sn
- Status string `form:"status" search:"type:exact;column:status;table:warehouse"` // 1-停用 2-启用
- IsBind bool `form:"isBind" search:"-"` // 是否绑定司机
- WarehouseOrder
- }
- type WarehouseOrder struct {
- CreatedAtOrder string `search:"type:order;column:created_at;table:warehouse" form:"createdAtOrder" default:"desc"`
- }
- func (m *WarehouseGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type WarehouseInsertReq struct {
- Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
- Name string `json:"name"` // 仓库名称
- Sn string `json:"sn"` // sn
- Address string `json:"address"` // 地址
- Status string `json:"status"` // 1-停用 2-启用
- UserId int `json:"userId"` // 绑定的用户id
- common.ControlBy `swaggerignore:"true"`
- common.DeptBy `swaggerignore:"true"`
- }
- func (s *WarehouseInsertReq) Generate(model *model.Warehouse) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- model.Sn = s.Sn
- model.Status = s.Status
- model.Address = s.Address
- model.UserId = s.UserId
- 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 *WarehouseInsertReq) GetId() interface{} {
- return s.Id
- }
- type WarehouseUpdateReq struct {
- Id int `json:"id" comment:"编码"` // 编码
- Name string `json:"name"` // 商品名称
- Sn string `json:"sn"` // sn
- Address string `json:"address"` // 地址
- Status string `json:"status"` // 1-停用 2-启用
- UserId int `json:"userId"` // 绑定的用户id
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *WarehouseUpdateReq) Generate(model *model.Warehouse) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- model.Sn = s.Sn
- model.Address = s.Address
- model.Status = s.Status
- model.UserId = s.UserId
- if s.ControlBy.UpdateBy != 0 {
- model.UpdateBy = s.UpdateBy
- }
- if s.ControlBy.CreateBy != 0 {
- model.CreateBy = s.CreateBy
- }
- }
- func (s *WarehouseUpdateReq) GetId() interface{} {
- return s.Id
- }
- type WarehouseGetReq struct {
- Id int `uri:"id"`
- }
- func (s *WarehouseGetReq) GetId() interface{} {
- return s.Id
- }
- type WarehouseDeleteReq struct {
- Id int `json:"id"`
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *WarehouseDeleteReq) GetId() interface{} {
- return s.Id
- }
- type WarehouseBatchInsertReq struct {
- List []WarehouseInsertReq
- Status string `json:"status"` // 1-停用 2-启用
- UserId int `json:"userId"` // 绑定的用户id
- common.ControlBy `swaggerignore:"true"`
- common.DeptBy `swaggerignore:"true"`
- }
|