123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- package myselfsrv
- import (
- "Cold_Logistic/internal/pkg/common/constant"
- "Cold_Logistic/internal/server/infra/models"
- validation "github.com/go-ozzo/ozzo-validation/v4"
- "gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/core"
- )
- type UpdateMyselfInfoReqVO struct {
- Name string `json:"name"` // 真实名称
- Gender string `json:"gender"` // 性别
- Phone string `json:"phone"` // 电话
- CompanyName string `json:"companyName"` // 公司
- }
- func (r *UpdateMyselfInfoReqVO) Validate() error {
- return validation.ValidateStruct(r,
- validation.Field(&r.Name, validation.Required, validation.RuneLength(1, 10)),
- validation.Field(&r.Gender, validation.Required, validation.In("男", "女", "未知")),
- validation.Field(&r.Phone, validation.Required, validation.RuneLength(1, 11)),
- validation.Field(&r.CompanyName, validation.Required, validation.RuneLength(1, 30)),
- )
- }
- type RefreshTokenRespVo struct {
- TokenType string `json:"tokenType"`
- AccessToken string `json:"accessToken"`
- ExpiresIn int64 `json:"expiresIn"`
- }
- type AddressPageReqVO struct {
- Page core.Page `json:"page"`
- AddressType string `json:"addressType"` // 地址类型:sender-发货人 consignee-收货人
- }
- func (r *AddressPageReqVO) Validate() error {
- return validation.ValidateStruct(r,
- validation.Field(&r.AddressType, validation.Required,
- validation.In(constant.AddressTypeSender, constant.AddressTypeConsignee)),
- )
- }
- type AddressIdRespVO struct {
- AddressId int `json:"addressId"`
- }
- type AddAddressReqVO struct {
- AddressType string `json:"addressType"` //地址类型:
- Name string `json:"name"` //姓名
- Phone string `json:"phone"` //联系电话
- ProvinceId int `json:"provinceId"` //省Id
- CityId int `json:"cityId"` //市Id
- RegionId int `json:"regionId"` //区Id
- Address string `json:"address"` //详细地址
- IsDefault int `json:"isDefault"` //是否默认:1-是 2-否
- }
- func (r *AddAddressReqVO) Validate() error {
- return validation.ValidateStruct(r,
- validation.Field(&r.AddressType, validation.Required, validation.In(constant.AddressTypeSender, constant.AddressTypeConsignee)),
- validation.Field(&r.Name, validation.Required, validation.RuneLength(1, 10)),
- validation.Field(&r.Phone, validation.Required, validation.RuneLength(1, 11)),
- validation.Field(&r.Address, validation.Required, validation.RuneLength(1, 100)),
- validation.Field(&r.IsDefault, validation.In(constant.YES, constant.NO)),
- )
- }
- type UpdateAddressReqVO struct {
- AddressId int `json:"addressId"`
- Name string `json:"name"` //姓名
- Phone string `json:"phone"` //联系电话
- ProvinceId int `json:"provinceId"` //省Id
- CityId int `json:"cityId"` //市Id
- RegionId int `json:"regionId"` //区Id
- Address string `json:"address"` //详细地址
- IsDefault int `json:"isDefault"` //是否默认:1-是 2-否
- }
- func (r *UpdateAddressReqVO) Validate() error {
- return validation.ValidateStruct(r,
- validation.Field(&r.AddressId, validation.Required),
- validation.Field(&r.Name, validation.Required, validation.RuneLength(1, 10)),
- validation.Field(&r.Phone, validation.Required, validation.RuneLength(1, 11)),
- validation.Field(&r.Address, validation.Required, validation.RuneLength(1, 100)),
- validation.Field(&r.IsDefault, validation.In(constant.YES, constant.NO)),
- )
- }
- type DeleteAddressReqVO struct {
- AddressId int `json:"addressId"`
- }
- func (r *DeleteAddressReqVO) Validate() error {
- return validation.ValidateStruct(r, validation.Field(&r.AddressId, validation.Required))
- }
- type LogisticPageReqVO struct {
- Page core.Page `json:"page"`
- }
- type LogisticIdRespVO struct {
- LogisticId int `json:"logisticId"`
- }
- type AddLogisticReqVO struct {
- Name string `json:"name"` //名称
- IsDefault int `json:"isDefault"` //是否默认:1-是 - 2-否
- Pid int `json:"pid"` //冷链系统公司Id
- }
- func (r *AddLogisticReqVO) Validate() error {
- return validation.ValidateStruct(r,
- validation.Field(&r.Name, validation.Required, validation.RuneLength(1, 100)),
- validation.Field(&r.Pid, validation.Required),
- )
- }
- type DeleteLogisticReqVO struct {
- LogisticId string `json:"logisticId"`
- }
- func (r *DeleteLogisticReqVO) Validate() error {
- return validation.ValidateStruct(r, validation.Field(&r.LogisticId, validation.Required))
- }
- type OrderPageReqVO struct {
- Page core.Page `json:"page"`
- Search struct {
- OrderNo string `json:"orderNo"` // 订单号
- OrderStatus []int `json:"orderStatus"`
- SearchDateTime constant.SearchDateTimeType `json:"searchDateTime"`
- PlaceOrderStartTime models.MyTime `json:"placeOrderStartTime"`
- PlaceOrderEndTime models.MyTime `json:"placeOrderEndTime"`
- }
- }
- type OrderSubNoReqVO struct {
- OrderId int `json:"orderId"` // 订单
- }
- func (r *OrderSubNoReqVO) Validate() error {
- return validation.ValidateStruct(r, validation.Field(&r.OrderId, validation.Required))
- }
- type OrderSubNoRespVO struct {
- OrderSubNo string `json:"orderSubNo"`
- }
|