新增index首页服务
This commit is contained in:
31
apps/index/internal/handler/routes.go
Normal file
31
apps/index/internal/handler/routes.go
Normal 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"),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user