Files
novatask/internal/handler/task/get_nft_list_handler.go
2024-12-27 18:06:13 +08:00

23 lines
500 B
Go

package task
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"nova_task/internal/logic/task"
"nova_task/internal/svc"
)
// 拉取玩家持有的nft列表
func GetNftListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := task.NewGetNftListLogic(r.Context(), svcCtx)
resp, err := l.GetNftList()
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}