nft质押任务逻辑

This commit is contained in:
lianghuanjie
2024-12-27 18:06:13 +08:00
parent a22f73df20
commit 31a674080d
39 changed files with 1532 additions and 99 deletions

View File

@@ -33,6 +33,24 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
// 质押NFT
Method: http.MethodPost,
Path: "/nft/stake",
Handler: task.StakeNftHandler(serverCtx),
},
{
// 取消质押NFT
Method: http.MethodPost,
Path: "/nft/unstake",
Handler: task.UnStakeNftHandler(serverCtx),
},
{
// 拉取玩家持有的nft列表
Method: http.MethodGet,
Path: "/nfts",
Handler: task.GetNftListHandler(serverCtx),
},
{
// 领取任务奖励
Method: http.MethodGet,
@@ -45,6 +63,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/task",
Handler: task.VerifyTaskResultHandler(serverCtx),
},
{
// 质押任务详情
Method: http.MethodGet,
Path: "/task/stake",
Handler: task.GetStakeTaskDetailHandler(serverCtx),
},
},
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
rest.WithPrefix("/gapi/task/v1"),