common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HeaderTokenKey HTTP请求Header中的令牌Key
	HeaderTokenKey = "Authorization"
	// AvatarStoragePath 头像存储相对路径
	AvatarStoragePath = "./web/public/avatar/"
)
View Source
const (
	RpcSuccessCode             = 10000
	HttpSuccessCode            = 10000
	HttpSuccessMessage         = "SUCCESS"
	HttpErrorCode              = 20000
	HttpErrorMessage           = "ERROR"
	HttpErrorServerBusyCode    = 20001
	HttpErrorServerBusyMessage = "Server is busy, please try again later"
	HttpErrorRpcRequestCode    = 20002
	HttpErrorRpcRequestMessage = "RPC failed or timeout"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpResponse

type HttpResponse struct {
	Code    int32       `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

HttpResponse 接口返回信息

type LoginRequest

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

LoginRequest 登陆请求

type LoginResponse

type LoginResponse struct {
	Token string   `json:"token"`
	User  UserInfo `json:"user"`
}

LoginResponse 登陆结果

type RegisterRequest

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

RegisterRequest 注册请求

type UpdateProfileRequest

type UpdateProfileRequest struct {
	Username string `json:"username"`
}

UpdateProfileRequest 更新账户请求

type UserInfo

type UserInfo struct {
	Id             int64  `json:"id"`
	Username       string `json:"username"`
	ProfilePicture string `json:"profilePicture"`
}

UserInfo 用户信息

Jump to

Keyboard shortcuts

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