diff --git a/internal/controller/task.go b/internal/controller/task.go index d7b160f..3c388f6 100644 --- a/internal/controller/task.go +++ b/internal/controller/task.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "micro-bundle/internal/dao" + "micro-bundle/internal/dto" "micro-bundle/internal/logic" "micro-bundle/internal/model" "micro-bundle/pb/bundle" @@ -323,7 +324,7 @@ func (b *BundleProvider) GetArtistUploadStatsList(_ context.Context, req *bundle if sortBy, ok := model.OrderByDataAnalysis[req.SortBy]; ok { req.SortBy = sortBy } - daoReq := &dao.TaskQueryRequest{ + daoReq := &dto.TaskQueryRequest{ Keyword: req.Keyword, Page: int(req.Page), PageSize: int(req.PageSize), diff --git a/internal/dao/taskDao.go b/internal/dao/taskDao.go index 2b0e5e0..b8e2d90 100644 --- a/internal/dao/taskDao.go +++ b/internal/dao/taskDao.go @@ -3,6 +3,7 @@ package dao import ( "fmt" bundleConfig "micro-bundle/config" + "micro-bundle/internal/dto" "micro-bundle/internal/model" "micro-bundle/pkg/app" commonErr "micro-bundle/pkg/err" @@ -16,17 +17,6 @@ import ( "gorm.io/gorm/clause" ) -// TaskQueryRequest 查询待指派任务记录请求参数 -type TaskQueryRequest struct { - Keyword string `json:"keyword"` // 艺人姓名、编号、手机号搜索关键词 - LastTaskAssignee string `json:"lastTaskAssignee"` // 最近一次指派人筛选(模糊匹配) - Page int `json:"page"` // 页码 - PageSize int `json:"pageSize"` // 每页数量 - SortBy string `json:"sortBy"` // 排序字段(支持白名单字段) - SortType string `json:"sortType"` // 排序类型 asc/desc - SubNums []string `json:"subNums"` // 选中导出的艺人编号集合(可选) -} - // TaskAssignRequest 指派任务请求参数 type TaskAssignRequest struct { SubNum string `json:"subNum"` // 艺人编号 @@ -264,7 +254,7 @@ type ArtistPendingAssignItem struct { } // GetArtistUploadStatsList 查询所有艺人的上传统计与额度信息(通过 BundleBalance 关联 CastWork/CastWorkAnalysis,及 subNum 关联 TaskManagement) -func GetArtistUploadStatsList(req *TaskQueryRequest) ([]*ArtistUploadStatsItem, int64, error) { +func GetArtistUploadStatsList(req *dto.TaskQueryRequest) ([]*ArtistUploadStatsItem, int64, error) { taskSchema := bundleConfig.Data.TaskBenchDB.DbName nowMonth := time.Now().Format("2006-01") diff --git a/internal/dto/task.go b/internal/dto/task.go new file mode 100644 index 0000000..11c6139 --- /dev/null +++ b/internal/dto/task.go @@ -0,0 +1,12 @@ +package dto + +// TaskQueryRequest 查询待指派任务记录请求参数 +type TaskQueryRequest struct { + Keyword string `json:"keyword"` // 艺人姓名、编号、手机号搜索关键词 + LastTaskAssignee string `json:"lastTaskAssignee"` // 最近一次指派人筛选(模糊匹配) + Page int `json:"page"` // 页码 + PageSize int `json:"pageSize"` // 每页数量 + SortBy string `json:"sortBy"` // 排序字段(支持白名单字段) + SortType string `json:"sortType"` // 排序类型 asc/desc + SubNums []string `json:"subNums"` // 选中导出的艺人编号集合(可选) +} diff --git a/internal/logic/taskLogic.go b/internal/logic/taskLogic.go index c424924..2219b53 100644 --- a/internal/logic/taskLogic.go +++ b/internal/logic/taskLogic.go @@ -3,6 +3,7 @@ package logic import ( "encoding/json" "micro-bundle/internal/dao" + "micro-bundle/internal/dto" "micro-bundle/pb/bundle" commonErr "micro-bundle/pkg/err" "strings" @@ -60,7 +61,7 @@ func ValidateEmployee(employeeNum string) (bool, error) { } // GetArtistUploadStatsList 查询艺人上传与额度统计列表 -func GetArtistUploadStatsList(req *dao.TaskQueryRequest) ([]*dao.ArtistUploadStatsItem, int64, error) { +func GetArtistUploadStatsList(req *dto.TaskQueryRequest) ([]*dao.ArtistUploadStatsItem, int64, error) { return dao.GetArtistUploadStatsList(req) }