初始化项目
This commit is contained in:
34
internal/handler/routes.go
Normal file
34
internal/handler/routes.go
Normal file
@@ -0,0 +1,34 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.7.3
|
||||
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
task "nova_task/internal/handler/task"
|
||||
"nova_task/internal/svc"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest"
|
||||
)
|
||||
|
||||
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// 领取任务奖励
|
||||
Method: http.MethodGet,
|
||||
Path: "/reward/:id",
|
||||
Handler: task.GetTaskRewardHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 获取任务列表
|
||||
Method: http.MethodGet,
|
||||
Path: "/tasks",
|
||||
Handler: task.GetTaskListHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
|
||||
rest.WithPrefix("/api/task/v1"),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user