user

package
v0.0.0-...-db099c4 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PhoneLogin

func PhoneLogin(c *gin.Context)

PhoneLogin 手机登录接口 @Summary 用户登录接口 @Description 仅限手机登录 @Tags 用户 @Produce json @Param req body PhoneLoginCredentials true "phone" @Success 200 {string} json "{"code":0,"message":"OK","data":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6Ik"}}" @Router /users/login [post]

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"`
	Password string `json:"password" form:"password"`
}

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