代码初始化

This commit is contained in:
2026-04-02 11:51:44 +08:00
commit b87244638f
83 changed files with 13084 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package copydata
import (
dto "cid/model/dto/copydata"
service "cid/service/copydata"
"context"
)
type AccountReport struct{}
// AccountReportDetail CidAccountReportDetail 广告数据报表详情控制器
var AccountReportDetail = new(AccountReport)
// CreateCidAccountReportDetail 创建广告数据报表详情
func (c *AccountReport) CreateCidAccountReportDetail(ctx context.Context, req *dto.CreateCidAccountReportDetailReq) (res *dto.CreateCidAccountReportDetailRes, err error) {
return service.CidAccountReportDetail.Create(ctx, req.CidAccountReportDetailItem)
}
// BatchCreateCidAccountReportDetail 批量创建广告数据报表详情
func (c *AccountReport) BatchCreateCidAccountReportDetail(ctx context.Context, req *dto.BatchCreateCidAccountReportDetailReq) (res *dto.BatchCreateCidAccountReportDetailRes, err error) {
return service.CidAccountReportDetail.BatchCreate(ctx, req)
}
// CreateCidAccountReportSum 创建广告数据报表汇总
func (c *AccountReport) CreateCidAccountReportSum(ctx context.Context, req *dto.CreateCidAccountReportSumReq) (res *dto.CreateCidAccountReportSumRes, err error) {
return service.CidAccountReportDetail.CreateSum(ctx, req.CidAccountReportSumItem)
}
// BatchCreateCidAccountReportSum 批量创建广告数据报表汇总
func (c *AccountReport) BatchCreateCidAccountReportSum(ctx context.Context, req *dto.BatchCreateCidAccountReportSumReq) (res *dto.BatchCreateCidAccountReportSumRes, err error) {
return service.CidAccountReportDetail.BatchCreateSum(ctx, req)
}

View File

@@ -0,0 +1,30 @@
package copydata
import (
dto "cid/model/dto/copydata"
service "cid/service/copydata"
"context"
)
type creativeReport struct{}
// CreativeReport 广告效果指标表控制器
var CreativeReport = new(creativeReport)
// CreateCreativeReportSum 创建广告效果指标表
func (c *creativeReport) CreateCreativeReportSum(ctx context.Context, req *dto.CreateCreativeReportSumReq) (res *dto.CreateCreativeReportSumRes, err error) {
return service.CreativeReportSum.Create(ctx, req.CreativeReportSumItem)
}
// BatchCreateCreativeReportSum 批量创建广告效果指标表
func (c *creativeReport) BatchCreateCreativeReportSum(ctx context.Context, req *dto.BatchCreateCreativeReportSumReq) (res *dto.BatchCreateCreativeReportSumRes, err error) {
return service.CreativeReportSum.BatchCreate(ctx, req)
}
func (c *creativeReport) CreateCreativeReportDetail(ctx context.Context, req *dto.CreateCreativeReportDetailReq) (res *dto.CreateCreativeReportDetailRes, err error) {
return service.CreativeReportSum.CreateDetail(ctx, req.CreativeReportDetailItem)
}
func (c *creativeReport) BatchCreateCreativeReportDetail(ctx context.Context, req *dto.BatchCreateCreativeReportDetailReq) (res *dto.BatchCreateCreativeReportDetailRes, err error) {
return service.CreativeReportSum.BatchCreateDetail(ctx, req)
}

View File

@@ -0,0 +1,27 @@
package copydata
import (
dto "cid/model/dto/copydata"
service "cid/service/copydata"
"context"
)
type materialReport struct{}
// MaterialReport 素材报表数据控制器
var MaterialReport = new(materialReport)
// CreateMaterialReport 创建素材报表数据
func (c *materialReport) CreateMaterialReport(ctx context.Context, req *dto.CreateMaterialReportReq) (res *dto.CreateMaterialReportRes, err error) {
return service.MaterialReport.Create(ctx, req.MaterialReportItem)
}
// BatchCreateMaterialReport 批量创建素材报表数据
func (c *materialReport) BatchCreateMaterialReport(ctx context.Context, req *dto.BatchCreateMaterialReportReq) (res *dto.BatchCreateMaterialReportRes, err error) {
return service.MaterialReport.BatchCreate(ctx, req)
}
// ListMaterialReport 获取素材报表数据列表
func (c *materialReport) ListMaterialReport(ctx context.Context, req *dto.ListMaterialReportReq) (res *dto.ListMaterialReportRes, err error) {
return service.MaterialReport.List(ctx, req)
}

View File

@@ -0,0 +1,29 @@
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)
}

View File

@@ -0,0 +1,32 @@
package copydata
import (
dto "cid/model/dto/copydata"
service "cid/service/copydata"
"context"
)
type storewideReport struct{}
// StorewideReport 广告效果指标控制器
var StorewideReport = new(storewideReport)
// CreateStorewideReport 创建广告效果指标表
func (c *storewideReport) CreateStorewideReport(ctx context.Context, req *dto.CreateStorewideReportSumReq) (res *dto.CreateStorewideReportSumRes, err error) {
return service.StorewideReportSum.Create(ctx, req.StorewideReportSumItem)
}
// BatchCreateStorewideReport 批量创建广告效果指标表
func (c *storewideReport) BatchCreateStorewideReport(ctx context.Context, req *dto.BatchCreateStorewideReportSumReq) (res *dto.BatchCreateStorewideReportSumRes, err error) {
return service.StorewideReportSum.BatchCreate(ctx, req)
}
// CreateStorewideReportDetail 创建广告效果指标表
func (c *storewideReport) CreateStorewideReportDetail(ctx context.Context, req *dto.CreateStorewideReportDetailReq) (res *dto.CreateStorewideReportDetailRes, err error) {
return service.StorewideReportSum.CreateDetail(ctx, req.StorewideReportDetailItem)
}
// BatchCreateStorewideReportDetail 批量创建广告效果指标表
func (c *storewideReport) BatchCreateStorewideReportDetail(ctx context.Context, req *dto.BatchCreateStorewideReportDetailReq) (res *dto.BatchCreateStorewideReportDetailRes, err error) {
return service.StorewideReportSum.BatchCreateDetail(ctx, req)
}

View File

@@ -0,0 +1,27 @@
package copydata
import (
dto "cid/model/dto/copydata"
service "cid/service/copydata"
"context"
)
type taskReport struct{}
// TaskReport 调控任务数据控制器
var TaskReport = new(taskReport)
// CreateTaskReport 创建调控任务数据
func (c *taskReport) CreateTaskReport(ctx context.Context, req *dto.CreateTaskReportReq) (res *dto.CreateTaskReportRes, err error) {
return service.TaskReport.Create(ctx, req.TaskReportItem)
}
// BatchCreateTaskReport 批量创建调控任务数据
func (c *taskReport) BatchCreateTaskReport(ctx context.Context, req *dto.BatchCreateTaskReportReq) (res *dto.BatchCreateTaskReportRes, err error) {
return service.TaskReport.BatchCreate(ctx, req)
}
// ListTaskReport 获取调控任务数据列表
func (c *taskReport) ListTaskReport(ctx context.Context, req *dto.ListTaskReportReq) (res *dto.ListTaskReportRes, err error) {
return service.TaskReport.List(ctx, req)
}

View File

@@ -0,0 +1,35 @@
package copydata
import (
dto "cid/model/dto/copydata"
"cid/service/copydata"
"context"
"gitea.com/red-future/common/beans"
)
type unitReport struct{}
// UnitReport 获取广告单元数据控制器
var UnitReport = new(unitReport)
// Create 创建广告效果指标
func (c *unitReport) Create(ctx context.Context, req *dto.CreateUnitReportSumReq) (res *dto.CreateUnitReportSumRes, err error) {
return copydata.UnitReportSumService.Create(ctx, req.UnitReportSumItem)
}
// BatchCreate 批量创建广告效果指标
func (c *unitReport) BatchCreate(ctx context.Context, req *dto.BatchCreateUnitReportSumReq) (res *dto.BatchCreateUnitReportSumRes, err error) {
return copydata.UnitReportSumService.BatchCreate(ctx, req)
}
// CreateDetail 创建广告效果指标详情
func (c *unitReport) CreateDetail(ctx context.Context, req *dto.CreateUnitReportDetailReq) (res *dto.CreateUnitReportDetailRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return copydata.UnitReportSumService.CreateDetail(ctx, req.UnitReportDetailItem)
}
// BatchCreateDetail 批量创建广告效果指标详情
func (c *unitReport) BatchCreateDetail(ctx context.Context, req *dto.BatchCreateUnitReportDetailReq) (res *dto.BatchCreateUnitReportDetailRes, err error) {
return copydata.UnitReportSumService.BatchCreateDetail(ctx, req)
}

View File

@@ -0,0 +1,71 @@
package dict
import (
dto "cid/model/dto/dict"
service "cid/service/dict"
"context"
"gitea.com/red-future/common/beans"
)
type datasourcePlatformController struct{}
// DatasourcePlatform 数据源平台控制器
var DatasourcePlatform = new(datasourcePlatformController)
// CreateDatasourcePlatform 创建数据源平台
func (c *datasourcePlatformController) CreateDatasourcePlatform(ctx context.Context, req *dto.CreateDatasourcePlatformReq) (res *dto.CreateDatasourcePlatformRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.DatasourcePlatform.Create(ctx, req)
}
// ListDatasourcePlatforms 获取数据源平台列表
func (c *datasourcePlatformController) ListDatasourcePlatforms(ctx context.Context, req *dto.ListDatasourcePlatformReq) (res *dto.ListDatasourcePlatformRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.DatasourcePlatform.List(ctx, req)
}
// GetDatasourcePlatform 获取数据源平台详情
func (c *datasourcePlatformController) GetDatasourcePlatform(ctx context.Context, req *dto.GetDatasourcePlatformReq) (res *dto.GetDatasourcePlatformRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.DatasourcePlatform.GetOne(ctx, req)
}
// GetPlatformByCode 根据平台编码获取平台信息
func (c *datasourcePlatformController) GetPlatformByCode(ctx context.Context, req *dto.GetPlatformByCodeReq) (res *dto.GetPlatformByCodeRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
platform, err := service.DatasourcePlatform.GetByPlatformCode(ctx, req.PlatformCode)
if err != nil {
return nil, err
}
return &dto.GetPlatformByCodeRes{
DatasourcePlatform: platform,
}, nil
}
// UpdateDatasourcePlatform 更新数据源平台
func (c *datasourcePlatformController) UpdateDatasourcePlatform(ctx context.Context, req *dto.UpdateDatasourcePlatformReq) (res *beans.ResponseEmpty, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
err = service.DatasourcePlatform.Update(ctx, req)
return
}
// UpdateDatasourcePlatformStatus 更新数据源平台状态
func (c *datasourcePlatformController) UpdateDatasourcePlatformStatus(ctx context.Context, req *dto.UpdateDatasourcePlatformStatusReq) (res *beans.ResponseEmpty, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
err = service.DatasourcePlatform.UpdateStatus(ctx, req)
return
}
// DeleteDatasourcePlatform 删除数据源平台
func (c *datasourcePlatformController) DeleteDatasourcePlatform(ctx context.Context, req *dto.DeleteDatasourcePlatformReq) (res *beans.ResponseEmpty, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
err = service.DatasourcePlatform.Delete(ctx, req)
return
}
// GetPlatformStatistics 获取平台统计信息
func (c *datasourcePlatformController) GetPlatformStatistics(ctx context.Context, req *dto.GetPlatformStatisticsReq) (res *dto.GetPlatformStatisticsRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.DatasourcePlatform.GetStatistics(ctx)
}

View File

@@ -0,0 +1,65 @@
package dict
import (
dto "cid/model/dto/dict"
service "cid/service/dict"
"context"
"gitea.com/red-future/common/beans"
)
type fieldMappingConfigController struct{}
// FieldMappingConfig 字段映射配置控制器
var FieldMappingConfig = new(fieldMappingConfigController)
// CreateFieldMappingConfig 创建字段映射配置
func (c *fieldMappingConfigController) CreateFieldMappingConfig(ctx context.Context, req *dto.CreateFieldMappingConfigReq) (res *dto.CreateFieldMappingConfigRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.FieldMappingConfig.Create(ctx, req)
}
// ListFieldMappingConfig 获取字段映射配置列表
func (c *fieldMappingConfigController) ListFieldMappingConfig(ctx context.Context, req *dto.ListFieldMappingConfigReq) (res *dto.ListFieldMappingConfigRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.FieldMappingConfig.List(ctx, req)
}
// GetFieldMappingConfig 获取字段映射配置详情
func (c *fieldMappingConfigController) GetFieldMappingConfig(ctx context.Context, req *dto.GetFieldMappingConfigReq) (res *dto.GetFieldMappingConfigRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.FieldMappingConfig.GetOne(ctx, req)
}
// UpdateFieldMappingConfig 更新字段映射配置
func (c *fieldMappingConfigController) UpdateFieldMappingConfig(ctx context.Context, req *dto.UpdateFieldMappingConfigReq) (res *beans.ResponseEmpty, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
err = service.FieldMappingConfig.Update(ctx, req)
return
}
// UpdateFieldMappingConfigStatus 更新字段映射配置状态
func (c *fieldMappingConfigController) UpdateFieldMappingConfigStatus(ctx context.Context, req *dto.UpdateFieldMappingConfigStatusReq) (res *beans.ResponseEmpty, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
err = service.FieldMappingConfig.UpdateStatus(ctx, req)
return
}
// DeleteFieldMappingConfig 删除字段映射配置
func (c *fieldMappingConfigController) DeleteFieldMappingConfig(ctx context.Context, req *dto.DeleteFieldMappingConfigReq) (res *beans.ResponseEmpty, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
err = service.FieldMappingConfig.Delete(ctx, req)
return
}
// QueryFieldMappingByVendorApi 根据厂商和接口查询字段映射
func (c *fieldMappingConfigController) QueryFieldMappingByVendorApi(ctx context.Context, req *dto.QueryFieldMappingByVendorApiReq) (res *dto.QueryFieldMappingByVendorApiRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.FieldMappingConfig.QueryByVendorApi(ctx, req)
}
// ValidateFieldMapping 验证字段映射配置
func (c *fieldMappingConfigController) ValidateFieldMapping(ctx context.Context, req *dto.ValidateFieldMappingReq) (res *dto.ValidateFieldMappingRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.FieldMappingConfig.Validate(ctx, req)
}

View File

@@ -0,0 +1,53 @@
package dict
import (
dto "cid/model/dto/dict"
service "cid/service/dict"
"context"
"gitea.com/red-future/common/beans"
)
type apiInterfaceController struct{}
// ApiInterface 接口控制器
var ApiInterface = new(apiInterfaceController)
// CreateApiInterface 创建接口
func (c *apiInterfaceController) CreateApiInterface(ctx context.Context, req *dto.CreateApiInterfaceReq) (res *dto.CreateApiInterfaceRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.ApiInterface.Create(ctx, req)
}
// ListApiInterface 获取接口列表
func (c *apiInterfaceController) ListApiInterface(ctx context.Context, req *dto.ListApiInterfaceReq) (res *dto.ListApiInterfaceRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.ApiInterface.List(ctx, req)
}
// GetApiInterface 获取接口详情
func (c *apiInterfaceController) GetApiInterface(ctx context.Context, req *dto.GetApiInterfaceReq) (res *dto.GetApiInterfaceRes, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
return service.ApiInterface.GetOne(ctx, req)
}
// UpdateApiInterface 更新接口
func (c *apiInterfaceController) UpdateApiInterface(ctx context.Context, req *dto.UpdateApiInterfaceReq) (res *beans.ResponseEmpty, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
err = service.ApiInterface.Update(ctx, req)
return
}
// UpdateApiInterfaceStatus 更新接口状态
func (c *apiInterfaceController) UpdateApiInterfaceStatus(ctx context.Context, req *dto.UpdateApiInterfaceStatusReq) (res *beans.ResponseEmpty, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
err = service.ApiInterface.UpdateStatus(ctx, req)
return
}
// DeleteApiInterface 删除接口
func (c *apiInterfaceController) DeleteApiInterface(ctx context.Context, req *dto.DeleteApiInterfaceReq) (res *beans.ResponseEmpty, err error) {
ctx = context.WithValue(ctx, "user", &beans.User{UserName: "admin"})
err = service.ApiInterface.Delete(ctx, req)
return
}