增加 dto 用来放请求参数
This commit is contained in:
parent
a03f14de50
commit
4d8203bf8c
@ -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),
|
||||
|
||||
@ -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")
|
||||
|
||||
|
||||
12
internal/dto/task.go
Normal file
12
internal/dto/task.go
Normal file
@ -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"` // 选中导出的艺人编号集合(可选)
|
||||
}
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user