package global import ( validation "github.com/go-ozzo/ozzo-validation/v4" "gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/core" ) // UserContextPermisVO 平铺权限 type UserContextPermisVO struct { PermisCode []string // 功能菜单权限code码 PermisFunc map[string]int // 功能权限 } // PermisTreeRespVo 权限树 type PermisTreeRespVo struct { Code string `json:"code"` // 权限唯一编码 Name string `json:"name"` // 权限名称 ParentCode string `json:"parentCode"` // 父Code Path string `json:"path"` // 前端路径 Selected int `json:"selected"` // 是否选中 1-是,0-否 Sort int `json:"sort"` // 排序号 Type int `json:"type"` // 1-功能权限;2-菜单权限;3-数据权限 Childes []*PermisTreeRespVo `json:"childes"` // 子节点 } type DataPermisRespVo struct { Code string `json:"code"` // 权限唯一编码 Name string `json:"name"` // 权限名称 Sort int `json:"sort"` // 排序号 } // AccountInfoVo 个人账号信息 type AccountInfoVo struct { AccountId int `json:"accountId"` // 账号ID AccountType int `json:"accountType"` // 账号类型 AccountUuid string `json:"accountUuid"` Openid string `json:"openid"` // 微信Openid Name string `json:"name"` // 真实名称 Role string `json:"role"` // 角色:用户 司机 仓管 Gender string `json:"gender"` // 性别 Phone string `json:"phone"` // 电话 CompanyName string `json:"companyName"` // 公司 Avatar core.FileSource `json:"avatar"` // 头像 IsFirst int `json:"isFirst"` // 是否首次登录,1-是 2-否 } // Credentials 临时秘钥 type Credentials struct { BaseUrl string `json:"baseUrl"` Bucket string `json:"bucket"` Region string `json:"region"` StartTime int `json:"startTime"` ExpiredTime int `json:"expiredTime"` TmpSecretID string `json:"tmpSecretId"` TmpSecretKey string `json:"tmpSecretKey"` SessionToken string `json:"sessionToken"` } type SimpleFileSource struct { FileId int `json:"fileId"` FileUrl string `json:"fileUrl"` FilePath string `json:"filePath"` FileName string `json:"fileName"` SourceCode string `json:"sourceCode"` } // SnIdVO sn设备信息 type SnIdVO struct { Id int `json:"id"` Name string `json:"name"` } // ClodAccount 冷链3.0账号 type ClodAccount struct { Pid int `json:"pid"` Name string `json:"name"` Uuid string `json:"uuid"` } func (r *ClodAccount) Validate() error { return validation.ValidateStruct(r, validation.Field(&r.Pid, validation.Required), validation.Field(&r.Uuid, validation.Required), validation.Field(&r.Name, validation.Required), ) }