fix analysis

This commit is contained in:
18278715334
2025-12-27 13:51:26 +08:00
parent ed50e9b778
commit cc1680cf01
17 changed files with 485 additions and 57 deletions

View File

@@ -0,0 +1,29 @@
package admin_agent
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tydata-server/app/main/api/internal/logic/admin_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 AdminGetWithdrawalStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.AdminGetWithdrawalStatisticsReq
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 := admin_agent.NewAdminGetWithdrawalStatisticsLogic(r.Context(), svcCtx)
resp, err := l.AdminGetWithdrawalStatistics(&req)
result.HttpResult(r, w, resp, err)
}
}

View File

@@ -0,0 +1,29 @@
package admin_order
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tydata-server/app/main/api/internal/logic/admin_order"
"tydata-server/app/main/api/internal/svc"
"tydata-server/app/main/api/internal/types"
"tydata-server/common/result"
"tydata-server/pkg/lzkit/validator"
)
func AdminGetRefundStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.AdminGetRefundStatisticsReq
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 := admin_order.NewAdminGetRefundStatisticsLogic(r.Context(), svcCtx)
resp, err := l.AdminGetRefundStatistics(&req)
result.HttpResult(r, w, resp, err)
}
}

View File

@@ -0,0 +1,30 @@
package admin_order
import (
"net/http"
"tydata-server/app/main/api/internal/logic/admin_order"
"tydata-server/app/main/api/internal/svc"
"tydata-server/app/main/api/internal/types"
"tydata-server/common/result"
"tydata-server/pkg/lzkit/validator"
"github.com/zeromicro/go-zero/rest/httpx"
)
func AdminGetRevenueStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.AdminGetRevenueStatisticsReq
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 := admin_order.NewAdminGetRevenueStatisticsLogic(r.Context(), svcCtx)
resp, err := l.AdminGetRevenueStatistics(&req)
result.HttpResult(r, w, resp, err)
}
}

View File

@@ -97,6 +97,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/agent-withdrawal/list",
Handler: admin_agent.AdminGetAgentWithdrawalListHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/agent-withdrawal/statistics",
Handler: admin_agent.AdminGetWithdrawalStatisticsHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/list",
@@ -309,6 +314,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/list",
Handler: admin_order.AdminGetOrderListHandler(serverCtx),
},
{
// 获取退款统计数据
Method: http.MethodGet,
Path: "/refund-statistics",
Handler: admin_order.AdminGetRefundStatisticsHandler(serverCtx),
},
{
// 订单退款
Method: http.MethodPost,
@@ -321,6 +332,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Path: "/retry-agent-process/:id",
Handler: admin_order.AdminRetryAgentProcessHandler(serverCtx),
},
{
// 获取收入和利润统计数据
Method: http.MethodGet,
Path: "/revenue-statistics",
Handler: admin_order.AdminGetRevenueStatisticsHandler(serverCtx),
},
{
// 更新订单
Method: http.MethodPut,