Skip to content

Commit

Permalink
添加githubrepo
Browse files Browse the repository at this point in the history
  • Loading branch information
juniaoshaonian committed Aug 6, 2024
1 parent 62a699a commit 750422f
Show file tree
Hide file tree
Showing 22 changed files with 513 additions and 454 deletions.
7 changes: 3 additions & 4 deletions internal/ai/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,16 @@ func InitQuestionExamineHandler(
// log -> cfg -> credit -> record -> question_examine -> platform
builder := biz.NewQuestionExamineBizHandlerBuilder()
common = append(common, builder)
res := biz.NewCombinedBizHandler("question_examine", common, platform)
return res
return biz.NewCombinedBizHandler("question_examine", common, platform)

}
func InitCaseExamineHandler(
common []handler.Builder,
// platform 就是真正的出口
platform handler.Handler) *biz.CompositionHandler {
builder := biz.NewCaseExamineBizHandlerBuilder()
common = append(common, builder)
res := biz.NewCombinedBizHandler("case_examine", common, platform)
return res
return biz.NewCombinedBizHandler("case_examine", common, platform)
}

func InitCommonHandlers(log *log.HandlerBuilder,
Expand Down
6 changes: 3 additions & 3 deletions internal/ai/internal/integration/llm_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (s *LLMServiceSuite) SetupSuite() {
db := testioc.InitDB()
s.db = db
err := dao.InitTables(db)
require.NoError(s.T(), err)
s.NoError(err)
s.logDao = dao.NewGORMLLMLogDAO(db)

// 先插入 BizConfig
Expand All @@ -56,7 +56,7 @@ func (s *LLMServiceSuite) SetupSuite() {
Ctime: now,
Utime: now,
}).Error
assert.NoError(s.T(), err)
s.NoError(err)
err = s.db.Create(&dao.BizConfig{
Biz: domain.BizCaseExamine,
MaxInput: 100,
Expand All @@ -65,7 +65,7 @@ func (s *LLMServiceSuite) SetupSuite() {
Ctime: now,
Utime: now,
}).Error
assert.NoError(s.T(), err)
s.NoError(err)
}

func (s *LLMServiceSuite) TearDownSuite() {
Expand Down
3 changes: 2 additions & 1 deletion internal/cases/internal/domain/cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ type Case struct {
Introduction string
Title string
Content string
CodeRepo string
GithubRepo string
GiteeRepo string
// 关键字,辅助记忆,提取重点
Keywords string
// 速记,口诀
Expand Down
4 changes: 2 additions & 2 deletions internal/cases/internal/errs/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package errs

var (
SystemError = ErrorCode{Code: 505001, Msg: "系统错误"}
// InsufficientCredit 这个不管说是客户端错误还是服务端错误,都有点勉强,所以随便用一个 5
InsufficientCredit = ErrorCode{Code: 505002, Msg: "积分不足"}
// InsufficientCredits 这个不管说是客户端错误还是服务端错误,都有点勉强,所以随便用一个 5
InsufficientCredits = ErrorCode{Code: 505002, Msg: "积分不足"}
)

type ErrorCode struct {
Expand Down
6 changes: 4 additions & 2 deletions internal/cases/internal/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ type Case struct {
Labels []string `json:"labels"`
Title string `json:"title"`
Content string `json:"content"`
CodeRepo string `json:"code_repo"`
GithubRepo string `json:"github_repo"`
GiteeRepo string `json:"gitee_repo"`
Keywords string `json:"keywords"`
Shorthand string `json:"shorthand"`
Highlight string `json:"highlight"`
Expand All @@ -59,7 +60,8 @@ func newCase(ca domain.Case) Case {
Labels: ca.Labels,
Title: ca.Title,
Content: ca.Content,
CodeRepo: ca.CodeRepo,
GithubRepo: ca.GithubRepo,
GiteeRepo: ca.GiteeRepo,
Keywords: ca.Keywords,
Shorthand: ca.Shorthand,
Highlight: ca.Highlight,
Expand Down
20 changes: 11 additions & 9 deletions internal/cases/internal/integration/admin_case_set_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -706,14 +706,15 @@ func getTestCase(id int64) dao.Case {
Valid: true,
Val: []string{"case", "mysql"},
},
CodeRepo: fmt.Sprintf("coderepo%d", id),
Keywords: fmt.Sprintf("keywords%d", id),
Shorthand: fmt.Sprintf("shorthand%d", id),
Highlight: fmt.Sprintf("highlight%d", id),
Guidance: fmt.Sprintf("guidance%d", id),
Biz: "question",
BizId: 11,
Status: 2,
GithubRepo: fmt.Sprintf("githubrepo%d", id),
GiteeRepo: fmt.Sprintf("giteerepo%d", id),
Keywords: fmt.Sprintf("keywords%d", id),
Shorthand: fmt.Sprintf("shorthand%d", id),
Highlight: fmt.Sprintf("highlight%d", id),
Guidance: fmt.Sprintf("guidance%d", id),
Biz: "question",
BizId: 11,
Status: 2,
}
}

Expand All @@ -735,7 +736,8 @@ func getCase(id int64) web.Case {
Title: fmt.Sprintf("title%d", id),
Content: fmt.Sprintf("content%d", id),
Labels: []string{"case", "mysql"},
CodeRepo: fmt.Sprintf("coderepo%d", id),
GithubRepo: fmt.Sprintf("githubrepo%d", id),
GiteeRepo: fmt.Sprintf("giteerepo%d", id),
Keywords: fmt.Sprintf("keywords%d", id),
Shorthand: fmt.Sprintf("shorthand%d", id),
Highlight: fmt.Sprintf("highlight%d", id),
Expand Down
Loading

0 comments on commit 750422f

Please sign in to comment.