12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package manage
- import (
- "Cold_Logistic/internal/pkg/common/codex"
- "Cold_Logistic/internal/pkg/common/global"
- "Cold_Logistic/internal/server/application/statisticsrv"
- "Cold_Logistic/internal/server/infra/dao"
- "github.com/gin-gonic/gin"
- "gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/core"
- "gogs.baozhida.cn/Cold_Logistic_libs/pkg/contrib/errors"
- )
- func (api Api) statOrderNumByTime(c *gin.Context) {
- req := statisticsrv.OrderNumTimeStatReqVO{}
- if err := c.BindJSON(&req); err != nil {
- core.WriteErrResponse(c, errors.WithCodeOnce(err, codex.ErrBindJSON, ""))
- return
- }
- srv := statisticsrv.NewStatisticService(dao.NewDataStore(global.CommonConnectRepoInst.StoreDB))
- res, err := srv.OrderNumTimeStat(c, req)
- if err != nil {
- core.WriteErrResponse(c, errors.WithCodeOnce(err, codex.ErrQueryFailed, ""))
- return
- }
- core.WriteResponse(c, nil, res)
- }
- func (api Api) statOrderNumByUser(c *gin.Context) {
- req := statisticsrv.OrderNumUserStatReqVO{}
- if err := c.BindJSON(&req); err != nil {
- core.WriteErrResponse(c, errors.WithCodeOnce(err, codex.ErrBindJSON, ""))
- return
- }
- srv := statisticsrv.NewStatisticService(dao.NewDataStore(global.CommonConnectRepoInst.StoreDB))
- res, err := srv.OrderNumUserStat(c, req)
- if err != nil {
- core.WriteErrResponse(c, errors.WithCodeOnce(err, codex.ErrQueryFailed, ""))
- return
- }
- core.WriteResponse(c, nil, res)
- }
|