Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

改成会员功能 #283

Merged
merged 2 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions internal/ai/internal/integration/llm_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func (s *LLMServiceSuite) TestHandler_Ask() {
Uid: 123,
}))
})
mou.Hdl.PrivateRoutes(server.Engine)
mou.Hdl.MemberRoutes(server.Engine)
recorder := test.NewJSONResponseRecorder[web.LLMResponse]()
server.ServeHTTP(recorder, req)
require.Equal(t, tc.wantCode, recorder.Code)
Expand Down Expand Up @@ -712,7 +712,7 @@ func (s *LLMServiceSuite) TestHandler_AnalysisJD() {
Uid: 123,
}))
})
mou.Hdl.PrivateRoutes(server.Engine)
mou.Hdl.MemberRoutes(server.Engine)
recorder := test.NewJSONResponseRecorder[web.JDResponse]()
server.ServeHTTP(recorder, req)
require.Equal(t, tc.wantCode, recorder.Code)
Expand Down
2 changes: 1 addition & 1 deletion internal/ai/internal/web/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func NewHandler(generalSvc service.GeneralService, jdSvc service.JDService) *Han
}
}

func (h *Handler) PrivateRoutes(server *gin.Engine) {
func (h *Handler) MemberRoutes(server *gin.Engine) {
server.POST("/ai/ask", ginx.BS(h.LLMAsk))
server.POST("/ai/analysis_jd", ginx.BS(h.AnalysisJd))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (a *AnalysisTestSuite) SetupSuite() {
Uid: uid,
}))
})
hdl.PublicRoutes(server.Engine)
hdl.MemberRoutes(server.Engine)
a.server = server
}

Expand Down
2 changes: 1 addition & 1 deletion internal/resume/internal/web/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func NewAnalysisHandler(svc service.AnalysisService) *AnalysisHandler {
}
}

func (h *AnalysisHandler) PublicRoutes(server *gin.Engine) {
func (h *AnalysisHandler) MemberRoutes(server *gin.Engine) {
g := server.Group("/resume/analysis")
g.POST("", ginx.BS(h.Analysis))
}
Expand Down
6 changes: 6 additions & 0 deletions ioc/gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"net/http"
"strings"

"github.com/ecodeclub/webook/internal/ai"

"github.com/ecodeclub/webook/internal/resume"

"github.com/ecodeclub/webook/internal/bff"
Expand Down Expand Up @@ -86,6 +88,8 @@ func initGinxServer(sp session.Provider,
csHdl *cases.CaseSetHandler,
caseExamineHdl *cases.ExamineHandler,
resumePrjHdl *resume.ProjectHandler,
resumeAnaHdl *resume.AnalysisHandler,
aiHdl *ai.LLMHandler,
) *egin.Component {
session.SetDefaultProvider(sp)
res := egin.Load("web").Build()
Expand Down Expand Up @@ -159,5 +163,7 @@ func initGinxServer(sp session.Provider,
skillHdl.MemberRoutes(res.Engine)
caseExamineHdl.MemberRoutes(res.Engine)
resumePrjHdl.MemberRoutes(res.Engine)
resumeAnaHdl.MemberRoutes(res.Engine)
aiHdl.MemberRoutes(res.Engine)
return res
}
4 changes: 3 additions & 1 deletion ioc/wire.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ func InitApp() (*App, error) {
bff.InitModule,
wire.FieldsOf(new(*bff.Module), "Hdl"),
resume.InitModule,
wire.FieldsOf(new(*resume.Module), "PrjHdl"),
wire.FieldsOf(new(*resume.Module), "PrjHdl", "AnalysisHandler"),
wire.FieldsOf(new(*ai.Module), "Hdl"),

initLocalActiveLimiterBuilder,
initCronJobs,
// 这两个顺序不要换
Expand Down
6 changes: 4 additions & 2 deletions ioc/wire_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.