mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-12 21:16:00 +08:00
swagger
This commit is contained in:
+17
-17
@@ -16,17 +16,17 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// @Summary 用户登录
|
||||
// @Description 用户登录
|
||||
// @Summary 用户注册
|
||||
// @Description 用户注册
|
||||
// @Tags 鉴权认证
|
||||
// @ID UserRegister
|
||||
// @Accept json
|
||||
// @Param token header string true "im token"
|
||||
// @Param req body api.UserRegisterReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID <br> ex为拓展字段"
|
||||
// @Param req body api.UserRegisterReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID <br> ex为拓展字段 <br> gender为性别, 0为女, 1为男"
|
||||
// @Produce json
|
||||
// @Success 0 {object} api.UserRegisterResp
|
||||
// @Failure 500 {object} api.UserRegisterResp "errCode为500 一般为服务器内部错误"
|
||||
// @Failure 400 {object} api.UserRegisterResp "errCode为400 一般为参数输入错误, token未带上等"
|
||||
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
|
||||
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
|
||||
// @Router /auth/user_register [post]
|
||||
func UserRegister(c *gin.Context) {
|
||||
params := api.UserRegisterReq{}
|
||||
@@ -91,11 +91,11 @@ func UserRegister(c *gin.Context) {
|
||||
// @ID UserToken
|
||||
// @Accept json
|
||||
// @Param token header string true "im token"
|
||||
// @Param req body api.UserTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段, platform为平台ID"
|
||||
// @Param req body api.UserTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段 <br> platform为平台ID"
|
||||
// @Produce json
|
||||
// @Success 0 {object} api.UserTokenResp
|
||||
// @Failure 500 {object} api.UserTokenResp "errCode为500 一般为服务器内部错误"
|
||||
// @Failure 400 {object} api.UserTokenResp "errCode为400 一般为参数输入错误, token未带上等"
|
||||
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
|
||||
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
|
||||
// @Router /auth/user_token [post]
|
||||
func UserToken(c *gin.Context) {
|
||||
params := api.UserTokenReq{}
|
||||
@@ -135,17 +135,17 @@ func UserToken(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, resp)
|
||||
}
|
||||
|
||||
// @Summary 解析token
|
||||
// @Description 解析用户token
|
||||
// @Summary 解析当前用户token
|
||||
// @Description 解析当前用户token(token在请求头中传入)
|
||||
// @Tags 鉴权认证
|
||||
// @ID ParseToken
|
||||
// @Accept json
|
||||
// @Param token header string true "im token"
|
||||
// @Param req body api.ParseTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段, platform为平台ID"
|
||||
// @Param req body api.ParseTokenReq true "secret为openIM密钥, 详细见服务端config.yaml secret字段<br>platform为平台ID"
|
||||
// @Produce json
|
||||
// @Success 0 {object} api.ParseTokenResp
|
||||
// @Failure 500 {object} api.ParseTokenResp "errCode为500 一般为服务器内部错误"
|
||||
// @Failure 400 {object} api.ParseTokenResp "errCode为400 一般为参数输入错误, token未带上等"
|
||||
// @Success 0 {object} api.ParseTokenResp{Data=api.ExpireTime}
|
||||
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
|
||||
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
|
||||
// @Router /auth/parse_token [post]
|
||||
func ParseToken(c *gin.Context) {
|
||||
params := api.ParseTokenReq{}
|
||||
@@ -179,11 +179,11 @@ func ParseToken(c *gin.Context) {
|
||||
// @ID ForceLogout
|
||||
// @Accept json
|
||||
// @Param token header string true "im token"
|
||||
// @Param req body api.ForceLogoutReq true "platform为平台ID, fromUserID为要执行强制登出的用户ID"
|
||||
// @Param req body api.ForceLogoutReq true "platform为平台ID <br> fromUserID为要执行强制登出的用户ID"
|
||||
// @Produce json
|
||||
// @Success 0 {object} api.ForceLogoutResp
|
||||
// @Failure 500 {object} api.ForceLogoutResp "errCode为500 一般为服务器内部错误"
|
||||
// @Failure 400 {object} api.ForceLogoutResp "errCode为400 一般为参数输入错误, token未带上等"
|
||||
// @Failure 500 {object} api.Swagger500Resp "errCode为500 一般为服务器内部错误"
|
||||
// @Failure 400 {object} api.Swagger400Resp "errCode为400 一般为参数输入错误, token未带上等"
|
||||
// @Router /auth/force_logout [post]
|
||||
func ForceLogout(c *gin.Context) {
|
||||
params := api.ForceLogoutReq{}
|
||||
|
||||
Reference in New Issue
Block a user