Files
ycc-proxy-server/app/main/api/internal/handler/agent/applywithdrawalhandler.go
2025-11-27 13:09:54 +08:00

29 lines
694 B
Go

package agent
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"ycc-server/app/main/api/internal/logic/agent"
"ycc-server/app/main/api/internal/svc"
"ycc-server/app/main/api/internal/types"
)
func ApplyWithdrawalHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ApplyWithdrawalReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := agent.NewApplyWithdrawalLogic(r.Context(), svcCtx)
resp, err := l.ApplyWithdrawal(&req)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}
}
}