From bfcfb32e892e47afdc3f203cce976d1b1f6b034d Mon Sep 17 00:00:00 2001 From: lijikun Date: Fri, 20 Dec 2024 10:51:31 +0800 Subject: [PATCH] =?UTF-8?q?12=E6=9C=8820=E6=97=A5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E7=BB=93=E6=9E=84=E4=BD=93=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E9=99=A4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- link_homework/api/v1/record/Record.go | 12 ++++++------ link_homework/utility/utility.go | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/link_homework/api/v1/record/Record.go b/link_homework/api/v1/record/Record.go index 1c9f0bd..ea29366 100644 --- a/link_homework/api/v1/record/Record.go +++ b/link_homework/api/v1/record/Record.go @@ -59,10 +59,10 @@ type ExcelExportReq struct { } type Reply struct { - FormId int `json:"formId"` - Type int `json:"type"` - FormTitle string `json:"formTitle"` - ContentTitle string `json:"contentTitle"` - Content string `json:"content"` - SubmitTime gtime.Time `json:"submitTime"` + FormId int `json:"formId" dc:"作业题目id"` + Type int `json:"type" dc:"作业类型"` + FormTitle string `json:"formTitle" dc:"作业题目名"` + ContentTitle string `json:"contentTitle" dc:"作答题目名"` + Content string `json:"content" dc:"作答内容"` + SubmitTime gtime.Time `json:"submitTime" dc:"提交时间"` } diff --git a/link_homework/utility/utility.go b/link_homework/utility/utility.go index 6fb6316..874fd3c 100644 --- a/link_homework/utility/utility.go +++ b/link_homework/utility/utility.go @@ -21,7 +21,7 @@ func getUrl(key, hashKey string) *dto.Result { // 1. 从 Redis 获取 URL redisUrl, err := g.Redis().Do(ctx, "HGET", key, hashKey) if err == nil && redisUrl.String() != "" { - g.Log().Infof(ctx, "从 Redis 获取到 URL: %s", redisUrl.String()) + //g.Log().Infof(ctx, "从 Redis 获取到 URL: %s", redisUrl.String()) return dto.SuccessWithData(redisUrl.String()) } @@ -34,16 +34,16 @@ func getUrl(key, hashKey string) *dto.Result { // 3. 将 URL 存入 Redis if _, err = g.Redis().Do(ctx, "HSET", key, hashKey, url); err != nil { - g.Log().Warningf(ctx, "将数据存入 Redis 失败: %v", err) + //g.Log().Warningf(ctx, "将数据存入 Redis 失败: %v", err) } - g.Log().Infof(ctx, "将 URL 存入 Redis: %s", url) + //g.Log().Infof(ctx, "将 URL 存入 Redis: %s", url) return dto.SuccessWithData(url) } // 查询数据库中的 URL func selectBaseUrl(hashKey string) *dto.Result { - ctx := gctx.New() + //ctx := gctx.New() // 查询数据库 value, err := g.DB("cms").Model("env").Where("`key` = ?", hashKey).Value("value") @@ -53,7 +53,7 @@ func selectBaseUrl(hashKey string) *dto.Result { } if value.IsNil() || value.String() == "" { - g.Log().Errorf(ctx, "未找到对应数据, key: %s", hashKey) + //g.Log().Errorf(ctx, "未找到对应数据, key: %s", hashKey) return dto.Error("未找到对应数据") }