3 Star 15 Fork 13

联犀/中台模块

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
apiBatchAggHandler.go 926 Bytes
一键复制 编辑 原始数据 按行查看 历史
杨磊 提交于 2024-12-28 17:42 +08:00 . feat: 新增批量聚合接口
package common
import (
"encoding/json"
"gitee.com/unitedrhino/core/service/apisvr/internal/logic/system/common"
"gitee.com/unitedrhino/core/service/apisvr/internal/svc"
"gitee.com/unitedrhino/core/service/apisvr/internal/types"
"gitee.com/unitedrhino/share/errors"
"gitee.com/unitedrhino/share/result"
"io"
"net/http"
)
// 批量聚合接口请求
func ApiBatchAggHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ApiBatchAggReq
body, err := io.ReadAll(r.Body)
if err != nil {
result.Http(w, r, nil, errors.Parameter.WithMsg("入参不正确:"+err.Error()))
}
err = json.Unmarshal(body, &req)
if err != nil {
result.Http(w, r, nil, errors.Parameter.WithMsg("入参不正确:"+err.Error()))
}
l := common.NewApiBatchAggLogic(r.Context(), svcCtx)
resp, err := l.ApiBatchAgg(r, &req)
result.Http(w, r, resp, err)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/unitedrhino/core.git
git@gitee.com:unitedrhino/core.git
unitedrhino
core
中台模块
v1.5.4

搜索帮助