12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- package carsrv
- import (
- "Cold_Logistic/internal/pkg/common/constant"
- "Cold_Logistic/internal/pkg/common/global"
- "Cold_Logistic/internal/server/infra/models"
- validation "github.com/go-ozzo/ozzo-validation/v4"
- "gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/core"
- )
- type CarPageReqVO struct {
- Page core.Page `json:"page"`
- Search struct {
- CarNumber string `json:"carNumber"`
- SnCode string `json:"snCode"`
- DriverAccountUuid string `json:"driverAccountUuid"`
- } `json:"search"`
- }
- type CarIdRespVO struct {
- CarId int `json:"carId"`
- }
- type AddCarReqVO struct {
- CarNumber string `json:"carNumber"`
- SnCode string `json:"snCode"`
- Driver global.ClodAccount `json:"driver"`
- CarType string `json:"carType"`
- Enable int `json:"enable"`
- }
- func (r *AddCarReqVO) Validate() error {
- return validation.ValidateStruct(r,
- validation.Field(&r.CarNumber, validation.Required, validation.RuneLength(1, 30)),
- validation.Field(&r.SnCode, validation.Required, validation.RuneLength(1, 100)),
- validation.Field(&r.Driver),
- validation.Field(&r.CarType, validation.Required),
- validation.Field(&r.Enable, validation.In(constant.YES, constant.NO)),
- )
- }
- type UpdateCarReqVO struct {
- CarId int `json:"carId"`
- AddCarReqVO
- }
- func (r *UpdateCarReqVO) Validate() error {
- return validation.ValidateStruct(r,
- validation.Field(&r.CarId, validation.Required),
- validation.Field(&r.AddCarReqVO),
- )
- }
- type DriverLogReqVO struct {
- CarId int `json:"carId"`
- }
- func (r *DriverLogReqVO) Validate() error {
- return validation.ValidateStruct(r, validation.Field(&r.CarId, validation.Required))
- }
- type DriverLogRespVO struct {
- AccountId int `json:"accountId"`
- Name string `json:"name"`
- UseTime models.MyTime `json:"useTime"`
- HandoverTime models.MyTime `json:"handoverTime"`
- }
|