增加修正nft质押者接口
This commit is contained in:
22
internal/handler/admin/fix_nft_staker_handler.go
Normal file
22
internal/handler/admin/fix_nft_staker_handler.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
"nova_task/internal/logic/admin"
|
||||
"nova_task/internal/svc"
|
||||
)
|
||||
|
||||
// 修正 NFT 质押者
|
||||
func FixNftStakerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := admin.NewFixNftStakerLogic(r.Context(), svcCtx)
|
||||
err := l.FixNftStaker()
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.Ok(w)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
Path: "/email_reward",
|
||||
Handler: admin.SendEmailRewardHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// 修正 NFT 质押者
|
||||
Method: http.MethodGet,
|
||||
Path: "/fix_nft_staker",
|
||||
Handler: admin.FixNftStakerHandler(serverCtx),
|
||||
},
|
||||
{
|
||||
// NFT持有者更新
|
||||
Method: http.MethodGet,
|
||||
|
||||
Reference in New Issue
Block a user