新增index首页服务

This commit is contained in:
2024-10-02 22:10:58 +08:00
parent 30f3ec55c2
commit 9fd6f70630
12 changed files with 357 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.7.2
package handler
import (
"net/http"
product "tianyuan-api/apps/index/internal/handler/product"
"tianyuan-api/apps/index/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/:productId",
Handler: product.GetProductByIdHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/list",
Handler: product.GetProductListHandler(serverCtx),
},
},
rest.WithPrefix("/api/index/product"),
)
}