chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"context"
|
||||
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/common/v1"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/model"
|
||||
"git.5iot.com/iotlcm-public/iotlcm-admin-svr/internal/service"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) BatchExecutionLogList(ctx context.Context, req *v1.BatchExecutionLogListReq) (res *v1.BatchExecutionLogListRes, err error) {
|
||||
list, totalCount, err := service.CommonBatchExecutionLog().List(ctx, &req.BatchExecutionLogListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*model.BatchExecutionLogListModel{}
|
||||
}
|
||||
|
||||
res = new(v1.BatchExecutionLogListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
|
||||
func (c *ControllerV1) BatchExecutionLogSummary(ctx context.Context, req *v1.BatchExecutionLogSummaryReq) (res *v1.BatchExecutionLogSummaryRes, err error) {
|
||||
data, err := service.CommonBatchExecutionLog().Summary(ctx, &req.BatchExecutionLogDetailParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(v1.BatchExecutionLogSummaryRes)
|
||||
res.BatchExecutionLogDetailModel = data
|
||||
return
|
||||
}
|
||||
|
||||
func (c *ControllerV1) BatchExecutionLogDetailList(ctx context.Context, req *v1.BatchExecutionLogDetailListReq) (res *v1.BatchExecutionLogDetailListRes, err error) {
|
||||
list, totalCount, err := service.CommonBatchExecutionLog().DetailList(ctx, &req.BatchDetailListParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*model.BatchDetailListModel{}
|
||||
}
|
||||
|
||||
res = new(v1.BatchExecutionLogDetailListRes)
|
||||
res.Items = list
|
||||
res.PageResult.Page = req.Page
|
||||
res.PageResult.PageSize = req.PageSize
|
||||
res.PageResult.Total = totalCount
|
||||
return
|
||||
}
|
||||
|
||||
func (c *ControllerV1) BatchExecutionLogSyncReview(ctx context.Context, req *v1.BatchExecutionLogSyncReviewReq) (res *v1.BatchExecutionLogSyncReviewRes, err error) {
|
||||
data, err := service.CommonBatchExecutionLog().SyncReview(ctx, &req.BatchExecutionLogSyncReviewParam)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res = new(v1.BatchExecutionLogSyncReviewRes)
|
||||
res.BatchExecutionLogSyncReviewModel = data
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user