30 lines
1.1 KiB
Go
30 lines
1.1 KiB
Go
package copydata
|
|
|
|
import (
|
|
dto "cid/model/dto/copydata"
|
|
service "cid/service/copydata"
|
|
"context"
|
|
|
|
"gitea.com/red-future/common/beans"
|
|
)
|
|
|
|
var PopulationReport = new(populationReport)
|
|
|
|
type populationReport struct{}
|
|
|
|
// CreatePopulationReport 创建人群报表数据
|
|
func (c *populationReport) CreatePopulationReport(ctx context.Context, req *dto.CreatePopulationReportReq) (*dto.CreatePopulationReportRes, error) {
|
|
return service.PopulationReportService.Create(ctx, req.PopulationReportItem)
|
|
}
|
|
|
|
// BatchCreatePopulationReport 批量创建人群报表数据
|
|
func (c *populationReport) BatchCreatePopulationReport(ctx context.Context, req *dto.BatchCreatePopulationReportReq) (*dto.BatchCreatePopulationReportRes, error) {
|
|
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
|
|
return service.PopulationReportService.BatchCreate(ctx, req.Items)
|
|
}
|
|
|
|
// ListPopulationReport 查询人群报表数据列表
|
|
func (c *populationReport) ListPopulationReport(ctx context.Context, req *dto.ListPopulationReportReq) (*dto.ListPopulationReportRes, error) {
|
|
return service.PopulationReportService.List(ctx, req)
|
|
}
|