1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- package dto
- import (
- "gas-cylinder-api/app/admin/model"
- "gas-cylinder-api/common/dto"
- common "gas-cylinder-api/common/model"
- )
- type WarehouseGetPageReq struct {
- dto.Pagination `search:"-"`
- Name string `form:"name" search:"type:contains;column:name;table:warehouse"` // 商品名称
- 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"` // 名称
- Address string `json:"address"` // 地址
- 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.Address = s.Address
- 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"` // 商品名称
- Address string `json:"address"` // 备注
- common.ControlBy `swaggerignore:"true"`
- }
- func (s *WarehouseUpdateReq) Generate(model *model.Warehouse) {
- if s.Id != 0 {
- model.Id = s.Id
- }
- model.Name = s.Name
- model.Address = s.Address
- 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
- }
|