Documentation
¶
Index ¶
- func Follow(c *gin.Context)
- func FollowList(c *gin.Context)
- func FollowerList(c *gin.Context)
- func Get(c *gin.Context)
- func Login(c *gin.Context)
- func PhoneLogin(c *gin.Context)
- func Register(c *gin.Context)
- func Unfollow(c *gin.Context)
- func Update(c *gin.Context)
- func VCode(c *gin.Context)
- type CreateRequest
- type CreateResponse
- type FollowRequest
- type ListResponse
- type LoginCredentials
- type PhoneLoginCredentials
- type RegisterRequest
- type SwaggerListResponse
- type UpdateRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Follow ¶
Follow 关注 @Summary 通过用户id关注用户 @Description Get an user by user id @Tags 用户 @Accept json @Produce json @Param user_id body string true "用户id" @Success 200 {object} model.UserInfo "用户信息" @Router /users/follow [post]
func FollowList ¶
FollowList 关注列表 @Summary 正在关注的用户列表 @Description Get an user by user id @Tags 用户 @Accept json @Produce json @Param user_id body string true "用户id" @Success 200 {object} model.UserInfo "用户信息" @Router /users/{id}/following [get]
func FollowerList ¶
FollowerList 粉丝列表 @Summary 通过用户id关注用户 @Description Get an user by user id @Tags 用户 @Accept json @Produce json @Param user_id body string true "用户id" @Success 200 {object} model.UserInfo "用户信息" @Router /users/{id}/followers [get]
func Get ¶
Get 获取用户信息 @Summary 通过用户id获取用户信息 @Description Get an user by user id @Tags 用户 @Accept json @Produce json @Param id path string true "用户id" @Success 200 {object} model.UserInfo "用户信息" @Router /users/:id [get]
func Login ¶
Login 邮箱登录 @Summary 用户登录接口 @Description 仅限邮箱登录 @Tags 用户 @Produce json @Param req body LoginCredentials true "请求参数" @Success 200 {object} model.UserInfo "用户信息" @Router /login [post]
func PhoneLogin ¶
PhoneLogin 手机登录接口 @Summary 用户登录接口 @Description 仅限手机登录 @Tags 用户 @Produce json @Param req body PhoneLoginCredentials true "phone" @Success 200 {object} model.UserInfo "用户信息" @Router /users/login [post]
func Register ¶
Register 注册 @Summary 注册 @Description 用户注册 @Tags 用户 @Produce json @Param req body RegisterRequest true "请求参数" @Success 200 {object} model.UserInfo "用户信息" @Router /Register [post]
func Unfollow ¶
Unfollow 取消关注 @Summary 通过用户id取消关注用户 @Description Get an user by user id @Tags 用户 @Accept json @Produce json @Param user_id body string true "用户id" @Success 200 {object} model.UserInfo "用户信息" @Router /users/unfollow [post]
func Update ¶
Update 更新用户信息 @Summary Update a user info by the user identifier @Description Update a user by ID @Tags 用户 @Accept json @Produce json @Param id path uint64 true "The user's database id index num" @Param user body model.UserBaseModel true "The user info" @Success 200 {object} app.Response "{"code":0,"message":"OK","data":null}" @Router /users/{id} [put]
Types ¶
type CreateRequest ¶
CreateRequest 创建用户请求
type CreateResponse ¶
type CreateResponse struct {
Username string `json:"username"`
}
CreateResponse 创建用户响应
type FollowRequest ¶
type FollowRequest struct {
UserID uint64 `json:"user_id"`
}
FollowRequest 关注请求
type ListResponse ¶
type ListResponse struct {
TotalCount uint64 `json:"total_count"`
HasMore int `json:"has_more"`
PageKey string `json:"page_key"`
PageValue int `json:"page_value"`
Items interface{} `json:"items"`
}
ListResponse 通用列表resp
type LoginCredentials ¶
type LoginCredentials struct {
Email string `json:"email" form:"email" binding:"required" `
Password string `json:"password" form:"password" binding:"required" `
}
LoginCredentials 默认登录方式-邮箱
type PhoneLoginCredentials ¶
type PhoneLoginCredentials struct {
Phone int64 `json:"phone" form:"phone" binding:"required" example:"13010002000"`
VerifyCode int `json:"verify_code" form:"verify_code" binding:"required" example:"120110"`
}
PhoneLoginCredentials 手机登录
type RegisterRequest ¶
type RegisterRequest struct {
Username string `json:"username" form:"username"`
Email string `json:"email" form:"email"`
Password string `json:"password" form:"password"`
ConfirmPassword string `json:"confirm_password" form:"confirm_password"`
}
RegisterRequest 注册
type SwaggerListResponse ¶
type SwaggerListResponse struct {
TotalCount uint64 `json:"totalCount"`
UserList []model.UserInfo `json:"userList"`
}
SwaggerListResponse 文档
type UpdateRequest ¶
UpdateRequest 更新请求