Merge branch 'feat-cjy-taskBench2' into dev
This commit is contained in:
commit
d482d7757e
File diff suppressed because it is too large
Load Diff
@ -7,8 +7,8 @@ import (
|
||||
fmt "fmt"
|
||||
math "math"
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
_ "github.com/mwitkow/go-proto-validators"
|
||||
_ "google.golang.org/protobuf/types/descriptorpb"
|
||||
_ "github.com/mwitkow/go-proto-validators"
|
||||
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
|
||||
)
|
||||
|
||||
@ -620,6 +620,22 @@ func (this *ArtistUploadStatsResponse) Validate() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *PendingUploadBreakdownRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *PendingUploadBreakdownItem) Validate() error {
|
||||
return nil
|
||||
}
|
||||
func (this *PendingUploadBreakdownResponse) Validate() error {
|
||||
for _, item := range this.Items {
|
||||
if item != nil {
|
||||
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
|
||||
return github_com_mwitkow_go_proto_validators.FieldError("Items", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func (this *ArtistBundleBalanceRequest) Validate() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -110,6 +110,7 @@ type BundleClient interface {
|
||||
MetricsVideoSubmitExport(ctx context.Context, in *MetricsVideoSubmitExportReq, opts ...grpc_go.CallOption) (*MetricsVideoSubmitExportResp, common.ErrorWithAttachment)
|
||||
GetPendingTaskLayout(ctx context.Context, in *GetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*GetPendingTaskLayoutResp, common.ErrorWithAttachment)
|
||||
SetPendingTaskLayout(ctx context.Context, in *SetPendingTaskLayoutReq, opts ...grpc_go.CallOption) (*SetPendingTaskLayoutResp, common.ErrorWithAttachment)
|
||||
GetPendingUploadBreakdown(ctx context.Context, in *PendingUploadBreakdownRequest, opts ...grpc_go.CallOption) (*PendingUploadBreakdownResponse, common.ErrorWithAttachment)
|
||||
}
|
||||
|
||||
type bundleClient struct {
|
||||
@ -192,6 +193,7 @@ type BundleClientImpl struct {
|
||||
MetricsVideoSubmitExport func(ctx context.Context, in *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||
GetPendingTaskLayout func(ctx context.Context, in *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error)
|
||||
SetPendingTaskLayout func(ctx context.Context, in *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error)
|
||||
GetPendingUploadBreakdown func(ctx context.Context, in *PendingUploadBreakdownRequest) (*PendingUploadBreakdownResponse, error)
|
||||
}
|
||||
|
||||
func (c *BundleClientImpl) GetDubboStub(cc *triple.TripleConn) BundleClient {
|
||||
@ -656,6 +658,12 @@ func (c *bundleClient) SetPendingTaskLayout(ctx context.Context, in *SetPendingT
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/SetPendingTaskLayout", in, out)
|
||||
}
|
||||
|
||||
func (c *bundleClient) GetPendingUploadBreakdown(ctx context.Context, in *PendingUploadBreakdownRequest, opts ...grpc_go.CallOption) (*PendingUploadBreakdownResponse, common.ErrorWithAttachment) {
|
||||
out := new(PendingUploadBreakdownResponse)
|
||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/GetPendingUploadBreakdown", in, out)
|
||||
}
|
||||
|
||||
// BundleServer is the server API for Bundle service.
|
||||
// All implementations must embed UnimplementedBundleServer
|
||||
// for forward compatibility
|
||||
@ -742,6 +750,7 @@ type BundleServer interface {
|
||||
MetricsVideoSubmitExport(context.Context, *MetricsVideoSubmitExportReq) (*MetricsVideoSubmitExportResp, error)
|
||||
GetPendingTaskLayout(context.Context, *GetPendingTaskLayoutReq) (*GetPendingTaskLayoutResp, error)
|
||||
SetPendingTaskLayout(context.Context, *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error)
|
||||
GetPendingUploadBreakdown(context.Context, *PendingUploadBreakdownRequest) (*PendingUploadBreakdownResponse, error)
|
||||
mustEmbedUnimplementedBundleServer()
|
||||
}
|
||||
|
||||
@ -975,6 +984,9 @@ func (UnimplementedBundleServer) GetPendingTaskLayout(context.Context, *GetPendi
|
||||
func (UnimplementedBundleServer) SetPendingTaskLayout(context.Context, *SetPendingTaskLayoutReq) (*SetPendingTaskLayoutResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetPendingTaskLayout not implemented")
|
||||
}
|
||||
func (UnimplementedBundleServer) GetPendingUploadBreakdown(context.Context, *PendingUploadBreakdownRequest) (*PendingUploadBreakdownResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetPendingUploadBreakdown not implemented")
|
||||
}
|
||||
func (s *UnimplementedBundleServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||
s.proxyImpl = impl
|
||||
}
|
||||
@ -3178,6 +3190,35 @@ func _Bundle_SetPendingTaskLayout_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bundle_GetPendingUploadBreakdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(PendingUploadBreakdownRequest)
|
||||
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("GetPendingUploadBreakdown", 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)
|
||||
@ -3485,6 +3526,10 @@ var Bundle_ServiceDesc = grpc_go.ServiceDesc{
|
||||
MethodName: "SetPendingTaskLayout",
|
||||
Handler: _Bundle_SetPendingTaskLayout_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetPendingUploadBreakdown",
|
||||
Handler: _Bundle_GetPendingUploadBreakdown_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc_go.StreamDesc{},
|
||||
Metadata: "pb/bundle.proto",
|
||||
|
||||
@ -62,6 +62,9 @@ func TaskBenchRouter(r *gin.RouterGroup) {
|
||||
// 查询艺人套餐剩余数量
|
||||
taskBenchRoute.POST("artist-bundle-balance", taskbench.GetArtistBundleBalance)
|
||||
|
||||
// 批量查询艺人待上传数量
|
||||
taskBenchRoute.POST("batch-get-pending-upload", taskbench.GetPendingUploadBreakdown)
|
||||
|
||||
// 查询艺人待上传列表
|
||||
taskBenchRoute.POST("pending-upload-list", taskbench.GetArtistUploadStatsList)
|
||||
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
package taskbench
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"fonchain-fiee/api/accountFiee"
|
||||
"fonchain-fiee/api/bundle"
|
||||
"fonchain-fiee/api/cast"
|
||||
"fonchain-fiee/cmd/config"
|
||||
modelCast "fonchain-fiee/pkg/model/cast"
|
||||
"fonchain-fiee/pkg/model/login"
|
||||
"fonchain-fiee/pkg/service"
|
||||
castService "fonchain-fiee/pkg/service/cast"
|
||||
"fonchain-fiee/pkg/utils"
|
||||
"io"
|
||||
"strconv"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"fonchain-fiee/api/accountFiee"
|
||||
"fonchain-fiee/api/bundle"
|
||||
"fonchain-fiee/api/cast"
|
||||
"fonchain-fiee/cmd/config"
|
||||
modelCast "fonchain-fiee/pkg/model/cast"
|
||||
"fonchain-fiee/pkg/model/login"
|
||||
"fonchain-fiee/pkg/service"
|
||||
castService "fonchain-fiee/pkg/service/cast"
|
||||
"fonchain-fiee/pkg/utils"
|
||||
"io"
|
||||
"strconv"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
@ -40,25 +40,25 @@ func GetPendingTaskList(c *gin.Context) {
|
||||
}
|
||||
|
||||
func GetPendingTaskLayout(c *gin.Context) {
|
||||
res, err := service.BundleProvider.GetPendingTaskLayout(context.Background(), &bundle.GetPendingTaskLayoutReq{})
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
var j any
|
||||
_ = json.Unmarshal([]byte(res.Data), &j)
|
||||
service.Success(c, j)
|
||||
res, err := service.BundleProvider.GetPendingTaskLayout(context.Background(), &bundle.GetPendingTaskLayoutReq{})
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
var j any
|
||||
_ = json.Unmarshal([]byte(res.Data), &j)
|
||||
service.Success(c, j)
|
||||
}
|
||||
|
||||
func SetPendingTaskLayout(c *gin.Context) {
|
||||
b, _ := io.ReadAll(c.Request.Body)
|
||||
var req = bundle.SetPendingTaskLayoutReq{Data: string(b)}
|
||||
res, err := service.BundleProvider.SetPendingTaskLayout(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
b, _ := io.ReadAll(c.Request.Body)
|
||||
var req = bundle.SetPendingTaskLayoutReq{Data: string(b)}
|
||||
res, err := service.BundleProvider.SetPendingTaskLayout(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
||||
// AssignTask 指派某位员工完成某个艺人的任务
|
||||
@ -507,6 +507,22 @@ func GetArtistUploadStatsList(c *gin.Context) {
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
||||
func GetPendingUploadBreakdown(c *gin.Context) {
|
||||
var req bundle.PendingUploadBreakdownRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
res, err := service.BundleProvider.GetPendingUploadBreakdown(context.Background(), &req)
|
||||
if err != nil {
|
||||
service.Error(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
service.Success(c, res)
|
||||
}
|
||||
|
||||
// GetArtistUploadStatsListDownload 导出艺人待上传列表为Excel
|
||||
func GetArtistUploadStatsListDownload(c *gin.Context) {
|
||||
var req bundle.TaskQueryRequest
|
||||
|
||||
Loading…
Reference in New Issue
Block a user