58 lines
3.6 KiB
Go
58 lines
3.6 KiB
Go
package request
|
||
|
||
// QueryWarehouseRequest 查询仓库请求参数
|
||
type QueryWarehouseRequest struct {
|
||
IDs []int64 `form:"ids[]"` // 仓库ID列表,支持批量查询
|
||
Keyword string `form:"keyword"` // 关键字,用于模糊匹配仓库编码或名称
|
||
Type *int8 `form:"type"` // 仓库类型:1:主仓库,2:备用仓库,3:中转仓库(使用指针区分未传值)
|
||
Status *int8 `form:"status"` // 仓库状态:0-禁用,1-启用(使用指针区分未传值)
|
||
Page int `form:"page,default=1"` // 页码,默认1
|
||
PageSize int `form:"page_size,default=10"` // 每页数量,默认10
|
||
}
|
||
|
||
// CreateWarehouseRequest 创建仓库请求参数
|
||
type CreateWarehouseRequest struct {
|
||
Code string `form:"code" binding:"required,max=50"` // 仓库ID,必填
|
||
Name string `form:"name" binding:"required,max=100"` // 仓库名称,可选,最大 100 字符
|
||
Type int8 `form:"type" binding:"omitempty,oneof=1 2 3"` // 仓库类型:1:主仓库,2:备用仓库,3:中转仓库
|
||
ContactPerson string `form:"contact_person" binding:"required"` // 联系人,必填
|
||
ContactPhone string `form:"contact_phone" binding:"required"` // 联系电话,必填
|
||
Province string `form:"province" binding:"required"` // 省份,必填
|
||
City string `form:"city" binding:"required"` // 城市,必填
|
||
District string `form:"district" binding:"required"` // 区/县,必填
|
||
Address string `form:"address" binding:"required,max=255"` // 详细地址,必填,最大 255 字符
|
||
Status int8 `form:"status" binding:"omitempty,oneof=0 1"` // 仓库状态:0-禁用,1-启用,可选
|
||
LogisticsID int64 `form:"logistics_id"` // 关联物流商ID,可选
|
||
}
|
||
|
||
// UpdateWarehouseRequest 更新仓库请求参数
|
||
type UpdateWarehouseRequest struct {
|
||
ID int64 `form:"id" binding:"required"` // 仓库ID,必填
|
||
Name string `form:"name" binding:"omitempty,max=100"` // 仓库名称,可选,最大 100 字符
|
||
Type int8 `form:"type" binding:"omitempty,oneof=1 2 3"` // 仓库类型:1:主仓库,2:备用仓库,3:中转仓库
|
||
ContactPerson string `form:"contact_person" binding:"required"` // 联系人,必填
|
||
ContactPhone string `form:"contact_phone" binding:"required"` // 联系电话,必填
|
||
Province string `form:"province" binding:"required"` // 省份,必填
|
||
City string `form:"city" binding:"required"` // 城市,必填
|
||
District string `form:"district" binding:"required"` // 区/县,必填
|
||
Address string `form:"address" binding:"required,max=255"` // 详细地址,必填,最大 255 字符
|
||
Status int8 `form:"status" binding:"omitempty,oneof=0 1"` // 仓库状态:0-禁用,1-启用,可选
|
||
LogisticsID int64 `form:"logistics_id"` // 关联物流商ID,可选
|
||
}
|
||
|
||
// DeleteWarehouseRequest 删除仓库请求参数
|
||
type DeleteWarehouseRequest struct {
|
||
ID int64 `form:"id" binding:"required"` // 货位ID,必填
|
||
}
|
||
|
||
// ExportLocationRequest 导出库位数据请求参数
|
||
type ExportLocationRequest struct {
|
||
WarehouseID int64 `json:"warehouse_id" form:"warehouse_id" binding:"required"` // 仓库ID,必填
|
||
Type int `json:"type" form:"type"` // 导出类型:0
|
||
}
|
||
|
||
// ImportLocationRequest 导入库位数据请求参数
|
||
type ImportLocationRequest struct {
|
||
WarehouseID int64 `form:"warehouse_id" binding:"required"` // 目标仓库ID,必填
|
||
}
|