1、response修改 2、负数扣款

This commit is contained in:
2024-10-15 20:52:51 +08:00
parent 8c14915955
commit d63d70847b
67 changed files with 368 additions and 202 deletions

View File

@@ -2,28 +2,27 @@ package YYSY
import (
"net/http"
"tianyuan-api/pkg/errs"
"tianyuan-api/pkg/response"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSY09CDHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
response.Fail(r.Context(), w, errs.ErrParamValidation, nil)
return
}
l := YYSY.NewYYSY09CDLogic(r.Context(), svcCtx)
resp, err := l.YYSY09CD(&req)
if err != nil {
response.Fail(r.Context(), w, err)
response.Fail(r.Context(), w, err, resp)
} else {
response.Success(r.Context(), w, resp)
}

View File

@@ -2,28 +2,27 @@ package YYSY
import (
"net/http"
"tianyuan-api/pkg/errs"
"tianyuan-api/pkg/response"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSY4B21Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
response.Fail(r.Context(), w, errs.ErrParamValidation, nil)
return
}
l := YYSY.NewYYSY4B21Logic(r.Context(), svcCtx)
resp, err := l.YYSY4B21(&req)
if err != nil {
response.Fail(r.Context(), w, err)
response.Fail(r.Context(), w, err, resp)
} else {
response.Success(r.Context(), w, resp)
}

View File

@@ -2,28 +2,27 @@ package YYSY
import (
"net/http"
"tianyuan-api/pkg/errs"
"tianyuan-api/pkg/response"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSY4B37Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
response.Fail(r.Context(), w, errs.ErrParamValidation, nil)
return
}
l := YYSY.NewYYSY4B37Logic(r.Context(), svcCtx)
resp, err := l.YYSY4B37(&req)
if err != nil {
response.Fail(r.Context(), w, err)
response.Fail(r.Context(), w, err, resp)
} else {
response.Success(r.Context(), w, resp)
}

View File

@@ -2,28 +2,27 @@ package YYSY
import (
"net/http"
"tianyuan-api/pkg/errs"
"tianyuan-api/pkg/response"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSY6F2EHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
response.Fail(r.Context(), w, errs.ErrParamValidation, nil)
return
}
l := YYSY.NewYYSY6F2ELogic(r.Context(), svcCtx)
resp, err := l.YYSY6F2E(&req)
if err != nil {
response.Fail(r.Context(), w, err)
response.Fail(r.Context(), w, err, resp)
} else {
response.Success(r.Context(), w, resp)
}

View File

@@ -2,28 +2,27 @@ package YYSY
import (
"net/http"
"tianyuan-api/pkg/errs"
"tianyuan-api/pkg/response"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSYBE08Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
response.Fail(r.Context(), w, errs.ErrParamValidation, nil)
return
}
l := YYSY.NewYYSYBE08Logic(r.Context(), svcCtx)
resp, err := l.YYSYBE08(&req)
if err != nil {
response.Fail(r.Context(), w, err)
response.Fail(r.Context(), w, err, resp)
} else {
response.Success(r.Context(), w, resp)
}

View File

@@ -2,28 +2,27 @@ package YYSY
import (
"net/http"
"tianyuan-api/pkg/errs"
"tianyuan-api/pkg/response"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSYD50FHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
response.Fail(r.Context(), w, errs.ErrParamValidation, nil)
return
}
l := YYSY.NewYYSYD50FLogic(r.Context(), svcCtx)
resp, err := l.YYSYD50F(&req)
if err != nil {
response.Fail(r.Context(), w, err)
response.Fail(r.Context(), w, err, resp)
} else {
response.Success(r.Context(), w, resp)
}

View File

@@ -2,28 +2,27 @@ package YYSY
import (
"net/http"
"tianyuan-api/pkg/errs"
"tianyuan-api/pkg/response"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSYF7DBHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
response.Fail(r.Context(), w, errs.ErrParamValidation, nil)
return
}
l := YYSY.NewYYSYF7DBLogic(r.Context(), svcCtx)
resp, err := l.YYSYF7DB(&req)
if err != nil {
response.Fail(r.Context(), w, err)
response.Fail(r.Context(), w, err, resp)
} else {
response.Success(r.Context(), w, resp)
}