初始化项目

This commit is contained in:
lianghuanjie
2024-12-05 20:51:35 +08:00
commit e2ba6924b8
30 changed files with 1560 additions and 0 deletions

View 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"),
)
}