package v1 import ( "github.com/gogf/gf/v2/frame/g" ) type LoginReq struct { g.Meta `path:"/login" tags:"Login" method:"post" summary:"user login process"` Username string `json:"username" v:"required|length:4,30#请输入用户名|用户名长度为:min到:max位"` Password string `json:"password" v:"required|length:6,30#请输入密码|密码长度为:min到:max位"` } type LoginRes struct { g.Meta `mime:"text/html" example:"{"code":200,"msg":"注册成功"}"` Reply string `dc:"Reply content"` Cookie string } // RegisterReq 是注册接口的请求参数结构体。 type RegisterReq struct { g.Meta `path:"/register" tags:"Register" method:"post" summary:"处理用户注册请求"` Username string `json:"username" v:"required|length:6,30#请输入用户名|用户名长度为:min到:max位"` Password string `json:"password" v:"required|length:6,30#请输入密码|密码长度为:min到:max位"` Email string `json:"email" v:"required|email#请输入有效的邮箱地址"` } // RegisterRes 是注册接口的响应参数结构体。 type RegisterRes struct { g.Meta `mime:"application/json" example:"{"code":200,"msg":"注册成功"}"` Code int `json:"code"` Msg string `json:"msg"` } // RegisterReq 是注册接口的请求参数结构体。 type PushMessageReq struct { g.Meta `path:"/api/pushmessage" tags:"PushMessage" method:"post" summary:"发送消息"` body map[string]interface{} `json:"body"` } // RegisterRes 是注册接口的响应参数结构体。 type PushMessageRes struct { g.Meta `mime:"application/json" example:"{"code":200,"msg":"push successed"}"` Code int `json:"code"` Msg map[string]interface{} `json:"msg"` }