user

package
v0.0.0-...-94c11f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Follow

func Follow(c *gin.Context)

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

func FollowList(c *gin.Context)

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

func FollowerList(c *gin.Context)

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

func Get(c *gin.Context)

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

func Login(c *gin.Context)

Login 邮箱登录 @Summary 用户登录接口 @Description 仅限邮箱登录 @Tags 用户 @Produce json @Param req body LoginCredentials true "请求参数" @Success 200 {object} model.UserInfo "用户信息" @Router /login [post]

func PhoneLogin

func PhoneLogin(c *gin.Context)

PhoneLogin 手机登录接口 @Summary 用户登录接口 @Description 仅限手机登录 @Tags 用户 @Produce json @Param req body PhoneLoginCredentials true "phone" @Success 200 {object} model.UserInfo "用户信息" @Router /users/login [post]

func Register

func Register(c *gin.Context)

Register 注册 @Summary 注册 @Description 用户注册 @Tags 用户 @Produce json @Param req body RegisterRequest true "请求参数" @Success 200 {object} model.UserInfo "用户信息" @Router /Register [post]

func Unfollow

func Unfollow(c *gin.Context)

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

func Update(c *gin.Context)

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]

func VCode

func VCode(c *gin.Context)

VCode 获取验证码 @Summary 根据手机号获取校验码 @Description Get an user by username @Tags 用户 @Accept json @Produce json @Param area_code query string true "区域码,比如86" @Param phone query string true "手机号" @Success 200 {object} app.Response @Router /vcode [get]

Types

type CreateRequest

type CreateRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

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

type UpdateRequest struct {
	Avatar string `json:"avatar"`
	Sex    int    `json:"sex"`
}

UpdateRequest 更新请求

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL