新版本,代理功能上线
This commit is contained in:
		| @@ -4,6 +4,7 @@ package handler | ||||
| import ( | ||||
| 	"net/http" | ||||
|  | ||||
| 	agent "tydata-server/app/user/cmd/api/internal/handler/agent" | ||||
| 	auth "tydata-server/app/user/cmd/api/internal/handler/auth" | ||||
| 	notification "tydata-server/app/user/cmd/api/internal/handler/notification" | ||||
| 	pay "tydata-server/app/user/cmd/api/internal/handler/pay" | ||||
| @@ -16,6 +17,89 @@ import ( | ||||
| ) | ||||
|  | ||||
| func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||||
| 	server.AddRoutes( | ||||
| 		[]rest.Route{ | ||||
| 			{ | ||||
| 				Method:  http.MethodGet, | ||||
| 				Path:    "/audit/status", | ||||
| 				Handler: agent.GetAgentAuditStatusHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodGet, | ||||
| 				Path:    "/commission", | ||||
| 				Handler: agent.GetAgentCommissionHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodPost, | ||||
| 				Path:    "/generating_link", | ||||
| 				Handler: agent.GeneratingLinkHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodGet, | ||||
| 				Path:    "/info", | ||||
| 				Handler: agent.GetAgentInfoHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodPost, | ||||
| 				Path:    "/membership/save_user_config", | ||||
| 				Handler: agent.SaveAgentMembershipUserConfigHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodGet, | ||||
| 				Path:    "/membership/user_config", | ||||
| 				Handler: agent.GetAgentMembershipProductConfigHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodGet, | ||||
| 				Path:    "/product_config", | ||||
| 				Handler: agent.GetAgentProductConfigHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodGet, | ||||
| 				Path:    "/revenue", | ||||
| 				Handler: agent.GetAgentRevenueInfoHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodGet, | ||||
| 				Path:    "/rewards", | ||||
| 				Handler: agent.GetAgentRewardsHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodGet, | ||||
| 				Path:    "/withdrawal", | ||||
| 				Handler: agent.GetAgentWithdrawalHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodPost, | ||||
| 				Path:    "/withdrawal", | ||||
| 				Handler: agent.AgentWithdrawalHandler(serverCtx), | ||||
| 			}, | ||||
| 		}, | ||||
| 		rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret), | ||||
| 		rest.WithPrefix("/api/v1/agent"), | ||||
| 	) | ||||
|  | ||||
| 	server.AddRoutes( | ||||
| 		[]rest.Route{ | ||||
| 			{ | ||||
| 				Method:  http.MethodPost, | ||||
| 				Path:    "/apply", | ||||
| 				Handler: agent.ApplyForAgentHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodGet, | ||||
| 				Path:    "/link", | ||||
| 				Handler: agent.GetLinkDataHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				Method:  http.MethodPost, | ||||
| 				Path:    "/membership/activate", | ||||
| 				Handler: agent.ActivateAgentMembershipHandler(serverCtx), | ||||
| 			}, | ||||
| 		}, | ||||
| 		rest.WithPrefix("/api/v1/agent"), | ||||
| 	) | ||||
|  | ||||
| 	server.AddRoutes( | ||||
| 		[]rest.Route{ | ||||
| 			{ | ||||
| @@ -101,47 +185,17 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||||
| 	server.AddRoutes( | ||||
| 		[]rest.Route{ | ||||
| 			{ | ||||
| 				// query general background check | ||||
| 				// query service agent | ||||
| 				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), | ||||
| 				Path:    "/query/service_agent/:product", | ||||
| 				Handler: query.QueryServiceAgentHandler(serverCtx), | ||||
| 			}, | ||||
| 		}, | ||||
| 		rest.WithPrefix("/api/v1"), | ||||
| 	) | ||||
|  | ||||
| 	server.AddRoutes( | ||||
| 		[]rest.Route{ | ||||
| 			{ | ||||
| 				// query service | ||||
| 				Method:  http.MethodPost, | ||||
| @@ -204,6 +258,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | ||||
|  | ||||
| 	server.AddRoutes( | ||||
| 		[]rest.Route{ | ||||
| 			{ | ||||
| 				// agent mobile code login | ||||
| 				Method:  http.MethodPost, | ||||
| 				Path:    "/user/agent_mobile_code_login", | ||||
| 				Handler: user.AgentMobileCodeLoginHandler(serverCtx), | ||||
| 			}, | ||||
| 			{ | ||||
| 				// mobile code login | ||||
| 				Method:  http.MethodPost, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user