操作日志
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m10s

This commit is contained in:
2026-04-27 12:16:38 +08:00
parent 95104100c9
commit cb75b5668b
33 changed files with 3860 additions and 112 deletions

View File

@@ -132,6 +132,28 @@ func GetUserAgentFromContext(ctx context.Context) *string {
return nil
}
// GetRequestPathFromContext 从 context 中提取请求路径。
func GetRequestPathFromContext(ctx context.Context) *string {
if ctx == nil {
return nil
}
if requestPath, ok := ctx.Value(constants.ContextKeyRequestPath).(string); ok {
return &requestPath
}
return nil
}
// GetRequestMethodFromContext 从 context 中提取请求方法。
func GetRequestMethodFromContext(ctx context.Context) *string {
if ctx == nil {
return nil
}
if requestMethod, ok := ctx.Value(constants.ContextKeyRequestMethod).(string); ok {
return &requestMethod
}
return nil
}
// SetUserToFiberContext 将用户信息设置到 Fiber context 的 Locals 中
// 同时也设置到标准 context 中,便于 GORM 查询使用
func SetUserToFiberContext(c *fiber.Ctx, info *UserContextInfo) {