根据地址修复质押接口

This commit is contained in:
lianghuanjie
2025-01-13 17:45:25 +08:00
parent 16f75d222c
commit b5e98afecf
7 changed files with 182 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package admin
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"nova_task/internal/logic/admin"
"nova_task/internal/svc"
"nova_task/internal/types"
)
// 根据地址修复质押
func StakeByAddressHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.StakeByAddressReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := admin.NewStakeByAddressLogic(r.Context(), svcCtx)
err := l.StakeByAddress(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.Ok(w)
}
}
}

View File

@@ -44,6 +44,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/nft_holder_update",
Handler: admin.NftHolderUpdateHandler(serverCtx),
},
{
// 根据地址修复质押
Method: http.MethodPost,
Path: "/stake_by_address",
Handler: admin.StakeByAddressHandler(serverCtx),
},
{
// 软质压手动结算
Method: http.MethodGet,