init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
package ai_mate_v2_ctrl
import (
"91jd-server/app/service/aiser"
"91jd-server/common"
"91jd-server/common/laosiji_app"
"91jd-server/common/log"
"91jd-server/common/stderr"
"91jd-server/models/cache/sysconfdata"
"91jd-server/models/v/sysconfmod"
"github.com/gin-gonic/gin"
)
// URL doc
// @Summary AI女友V2
// @Description 主钱包金币上分并获取AI女友授权链接
// @Tags AI女友V2
// @Produce json
// @Success 200 {object} aiser.GetAuthURLResp
// @Router /api/app/aimatev2/url [post]
func URL(ctx *gin.Context) {
uid, err := common.GetUID(ctx)
if err != nil {
common.ServeJSON(ctx, stderr.ErrNoToken, nil)
return
}
config, err := sysconfdata.GetAllFromCache()
if err != nil {
log.Warn("get AI girlfriend switch failed", log.Any("uid", uid), log.E(err))
common.ServeJSON(ctx, stderr.Failure, nil)
return
}
if !config.GetBool(sysconfmod.VCodeAiGirlFriend) || !laosiji_app.Configured() {
common.ServeJSON(ctx, stderr.FunctionNotEnabled, nil)
return
}
resp, err := aiser.GetAuthURL(ctx.Request.Context(), uid)
if err != nil {
log.Error("get AI girlfriend V2 URL failed", log.Any("uid", uid), log.E(err))
common.ServeJSON(ctx, stderr.Failure, nil)
return
}
common.ServeJSON(ctx, stderr.Success, resp)
}