新增扣税

This commit is contained in:
2025-06-22 16:02:09 +08:00
parent 541b88bbf8
commit 8b728e28c5
18 changed files with 1206 additions and 28 deletions

View File

@@ -0,0 +1,29 @@
package agent
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tydata-server/app/main/api/internal/logic/agent"
"tydata-server/app/main/api/internal/svc"
"tydata-server/app/main/api/internal/types"
"tydata-server/common/result"
"tydata-server/pkg/lzkit/validator"
)
func GetAgentWithdrawalTaxExemptionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.GetWithdrawalTaxExemptionReq
if err := httpx.Parse(r, &req); err != nil {
result.ParamErrorResult(r, w, err)
return
}
if err := validator.Validate(req); err != nil {
result.ParamValidateErrorResult(r, w, err)
return
}
l := agent.NewGetAgentWithdrawalTaxExemptionLogic(r.Context(), svcCtx)
resp, err := l.GetAgentWithdrawalTaxExemption(&req)
result.HttpResult(r, w, resp, err)
}
}

View File

@@ -620,6 +620,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/withdrawal",
Handler: agent.AgentWithdrawalHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/withdrawal/tax/exemption",
Handler: agent.GetAgentWithdrawalTaxExemptionHandler(serverCtx),
},
}...,
),
rest.WithJwt(serverCtx.Config.JwtAuth.AccessSecret),