| 
									
										
										
										
											2024-10-02 00:57:17 +08:00
										 |  |  | // Code generated by goctl. DO NOT EDIT. | 
					
						
							|  |  |  | // goctl 1.7.2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | package handler | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import ( | 
					
						
							|  |  |  | 	"net/http" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	auth "tianyuan-api/apps/gateway/internal/handler/auth" | 
					
						
							|  |  |  | 	base "tianyuan-api/apps/gateway/internal/handler/base" | 
					
						
							|  |  |  | 	product "tianyuan-api/apps/gateway/internal/handler/product" | 
					
						
							| 
									
										
										
										
											2024-10-15 00:23:07 +08:00
										 |  |  | 	topup "tianyuan-api/apps/gateway/internal/handler/topup" | 
					
						
							| 
									
										
										
										
											2024-10-02 00:57:17 +08:00
										 |  |  | 	user "tianyuan-api/apps/gateway/internal/handler/user" | 
					
						
							|  |  |  | 	userProduct "tianyuan-api/apps/gateway/internal/handler/userProduct" | 
					
						
							|  |  |  | 	whitelistr "tianyuan-api/apps/gateway/internal/handler/whitelistr" | 
					
						
							|  |  |  | 	"tianyuan-api/apps/gateway/internal/svc" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	"github.com/zeromicro/go-zero/rest" | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { | 
					
						
							|  |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		[]rest.Route{ | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				Method:  http.MethodPost, | 
					
						
							|  |  |  | 				Path:    "/getVerifyCode", | 
					
						
							|  |  |  | 				Handler: auth.GetVerifyCodeHandler(serverCtx), | 
					
						
							|  |  |  | 			}, | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				Method:  http.MethodPost, | 
					
						
							|  |  |  | 				Path:    "/login", | 
					
						
							|  |  |  | 				Handler: auth.LoginUserHandler(serverCtx), | 
					
						
							|  |  |  | 			}, | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				Method:  http.MethodPost, | 
					
						
							|  |  |  | 				Path:    "/logout", | 
					
						
							|  |  |  | 				Handler: auth.LogoutHandler(serverCtx), | 
					
						
							|  |  |  | 			}, | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				Method:  http.MethodPost, | 
					
						
							|  |  |  | 				Path:    "/phoneLogin", | 
					
						
							|  |  |  | 				Handler: auth.PhoneLoginUserHandler(serverCtx), | 
					
						
							|  |  |  | 			}, | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				Method:  http.MethodPost, | 
					
						
							|  |  |  | 				Path:    "/register", | 
					
						
							|  |  |  | 				Handler: auth.RegisterUserHandler(serverCtx), | 
					
						
							|  |  |  | 			}, | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		rest.WithPrefix("/api/console/auth"), | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		[]rest.Route{ | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				Method:  http.MethodGet, | 
					
						
							|  |  |  | 				Path:    "/health", | 
					
						
							|  |  |  | 				Handler: base.HealthHandler(serverCtx), | 
					
						
							|  |  |  | 			}, | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		rest.WithPrefix("/api/console/base"), | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		rest.WithMiddlewares( | 
					
						
							|  |  |  | 			[]rest.Middleware{serverCtx.AuthInterceptor}, | 
					
						
							|  |  |  | 			[]rest.Route{ | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodGet, | 
					
						
							|  |  |  | 					Path:    "/:productId", | 
					
						
							|  |  |  | 					Handler: product.GetProductByIdHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodGet, | 
					
						
							|  |  |  | 					Path:    "/list", | 
					
						
							|  |  |  | 					Handler: product.GetProductListHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 			}..., | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 		rest.WithPrefix("/api/console/product"), | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-15 00:23:07 +08:00
										 |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		rest.WithMiddlewares( | 
					
						
							|  |  |  | 			[]rest.Middleware{serverCtx.AuthInterceptor, serverCtx.EntAuthInterceptor}, | 
					
						
							|  |  |  | 			[]rest.Route{ | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodPost, | 
					
						
							|  |  |  | 					Path:    "/aliTopUp", | 
					
						
							|  |  |  | 					Handler: topup.AliTopUpHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 				{ | 
					
						
							| 
									
										
										
										
											2024-10-15 17:19:23 +08:00
										 |  |  | 					Method:  http.MethodGet, | 
					
						
							|  |  |  | 					Path:    "/topUpList", | 
					
						
							|  |  |  | 					Handler: topup.TopListHandler(serverCtx), | 
					
						
							| 
									
										
										
										
											2024-10-15 00:23:07 +08:00
										 |  |  | 				}, | 
					
						
							|  |  |  | 			}..., | 
					
						
							|  |  |  | 		), | 
					
						
							| 
									
										
										
										
											2024-10-15 17:19:23 +08:00
										 |  |  | 		rest.WithPrefix("/api/console/topup"), | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		[]rest.Route{ | 
					
						
							|  |  |  | 			{ | 
					
						
							|  |  |  | 				Method:  http.MethodPost, | 
					
						
							|  |  |  | 				Path:    "/aliTopUpCallback", | 
					
						
							|  |  |  | 				Handler: topup.AliTopUpCallbackHandler(serverCtx), | 
					
						
							|  |  |  | 			}, | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		rest.WithPrefix("/api/console/topup"), | 
					
						
							| 
									
										
										
										
											2024-10-15 00:23:07 +08:00
										 |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-02 00:57:17 +08:00
										 |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		rest.WithMiddlewares( | 
					
						
							|  |  |  | 			[]rest.Middleware{serverCtx.AuthInterceptor}, | 
					
						
							|  |  |  | 			[]rest.Route{ | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodPost, | 
					
						
							|  |  |  | 					Path:    "/businessLicenseUpload", | 
					
						
							|  |  |  | 					Handler: user.UploadBusinessLicenseHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodPost, | 
					
						
							|  |  |  | 					Path:    "/enterpriseAuth", | 
					
						
							|  |  |  | 					Handler: user.EnterpriseAuthHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodPost, | 
					
						
							|  |  |  | 					Path:    "/getSecretInfo", | 
					
						
							|  |  |  | 					Handler: user.GetSecretInfoHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodGet, | 
					
						
							|  |  |  | 					Path:    "/info", | 
					
						
							|  |  |  | 					Handler: user.GetUserInfoHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 			}..., | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 		rest.WithPrefix("/api/console/user"), | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		rest.WithMiddlewares( | 
					
						
							|  |  |  | 			[]rest.Middleware{serverCtx.AuthInterceptor}, | 
					
						
							| 
									
										
										
										
											2024-10-15 00:23:07 +08:00
										 |  |  | 			[]rest.Route{ | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodGet, | 
					
						
							|  |  |  | 					Path:    "/userProductList", | 
					
						
							|  |  |  | 					Handler: userProduct.GetUserProductListHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 			}..., | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 		rest.WithPrefix("/api/console/user-product"), | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		rest.WithMiddlewares( | 
					
						
							|  |  |  | 			[]rest.Middleware{serverCtx.AuthInterceptor, serverCtx.EntAuthInterceptor}, | 
					
						
							| 
									
										
										
										
											2024-10-02 00:57:17 +08:00
										 |  |  | 			[]rest.Route{ | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodPost, | 
					
						
							|  |  |  | 					Path:    "/userProductAdd", | 
					
						
							|  |  |  | 					Handler: userProduct.AddUserProductHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodDelete, | 
					
						
							|  |  |  | 					Path:    "/userProductDel/:id", | 
					
						
							|  |  |  | 					Handler: userProduct.DeleteUserProductHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 			}..., | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 		rest.WithPrefix("/api/console/user-product"), | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		rest.WithMiddlewares( | 
					
						
							|  |  |  | 			[]rest.Middleware{serverCtx.AuthInterceptor}, | 
					
						
							|  |  |  | 			[]rest.Route{ | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodGet, | 
					
						
							|  |  |  | 					Path:    "/getWhitelistList", | 
					
						
							|  |  |  | 					Handler: whitelistr.GetWhitelistListHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 			}..., | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 		rest.WithPrefix("/api/console/whitelist"), | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	server.AddRoutes( | 
					
						
							|  |  |  | 		rest.WithMiddlewares( | 
					
						
							|  |  |  | 			[]rest.Middleware{serverCtx.AuthInterceptor, serverCtx.EntAuthInterceptor}, | 
					
						
							|  |  |  | 			[]rest.Route{ | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodPost, | 
					
						
							|  |  |  | 					Path:    "/addWhitelist", | 
					
						
							|  |  |  | 					Handler: whitelistr.AddWhitelistHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					Method:  http.MethodDelete, | 
					
						
							|  |  |  | 					Path:    "/delWhitelist", | 
					
						
							|  |  |  | 					Handler: whitelistr.DeleteWhitelistHandler(serverCtx), | 
					
						
							|  |  |  | 				}, | 
					
						
							|  |  |  | 			}..., | 
					
						
							|  |  |  | 		), | 
					
						
							|  |  |  | 		rest.WithPrefix("/api/console/whitelist"), | 
					
						
							|  |  |  | 	) | 
					
						
							|  |  |  | } |