Compare commits
7 Commits
main
...
feat-cjy-t
Author | SHA1 | Date | |
---|---|---|---|
abe34505b3 | |||
8f0fa39ab9 | |||
5269d7e24c | |||
6d0ccb0c9d | |||
6b12c7441d | |||
b82f4159ba | |||
019197fc15 |
@ -5,6 +5,7 @@ import (
|
||||
"micro-bundle/internal/controller"
|
||||
_ "micro-bundle/internal/handler"
|
||||
"micro-bundle/pkg/app"
|
||||
"micro-bundle/pkg/db"
|
||||
"micro-bundle/pkg/tracing"
|
||||
|
||||
"dubbo.apache.org/dubbo-go/v3/config"
|
||||
@ -12,15 +13,15 @@ import (
|
||||
_ "dubbo.apache.org/dubbo-go/v3/imports"
|
||||
"github.com/bwmarrin/snowflake"
|
||||
"go.uber.org/zap"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func NewApp(Lg *zap.Logger, JaegerTracer *tracing.JaegerProvider, SfNode *snowflake.Node, BundleDB *gorm.DB) *app.App {
|
||||
func NewApp(Lg *zap.Logger, JaegerTracer *tracing.JaegerProvider, SfNode *snowflake.Node, BundleDB *db.BundleDB, TaskBenchDB *db.TaskBenchDB) *app.App {
|
||||
return &app.App{
|
||||
Lg: Lg,
|
||||
JaegerTracer: JaegerTracer,
|
||||
SfNode: SfNode,
|
||||
BundleDB: BundleDB,
|
||||
TaskBenchDB: TaskBenchDB,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,6 @@ import (
|
||||
)
|
||||
|
||||
func InitApp() (*app.App, error) {
|
||||
wire.Build(logger.Provider, tracing.Provider, snowf.Provider, db.Provider, NewApp)
|
||||
wire.Build(logger.Provider, tracing.Provider, snowf.Provider, db.Provider, db.TaskBenchProvider, NewApp)
|
||||
return &app.App{}, nil
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by Wire. DO NOT EDIT.
|
||||
|
||||
//go:generate go run github.com/google/wire/cmd/wire
|
||||
//go:generate go run -mod=mod github.com/google/wire/cmd/wire
|
||||
//go:build !wireinject
|
||||
// +build !wireinject
|
||||
|
||||
@ -12,6 +12,12 @@ import (
|
||||
"micro-bundle/pkg/logger"
|
||||
"micro-bundle/pkg/snowf"
|
||||
"micro-bundle/pkg/tracing"
|
||||
|
||||
_ "dubbo.apache.org/dubbo-go/v3/filter/tps/strategy"
|
||||
|
||||
_ "dubbo.apache.org/dubbo-go/v3/imports"
|
||||
|
||||
_ "micro-bundle/internal/handler"
|
||||
)
|
||||
|
||||
// Injectors from wire.go:
|
||||
@ -20,7 +26,8 @@ func InitApp() (*app.App, error) {
|
||||
zapLogger := logger.ZapInit()
|
||||
jaegerProvider := tracing.NewTracing()
|
||||
node := snowf.NewSf()
|
||||
gormDB := db.NewBundleDB()
|
||||
appApp := NewApp(zapLogger, jaegerProvider, node, gormDB)
|
||||
bundleDB := db.NewBundleDB()
|
||||
taskBenchDB := db.NewTaskBenchDB()
|
||||
appApp := NewApp(zapLogger, jaegerProvider, node, bundleDB, taskBenchDB)
|
||||
return appApp, nil
|
||||
}
|
||||
|
@ -7,6 +7,12 @@ bundleDB:
|
||||
user: artuser
|
||||
password: C250PflXIWv2SQm8
|
||||
db_name: "fiee_bundle"
|
||||
taskBenchDB:
|
||||
host: 121.229.45.214
|
||||
port: 9007
|
||||
user: artuser
|
||||
password: C250PflXIWv2SQm8
|
||||
db_name: "fiee_task_bench"
|
||||
#aliYunRtc:
|
||||
# appid: "aeztom27"
|
||||
# app_key: "76c62466cbd77d7a3606660a15861d1e"
|
||||
|
@ -7,6 +7,12 @@ bundleDB:
|
||||
user: artuser
|
||||
password: C250PflXIWv2SQm8
|
||||
db_name: "fiee_bundle"
|
||||
taskBenchDB:
|
||||
host: 121.229.45.214
|
||||
port: 9007
|
||||
user: artuser
|
||||
password: C250PflXIWv2SQm8
|
||||
db_name: "fiee_task_bench"
|
||||
#aliYunRtc:
|
||||
# appid: "aeztom27"
|
||||
# app_key: "76c62466cbd77d7a3606660a15861d1e"
|
||||
|
@ -7,6 +7,12 @@ bundleDB:
|
||||
user: fonchain_opv
|
||||
password: IhQmhg8HZjDmU=Ove5PnA^D
|
||||
db_name: "micro_bundle"
|
||||
taskBenchDB:
|
||||
host: svc-fontree-mysql-service
|
||||
port: 3306
|
||||
user: fonchain_opv
|
||||
password: IhQmhg8HZjDmU=Ove5PnA^D
|
||||
db_name: "fiee_task_bench"
|
||||
#redis:
|
||||
# db: ${oa-meeting.redis.db}
|
||||
# addr: ${redis.addr}
|
||||
|
@ -26,6 +26,13 @@ type AppConfig struct {
|
||||
Password string
|
||||
DbName string `mapstructure:"db_name"`
|
||||
}
|
||||
TaskBenchDB struct {
|
||||
Host string
|
||||
Port string
|
||||
User string
|
||||
Password string
|
||||
DbName string `mapstructure:"db_name"`
|
||||
}
|
||||
Redis struct {
|
||||
DB string
|
||||
Addr string
|
||||
|
312
internal/controller/task.go
Normal file
312
internal/controller/task.go
Normal file
@ -0,0 +1,312 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"micro-bundle/internal/dao"
|
||||
"micro-bundle/internal/logic"
|
||||
"micro-bundle/pb/bundle"
|
||||
)
|
||||
|
||||
// GetPendingTaskList 查询待指派任务记录
|
||||
func (b *BundleProvider) GetPendingTaskList(_ context.Context, req *bundle.TaskQueryRequest) (*bundle.TaskQueryResponse, error) {
|
||||
// 转换请求参数
|
||||
daoReq := &dao.TaskQueryRequest{
|
||||
Keyword: req.Keyword,
|
||||
Page: int(req.Page),
|
||||
PageSize: int(req.PageSize),
|
||||
SortBy: req.SortBy,
|
||||
SortType: req.SortType,
|
||||
}
|
||||
|
||||
// 调用logic层
|
||||
tasks, total, err := logic.GetPendingTaskList(daoReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 转换响应数据
|
||||
var taskInfos []*bundle.TaskManagementInfo
|
||||
for _, task := range tasks {
|
||||
taskInfo := &bundle.TaskManagementInfo{
|
||||
SubNum: task.SubNum,
|
||||
TelNum: task.TelNum,
|
||||
ArtistName: task.ArtistName,
|
||||
PendingVideoCount: int32(task.PendingVideoCount),
|
||||
PendingPostCount: int32(task.PendingPostCount),
|
||||
PendingDataCount: int32(task.PendingDataCount),
|
||||
ProgressTaskCount: int32(task.ProgressTaskCount),
|
||||
CompleteTaskCount: int32(task.CompleteTaskCount),
|
||||
LastTaskAssignee: task.LastTaskAssignee,
|
||||
TaskAssigneeNum: task.TaskAssigneeNum,
|
||||
}
|
||||
taskInfos = append(taskInfos, taskInfo)
|
||||
}
|
||||
|
||||
return &bundle.TaskQueryResponse{
|
||||
Tasks: taskInfos,
|
||||
Total: total,
|
||||
Page: req.Page,
|
||||
PageSize: req.PageSize,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// AssignTask 指派某位员工完成某个艺人的任务
|
||||
// AssignTask 指派某位员工完成某个艺人的任务
|
||||
func (b *BundleProvider) AssignTask(_ context.Context, req *bundle.TaskAssignRequest) (*bundle.CommonResponse, error) {
|
||||
// 转换请求参数
|
||||
daoReq := &dao.TaskAssignRequest{
|
||||
SubNum: req.SubNum,
|
||||
TelNum: req.TelNum,
|
||||
ArtistName: req.ArtistName, // 添加缺失的ArtistName字段
|
||||
TaskAssignee: req.TaskAssignee,
|
||||
TaskAssigneeNum: req.TaskAssigneeNum,
|
||||
Operator: req.Operator,
|
||||
OperatorNum: req.OperatorNum,
|
||||
AssignVideoCount: int(req.AssignVideoCount),
|
||||
AssignPostCount: int(req.AssignPostCount),
|
||||
AssignDataCount: int(req.AssignDataCount),
|
||||
}
|
||||
|
||||
// 调用logic层
|
||||
err := logic.AssignTask(daoReq)
|
||||
if err != nil {
|
||||
return &bundle.CommonResponse{
|
||||
Msg: err.Error(),
|
||||
}, err
|
||||
}
|
||||
|
||||
return &bundle.CommonResponse{
|
||||
Msg: "任务指派成功",
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdatePendingCount 修改待发数量
|
||||
func (b *BundleProvider) UpdatePendingCount(_ context.Context, req *bundle.UpdatePendingCountRequest) (*bundle.CommonResponse, error) {
|
||||
// 转换请求参数
|
||||
daoReq := &dao.UpdatePendingCountRequest{
|
||||
SubNum: req.SubNum,
|
||||
TelNum: req.TelNum,
|
||||
ArtistName: req.ArtistName, // 添加缺失的ArtistName字段
|
||||
PendingVideoCount: int(req.PendingVideoCount),
|
||||
PendingPostCount: int(req.PendingPostCount),
|
||||
PendingDataCount: int(req.PendingDataCount),
|
||||
Operator: req.Operator,
|
||||
OperatorNum: req.OperatorNum,
|
||||
}
|
||||
|
||||
// 调用logic层
|
||||
err := logic.UpdatePendingCount(daoReq)
|
||||
if err != nil {
|
||||
return &bundle.CommonResponse{
|
||||
Msg: err.Error(),
|
||||
}, err
|
||||
}
|
||||
|
||||
return &bundle.CommonResponse{
|
||||
Msg: "待发数量修改成功",
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetRecentAssignRecords 查询最近被指派记录
|
||||
func (b *BundleProvider) GetRecentAssignRecords(_ context.Context, req *bundle.RecentAssignRecordsRequest) (*bundle.RecentAssignRecordsResponse, error) {
|
||||
limit := int(req.Limit)
|
||||
if limit == 0 {
|
||||
limit = 3 // 默认查询3条
|
||||
}
|
||||
|
||||
// 调用logic层
|
||||
operatorList, err := logic.GetRecentAssignRecords(limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &bundle.RecentAssignRecordsResponse{
|
||||
OperatorList: operatorList,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetEmployeeAssignedTasks 根据登录人信息查询被指派给该员工的任务
|
||||
func (b *BundleProvider) GetEmployeeAssignedTasks(_ context.Context, req *bundle.EmployeeTaskQueryRequest) (*bundle.EmployeeTaskQueryResponse, error) {
|
||||
// 转换请求参数
|
||||
daoReq := &dao.EmployeeTaskQueryRequest{
|
||||
TaskAssigneeNum: req.TaskAssigneeNum,
|
||||
Keyword: req.Keyword,
|
||||
Operator: req.Operator,
|
||||
SortBy: req.SortBy,
|
||||
StartTime: req.StartTime,
|
||||
EndTime: req.EndTime,
|
||||
StartCompleteTime: req.StartCompleteTime,
|
||||
EndCompleteTime: req.EndCompleteTime,
|
||||
Status: int(req.Status),
|
||||
Page: int(req.Page),
|
||||
PageSize: int(req.PageSize),
|
||||
}
|
||||
|
||||
// 调用logic层
|
||||
records, total, err := logic.GetEmployeeAssignedTasks(daoReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 转换响应数据
|
||||
var recordInfos []*bundle.TaskAssignRecordInfo
|
||||
for _, record := range records {
|
||||
recordInfo := convertToTaskAssignRecordInfo(record)
|
||||
recordInfos = append(recordInfos, recordInfo)
|
||||
}
|
||||
|
||||
return &bundle.EmployeeTaskQueryResponse{
|
||||
Records: recordInfos,
|
||||
Total: total,
|
||||
Page: req.Page,
|
||||
PageSize: req.PageSize,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CompleteTaskManually 员工手动点击完成任务
|
||||
func (b *BundleProvider) CompleteTaskManually(_ context.Context, req *bundle.CompleteTaskManuallyRequest) (*bundle.CommonResponse, error) {
|
||||
// 调用logic层
|
||||
err := logic.CompleteTaskManually(req.AssignRecordsUUID, req.TaskAssigneeNum)
|
||||
if err != nil {
|
||||
return &bundle.CommonResponse{
|
||||
Msg: err.Error(),
|
||||
}, err
|
||||
}
|
||||
|
||||
return &bundle.CommonResponse{
|
||||
Msg: "任务完成状态更新成功",
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdateTaskProgress 员工实际完成任务状态更新
|
||||
func (b *BundleProvider) UpdateTaskProgress(_ context.Context, req *bundle.UpdateTaskProgressRequest) (*bundle.CommonResponse, error) {
|
||||
// 转换请求参数
|
||||
daoReq := &dao.CompleteTaskRequest{
|
||||
AssignRecordsUUID: req.AssignRecordsUUID,
|
||||
EmployeeName: req.EmployeeName,
|
||||
EmployeeNum: req.EmployeeNum,
|
||||
TaskType: req.TaskType,
|
||||
CompleteCount: int(req.CompleteCount),
|
||||
}
|
||||
|
||||
// 调用logic层
|
||||
err := logic.UpdateTaskProgress(daoReq)
|
||||
if err != nil {
|
||||
return &bundle.CommonResponse{
|
||||
Msg: err.Error(),
|
||||
}, err
|
||||
}
|
||||
|
||||
return &bundle.CommonResponse{
|
||||
Msg: "任务进度更新成功",
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetTaskAssignRecordsList 多条件查询操作记录表
|
||||
func (b *BundleProvider) GetTaskAssignRecordsList(_ context.Context, req *bundle.TaskAssignRecordsQueryRequest) (*bundle.TaskAssignRecordsQueryResponse, error) {
|
||||
// 转换请求参数
|
||||
daoReq := &dao.TaskAssignRecordsQueryRequest{
|
||||
Keyword: req.Keyword,
|
||||
TaskAssignee: req.TaskAssignee,
|
||||
Operator: req.Operator,
|
||||
OperatorNum: req.OperatorNum,
|
||||
StartTime: req.StartTime,
|
||||
EndTime: req.EndTime,
|
||||
Status: int(req.Status),
|
||||
ActualStatus: int(req.ActualStatus),
|
||||
Page: int(req.Page),
|
||||
PageSize: int(req.PageSize),
|
||||
}
|
||||
|
||||
// 调用logic层
|
||||
records, total, err := logic.GetTaskAssignRecordsList(daoReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 转换响应数据
|
||||
var recordInfos []*bundle.TaskAssignRecordInfo
|
||||
for _, record := range records {
|
||||
recordInfo := convertToTaskAssignRecordInfo(record)
|
||||
recordInfos = append(recordInfos, recordInfo)
|
||||
}
|
||||
|
||||
return &bundle.TaskAssignRecordsQueryResponse{
|
||||
Records: recordInfos,
|
||||
Total: total,
|
||||
Page: req.Page,
|
||||
PageSize: req.PageSize,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// convertToTaskAssignRecordInfo 转换TaskAssignRecords模型为proto消息
|
||||
func convertToTaskAssignRecordInfo(record *dao.TaskAssignRecordsResponse) *bundle.TaskAssignRecordInfo {
|
||||
var completeTime string
|
||||
if record.CompleteTime != nil {
|
||||
completeTime = record.CompleteTime.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
|
||||
return &bundle.TaskAssignRecordInfo{
|
||||
AssignRecordsUUID: record.AssignRecordsUUID,
|
||||
SubNum: record.SubNum,
|
||||
TelNum: record.TelNum,
|
||||
ArtistName: record.ArtistName,
|
||||
Status: int32(record.Status),
|
||||
ActualStatus: int32(record.ActualStatus),
|
||||
CompleteTime: completeTime,
|
||||
OperatorType: int32(record.OperatorType),
|
||||
Operator: record.Operator,
|
||||
OperatorNum: record.OperatorNum,
|
||||
OperatorTime: record.OperatorTime.Format("2006-01-02 15:04:05"),
|
||||
TaskAssignee: record.TaskAssignee,
|
||||
TaskAssigneeNum: record.TaskAssigneeNum,
|
||||
PendingVideoCount: int32(record.PendingVideoCount),
|
||||
PendingPostCount: int32(record.PendingPostCount),
|
||||
PendingDataCount: int32(record.PendingDataCount),
|
||||
UpdatedAt: record.UpdatedAt.Format("2006-01-02 15:04:05"),
|
||||
}
|
||||
}
|
||||
|
||||
// GetArtistBundleBalance 查询艺人的当前任务余额与待发数量(区分套餐/增值两类)
|
||||
// 说明:
|
||||
// - 查询条件优先使用艺人编号(customerNum),为空时使用手机号(telNum)
|
||||
// - 返回同时包含“套餐类型”和“增值类型”的余额与待发数量,均按视频/图文/数据分析三类区分
|
||||
func (b *BundleProvider) GetArtistBundleBalance(_ context.Context, req *bundle.ArtistBundleBalanceRequest) (*bundle.ArtistBundleBalanceResponse, error) {
|
||||
// 参数校验
|
||||
if req.CustomerNum == "" && req.TelNum == "" {
|
||||
return nil, fmt.Errorf("艺人编号和手机号不能同时为空")
|
||||
}
|
||||
|
||||
// 组装查询参数(逻辑层/DAO层使用 SubNum 与 TelNum)
|
||||
pendingReq := &dao.PendingAndBalanceRequest{
|
||||
SubNum: req.CustomerNum, // 映射 customerNum -> SubNum
|
||||
TelNum: req.TelNum, // 映射 telNum -> TelNum
|
||||
}
|
||||
|
||||
// 调用逻辑层:查询待发数量与任务余额(区分套餐/增值)
|
||||
resp, err := logic.GetPendingAndTaskBalances(pendingReq)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 映射为proto响应结构(套餐/增值分别返回视频/图文/数据分析的余额与待发数量)
|
||||
return &bundle.ArtistBundleBalanceResponse{
|
||||
// 套餐类型余额
|
||||
BundleVideoBalance: int32(resp.BundleVideoBalance),
|
||||
BundleImageBalance: int32(resp.BundleImageBalance),
|
||||
BundleDataAnalysisBalance: int32(resp.BundleDataAnalysisBalance),
|
||||
// 增值类型余额
|
||||
IncreaseVideoBalance: int32(resp.IncreaseVideoBalance),
|
||||
IncreaseImageBalance: int32(resp.IncreaseImageBalance),
|
||||
IncreaseDataAnalysisBalance: int32(resp.IncreaseDataAnalysisBalance),
|
||||
// 套餐类型待发数量
|
||||
BundlePendingVideoCount: int32(resp.PendingBundleVideoCount),
|
||||
BundlePendingImageCount: int32(resp.PendingBundleImageCount),
|
||||
BundlePendingDataAnalysisCount: int32(resp.PendingBundleDataAnalysisCount),
|
||||
// 增值类型待发数量
|
||||
IncreasePendingVideoCount: int32(resp.PendingIncreaseVideoCount),
|
||||
IncreasePendingImageCount: int32(resp.PendingIncreaseImageCount),
|
||||
IncreasePendingDataAnalysisCount: int32(resp.PendingIncreaseDataAnalysisCount),
|
||||
}, nil
|
||||
}
|
1707
internal/dao/taskDao.go
Normal file
1707
internal/dao/taskDao.go
Normal file
File diff suppressed because it is too large
Load Diff
317
internal/logic/taskLogic.go
Normal file
317
internal/logic/taskLogic.go
Normal file
@ -0,0 +1,317 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"micro-bundle/internal/dao"
|
||||
commonErr "micro-bundle/pkg/err"
|
||||
)
|
||||
|
||||
// GetValidArtistList 查询套餐状态为有效中的艺人列表
|
||||
// 调用dao层获取艺人详细信息
|
||||
func GetValidArtistList() ([]dao.ValidArtistInfo, error) {
|
||||
return dao.GetValidArtistList()
|
||||
}
|
||||
|
||||
// GetValidArtistIDs 查询套餐没有过期的艺人ID列表(保持向后兼容)
|
||||
// 根据BundleOrderRecords表查询过期时间大于当前时间且状态为已支付的艺人
|
||||
func GetValidArtistIDs() ([]string, error) {
|
||||
artistList, err := GetValidArtistList()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var artistIDs []string
|
||||
for _, artist := range artistList {
|
||||
if artist.CustomerNum != "" {
|
||||
artistIDs = append(artistIDs, artist.CustomerNum)
|
||||
}
|
||||
}
|
||||
|
||||
return artistIDs, nil
|
||||
}
|
||||
|
||||
// todo 目前暂时不做检验,后续需要做判断
|
||||
// GetValidEmployeeIDs 查询可以被指派任务的员工ID列表
|
||||
// 这里可以根据实际业务需求实现,比如查询员工表、权限表等
|
||||
// 目前先返回一个示例实现,实际项目中需要根据具体的员工管理逻辑来实现
|
||||
func GetValidEmployeeIDs() ([]string, error) {
|
||||
var employeeIDs []string
|
||||
|
||||
return employeeIDs, nil
|
||||
}
|
||||
|
||||
// ValidateEmployee 验证员工是否可以被指派任务
|
||||
func ValidateEmployee(employeeNum string) (bool, error) {
|
||||
validEmployees, err := GetValidEmployeeIDs()
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
// 如果没有限制(返回空列表),则认为所有员工都可以被指派
|
||||
if len(validEmployees) == 0 {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
for _, validEmp := range validEmployees {
|
||||
if validEmp == employeeNum {
|
||||
return true, nil
|
||||
}
|
||||
}
|
||||
|
||||
return false, nil
|
||||
}
|
||||
|
||||
// GetPendingTaskList 查询待指派任务记录
|
||||
func GetPendingTaskList(req *dao.TaskQueryRequest) ([]*dao.TaskQueryResponse, int64, error) {
|
||||
// 1. 先查询套餐没有过期的艺人
|
||||
validArtist, err := GetValidArtistList()
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
// 2. 调用DAO层查询待指派任务记录
|
||||
record, total, err := dao.GetPendingTaskList(req, validArtist)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
// 3. 转换为响应结构体
|
||||
var recordResponse []*dao.TaskQueryResponse
|
||||
for _, record := range record {
|
||||
// 计算聚合的待发数量:视频、图文、数据分析
|
||||
videoTotal := record.PendingBundleLimitVideoExpiredCount + record.PendingBundleLimitVideoCount + record.PendingIncreaseLimitVideoExpiredCount + record.PendingIncreaseLimitVideoCount + record.PendingBundleVideoCount + record.PendingIncreaseVideoCount
|
||||
imageTotal := record.PendingBundleLimitImageExpiredCount + record.PendingBundleLimitImageCount + record.PendingIncreaseLimitImageExpiredCount + record.PendingIncreaseLimitImageCount + record.PendingBundleImageCount + record.PendingIncreaseImageCount
|
||||
dataTotal := record.PendingBundleLimitDataAnalysisExpiredCount + record.PendingBundleLimitDataAnalysisCount + record.PendingIncreaseLimitDataAnalysisExpiredCount + record.PendingIncreaseLimitDataAnalysisCount + record.PendingBundleDataAnalysisCount + record.PendingIncreaseDataAnalysisCount
|
||||
|
||||
// 根据 SubNum 和 TelNum 查询对应的员工正在进行中的任务和已完成任务数量
|
||||
progressTaskCount, completeTaskCount, err := dao.GetTaskAssigneeInfo(record.TaskAssigneeNum)
|
||||
if err != nil {
|
||||
recordResponse = append(recordResponse, &dao.TaskQueryResponse{
|
||||
SubNum: record.SubNum,
|
||||
TelNum: record.TelNum,
|
||||
ArtistName: record.ArtistName,
|
||||
TaskAssigneeNum: record.TaskAssigneeNum,
|
||||
PendingPostCount: imageTotal,
|
||||
PendingVideoCount: videoTotal,
|
||||
PendingDataCount: dataTotal,
|
||||
ProgressTaskCount: 0,
|
||||
CompleteTaskCount: 0,
|
||||
LastTaskAssignee: record.LastTaskAssignee,
|
||||
})
|
||||
} else {
|
||||
recordResponse = append(recordResponse, &dao.TaskQueryResponse{
|
||||
SubNum: record.SubNum,
|
||||
TelNum: record.TelNum,
|
||||
ArtistName: record.ArtistName,
|
||||
TaskAssigneeNum: record.TaskAssigneeNum,
|
||||
PendingPostCount: imageTotal,
|
||||
PendingVideoCount: videoTotal,
|
||||
PendingDataCount: dataTotal,
|
||||
ProgressTaskCount: progressTaskCount,
|
||||
CompleteTaskCount: completeTaskCount,
|
||||
LastTaskAssignee: record.LastTaskAssignee,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return recordResponse, total, nil
|
||||
}
|
||||
|
||||
// AssignTask 指派某位员工完成某个艺人的任务
|
||||
func AssignTask(req *dao.TaskAssignRequest) error {
|
||||
// 1. 验证员工是否可以被指派任务
|
||||
isValid, err := ValidateEmployee(req.TaskAssigneeNum)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !isValid {
|
||||
return commonErr.ReturnError(nil, "员工不能被指派任务", "该员工不在可指派任务的员工列表中")
|
||||
}
|
||||
|
||||
progressTaskCount, completeTaskCount, err := dao.GetTaskAssigneeInfo(req.TaskAssigneeNum)
|
||||
if err != nil {
|
||||
// 查询不到的话,给一个默认值
|
||||
progressTaskCount, completeTaskCount = 1, 0
|
||||
}
|
||||
|
||||
// 2. 调用DAO层执行指派任务
|
||||
// 待完成任务数量需要+1,因为这个任务暂时还没有指派,所以+1
|
||||
return dao.AssignTask(req, progressTaskCount+1, completeTaskCount)
|
||||
}
|
||||
|
||||
// UpdatePendingCount 修改待发数量
|
||||
func UpdatePendingCount(req *dao.UpdatePendingCountRequest) error {
|
||||
// 1. 验证艺人是否有有效套餐
|
||||
validArtistIDs, err := GetValidArtistIDs()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// 检查艺人是否在有效列表中
|
||||
isValidArtist := false
|
||||
for _, artistID := range validArtistIDs {
|
||||
if artistID == req.SubNum {
|
||||
isValidArtist = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !isValidArtist {
|
||||
return commonErr.ReturnError(nil, "艺人套餐已过期", "该艺人没有有效的套餐,无法修改待发数量")
|
||||
}
|
||||
|
||||
// 查询艺人当前任务余额与待发汇总,校验待发数量和余额的总和是否足够
|
||||
resp, err := dao.GetUserPendingAndTaskBalances(&dao.PendingAndBalanceRequest{
|
||||
SubNum: req.SubNum,
|
||||
TelNum: req.TelNum,
|
||||
})
|
||||
if err != nil {
|
||||
return commonErr.ReturnError(err, "查询艺人任务余额失败", "查询艺人任务余额失败: ")
|
||||
}
|
||||
|
||||
// 计算当前待发数量(聚合所有类型)
|
||||
curVideo := resp.PendingBundleVideoCount + resp.PendingIncreaseVideoCount
|
||||
curImage := resp.PendingBundleImageCount + resp.PendingIncreaseImageCount
|
||||
curData := resp.PendingBundleDataAnalysisCount + resp.PendingIncreaseDataAnalysisCount
|
||||
|
||||
// 计算可用余额(套餐 + 增值)
|
||||
availVideo := resp.BundleVideoBalance + resp.IncreaseVideoBalance
|
||||
availImage := resp.BundleImageBalance + resp.IncreaseImageBalance
|
||||
availData := resp.BundleDataAnalysisBalance + resp.IncreaseDataAnalysisBalance
|
||||
|
||||
// 校验:当前待发数量 + 艺人余额 >= 目标数量
|
||||
// 这确保了可以优先扣减待发数量,不足时再扣减余额
|
||||
totalAvailVideo := curVideo + availVideo
|
||||
totalAvailImage := curImage + availImage
|
||||
totalAvailData := curData + availData
|
||||
|
||||
if req.PendingVideoCount > totalAvailVideo {
|
||||
return commonErr.ReturnError(nil, "视频任务数量不足",
|
||||
fmt.Sprintf("目标待发视频数量(%d)超出当前待发数量(%d)和可用余额(%d)的总和(%d)",
|
||||
req.PendingVideoCount, curVideo, availVideo, totalAvailVideo))
|
||||
}
|
||||
if req.PendingPostCount > totalAvailImage {
|
||||
return commonErr.ReturnError(nil, "图文任务数量不足",
|
||||
fmt.Sprintf("目标待发图文数量(%d)超出当前待发数量(%d)和可用余额(%d)的总和(%d)",
|
||||
req.PendingPostCount, curImage, availImage, totalAvailImage))
|
||||
}
|
||||
if req.PendingDataCount > totalAvailData {
|
||||
return commonErr.ReturnError(nil, "数据分析任务数量不足",
|
||||
fmt.Sprintf("目标待发数据分析数量(%d)超出当前待发数量(%d)和可用余额(%d)的总和(%d)",
|
||||
req.PendingDataCount, curData, availData, totalAvailData))
|
||||
}
|
||||
|
||||
// 2. 调用DAO层更新待发数量
|
||||
return dao.UpdatePendingCount(req)
|
||||
}
|
||||
|
||||
// GetRecentAssignRecords 查询最近被指派记录
|
||||
func GetRecentAssignRecords(limit int) ([]string, error) {
|
||||
records, err := dao.GetRecentAssignRecords(limit)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var recordOperator []string
|
||||
for _, record := range records {
|
||||
recordOperator = append(recordOperator, record.TaskAssignee)
|
||||
}
|
||||
return recordOperator, nil
|
||||
}
|
||||
|
||||
// GetEmployeeAssignedTasks 根据登录人信息查询被指派给该员工的艺人任务
|
||||
func GetEmployeeAssignedTasks(req *dao.EmployeeTaskQueryRequest) ([]*dao.TaskAssignRecordsResponse, int64, error) {
|
||||
// 1. 调用DAO层查询被指派给该员工的艺人任务
|
||||
record, total, err := dao.GetEmployeeAssignedTasks(req)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
// 2. 转换为响应结构体
|
||||
var recordResponse []*dao.TaskAssignRecordsResponse
|
||||
for _, record := range record {
|
||||
recordResponse = append(recordResponse, &dao.TaskAssignRecordsResponse{
|
||||
AssignRecordsUUID: record.AssignRecordsUUID,
|
||||
SubNum: record.SubNum,
|
||||
TelNum: record.TelNum,
|
||||
ArtistName: record.ArtistName,
|
||||
Status: record.Status,
|
||||
ActualStatus: record.ActualStatus,
|
||||
CompleteTime: record.CompleteTime,
|
||||
OperatorType: record.OperatorType,
|
||||
Operator: record.Operator,
|
||||
OperatorNum: record.OperatorNum,
|
||||
OperatorTime: record.OperatorTime,
|
||||
TaskAssignee: record.TaskAssignee,
|
||||
TaskAssigneeNum: record.TaskAssigneeNum,
|
||||
PendingVideoCount: record.PendingVideoCount,
|
||||
PendingPostCount: record.PendingPostCount,
|
||||
PendingDataCount: record.PendingDataCount,
|
||||
// todo: 将更新时间转换成人类可读的格式
|
||||
UpdatedAt: record.UpdatedAt,
|
||||
})
|
||||
}
|
||||
|
||||
return recordResponse, total, nil
|
||||
}
|
||||
|
||||
// CompleteTaskManually 员工手动点击完成任务
|
||||
func CompleteTaskManually(assignRecordsUUID string, taskAssigneeNum string) error {
|
||||
// // 第一步,批量更新记录被指派的员工为taskAssigneeNum的待完成任务数量和已经完成任务的数量
|
||||
// err := dao.UpdateTaskRecordsByAssigneeNum(taskAssigneeNum)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
return dao.CompleteTaskManually(assignRecordsUUID)
|
||||
}
|
||||
|
||||
// UpdateTaskProgress 员工实际完成任务状态更新
|
||||
func UpdateTaskProgress(req *dao.CompleteTaskRequest) error {
|
||||
return dao.UpdateTaskProgress(req)
|
||||
}
|
||||
|
||||
// GetTaskAssignRecordsList 多条件查询操作记录表
|
||||
func GetTaskAssignRecordsList(req *dao.TaskAssignRecordsQueryRequest) ([]*dao.TaskAssignRecordsResponse, int64, error) {
|
||||
record, total, err := dao.GetTaskAssignRecordsList(req)
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
// 2. 转换为响应结构体
|
||||
var recordResponse []*dao.TaskAssignRecordsResponse
|
||||
for _, record := range record {
|
||||
recordResponse = append(recordResponse, &dao.TaskAssignRecordsResponse{
|
||||
AssignRecordsUUID: record.AssignRecordsUUID,
|
||||
SubNum: record.SubNum,
|
||||
TelNum: record.TelNum,
|
||||
ArtistName: record.ArtistName,
|
||||
Status: record.Status,
|
||||
ActualStatus: record.ActualStatus,
|
||||
CompleteTime: record.CompleteTime,
|
||||
OperatorType: record.OperatorType,
|
||||
Operator: record.Operator,
|
||||
OperatorNum: record.OperatorNum,
|
||||
OperatorTime: record.OperatorTime,
|
||||
TaskAssignee: record.TaskAssignee,
|
||||
TaskAssigneeNum: record.TaskAssigneeNum,
|
||||
PendingVideoCount: record.PendingVideoCount,
|
||||
PendingPostCount: record.PendingPostCount,
|
||||
PendingDataCount: record.PendingDataCount,
|
||||
UpdatedAt: record.UpdatedAt,
|
||||
})
|
||||
}
|
||||
|
||||
return recordResponse, total, nil
|
||||
}
|
||||
|
||||
// // GetArtistBundleBalance 查询艺人套餐剩余数量
|
||||
// func GetArtistBundleBalance(req *dao.ArtistBundleBalanceRequest) (*dao.ArtistBundleBalanceResponse, error) {
|
||||
// return dao.GetArtistBundleBalance(req)
|
||||
// }
|
||||
|
||||
// GetPendingAndTaskBalances 查询艺人当前的待发数量与任务余额(区分套餐/增值)
|
||||
// 根据艺人的编号 SubNum 或手机号 TelNum 进行查询,优先使用编号
|
||||
// 返回的数据会区分为“套餐类型”和“增值类型”两大类,涵盖视频/图文/数据分析三种任务
|
||||
func GetPendingAndTaskBalances(req *dao.PendingAndBalanceRequest) (*dao.PendingAndBalanceResponse, error) {
|
||||
return dao.GetUserPendingAndTaskBalances(req)
|
||||
}
|
212
internal/model/task.go
Normal file
212
internal/model/task.go
Normal file
@ -0,0 +1,212 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
type TaskManagement struct {
|
||||
ID int64 `gorm:"primarykey"`
|
||||
SubNum string `gorm:"column:sub_num;comment:用户编号;index:idx_sub_num;index:idx_sub_tel,priority:1" json:"subNum"`
|
||||
TelNum string `gorm:"column:tel_num;comment:手机号;index:idx_tel_num;index:idx_sub_tel,priority:2" json:"telNum"`
|
||||
ArtistName string `gorm:"column:artist_name;comment:艺人名称;index:idx_artist_name" json:"artistName"`
|
||||
|
||||
// ===== 待发视频类任务 =====
|
||||
PendingBundleVideoCount int `gorm:"column:pending_bundle_video_count;comment:待发非限制类型套餐权益视频数量" json:"pendingBundleVideoCount"`
|
||||
PendingIncreaseVideoCount int `gorm:"column:pending_increase_video_count;comment:待发非限制类型增值权益视频数量" json:"pendingIncreaseVideoCount"`
|
||||
PendingBundleLimitVideoCount int `gorm:"column:pending_bundle_limit_video_count;comment:待发套餐权益限制类型非过期视频数量" json:"pendingBundleLimitVideoCount"`
|
||||
PendingIncreaseLimitVideoCount int `gorm:"column:pending_increase_limit_video_count;comment:待发增值权益限制类型非过期视频数量" json:"pendingIncreaseLimitVideoCount"`
|
||||
PendingBundleLimitVideoExpiredCount int `gorm:"column:pending_bundle_limit_video_expired_count;comment:待发套餐权益限制类型会过期视频数量" json:"pendingBundleLimitVideoExpiredCount"`
|
||||
PendingIncreaseLimitVideoExpiredCount int `gorm:"column:pending_increase_limit_video_expired_count;comment:待发增值权益限制类型会过期视频数量" json:"pendingIncreaseLimitVideoExpiredCount"`
|
||||
|
||||
// ===== 待发图片类任务 =====
|
||||
PendingBundleImageCount int `gorm:"column:pending_bundle_image_count;comment:待发非限制类型套餐权益图片数量" json:"pendingBundleImageCount"`
|
||||
PendingIncreaseImageCount int `gorm:"column:pending_increase_image_count;comment:待发非限制类型增值权益图片数量" json:"pendingIncreaseImageCount"`
|
||||
PendingBundleLimitImageCount int `gorm:"column:pending_bundle_limit_image_count;comment:待发套餐权益限制类型非过期图片数量" json:"pendingBundleLimitImageCount"`
|
||||
PendingIncreaseLimitImageCount int `gorm:"column:pending_increase_limit_image_count;comment:待发增值权益限制类型非过期图片数量" json:"pendingIncreaseLimitImageCount"`
|
||||
PendingBundleLimitImageExpiredCount int `gorm:"column:pending_bundle_limit_image_expired_count;comment:待发套餐权益限制类型会过期图片数量" json:"pendingBundleLimitImageExpiredCount"`
|
||||
PendingIncreaseLimitImageExpiredCount int `gorm:"column:pending_increase_limit_image_expired_count;comment:待发增值权益限制类型会过期图片数量" json:"pendingIncreaseLimitImageExpiredCount"`
|
||||
|
||||
// ===== 待发数据分析类任务 =====
|
||||
PendingBundleDataAnalysisCount int `gorm:"column:pending_bundle_data_analysis_count;comment:待发非限制类型套餐权益数据分析数量" json:"pendingBundleDataAnalysisCount"`
|
||||
PendingIncreaseDataAnalysisCount int `gorm:"column:pending_increase_data_analysis_count;comment:待发非限制类型增值权益数据分析数量" json:"pendingIncreaseDataAnalysisCount"`
|
||||
PendingBundleLimitDataAnalysisCount int `gorm:"column:pending_bundle_limit_data_analysis_count;comment:待发套餐权益限制类型非过期数据分析数量" json:"pendingBundleLimitDataAnalysisCount"`
|
||||
PendingIncreaseLimitDataAnalysisCount int `gorm:"column:pending_increase_limit_data_analysis_count;comment:待发增值权益限制类型非过期数据分析数量" json:"pendingIncreaseLimitDataAnalysisCount"`
|
||||
PendingBundleLimitDataAnalysisExpiredCount int `gorm:"column:pending_bundle_limit_data_analysis_expired_count;comment:待发套餐权益限制类型会过期数据分析数量" json:"pendingBundleLimitDataAnalysisExpiredCount"`
|
||||
PendingIncreaseLimitDataAnalysisExpiredCount int `gorm:"column:pending_increase_limit_data_analysis_expired_count;comment:待发增值权益限制类型会过期数据分析数量" json:"pendingIncreaseLimitDataAnalysisExpiredCount"`
|
||||
|
||||
LastTaskAssignee string `gorm:"column:last_task_assignee;comment:最后一次的任务指派人" json:"lastTaskAssignee"`
|
||||
TaskAssigneeNum string `gorm:"column:task_assignee_num;comment:任务指派人账号" json:"taskAssigneeNum"`
|
||||
ProgressCount int `gorm:"column:progress_count;comment:进行中的任务数量" json:"progressCount"`
|
||||
CompleteCount int `gorm:"column:complete_count;comment:已完成的任务数量" json:"completeCount"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
|
||||
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_deleted_at" json:"deletedAt"`
|
||||
}
|
||||
|
||||
func (t *TaskManagement) TableName() string {
|
||||
return "task_management"
|
||||
}
|
||||
|
||||
// 指派记录表
|
||||
type TaskAssignRecords struct {
|
||||
ID int64 `gorm:"primarykey"`
|
||||
AssignRecordsUUID string `gorm:"column:assign_records_uuid;comment:指派记录UUID;uniqueIndex:idx_assign_uuid" json:"assignRecordsUUID"`
|
||||
SubNum string `gorm:"column:sub_num;comment:艺人编号;index:idx_assign_sub_num;index:idx_assign_sub_tel,priority:1" json:"subNum"`
|
||||
TelNum string `gorm:"column:tel_num;comment:艺人手机号;index:idx_assign_tel_num;index:idx_assign_sub_tel,priority:2" json:"telNum"`
|
||||
ArtistName string `gorm:"column:artist_name;comment:艺人名称;index:idx_assign_artist_name" json:"artistName"`
|
||||
Status int `gorm:"column:status;comment:反馈完成状态 1:未完成 2:完成;index:idx_status;index:idx_status_assignee,priority:1" json:"status"`
|
||||
ActualStatus int `gorm:"column:actual_status;comment:实际完成状态 1:未完成 2:完成;index:idx_actual_status;index:idx_actual_assignee,priority:1" json:"actualStatus"`
|
||||
CompleteTime *time.Time `gorm:"column:complete_time;comment:反馈完成时间;index:idx_complete_time" json:"completeTime"`
|
||||
OperatorType int `gorm:"column:operator_type;comment:操作类型 1:修改待发数量 2:指派;index:idx_operator_type;index:idx_operator_type_time,priority:1" json:"operatorType"`
|
||||
Operator string `gorm:"column:operator;comment:操作人;index:idx_operator" json:"operator"`
|
||||
OperatorNum string `gorm:"column:operator_num;comment:操作人账号;index:idx_operator_num" json:"operatorNum"`
|
||||
OperatorTime time.Time `gorm:"column:operator_time;comment:操作时间;index:idx_operator_time;index:idx_operator_type_time,priority:2" json:"operatorTime"`
|
||||
TaskAssignee string `gorm:"column:task_assignee;comment:任务指派人;index:idx_task_assignee;index:idx_status_assignee,priority:2;index:idx_actual_assignee,priority:2" json:"taskAssignee"`
|
||||
TaskAssigneeNum string `gorm:"column:task_assignee_num;comment:任务指派人账号;index:idx_task_assignee_num" json:"taskAssigneeNum"`
|
||||
PendingVideoCount int `gorm:"column:pending_video_count;comment:待发视频数量" json:"pendingVideoCount"`
|
||||
PendingPostCount int `gorm:"column:pending_post_count;comment:待发图文数量" json:"pendingPostCount"`
|
||||
PendingDataCount int `gorm:"column:pending_data_count;comment:待发数据数量" json:"pendingDataCount"`
|
||||
AssignVideoCount int `gorm:"column:assign_video_count;comment:指派待发视频数" json:"assignVideoCount"`
|
||||
AssignPostCount int `gorm:"column:assign_post_count;comment:指派待发图文数" json:"assignPostCount"`
|
||||
AssignDataCount int `gorm:"column:assign_data_count;comment:指派待发数据数" json:"assignDataCount"`
|
||||
CompleteVideoCount int `gorm:"column:complete_video_count;comment:已完成视频数" json:"completeVideoCount"`
|
||||
CompletePostCount int `gorm:"column:complete_post_count;comment:已完成图文数" json:"completePostCount"`
|
||||
CompleteDataCount int `gorm:"column:complete_data_count;comment:已完成数据数" json:"completeDataCount"`
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间;index:idx_updated_at" json:"updatedAt"`
|
||||
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_assign_deleted_at" json:"deletedAt"`
|
||||
}
|
||||
|
||||
func (t *TaskAssignRecords) TableName() string {
|
||||
return "task_assign_records"
|
||||
}
|
||||
|
||||
// 任务余额表
|
||||
type TaskBalance struct {
|
||||
ID int64 `gorm:"primarykey"`
|
||||
SubNum string `gorm:"column:sub_num;comment:用户编号;index:idx_task_sub_num;not null" json:"subNum"`
|
||||
TelNum string `gorm:"column:tel_num;comment:手机号;index:idx_task_tel_num;not null" json:"telNum"`
|
||||
Month string `gorm:"column:month;type:varchar(32);comment:月份;index:idx_task_month;not null" json:"month"`
|
||||
ExpiredAt time.Time `gorm:"column:expired_at;type:datetime;comment:任务过期时间" json:"expiredAt"`
|
||||
StartAt time.Time `gorm:"column:start_at;type:datetime;comment:任务开始时间" json:"startAt"`
|
||||
|
||||
// ===== 任务视频类 =====
|
||||
TaskBundleVideoNumber int `gorm:"column:task_bundle_video_number;not null;comment:任务非限制类型套餐权益视频总数" json:"taskBundleVideoNumber"`
|
||||
TaskIncreaseVideoNumber int `gorm:"column:task_increase_video_number;not null;comment:任务非限制类型增值权益视频总数" json:"taskIncreaseVideoNumber"`
|
||||
TaskBundleLimitVideoNumber int `gorm:"column:task_bundle_limit_video_number;not null;comment:任务套餐权益限制类型非过期总数" json:"taskBundleLimitVideoNumber"`
|
||||
TaskIncreaseLimitVideoNumber int `gorm:"column:task_increase_limit_video_number;not null;comment:任务增值权益限制类型非过期总数" json:"taskIncreaseLimitVideoNumber"`
|
||||
TaskBundleLimitVideoExpiredNumber int `gorm:"column:task_bundle_limit_video_expired_number;not null;comment:任务套餐权益限制类型会过期总数" json:"taskBundleLimitVideoExpiredNumber"`
|
||||
TaskIncreaseLimitVideoExpiredNumber int `gorm:"column:task_increase_limit_video_expired_number;not null;comment:任务增值权益限制类型会过期总数" json:"taskIncreaseLimitVideoExpiredNumber"`
|
||||
TaskMonthlyInvalidBundleVideoNumber int `gorm:"column:task_monthly_invalid_bundle_video_number;not null;comment:任务当月失效的套餐权益视频总数" json:"taskMonthlyInvalidBundleVideoNumber"`
|
||||
TaskInvalidBundleVideoNumber int `gorm:"column:task_invalid_bundle_video_number;not null;comment:任务历史失效的套餐权益视频总数" json:"taskInvalidBundleVideoNumber"`
|
||||
TaskMonthlyInvalidIncreaseVideoNumber int `gorm:"column:task_monthly_invalid_increase_video_number;not null;comment:任务当月失效的增值权益视频总数" json:"taskMonthlyInvalidIncreaseVideoNumber"`
|
||||
TaskInvalidIncreaseVideoNumber int `gorm:"column:task_invalid_increase_video_number;not null;comment:任务历史失效的增值权益视频总数" json:"taskInvalidIncreaseVideoNumber"`
|
||||
TaskBundleVideoConsumptionNumber int `gorm:"column:task_bundle_video_consumption_number;not null;comment:任务非限制类型套餐权益视频使用数" json:"taskBundleVideoConsumptionNumber"`
|
||||
TaskIncreaseVideoConsumptionNumber int `gorm:"column:task_increase_video_consumption_number;not null;comment:任务非限制类型增值权益视频使用数" json:"taskIncreaseVideoConsumptionNumber"`
|
||||
TaskBundleLimitVideoConsumptionNumber int `gorm:"column:task_bundle_limit_video_consumption_number;not null;comment:任务套餐权益限制类型非过期使用数" json:"taskBundleLimitVideoConsumptionNumber"`
|
||||
TaskIncreaseLimitVideoConsumptionNumber int `gorm:"column:task_increase_limit_video_consumption_number;not null;comment:任务增值权益限制类型非过期使用数" json:"taskIncreaseLimitVideoConsumptionNumber"`
|
||||
TaskBundleLimitVideoExpiredConsumptionNumber int `gorm:"column:task_bundle_limit_video_expired_consumption_number;not null;comment:任务套餐权益限制类型会过期使用数" json:"taskBundleLimitVideoExpiredConsumptionNumber"`
|
||||
TaskIncreaseLimitVideoExpiredConsumptionNumber int `gorm:"column:task_increase_limit_video_expired_consumption_number;not null;comment:任务增值权益限制类型会过期使用数" json:"taskIncreaseLimitVideoExpiredConsumptionNumber"`
|
||||
TaskMonthlyLimitVideoNumber int `gorm:"column:task_monthly_limit_video_number;not null;comment:任务当月限制类型视频可用数" json:"taskMonthlyLimitVideoNumber"`
|
||||
TaskMonthlyLimitVideoConsumptionNumber int `gorm:"column:task_monthly_limit_video_consumption_number;not null;comment:任务当月限制类型视频已使用额度" json:"taskMonthlyLimitVideoConsumptionNumber"`
|
||||
TaskMonthlyLimitVideoExpireNumber int `gorm:"column:task_monthly_limit_video_expired_number;not null;comment:任务当月限制类型视频会过期可用数" json:"taskMonthlyLimitVideoExpireNumber"`
|
||||
TaskMonthlyLimitVideoExpireConsumptionNumber int `gorm:"column:task_monthly_limit_video_expired_consumption_number;not null;comment:任务当月限制类型视频会过期已使用额度" json:"taskMonthlyLimitVideoExpireConsumptionNumber"`
|
||||
TaskMonthlyBundleVideoConsumptionNumber int `gorm:"column:task_monthly_bundle_video_consumption_number;not null;comment:任务当月套餐类型总使用数" json:"taskMonthlyBundleVideoConsumptionNumber"`
|
||||
TaskMonthlyIncreaseVideoConsumptionNumber int `gorm:"column:task_monthly_increase_video_consumption_number;not null;comment:任务当月增值类型总使用数" json:"taskMonthlyIncreaseVideoConsumptionNumber"`
|
||||
TaskMonthlyLimitVideoQuotaNumber int `gorm:"column:task_monthly_limit_video_quota_number;not null;comment:任务当月限制类型视频额度" json:"taskMonthlyLimitVideoQuotaNumber"`
|
||||
|
||||
// ===== 任务图片类 =====
|
||||
TaskBundleImageNumber int `gorm:"column:task_bundle_image_number;not null;comment:任务非限制类型套餐权益图片总数" json:"taskBundleImageNumber"`
|
||||
TaskIncreaseImageNumber int `gorm:"column:task_increase_image_number;not null;comment:任务非限制类型增值权益图片总数" json:"taskIncreaseImageNumber"`
|
||||
TaskBundleLimitImageNumber int `gorm:"column:task_bundle_limit_image_number;not null;comment:任务套餐权益限制类型非过期总数" json:"taskBundleLimitImageNumber"`
|
||||
TaskIncreaseLimitImageNumber int `gorm:"column:task_increase_limit_image_number;not null;comment:任务增值权益限制类型非过期总数" json:"taskIncreaseLimitImageNumber"`
|
||||
TaskBundleLimitImageExpiredNumber int `gorm:"column:task_bundle_limit_image_expired_number;not null;comment:任务套餐权益限制类型会过期总数" json:"taskBundleLimitImageExpiredNumber"`
|
||||
TaskIncreaseLimitImageExpiredNumber int `gorm:"column:task_increase_limit_image_expired_number;not null;comment:任务增值权益限制类型会过期总数" json:"taskIncreaseLimitImageExpiredNumber"`
|
||||
TaskMonthlyInvalidBundleImageNumber int `gorm:"column:task_monthly_invalid_bundle_image_number;not null;comment:任务当月失效的套餐权益图片总数" json:"taskMonthlyInvalidBundleImageNumber"`
|
||||
TaskInvalidBundleImageNumber int `gorm:"column:task_invalid_bundle_image_number;not null;comment:任务历史失效的套餐权益图片总数" json:"taskInvalidBundleImageNumber"`
|
||||
TaskMonthlyInvalidIncreaseImageNumber int `gorm:"column:task_monthly_invalid_increase_image_number;not null;comment:任务当月失效的增值权益图片总数" json:"taskMonthlyInvalidIncreaseImageNumber"`
|
||||
TaskInvalidIncreaseImageNumber int `gorm:"column:task_invalid_increase_image_number;not null;comment:任务历史失效的增值权益图片总数" json:"taskInvalidIncreaseImageNumber"`
|
||||
TaskBundleImageConsumptionNumber int `gorm:"column:task_bundle_image_consumption_number;not null;comment:任务非限制类型套餐权益图片使用数" json:"taskBundleImageConsumptionNumber"`
|
||||
TaskIncreaseImageConsumptionNumber int `gorm:"column:task_increase_image_consumption_number;not null;comment:任务非限制类型增值权益图片使用数" json:"taskIncreaseImageConsumptionNumber"`
|
||||
TaskBundleLimitImageConsumptionNumber int `gorm:"column:task_bundle_limit_image_consumption_number;not null;comment:任务套餐权益限制类型非过期使用数" json:"taskBundleLimitImageConsumptionNumber"`
|
||||
TaskIncreaseLimitImageConsumptionNumber int `gorm:"column:task_increase_limit_image_consumption_number;not null;comment:任务增值权益限制类型非过期使用数" json:"taskIncreaseLimitImageConsumptionNumber"`
|
||||
TaskBundleLimitImageExpiredConsumptionNumber int `gorm:"column:task_bundle_limit_image_expired_consumption_number;not null;comment:任务套餐权益限制类型会过期使用数" json:"taskBundleLimitImageExpiredConsumptionNumber"`
|
||||
TaskIncreaseLimitImageExpiredConsumptionNumber int `gorm:"column:task_increase_limit_image_expired_consumption_number;not null;comment:任务增值权益限制类型会过期使用数" json:"taskIncreaseLimitImageExpiredConsumptionNumber"`
|
||||
TaskMonthlyLimitImageNumber int `gorm:"column:task_monthly_limit_image_number;not null;comment:任务当月限制类型图片可使用额度" json:"taskMonthlyLimitImageNumber"`
|
||||
TaskMonthlyLimitImageConsumptionNumber int `gorm:"column:task_monthly_limit_image_consumption_number;not null;comment:任务当月限制类型图片已使用额度" json:"taskMonthlyLimitImageConsumptionNumber"`
|
||||
TaskMonthlyLimitImageExpireNumber int `gorm:"column:task_monthly_limit_image_expired_number;not null;comment:任务当月限制类型图片会过期可用数" json:"taskMonthlyLimitImageExpireNumber"`
|
||||
TaskMonthlyLimitImageExpireConsumptionNumber int `gorm:"column:task_monthly_limit_image_expired_consumption_number;not null;comment:任务当月限制类型图片会过期已使用额度" json:"taskMonthlyLimitImageExpireConsumptionNumber"`
|
||||
TaskMonthlyBundleImageConsumptionNumber int `gorm:"column:task_monthly_bundle_image_consumption_number;not null;comment:任务当月套餐类型总使用数" json:"taskMonthlyBundleImageConsumptionNumber"`
|
||||
TaskMonthlyIncreaseImageConsumptionNumber int `gorm:"column:task_monthly_increase_image_consumption_number;not null;comment:任务当月增值类型总使用数" json:"taskMonthlyIncreaseImageConsumptionNumber"`
|
||||
TaskMonthlyLimitImageQuotaNumber int `gorm:"column:task_monthly_limit_image_quota_number;not null;comment:任务当月限制类型图片额度" json:"taskMonthlyLimitImageQuotaNumber"`
|
||||
|
||||
// ===== 任务数据分析类 =====
|
||||
TaskBundleDataAnalysisNumber int `gorm:"column:task_bundle_data_analysis_number;not null;comment:任务非限制类型套餐权益数据分析总数" json:"taskBundleDataAnalysisNumber"`
|
||||
TaskIncreaseDataAnalysisNumber int `gorm:"column:task_increase_data_analysis_number;not null;comment:任务非限制类型增值权益数据分析总数" json:"taskIncreaseDataAnalysisNumber"`
|
||||
TaskBundleLimitDataAnalysisNumber int `gorm:"column:task_bundle_limit_data_analysis_number;not null;comment:任务套餐权益限制类型非过期总数" json:"taskBundleLimitDataAnalysisNumber"`
|
||||
TaskIncreaseLimitDataAnalysisNumber int `gorm:"column:task_increase_limit_data_analysis_number;not null;comment:任务增值权益限制类型非过期总数" json:"taskIncreaseLimitDataAnalysisNumber"`
|
||||
TaskBundleLimitDataAnalysisExpiredNumber int `gorm:"column:task_bundle_limit_data_analysis_expired_number;not null;comment:任务套餐权益限制类型会过期总数" json:"taskBundleLimitDataAnalysisExpiredNumber"`
|
||||
TaskIncreaseLimitDataAnalysisExpiredNumber int `gorm:"column:task_increase_limit_data_analysis_expired_number;not null;comment:任务增值权益限制类型会过期总数" json:"taskIncreaseLimitDataAnalysisExpiredNumber"`
|
||||
TaskMonthlyInvalidBundleDataAnalysisNumber int `gorm:"column:task_monthly_invalid_bundle_data_analysis_number;not null;comment:任务当月失效的套餐权益数据分析总数" json:"taskMonthlyInvalidBundleDataAnalysisNumber"`
|
||||
TaskInvalidBundleDataAnalysisNumber int `gorm:"column:task_invalid_bundle_data_analysis_number;not null;comment:任务历史失效的套餐权益数据分析总数" json:"taskInvalidBundleDataAnalysisNumber"`
|
||||
TaskMonthlyInvalidIncreaseDataAnalysisNumber int `gorm:"column:task_monthly_invalid_increase_data_analysis_number;not null;comment:任务当月失效的增值权益数据分析总数" json:"taskMonthlyInvalidIncreaseDataAnalysisNumber"`
|
||||
TaskInvalidIncreaseDataAnalysisNumber int `gorm:"column:task_invalid_increase_data_analysis_number;not null;comment:任务历史失效的增值权益数据分析总数" json:"taskInvalidIncreaseDataAnalysisNumber"`
|
||||
TaskBundleDataAnalysisConsumptionNumber int `gorm:"column:task_bundle_data_analysis_consumption_number;not null;comment:任务非限制类型套餐权益数据分析使用数" json:"taskBundleDataAnalysisConsumptionNumber"`
|
||||
TaskIncreaseDataAnalysisConsumptionNumber int `gorm:"column:task_increase_data_analysis_consumption_number;not null;comment:任务非限制类型增值权益数据分析使用数" json:"taskIncreaseDataAnalysisConsumptionNumber"`
|
||||
TaskBundleLimitDataAnalysisConsumptionNumber int `gorm:"column:task_bundle_limit_data_analysis_consumption_number;not null;comment:任务套餐权益限制类型非过期使用数" json:"taskBundleLimitDataAnalysisConsumptionNumber"`
|
||||
TaskIncreaseLimitDataAnalysisConsumptionNumber int `gorm:"column:task_increase_limit_data_analysis_consumption_number;not null;comment:任务增值权益限制类型非过期使用数" json:"taskIncreaseLimitDataAnalysisConsumptionNumber"`
|
||||
TaskBundleLimitDataAnalysisExpiredConsumptionNumber int `gorm:"column:task_bundle_limit_data_analysis_expired_consumption_number;not null;comment:任务套餐权益限制类型会过期使用数" json:"taskBundleLimitDataAnalysisExpiredConsumptionNumber"`
|
||||
TaskIncreaseLimitDataAnalysisExpiredConsumptionNumber int `gorm:"column:task_increase_limit_data_analysis_expired_consumption_number;not null;comment:任务增值权益限制类型会过期使用数" json:"taskIncreaseLimitDataAnalysisExpiredConsumptionNumber"`
|
||||
TaskMonthlyLimitDataAnalysisNumber int `gorm:"column:task_monthly_limit_data_analysis_number;not null;comment:任务当月限制类型数据分析可使用额度" json:"taskMonthlyLimitDataAnalysisNumber"`
|
||||
TaskMonthlyLimitDataAnalysisConsumptionNumber int `gorm:"column:task_monthly_limit_data_analysis_consumption_number;not null;comment:任务当月限制类型数据分析已使用额度" json:"taskMonthlyLimitDataAnalysisConsumptionNumber"`
|
||||
TaskMonthlyLimitDataAnalysisExpireNumber int `gorm:"column:task_monthly_limit_data_analysis_expired_number;not null;comment:任务当月限制类型数据分析会过期可用数" json:"taskMonthlyLimitDataAnalysisExpireNumber"`
|
||||
TaskMonthlyLimitDataAnalysisExpireConsumptionNumber int `gorm:"column:task_monthly_limit_data_analysis_expired_consumption_number;not null;comment:任务当月限制类型数据分析会过期已使用额度" json:"taskMonthlyLimitDataAnalysisExpireConsumptionNumber"`
|
||||
TaskMonthlyBundleDataAnalysisConsumptionNumber int `gorm:"column:task_monthly_bundle_data_analysis_consumption_number;not null;comment:任务当月套餐类型总使用数" json:"taskMonthlyBundleDataAnalysisConsumptionNumber"`
|
||||
TaskMonthlyIncreaseDataAnalysisConsumptionNumber int `gorm:"column:task_monthly_increase_data_analysis_consumption_number;not null;comment:任务当月增值类型总使用数" json:"taskMonthlyIncreaseDataAnalysisConsumptionNumber"`
|
||||
TaskMonthlyLimitDataAnalysisQuotaNumber int `gorm:"column:task_monthly_limit_data_analysis_quota_number;not null;comment:任务当月限制类型数据分析额度" json:"taskMonthlyLimitDataAnalysisQuotaNumber"`
|
||||
|
||||
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间" json:"createdAt"`
|
||||
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间" json:"updatedAt"`
|
||||
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_task_balance_deleted_at" json:"deletedAt"`
|
||||
}
|
||||
|
||||
func (t *TaskBalance) TableName() string {
|
||||
return "task_balance"
|
||||
}
|
||||
|
||||
// 任务日志表
|
||||
type TaskLog struct {
|
||||
LogUUID string `gorm:"column:log_uuid;type:varchar(50);comment:任务日志UUID;uniqueIndex:idx_task_log_uuid;not null" json:"taskLogUUID"`
|
||||
SubNum string `gorm:"column:sub_num;comment:任务用户编号;index:idx_task_log_sub_num;not null" json:"taskSubNum"`
|
||||
TelNum string `gorm:"column:tel_num;comment:任务用户手机号;index:idx_task_log_tel_num;not null" json:"taskTelNum"`
|
||||
ArtistName string `gorm:"column:artist_name;comment:任务艺人名称;index:idx_task_log_artist_name" json:"taskArtistName"`
|
||||
|
||||
// ===== 操作信息 =====
|
||||
OperationType int `gorm:"column:operation_type;type:int(11);comment:任务操作类型 1:加任务 2:消耗任务 3:完成任务;4:任务过期;index:idx_task_operation_type;not null" json:"taskOperationType"`
|
||||
TaskType int `gorm:"column:task_type;type:int(11);comment:任务类型 1:视频 2:图片 3:数据分析;index:idx_task_type;not null" json:"taskType"`
|
||||
TaskCount int `gorm:"column:task_count;type:int(11);comment:任务数量;not null" json:"taskCount"`
|
||||
Remark string `gorm:"column:remark;type:varchar(500);comment:任务备注" json:"taskRemark"`
|
||||
|
||||
// ===== 操作人信息 =====
|
||||
OperatorName string `gorm:"column:operator_name;comment:任务操作人姓名;index:idx_task_operator_name" json:"taskOperatorName"`
|
||||
OperatorNum string `gorm:"column:operator_num;comment:任务操作人账号;index:idx_task_operator_num" json:"taskOperatorNum"`
|
||||
CompletorName string `gorm:"column:completor_name;comment:任务完成人姓名;index:idx_task_completor_name" json:"taskCompletorName"`
|
||||
CompletorNum string `gorm:"column:completor_num;comment:任务完成人账号;index:idx_task_completor_num" json:"taskCompletorNum"`
|
||||
|
||||
// ===== 关联ID字段 =====
|
||||
VideoPublishUUID string `gorm:"column:video_publish_id;type:varchar(50);comment:任务关联的发布视频UUID;index:idx_task_video_publish_id" json:"taskVideoPublishID"`
|
||||
PostPublishUUID string `gorm:"column:post_publish_id;type:varchar(50);comment:任务关联的图文发布UUID;index:idx_task_post_publish_id" json:"taskPostPublishID"`
|
||||
DataAnalysisUUID string `gorm:"column:data_analysis_id;type:varchar(50);comment:任务关联的数据分析UUID;index:idx_task_data_analysis_id" json:"taskDataAnalysisID"`
|
||||
|
||||
// ===== 时间字段 =====
|
||||
OperationTime int `gorm:"column:operation_time;type:int(11);comment:任务操作时间;index:idx_task_operation_time;not null" json:"taskOperationTime"`
|
||||
CreatedAt int `gorm:"column:created_at;type:int(11);comment:任务日志创建时间" json:"taskCreatedAt"`
|
||||
UpdatedAt int `gorm:"column:updated_at;type:int(11);comment:任务日志更新时间" json:"taskUpdatedAt"`
|
||||
DeletedAt soft_delete.DeletedAt `gorm:"column:deleted_at;type:int(11);index:idx_task_log_deleted_at" json:"taskDeletedAt"`
|
||||
}
|
||||
|
||||
func (t *TaskLog) TableName() string {
|
||||
return "task_log"
|
||||
}
|
189
pb/bundle.proto
189
pb/bundle.proto
@ -78,6 +78,17 @@ service Bundle {
|
||||
// 查出没处理的数据
|
||||
rpc ListUnfinishedInfos(AutoCreateUserAndOrderRequest) returns (UnfinishedInfos) {} // 查出没处理的数据
|
||||
rpc SoftDeleteUnfinishedInfo(SoftDeleteUnfinishedInfoRequest) returns (CommonResponse) {} // 软删除
|
||||
|
||||
// 任务台
|
||||
rpc GetPendingTaskList(TaskQueryRequest) returns (TaskQueryResponse) {} // 查询待指派任务记录
|
||||
rpc AssignTask(TaskAssignRequest) returns (CommonResponse) {} // 指派某位员工完成某个艺人的任务
|
||||
rpc UpdatePendingCount(UpdatePendingCountRequest) returns (CommonResponse) {} // 修改待发数量
|
||||
rpc GetRecentAssignRecords(RecentAssignRecordsRequest) returns (RecentAssignRecordsResponse) {} // 查询最近被指派记录
|
||||
rpc GetEmployeeAssignedTasks(EmployeeTaskQueryRequest) returns (EmployeeTaskQueryResponse) {} // 根据登录人信息查询被指派给该员工的任务
|
||||
rpc CompleteTaskManually(CompleteTaskManuallyRequest) returns (CommonResponse) {} // 员工手动点击完成任务
|
||||
rpc UpdateTaskProgress(UpdateTaskProgressRequest) returns (CommonResponse) {} // 员工实际完成任务状态更新
|
||||
rpc GetTaskAssignRecordsList(TaskAssignRecordsQueryRequest) returns (TaskAssignRecordsQueryResponse) {} // 多条件查询操作记录表
|
||||
rpc GetArtistBundleBalance(ArtistBundleBalanceRequest) returns (ArtistBundleBalanceResponse) {} // 查询艺人套餐剩余数量
|
||||
}
|
||||
message DeleteValueAddServiceRequest{
|
||||
string orderNo = 1;
|
||||
@ -880,3 +891,181 @@ message UnfinishedInfo {
|
||||
message SoftDeleteUnfinishedInfoRequest {
|
||||
uint32 ID = 1;
|
||||
}
|
||||
|
||||
|
||||
// 任务管理台相关消息定义
|
||||
|
||||
// 查询待指派任务记录
|
||||
message TaskQueryRequest {
|
||||
string keyword = 1 [json_name = "keyword"]; // 艺人姓名、编号、手机号搜索关键词
|
||||
int32 page = 2 [json_name = "page"]; // 页码
|
||||
int32 pageSize = 3 [json_name = "pageSize"]; // 每页数量
|
||||
string sortBy = 4 [json_name = "sortBy"]; // 排序字段
|
||||
string sortType = 5 [json_name = "sortType"]; // 排序类型 asc/desc
|
||||
}
|
||||
|
||||
message TaskQueryResponse {
|
||||
repeated TaskManagementInfo tasks = 1 [json_name = "tasks"];
|
||||
int64 total = 2 [json_name = "total"];
|
||||
int32 page = 3 [json_name = "page"];
|
||||
int32 pageSize = 4 [json_name = "pageSize"];
|
||||
}
|
||||
|
||||
message TaskManagementInfo {
|
||||
string subNum = 1 [json_name = "subNum"]; // 艺人编号
|
||||
string telNum = 2 [json_name = "telNum"]; // 手机号
|
||||
string artistName = 3 [json_name = "artistName"]; // 艺人姓名
|
||||
int32 pendingVideoCount = 4 [json_name = "pendingVideoCount"]; // 待发视频数量
|
||||
int32 pendingPostCount = 5 [json_name = "pendingPostCount"]; // 待发图文数量
|
||||
int32 pendingDataCount = 6 [json_name = "pendingDataCount"]; // 待发数据数量
|
||||
int32 progressTaskCount = 7 [json_name = "progressTaskCount"]; // 进行中任务数量
|
||||
int32 completeTaskCount = 8 [json_name = "completeTaskCount"]; // 已完成任务数量
|
||||
string lastTaskAssignee = 9 [json_name = "lastTaskAssignee"]; // 最后一次任务指派人
|
||||
string taskAssigneeNum = 10 [json_name = "taskAssigneeNum"]; // 任务指派人账号
|
||||
}
|
||||
|
||||
// 指派任务
|
||||
message TaskAssignRequest {
|
||||
string subNum = 1 [json_name = "subNum"]; // 艺人编号
|
||||
string telNum = 2 [json_name = "telNum"]; // 艺人手机号
|
||||
string artistName = 3 [json_name = "artistName"]; // 艺人姓名
|
||||
string taskAssignee = 4 [json_name = "taskAssignee"]; // 任务指派人
|
||||
string taskAssigneeNum = 5 [json_name = "taskAssigneeNum"]; // 任务指派人账号
|
||||
string operator = 6 [json_name = "operator"]; // 操作人
|
||||
string operatorNum = 7 [json_name = "operatorNum"]; // 操作人账号
|
||||
int32 assignVideoCount = 8 [json_name = "assignVideoCount"]; // 指派视频数
|
||||
int32 assignPostCount = 9 [json_name = "assignPostCount"]; // 指派图文数
|
||||
int32 assignDataCount = 10 [json_name = "assignDataCount"]; // 指派数据数
|
||||
}
|
||||
|
||||
// 修改待发数量
|
||||
message UpdatePendingCountRequest {
|
||||
string subNum = 1 [json_name = "subNum"]; // 艺人编号
|
||||
string telNum = 2 [json_name = "telNum"]; // 艺人手机号
|
||||
string artistName = 3 [json_name = "artistName"]; // 艺人姓名
|
||||
int32 pendingVideoCount = 4 [json_name = "pendingVideoCount"]; // 待发视频数量
|
||||
int32 pendingPostCount = 5 [json_name = "pendingPostCount"]; // 待发图文数量
|
||||
int32 pendingDataCount = 6 [json_name = "pendingDataCount"]; // 待发数据数量
|
||||
string operator = 7 [json_name = "operator"]; // 操作人
|
||||
string operatorNum = 8 [json_name = "operatorNum"]; // 操作人账号
|
||||
}
|
||||
|
||||
// 查询最近被指派记录
|
||||
message RecentAssignRecordsRequest {
|
||||
int32 limit = 1 [json_name = "limit"]; // 查询数量限制
|
||||
}
|
||||
|
||||
message RecentAssignRecordsResponse {
|
||||
repeated string operatorList = 1 [json_name = "operatorList"];
|
||||
}
|
||||
|
||||
// 员工任务查询
|
||||
message EmployeeTaskQueryRequest {
|
||||
string taskAssigneeNum = 1 [json_name = "taskAssigneeNum"]; // 被指派人账号
|
||||
string keyword = 2 [json_name = "keyword"]; // 艺人姓名、编号、手机号搜索关键词
|
||||
string operator = 3 [json_name = "operator"]; // 操作人
|
||||
string sortBy = 4 [json_name = "sortBy"]; // 排序字段
|
||||
string startTime = 5 [json_name = "startTime"]; // 指派开始时间
|
||||
string endTime = 6 [json_name = "endTime"]; // 指派结束时间
|
||||
string startCompleteTime = 7 [json_name = "startCompleteTime"]; // 开始完成时间
|
||||
string endCompleteTime = 8 [json_name = "endCompleteTime"]; // 结束完成时间
|
||||
int32 status = 9 [json_name = "status"]; // 反馈完成状态
|
||||
int32 page = 10 [json_name = "page"]; // 页码
|
||||
int32 pageSize = 11 [json_name = "pageSize"]; // 每页数量
|
||||
}
|
||||
|
||||
message EmployeeTaskQueryResponse {
|
||||
repeated TaskAssignRecordInfo records = 1 [json_name = "records"];
|
||||
int64 total = 2 [json_name = "total"];
|
||||
int32 page = 3 [json_name = "page"];
|
||||
int32 pageSize = 4 [json_name = "pageSize"];
|
||||
}
|
||||
|
||||
// 任务指派记录信息
|
||||
message TaskAssignRecordInfo {
|
||||
string assignRecordsUUID = 1 [json_name = "assignRecordsUUID"]; // 指派记录UUID
|
||||
string subNum = 2 [json_name = "subNum"]; // 艺人编号
|
||||
string telNum = 3 [json_name = "telNum"]; // 艺人手机号
|
||||
string artistName = 4 [json_name = "artistName"]; // 艺人姓名
|
||||
int32 status = 5 [json_name = "status"]; // 反馈完成状态
|
||||
int32 actualStatus = 6 [json_name = "actualStatus"]; // 实际完成状态
|
||||
string completeTime = 7 [json_name = "completeTime"]; // 反馈完成时间
|
||||
int32 operatorType = 8 [json_name = "operatorType"]; // 操作类型
|
||||
string operator = 9 [json_name = "operator"]; // 操作人
|
||||
string operatorNum = 10 [json_name = "operatorNum"]; // 操作人账号
|
||||
string operatorTime = 11 [json_name = "operatorTime"]; // 操作时间
|
||||
string taskAssignee = 12 [json_name = "taskAssignee"]; // 任务指派人
|
||||
string taskAssigneeNum = 13 [json_name = "taskAssigneeNum"]; // 任务指派人账号
|
||||
int32 pendingVideoCount = 14 [json_name = "pendingVideoCount"]; // 待发视频数量
|
||||
int32 pendingPostCount = 15 [json_name = "pendingPostCount"]; // 待发图文数量
|
||||
int32 pendingDataCount = 16 [json_name = "pendingDataCount"]; // 待发数据数量
|
||||
string updatedAt = 17 [json_name = "updatedAt"]; // 更新时间
|
||||
}
|
||||
|
||||
// 手动完成任务
|
||||
message CompleteTaskManuallyRequest {
|
||||
string assignRecordsUUID = 1 [json_name = "assignRecordsUUID"]; // 指派记录UUID
|
||||
string taskAssigneeNum = 2 [json_name = "taskAssigneeNum"]; // 被指派完成该任务人的账号
|
||||
}
|
||||
|
||||
// 更新任务进度
|
||||
message UpdateTaskProgressRequest {
|
||||
string assignRecordsUUID = 1 [json_name = "assignRecordsUUID"]; // 指派记录UUID(可选)
|
||||
string employeeName = 2 [json_name = "employeeName"]; // 员工姓名(必要)
|
||||
string employeeNum = 3 [json_name = "employeeNum"]; // 员工工号(必要)
|
||||
string taskType = 4 [json_name = "taskType"]; // 任务类型: video/post/data
|
||||
int32 completeCount = 5 [json_name = "completeCount"]; // 完成数量
|
||||
}
|
||||
|
||||
// 多条件查询操作记录表
|
||||
message TaskAssignRecordsQueryRequest {
|
||||
string keyword = 1 [json_name = "keyword"]; // 艺人姓名、编号、手机号搜索关键词
|
||||
string taskAssignee = 2 [json_name = "taskAssignee"]; // 指派人姓名
|
||||
string operator = 3 [json_name = "operator"]; // 操作人姓名
|
||||
string operatorNum = 4 [json_name = "operatorNum"]; // 操作人手机号
|
||||
string startTime = 5 [json_name = "startTime"]; // 操作开始时间
|
||||
string endTime = 6 [json_name = "endTime"]; // 操作结束时间
|
||||
int32 status = 7 [json_name = "status"]; // 反馈完成状态
|
||||
int32 actualStatus = 8 [json_name = "actualStatus"]; // 实际完成状态
|
||||
int32 page = 9 [json_name = "page"]; // 页码
|
||||
int32 pageSize = 10 [json_name = "pageSize"]; // 每页数量
|
||||
}
|
||||
|
||||
message TaskAssignRecordsQueryResponse {
|
||||
repeated TaskAssignRecordInfo records = 1 [json_name = "records"];
|
||||
int64 total = 2 [json_name = "total"];
|
||||
int32 page = 3 [json_name = "page"];
|
||||
int32 pageSize = 4 [json_name = "pageSize"];
|
||||
}
|
||||
|
||||
// 查询艺人套餐剩余数量请求
|
||||
message ArtistBundleBalanceRequest {
|
||||
string customerNum = 1 [json_name = "customerNum"]; // 艺人编号(推荐使用)
|
||||
string telNum = 2 [json_name = "telNum"]; // 艺人手机号(备选)
|
||||
}
|
||||
|
||||
// 艺人套餐剩余数量响应
|
||||
message ArtistBundleBalanceResponse {
|
||||
// 以下返回值同时包含“套餐类型”和“增值类型”两类的任务余额与待发数量
|
||||
// 余额来自任务余额表(task_balance),待发数量来自任务管理表(task_management),均按视频/图文/数据分析三类区分
|
||||
|
||||
// 套餐类型 - 任务余额(视频/图文/数据分析)
|
||||
int32 bundleVideoBalance = 1 [json_name = "bundleVideoBalance"]; // 套餐类型视频余额
|
||||
int32 bundleImageBalance = 2 [json_name = "bundleImageBalance"]; // 套餐类型图文余额
|
||||
int32 bundleDataAnalysisBalance = 3 [json_name = "bundleDataAnalysisBalance"]; // 套餐类型数据分析余额
|
||||
|
||||
// 增值类型 - 任务余额(视频/图文/数据分析)
|
||||
int32 increaseVideoBalance = 4 [json_name = "increaseVideoBalance"]; // 增值类型视频余额
|
||||
int32 increaseImageBalance = 5 [json_name = "increaseImageBalance"]; // 增值类型图文余额
|
||||
int32 increaseDataAnalysisBalance = 6 [json_name = "increaseDataAnalysisBalance"]; // 增值类型数据分析余额
|
||||
|
||||
// 套餐类型 - 待发数量(视频/图文/数据分析)
|
||||
int32 bundlePendingVideoCount = 7 [json_name = "bundlePendingVideoCount"]; // 套餐类型待发视频数量
|
||||
int32 bundlePendingImageCount = 8 [json_name = "bundlePendingImageCount"]; // 套餐类型待发图文数量
|
||||
int32 bundlePendingDataAnalysisCount = 9 [json_name = "bundlePendingDataAnalysisCount"]; // 套餐类型待发数据分析数量
|
||||
|
||||
// 增值类型 - 待发数量(视频/图文/数据分析)
|
||||
int32 increasePendingVideoCount = 10 [json_name = "increasePendingVideoCount"]; // 增值类型待发视频数量
|
||||
int32 increasePendingImageCount = 11 [json_name = "increasePendingImageCount"]; // 增值类型待发图文数量
|
||||
int32 increasePendingDataAnalysisCount = 12 [json_name = "increasePendingDataAnalysisCount"]; // 增值类型待发数据分析数量
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -466,3 +466,72 @@ func (this *UnfinishedInfo) Validate() error {
|
||||
func (this *SoftDeleteUnfinishedInfoRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *TaskQueryRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *TaskQueryResponse) Validate() error {
|
||||
for _, item := range this.Tasks {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Tasks", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *TaskManagementInfo) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *TaskAssignRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *UpdatePendingCountRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *RecentAssignRecordsRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *RecentAssignRecordsResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *EmployeeTaskQueryRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *EmployeeTaskQueryResponse) Validate() error {
|
||||
for _, item := range this.Records {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Records", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *TaskAssignRecordInfo) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *CompleteTaskManuallyRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *UpdateTaskProgressRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *TaskAssignRecordsQueryRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *TaskAssignRecordsQueryResponse) Validate() error {
|
||||
for _, item := range this.Records {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Records", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistBundleBalanceRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistBundleBalanceResponse) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-triple. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-triple v1.0.8
|
||||
// - protoc v3.12.4
|
||||
// - protoc v3.21.1
|
||||
// source: pb/bundle.proto
|
||||
|
||||
package bundle
|
||||
@ -83,6 +83,16 @@ type BundleClient interface {
|
||||
// 查出没处理的数据
|
||||
ListUnfinishedInfos(ctx context.Context, in *AutoCreateUserAndOrderRequest, opts ...grpc_go.CallOption) (*UnfinishedInfos, common.ErrorWithAttachment)
|
||||
SoftDeleteUnfinishedInfo(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||
// 任务台
|
||||
GetPendingTaskList(ctx context.Context, in *TaskQueryRequest, opts ...grpc_go.CallOption) (*TaskQueryResponse, common.ErrorWithAttachment)
|
||||
AssignTask(ctx context.Context, in *TaskAssignRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||
UpdatePendingCount(ctx context.Context, in *UpdatePendingCountRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||
GetRecentAssignRecords(ctx context.Context, in *RecentAssignRecordsRequest, opts ...grpc_go.CallOption) (*RecentAssignRecordsResponse, common.ErrorWithAttachment)
|
||||
GetEmployeeAssignedTasks(ctx context.Context, in *EmployeeTaskQueryRequest, opts ...grpc_go.CallOption) (*EmployeeTaskQueryResponse, common.ErrorWithAttachment)
|
||||
CompleteTaskManually(ctx context.Context, in *CompleteTaskManuallyRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||
UpdateTaskProgress(ctx context.Context, in *UpdateTaskProgressRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment)
|
||||
GetTaskAssignRecordsList(ctx context.Context, in *TaskAssignRecordsQueryRequest, opts ...grpc_go.CallOption) (*TaskAssignRecordsQueryResponse, common.ErrorWithAttachment)
|
||||
GetArtistBundleBalance(ctx context.Context, in *ArtistBundleBalanceRequest, opts ...grpc_go.CallOption) (*ArtistBundleBalanceResponse, common.ErrorWithAttachment)
|
||||
}
|
||||
|
||||
type bundleClient struct {
|
||||
@ -139,6 +149,15 @@ type BundleClientImpl struct {
|
||||
UpdateReconciliationStatusBySerialNumber func(ctx context.Context, in *UpdateStatusAndPayTimeBySerialNumber) (*CommonResponse, error)
|
||||
ListUnfinishedInfos func(ctx context.Context, in *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error)
|
||||
SoftDeleteUnfinishedInfo func(ctx context.Context, in *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error)
|
||||
GetPendingTaskList func(ctx context.Context, in *TaskQueryRequest) (*TaskQueryResponse, error)
|
||||
AssignTask func(ctx context.Context, in *TaskAssignRequest) (*CommonResponse, error)
|
||||
UpdatePendingCount func(ctx context.Context, in *UpdatePendingCountRequest) (*CommonResponse, error)
|
||||
GetRecentAssignRecords func(ctx context.Context, in *RecentAssignRecordsRequest) (*RecentAssignRecordsResponse, error)
|
||||
GetEmployeeAssignedTasks func(ctx context.Context, in *EmployeeTaskQueryRequest) (*EmployeeTaskQueryResponse, error)
|
||||
CompleteTaskManually func(ctx context.Context, in *CompleteTaskManuallyRequest) (*CommonResponse, error)
|
||||
UpdateTaskProgress func(ctx context.Context, in *UpdateTaskProgressRequest) (*CommonResponse, error)
|
||||
GetTaskAssignRecordsList func(ctx context.Context, in *TaskAssignRecordsQueryRequest) (*TaskAssignRecordsQueryResponse, error)
|
||||
GetArtistBundleBalance func(ctx context.Context, in *ArtistBundleBalanceRequest) (*ArtistBundleBalanceResponse, error)
|
||||
}
|
||||
|
||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||
@ -447,6 +466,60 @@ func (c *bundleClient) SoftDeleteUnfinishedInfo(ctx context.Context, in *SoftDel
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SoftDeleteUnfinishedInfo", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetPendingTaskList(ctx context.Context, in *TaskQueryRequest, opts ...grpc_go.CallOption) (*TaskQueryResponse, common.ErrorWithAttachment) {
|
||||
out := new(TaskQueryResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPendingTaskList", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) AssignTask(ctx context.Context, in *TaskAssignRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||
out := new(CommonResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/AssignTask", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) UpdatePendingCount(ctx context.Context, in *UpdatePendingCountRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||
out := new(CommonResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdatePendingCount", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetRecentAssignRecords(ctx context.Context, in *RecentAssignRecordsRequest, opts ...grpc_go.CallOption) (*RecentAssignRecordsResponse, common.ErrorWithAttachment) {
|
||||
out := new(RecentAssignRecordsResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetRecentAssignRecords", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetEmployeeAssignedTasks(ctx context.Context, in *EmployeeTaskQueryRequest, opts ...grpc_go.CallOption) (*EmployeeTaskQueryResponse, common.ErrorWithAttachment) {
|
||||
out := new(EmployeeTaskQueryResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetEmployeeAssignedTasks", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) CompleteTaskManually(ctx context.Context, in *CompleteTaskManuallyRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||
out := new(CommonResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CompleteTaskManually", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) UpdateTaskProgress(ctx context.Context, in *UpdateTaskProgressRequest, opts ...grpc_go.CallOption) (*CommonResponse, common.ErrorWithAttachment) {
|
||||
out := new(CommonResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateTaskProgress", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetTaskAssignRecordsList(ctx context.Context, in *TaskAssignRecordsQueryRequest, opts ...grpc_go.CallOption) (*TaskAssignRecordsQueryResponse, common.ErrorWithAttachment) {
|
||||
out := new(TaskAssignRecordsQueryResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetTaskAssignRecordsList", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetArtistBundleBalance(ctx context.Context, in *ArtistBundleBalanceRequest, opts ...grpc_go.CallOption) (*ArtistBundleBalanceResponse, common.ErrorWithAttachment) {
|
||||
out := new(ArtistBundleBalanceResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetArtistBundleBalance", in, out)
|
||||
}
|
||||
|
||||
// BundleServer is the server API for Bundle service.
|
||||
// All implementations must embed UnimplementedBundleServer
|
||||
// for forward compatibility
|
||||
@ -506,6 +579,16 @@ type BundleServer interface {
|
||||
// 查出没处理的数据
|
||||
ListUnfinishedInfos(context.Context, *AutoCreateUserAndOrderRequest) (*UnfinishedInfos, error)
|
||||
SoftDeleteUnfinishedInfo(context.Context, *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error)
|
||||
// 任务台
|
||||
GetPendingTaskList(context.Context, *TaskQueryRequest) (*TaskQueryResponse, error)
|
||||
AssignTask(context.Context, *TaskAssignRequest) (*CommonResponse, error)
|
||||
UpdatePendingCount(context.Context, *UpdatePendingCountRequest) (*CommonResponse, error)
|
||||
GetRecentAssignRecords(context.Context, *RecentAssignRecordsRequest) (*RecentAssignRecordsResponse, error)
|
||||
GetEmployeeAssignedTasks(context.Context, *EmployeeTaskQueryRequest) (*EmployeeTaskQueryResponse, error)
|
||||
CompleteTaskManually(context.Context, *CompleteTaskManuallyRequest) (*CommonResponse, error)
|
||||
UpdateTaskProgress(context.Context, *UpdateTaskProgressRequest) (*CommonResponse, error)
|
||||
GetTaskAssignRecordsList(context.Context, *TaskAssignRecordsQueryRequest) (*TaskAssignRecordsQueryResponse, error)
|
||||
GetArtistBundleBalance(context.Context, *ArtistBundleBalanceRequest) (*ArtistBundleBalanceResponse, error)
|
||||
mustEmbedUnimplementedBundleServer()
|
||||
}
|
||||
|
||||
@ -661,6 +744,33 @@ func (UnimplementedBundleServer) ListUnfinishedInfos(context.Context, *AutoCreat
|
||||
func (UnimplementedBundleServer) SoftDeleteUnfinishedInfo(context.Context, *SoftDeleteUnfinishedInfoRequest) (*CommonResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SoftDeleteUnfinishedInfo not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetPendingTaskList(context.Context, *TaskQueryRequest) (*TaskQueryResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPendingTaskList not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) AssignTask(context.Context, *TaskAssignRequest) (*CommonResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method AssignTask not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) UpdatePendingCount(context.Context, *UpdatePendingCountRequest) (*CommonResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdatePendingCount not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetRecentAssignRecords(context.Context, *RecentAssignRecordsRequest) (*RecentAssignRecordsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRecentAssignRecords not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetEmployeeAssignedTasks(context.Context, *EmployeeTaskQueryRequest) (*EmployeeTaskQueryResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetEmployeeAssignedTasks not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) CompleteTaskManually(context.Context, *CompleteTaskManuallyRequest) (*CommonResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CompleteTaskManually not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) UpdateTaskProgress(context.Context, *UpdateTaskProgressRequest) (*CommonResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateTaskProgress not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetTaskAssignRecordsList(context.Context, *TaskAssignRecordsQueryRequest) (*TaskAssignRecordsQueryResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetTaskAssignRecordsList not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetArtistBundleBalance(context.Context, *ArtistBundleBalanceRequest) (*ArtistBundleBalanceResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetArtistBundleBalance not implemented")
|
||||
}
|
||||
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
}
|
||||
@ -2110,6 +2220,267 @@ func _Bundle_SoftDeleteUnfinishedInfo_Handler(srv interface{}, ctx context.Conte
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_GetPendingTaskList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TaskQueryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetPendingTaskList", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_AssignTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TaskAssignRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("AssignTask", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_UpdatePendingCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdatePendingCountRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("UpdatePendingCount", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_GetRecentAssignRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecentAssignRecordsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetRecentAssignRecords", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_GetEmployeeAssignedTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(EmployeeTaskQueryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetEmployeeAssignedTasks", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_CompleteTaskManually_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CompleteTaskManuallyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("CompleteTaskManually", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_UpdateTaskProgress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateTaskProgressRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("UpdateTaskProgress", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_GetTaskAssignRecordsList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TaskAssignRecordsQueryRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetTaskAssignRecordsList", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_GetArtistBundleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ArtistBundleBalanceRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
base := srv.(dubbo3.Dubbo3GrpcService)
|
||||
args := []interface{}{}
|
||||
args = append(args, in)
|
||||
md, _ := metadata.FromIncomingContext(ctx)
|
||||
invAttachment := make(map[string]interface{}, len(md))
|
||||
for k, v := range md {
|
||||
invAttachment[k] = v
|
||||
}
|
||||
invo := invocation.NewRPCInvocation("GetArtistBundleBalance", args, invAttachment)
|
||||
if interceptor == nil {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
info := &grpc_go.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: ctx.Value("XXX_TRIPLE_GO_INTERFACE_NAME").(string),
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
result := base.XXX_GetProxyImpl().Invoke(ctx, invo)
|
||||
return result, result.Error()
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Bundle_ServiceDesc is the grpc_go.ServiceDesc for Bundle service.
|
||||
// It's only intended for direct use with grpc_go.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -2313,6 +2684,42 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "SoftDeleteUnfinishedInfo",
|
||||
Handler: _Bundle_SoftDeleteUnfinishedInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPendingTaskList",
|
||||
Handler: _Bundle_GetPendingTaskList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "AssignTask",
|
||||
Handler: _Bundle_AssignTask_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdatePendingCount",
|
||||
Handler: _Bundle_UpdatePendingCount_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRecentAssignRecords",
|
||||
Handler: _Bundle_GetRecentAssignRecords_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetEmployeeAssignedTasks",
|
||||
Handler: _Bundle_GetEmployeeAssignedTasks_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CompleteTaskManually",
|
||||
Handler: _Bundle_CompleteTaskManually_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateTaskProgress",
|
||||
Handler: _Bundle_UpdateTaskProgress_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetTaskAssignRecordsList",
|
||||
Handler: _Bundle_GetTaskAssignRecordsList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetArtistBundleBalance",
|
||||
Handler: _Bundle_GetArtistBundleBalance_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "pb/bundle.proto",
|
||||
|
@ -3,7 +3,7 @@ package app
|
||||
import (
|
||||
"github.com/bwmarrin/snowflake"
|
||||
"go.uber.org/zap"
|
||||
"gorm.io/gorm"
|
||||
"micro-bundle/pkg/db"
|
||||
"micro-bundle/pkg/tracing"
|
||||
)
|
||||
|
||||
@ -13,6 +13,7 @@ type App struct {
|
||||
Lg *zap.Logger
|
||||
//RedisClient *redis.Client
|
||||
JaegerTracer *tracing.JaegerProvider
|
||||
BundleDB *gorm.DB
|
||||
SfNode *snowflake.Node
|
||||
BundleDB *db.BundleDB
|
||||
TaskBenchDB *db.TaskBenchDB
|
||||
}
|
||||
|
@ -8,12 +8,17 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// 定义一个新的类型来区分BundleDB
|
||||
type BundleDB struct {
|
||||
*gorm.DB
|
||||
}
|
||||
|
||||
var Provider = wire.NewSet(NewBundleDB)
|
||||
|
||||
func NewBundleDB() *gorm.DB {
|
||||
func NewBundleDB() *BundleDB {
|
||||
connBundleDB := strings.Join([]string{bundleConfig.Data.BundleDB.User, ":", bundleConfig.Data.BundleDB.Password,
|
||||
"@tcp(", bundleConfig.Data.BundleDB.Host, ":", bundleConfig.Data.BundleDB.Port, ")/",
|
||||
bundleConfig.Data.BundleDB.DbName, "?charset=utf8mb4&parseTime=true&loc=Local"}, "")
|
||||
DciDB := loadMysqlConn(connBundleDB)
|
||||
return DciDB
|
||||
db := loadMysqlConn(connBundleDB)
|
||||
return &BundleDB{DB: db}
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
@ -36,10 +38,13 @@ func loadMysqlConn(conn string) *gorm.DB {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Println("[BundleDB] 数据库连接成功, 连接字符串: %s", conn)
|
||||
sqlDB, _ := db.DB()
|
||||
sqlDB.SetMaxIdleConns(20) //设置连接池,空闲
|
||||
sqlDB.SetMaxOpenConns(100) //打开
|
||||
sqlDB.SetConnMaxLifetime(time.Second * 30)
|
||||
|
||||
// Bundle数据库的自动迁移
|
||||
err = db.AutoMigrate(
|
||||
&model.BundleProfile{},
|
||||
&model.BundleOrderRecords{},
|
||||
@ -58,15 +63,62 @@ func loadMysqlConn(conn string) *gorm.DB {
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
return nil
|
||||
// return nil
|
||||
panic(err)
|
||||
}
|
||||
return db
|
||||
}
|
||||
|
||||
// TaskBench数据库的自动迁移函数
|
||||
func loadTaskBenchMysqlConn(conn string) *gorm.DB {
|
||||
var ormLogger logger.Interface
|
||||
if gin.Mode() == "debug" {
|
||||
ormLogger = logger.Default.LogMode(logger.Info)
|
||||
} else {
|
||||
ormLogger = logger.Default
|
||||
}
|
||||
db, err := gorm.Open(mysql.New(mysql.Config{
|
||||
DSN: conn,
|
||||
DefaultStringSize: 256,
|
||||
DisableDatetimePrecision: true,
|
||||
DontSupportRenameIndex: true,
|
||||
DontSupportRenameColumn: true,
|
||||
SkipInitializeWithVersion: false,
|
||||
}), &gorm.Config{
|
||||
Logger: ormLogger,
|
||||
NamingStrategy: schema.NamingStrategy{
|
||||
SingularTable: true,
|
||||
},
|
||||
DisableForeignKeyConstraintWhenMigrating: true,
|
||||
})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
sqlDB, _ := db.DB()
|
||||
sqlDB.SetMaxIdleConns(20)
|
||||
sqlDB.SetMaxOpenConns(100)
|
||||
sqlDB.SetConnMaxLifetime(time.Second * 30)
|
||||
|
||||
// 自动迁移任务管理台相关数据库表
|
||||
err = db.AutoMigrate(
|
||||
&model.TaskManagement{},
|
||||
&model.TaskAssignRecords{},
|
||||
&model.TaskBalance{},
|
||||
&model.TaskLog{},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("[TaskBenchDB] 数据库迁移失败: %v", err)
|
||||
panic(err)
|
||||
}
|
||||
|
||||
log.Printf("[TaskBenchDB] 数据库迁移成功,已创建表: task_management, task_assign_records")
|
||||
return db
|
||||
}
|
||||
|
||||
func DBMigration() {
|
||||
}
|
||||
|
||||
func addColumn(dst interface{}, column string) {
|
||||
|
||||
return
|
||||
}
|
||||
|
24
pkg/db/taskBenchDB.go
Normal file
24
pkg/db/taskBenchDB.go
Normal file
@ -0,0 +1,24 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
bundleConfig "micro-bundle/config"
|
||||
"strings"
|
||||
|
||||
"github.com/google/wire"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// 定义一个新的类型来区分TaskBenchDB
|
||||
type TaskBenchDB struct {
|
||||
*gorm.DB
|
||||
}
|
||||
|
||||
var TaskBenchProvider = wire.NewSet(NewTaskBenchDB)
|
||||
|
||||
func NewTaskBenchDB() *TaskBenchDB {
|
||||
connTaskBenchDB := strings.Join([]string{bundleConfig.Data.TaskBenchDB.User, ":", bundleConfig.Data.TaskBenchDB.Password,
|
||||
"@tcp(", bundleConfig.Data.TaskBenchDB.Host, ":", bundleConfig.Data.TaskBenchDB.Port, ")/",
|
||||
bundleConfig.Data.TaskBenchDB.DbName, "?charset=utf8mb4&parseTime=true&loc=Local"}, "")
|
||||
db := loadTaskBenchMysqlConn(connTaskBenchDB)
|
||||
return &TaskBenchDB{DB: db}
|
||||
}
|
Loading…
Reference in New Issue
Block a user