common

package
v0.0.0-...-19a85bd Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMON_PROJECT_NAME = "gf-user"     // 项目名
	COMMON_AUTH_CURRENT = "currentUser" // 当前用户
)

项目

View Source
const (
	TIME_FORMAT_DIGIT = "20060102150405"
	TIME_FORMAT_DATE  = "2006-01-02 15:04:05"
	TIME_FORMAT_DAY   = "2006-01-02"
)

时间

View Source
const (
	RETURN_FAILED           = 0 //失败
	RETURN_SUCCESS          = 1 //成功
	RETURN_RECORD_NOT_FOUND = "404"
)

状态标识

View Source
const (
	JWT_RELET_NUM     = 2 // JWT续租时间(小时)
	EMAIL_CODE_LENGTH = 6 // 邮箱验证码长度
)

常量

View Source
const (
	USER_AGENT      = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
	ACCEPT_LANGUAGE = "zh-CN,zh;q=0.9,en;q=0.8"
	APPLICATION     = "application/json"
)

请求头

View Source
const (
	GLOBAL_MSG          = "GLOBAL_MSG"          // 全局事件
	COMMON_MSG          = "COMMON_MSG"          // 通用事件
	EVENT_STATUS_REPORT = "EVENT_STATUS_REPORT" // 状态上报事件
	EVENT_HEARTBEAT     = "EVENT_HEARTBEAT"     // 心跳事件
	EVENT_PING          = "EVENT_PING"          // Ping事件
)

事件

Variables

This section is empty.

Functions

func NewDaoError

func NewDaoError(msg string) *daoError

func NewResponse

func NewResponse(ctx *fiber.Ctx) *response

NewFiberResponse 创建响应实例

func NewServiceError

func NewServiceError(msg string) *serviceError

Types

type GFError

type GFError interface {
	GetErrorCode() int
	GetMsg() string
}

type ResultData

type ResultData struct {
	Code int `json:"code"`
	Data any `json:"data"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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