浏览代码

wip:删除常见问题多余字段

wangkaiyue 2 年之前
父节点
当前提交
83a7133f32
共有 2 个文件被更改,包括 1 次插入6 次删除
  1. 0 4
      internal/consts/consts.go
  2. 1 2
      internal/model/question.go

+ 0 - 4
internal/consts/consts.go

@@ -6,10 +6,6 @@ const (
 	JY_SESSIONNAME = "SESSIONID"
 	JY_SESSIONNAME = "SESSIONID"
 	ContextKey     = "ContextKey"
 	ContextKey     = "ContextKey"
 )
 )
-const (
-	QUESTION_TYPE_GUESS   = iota + 1 //猜你想问
-	QUESTION_TYPE_USUALLY            //常见问题
-)
 
 
 var (
 var (
 	RequestJsonHeader = g.MapStrStr{"Content-Type": "application/json"}
 	RequestJsonHeader = g.MapStrStr{"Content-Type": "application/json"}

+ 1 - 2
internal/model/question.go

@@ -1,7 +1,6 @@
 package model
 package model
 
 
 import (
 import (
-	"aiChat/internal/consts"
 	"aiChat/utility"
 	"aiChat/utility"
 	"aiChat/utility/fsw"
 	"aiChat/utility/fsw"
 	"context"
 	"context"
@@ -57,7 +56,7 @@ func (r *BaseQuestion) ParseHistoryFsw() {
 func (q *cQuestion) GetUsuallyProblem(ctx context.Context, scenario, limit int) (list []string, err error) {
 func (q *cQuestion) GetUsuallyProblem(ctx context.Context, scenario, limit int) (list []string, err error) {
 	list = make([]string, 0, limit)
 	list = make([]string, 0, limit)
 	res, err := g.Model("ai_question_list").Ctx(ctx).Fields("question").
 	res, err := g.Model("ai_question_list").Ctx(ctx).Fields("question").
-		Where("status = 1 and question_type = ? and source = ?", consts.QUESTION_TYPE_USUALLY, scenario).OrderDesc("create_time").OrderAsc("id").Limit(limit).All()
+		Where("status = 1 and source = ?", scenario).OrderDesc("create_time").OrderAsc("id").Limit(limit).All()
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err
 	}
 	}