ctl

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitUserInfo

func InitUserInfo(ctx context.Context, user *UserInfo) error

func SetUserInCache

func SetUserInCache(ctx context.Context, user *UserInfo, redisClient *redis.Client) error

Types

type Response

type Response struct {
	Status int         `json:"status"`
	Data   interface{} `json:"data"`
	Msg    string      `json:"msg"`
	Error  string      `json:"error"`
}

Response 基础序列化器

func RespError

func RespError(ctx *gin.Context, err error, data string, code ...int) *Response

func RespSuccess

func RespSuccess(ctx *gin.Context, data interface{}, code ...int) *Response

RespSuccess 带data成功返回

type UserInfo

type UserInfo struct {
	Id uint `json:"id"`
}

func GetUserInfo

func GetUserInfo(ctx context.Context) (*UserInfo, error)

Jump to

Keyboard shortcuts

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