first commit

This commit is contained in:
何昌清
2026-03-26 22:13:03 +08:00
parent bbe1faa363
commit a2685f7f1e
51 changed files with 11244 additions and 0 deletions

21
controllers/base_utils.go Normal file
View File

@@ -0,0 +1,21 @@
package controllers
import (
"errors"
"github.com/gin-gonic/gin"
)
func getCode(ctx *gin.Context) (string, error) {
userIDInterface, exists := ctx.Get("code")
if !exists {
return "", errors.New("用户ID不存在")
}
code, ok := userIDInterface.(string)
if !ok {
return "", errors.New("用户ID类型错误")
}
return code, nil
}