feat(main): add agent

This commit is contained in:
2025-02-13 19:39:16 +08:00
parent 8242ccf11e
commit 761796bd35
44 changed files with 2258 additions and 2096 deletions

View File

@@ -4,6 +4,7 @@ package handler
import (
"net/http"
agent "qnc-server/app/user/cmd/api/internal/handler/agent"
auth "qnc-server/app/user/cmd/api/internal/handler/auth"
notification "qnc-server/app/user/cmd/api/internal/handler/notification"
pay "qnc-server/app/user/cmd/api/internal/handler/pay"
@@ -16,6 +17,22 @@ import (
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodPost,
Path: "/agent/apply",
Handler: agent.ApplyForAgentHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/agent/audit/status",
Handler: agent.GetAgentAuditStatusHandler(serverCtx),
},
},
rest.WithPrefix("/api/v1"),
)
server.AddRoutes(
[]rest.Route{
{
@@ -114,48 +131,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
// query general background check
Method: http.MethodPost,
Path: "/query/backgroundCheck",
Handler: query.BackgroundCheckHandler(serverCtx),
},
{
// query company info
Method: http.MethodPost,
Path: "/query/companyInfo",
Handler: query.CompanyInfoHandler(serverCtx),
},
{
// query home service
Method: http.MethodPost,
Path: "/query/homeService",
Handler: query.HomeServiceHandler(serverCtx),
},
{
// query marriage
Method: http.MethodPost,
Path: "/query/marriage",
Handler: query.MarriageHandler(serverCtx),
},
{
// query pre-loan background check
Method: http.MethodPost,
Path: "/query/preLoanBackgroundCheck",
Handler: query.PreLoanBackgroundCheckHandler(serverCtx),
},
{
// query rental info
Method: http.MethodPost,
Path: "/query/rentalInfo",
Handler: query.RentalInfoHandler(serverCtx),
},
{
// query risk assessment
Method: http.MethodPost,
Path: "/query/riskAssessment",
Handler: query.RiskAssessmentHandler(serverCtx),
},
{
// query service
Method: http.MethodPost,