120 lines
4.8 KiB
Go
120 lines
4.8 KiB
Go
package proto
|
||
|
||
import (
|
||
"time"
|
||
)
|
||
|
||
type UpdateUserInfoReq struct {
|
||
ID int `json:"id" form:"id"` //用户id
|
||
Username string `json:"name" form:"name"` //用户名
|
||
Age int `json:"age" form:"age"` //年龄
|
||
Role string `json:"role" form:"role"` //角色
|
||
Gender string `json:"gender" form:"gender"` //性别
|
||
Redis bool `json:"redis" form:"redis"` //是否刷新redis
|
||
Upload bool `json:"upload" form:"upload"` //是否上传头像
|
||
VideoFunc bool `json:"video_func" form:"video_func"` //视频功能
|
||
DeviceFunc bool `json:"device_func" form:"device_func"` //设备功能
|
||
CIDFunc bool `json:"cid_func" form:"cid_func"` //持续集成功能
|
||
Run bool `json:"run" form:"run"` //是否运行
|
||
Avatar string `json:"avatar" form:"avatar"` //头像
|
||
}
|
||
|
||
type CIDRUN struct {
|
||
CID uint `json:"cid" form:"cid"` //持续集成ID,查找持续集成任务
|
||
Curr int `json:"curr" form:"curr"` //当前剩余时间,每次执行减10s小于等于0则执行
|
||
Every int `json:"every" form:"every"` //每隔多少秒执行一次,小于等于0表示不执行,时间粒度为10s
|
||
}
|
||
|
||
// 用于执行函数,方法
|
||
type CronInfo struct {
|
||
Type int `json:"type" form:"type"` //类型编码,1日志清理(且只会有一个),其他待定,2从服务器同步数据
|
||
Info string `json:"info" form:"info"` //信息
|
||
Curr int `json:"curr" form:"curr"` //当前剩余时间,每次执行减10s小于等于0则执行
|
||
Every int `json:"every" form:"every"` //每隔多少秒执行一次,小于等于0表示不执行,时间粒度为10s
|
||
}
|
||
|
||
// 用户数据同步
|
||
type UserSync struct {
|
||
Update []UserAddOrUpdate `json:"update" form:"update"` //更新用户
|
||
Add []UserAddOrUpdate `json:"add" form:"add"` //添加用户
|
||
Delete []UserDelID `json:"delete" form:"delete"` //删除用户
|
||
}
|
||
|
||
// 用户数据同步确认
|
||
type UserSyncConfirm struct {
|
||
Add []UserConfirmID `json:"add" form:"add"` //添加用户
|
||
Update []UserConfirmID `json:"update" form:"update"` //更新用户
|
||
Delete []UserConfirmID `json:"delete" form:"delete"` //删除用户
|
||
}
|
||
|
||
type UserConfirmID struct {
|
||
ID uint `json:"id" form:"id"` //用户id
|
||
}
|
||
|
||
type UserDelID struct {
|
||
ID uint `json:"ID" form:"ID"` //用户id
|
||
}
|
||
|
||
type UserAddOrUpdate struct {
|
||
ID uint `json:"ID" form:"ID"` //用户id
|
||
CreatedAt time.Time `json:"CreatedAt" form:"CreatedAt"` //创建时间
|
||
UpdatedAt time.Time `json:"UpdatedAt" form:"UpdatedAt"` //更新时间
|
||
DeletedAt time.Time `json:"DeletedAt" form:"DeletedAt"` //删除时间
|
||
Name string `json:"Name" form:"Name"` //用户名
|
||
Age int `json:"Age" form:"Age"` //年龄
|
||
Email string `json:"Email" form:"Email"` //邮箱
|
||
Password string `json:"Password" form:"Password"` //密码
|
||
Gender string `json:"Gender" form:"Gender"` //性别
|
||
Role string `json:"Role" form:"Role"` //角色
|
||
Redis bool `json:"Redis" form:"Redis"` //是否刷新redis
|
||
Run bool `json:"Run" form:"Run"` //是否运行
|
||
Upload bool `json:"Upload" form:"Upload"` //是否上传头像
|
||
VideoFunc bool `json:"VideoFunc" form:"VideoFunc"` //视频功能
|
||
DeviceFunc bool `json:"DeviceFunc" form:"DeviceFunc"`
|
||
CIDFunc bool `json:"CIDFunc" form:"CIDFunc"`
|
||
Avatar string `json:"Avatar" form:"Avatar"` //头像
|
||
CreateTime string `json:"CreateTime" form:"CreateTime"`
|
||
UpdateTime string `json:"UpdateTime" form:"UpdateTime"`
|
||
}
|
||
|
||
// 数据同步请求
|
||
type SyncUserReq struct {
|
||
Token string `json:"token" form:"token"`
|
||
Types int `json:"type" form:"type"` // 1为全量同步 2为增量同步
|
||
Device string `json:"device" form:"device"`
|
||
Confirm UserSyncConfirm `json:"confirm" form:"confirm"`
|
||
}
|
||
|
||
// shell待执行
|
||
type SyncUserShellReq struct {
|
||
Token string `json:"token" form:"token"`
|
||
Server string `json:"server" form:"server"`
|
||
}
|
||
|
||
type UpdateShellReq struct {
|
||
ID uint `json:"id"`
|
||
ShellName string `json:"shell_name"`
|
||
ShellContent string `json:"shell_content"`
|
||
Server string `json:"server"`
|
||
Status int `json:"status"`
|
||
ShellResult string `json:"shell_result"`
|
||
}
|
||
|
||
// shell 执行结果返回
|
||
type SyncUserShellResp struct {
|
||
Token string `json:"token" form:"token"`
|
||
Shells []UpdateShellReq `json:"shells" form:"shells"`
|
||
}
|
||
|
||
type UpdateShellRespV2 struct {
|
||
ID uint `json:"id" form:"id"`
|
||
Status int `json:"status" form:"status"`
|
||
}
|
||
|
||
type ResponseOAuth struct {
|
||
ID uint `json:"id" form:"id"`
|
||
Name string `json:"name" form:"name"`
|
||
Email string `json:"email" form:"email"`
|
||
Token string `json:"token" form:"token"`
|
||
}
|