优化结构

This commit is contained in:
Yvan
2026-08-21 10:29:14 +08:00
parent 56980c8087
commit 055f6811ca
340 changed files with 382 additions and 382 deletions
+25
View File
@@ -0,0 +1,25 @@
package handler
import (
"github.com/gin-gonic/gin"
"kra/internal/biz"
"kra/internal/server/httpx"
"kra/internal/server/middleware"
)
const (
CodeSuccess = httpx.CodeSuccess
CodeError = httpx.CodeError
CodePasswordChangeRequired = httpx.CodePasswordChangeRequired
)
type Response = httpx.Response
type PageResult = httpx.PageResult
func Write(c *gin.Context, code int, data any, message string) { httpx.Write(c, code, data, message) }
func OK(c *gin.Context) { httpx.OK(c) }
func OKWithData(c *gin.Context, data any) { httpx.OKWithData(c, data) }
func Fail(c *gin.Context, message string) { httpx.Fail(c, message) }
func NoAuth(c *gin.Context, message string) { httpx.NoAuth(c, message) }
func SetTokenCookie(c *gin.Context, value string, maxAge int) { httpx.SetTokenCookie(c, value, maxAge) }
func Claims(c *gin.Context) *biz.AuthClaims { return middleware.Claims(c) }