Compare commits

...

3 Commits

Author SHA1 Message Date
daiyb
be9b8c07c0 Merge branch 'feature-publishLog-daiyb' into dev 2026-02-26 14:41:21 +08:00
daiyb
d526db4c31 发布记录 2026-02-26 14:41:14 +08:00
daiyb
1608207281 1 2026-02-26 14:04:49 +08:00
5 changed files with 1106 additions and 234 deletions

File diff suppressed because it is too large Load Diff

View File

@ -25351,6 +25351,402 @@ var _ interface {
ErrorName() string ErrorName() string
} = UpdateMediaAccInfoReqValidationError{} } = UpdateMediaAccInfoReqValidationError{}
// Validate checks the field values on PublishLogInfo with the rules defined in
// the proto definition for this message. If any rules are violated, the first
// error encountered is returned, or nil if there are no violations.
func (m *PublishLogInfo) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on PublishLogInfo with the rules defined
// in the proto definition for this message. If any rules are violated, the
// result is a list of violation errors wrapped in PublishLogInfoMultiError,
// or nil if none found.
func (m *PublishLogInfo) ValidateAll() error {
return m.validate(true)
}
func (m *PublishLogInfo) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for Uuid
// no validation rules for WorkUuid
// no validation rules for Title
// no validation rules for PlatformID
// no validation rules for PublishMediaID
// no validation rules for PublishMediaStatus
// no validation rules for PublishSource
// no validation rules for Action
// no validation rules for Detail
// no validation rules for ArtistUuid
// no validation rules for ArtistSubNum
// no validation rules for CreatedAt
// no validation rules for UpdatedAt
// no validation rules for WorkCategory
// no validation rules for ArtistName
if len(errors) > 0 {
return PublishLogInfoMultiError(errors)
}
return nil
}
// PublishLogInfoMultiError is an error wrapping multiple validation errors
// returned by PublishLogInfo.ValidateAll() if the designated constraints
// aren't met.
type PublishLogInfoMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m PublishLogInfoMultiError) Error() string {
msgs := make([]string, 0, len(m))
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m PublishLogInfoMultiError) AllErrors() []error { return m }
// PublishLogInfoValidationError is the validation error returned by
// PublishLogInfo.Validate if the designated constraints aren't met.
type PublishLogInfoValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e PublishLogInfoValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e PublishLogInfoValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e PublishLogInfoValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e PublishLogInfoValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e PublishLogInfoValidationError) ErrorName() string { return "PublishLogInfoValidationError" }
// Error satisfies the builtin error interface
func (e PublishLogInfoValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sPublishLogInfo.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = PublishLogInfoValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = PublishLogInfoValidationError{}
// Validate checks the field values on ListPublishLogReq with the rules defined
// in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations.
func (m *ListPublishLogReq) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ListPublishLogReq with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// ListPublishLogReqMultiError, or nil if none found.
func (m *ListPublishLogReq) ValidateAll() error {
return m.validate(true)
}
func (m *ListPublishLogReq) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
// no validation rules for WorkUuid
// no validation rules for ArtistUuid
// no validation rules for PlatformID
// no validation rules for PublishMediaStatus
// no validation rules for PublishSource
// no validation rules for PublishStartTime
// no validation rules for PublishEndTime
// no validation rules for Page
// no validation rules for PageSize
// no validation rules for ArtistSubNum
// no validation rules for ArtistKeyword
// no validation rules for Title
// no validation rules for WorkCategory
if len(errors) > 0 {
return ListPublishLogReqMultiError(errors)
}
return nil
}
// ListPublishLogReqMultiError is an error wrapping multiple validation errors
// returned by ListPublishLogReq.ValidateAll() if the designated constraints
// aren't met.
type ListPublishLogReqMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ListPublishLogReqMultiError) Error() string {
msgs := make([]string, 0, len(m))
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ListPublishLogReqMultiError) AllErrors() []error { return m }
// ListPublishLogReqValidationError is the validation error returned by
// ListPublishLogReq.Validate if the designated constraints aren't met.
type ListPublishLogReqValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ListPublishLogReqValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ListPublishLogReqValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ListPublishLogReqValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ListPublishLogReqValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ListPublishLogReqValidationError) ErrorName() string {
return "ListPublishLogReqValidationError"
}
// Error satisfies the builtin error interface
func (e ListPublishLogReqValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sListPublishLogReq.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListPublishLogReqValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ListPublishLogReqValidationError{}
// Validate checks the field values on ListPublishLogResp with the rules
// defined in the proto definition for this message. If any rules are
// violated, the first error encountered is returned, or nil if there are no violations.
func (m *ListPublishLogResp) Validate() error {
return m.validate(false)
}
// ValidateAll checks the field values on ListPublishLogResp with the rules
// defined in the proto definition for this message. If any rules are
// violated, the result is a list of violation errors wrapped in
// ListPublishLogRespMultiError, or nil if none found.
func (m *ListPublishLogResp) ValidateAll() error {
return m.validate(true)
}
func (m *ListPublishLogResp) validate(all bool) error {
if m == nil {
return nil
}
var errors []error
for idx, item := range m.GetData() {
_, _ = idx, item
if all {
switch v := interface{}(item).(type) {
case interface{ ValidateAll() error }:
if err := v.ValidateAll(); err != nil {
errors = append(errors, ListPublishLogRespValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
case interface{ Validate() error }:
if err := v.Validate(); err != nil {
errors = append(errors, ListPublishLogRespValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
})
}
}
} else if v, ok := interface{}(item).(interface{ Validate() error }); ok {
if err := v.Validate(); err != nil {
return ListPublishLogRespValidationError{
field: fmt.Sprintf("Data[%v]", idx),
reason: "embedded message failed validation",
cause: err,
}
}
}
}
// no validation rules for Count
if len(errors) > 0 {
return ListPublishLogRespMultiError(errors)
}
return nil
}
// ListPublishLogRespMultiError is an error wrapping multiple validation errors
// returned by ListPublishLogResp.ValidateAll() if the designated constraints
// aren't met.
type ListPublishLogRespMultiError []error
// Error returns a concatenation of all the error messages it wraps.
func (m ListPublishLogRespMultiError) Error() string {
msgs := make([]string, 0, len(m))
for _, err := range m {
msgs = append(msgs, err.Error())
}
return strings.Join(msgs, "; ")
}
// AllErrors returns a list of validation violation errors.
func (m ListPublishLogRespMultiError) AllErrors() []error { return m }
// ListPublishLogRespValidationError is the validation error returned by
// ListPublishLogResp.Validate if the designated constraints aren't met.
type ListPublishLogRespValidationError struct {
field string
reason string
cause error
key bool
}
// Field function returns field value.
func (e ListPublishLogRespValidationError) Field() string { return e.field }
// Reason function returns reason value.
func (e ListPublishLogRespValidationError) Reason() string { return e.reason }
// Cause function returns cause value.
func (e ListPublishLogRespValidationError) Cause() error { return e.cause }
// Key function returns key value.
func (e ListPublishLogRespValidationError) Key() bool { return e.key }
// ErrorName returns error name.
func (e ListPublishLogRespValidationError) ErrorName() string {
return "ListPublishLogRespValidationError"
}
// Error satisfies the builtin error interface
func (e ListPublishLogRespValidationError) Error() string {
cause := ""
if e.cause != nil {
cause = fmt.Sprintf(" | caused by: %v", e.cause)
}
key := ""
if e.key {
key = "key for "
}
return fmt.Sprintf(
"invalid %sListPublishLogResp.%s: %s%s",
key,
e.field,
e.reason,
cause)
}
var _ error = ListPublishLogRespValidationError{}
var _ interface {
Field() string
Reason() string
Key() bool
Cause() error
ErrorName() string
} = ListPublishLogRespValidationError{}
// Validate checks the field values on WorkListResp_Info with the rules defined // Validate checks the field values on WorkListResp_Info with the rules defined
// in the proto definition for this message. If any rules are violated, the // in the proto definition for this message. If any rules are violated, the
// first error encountered is returned, or nil if there are no violations. // first error encountered is returned, or nil if there are no violations.

View File

@ -136,6 +136,8 @@ type CastClient interface {
DeleteCompetitiveReport(ctx context.Context, in *DeleteCompetitiveReportReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) DeleteCompetitiveReport(ctx context.Context, in *DeleteCompetitiveReportReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
UpdateCompetitiveReportApprovalID(ctx context.Context, in *UpdateCompetitiveReportApprovalIDReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) UpdateCompetitiveReportApprovalID(ctx context.Context, in *UpdateCompetitiveReportApprovalIDReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
CountCompetitiveReportByWorkUuids(ctx context.Context, in *CountCompetitiveReportByWorkUuidsReq, opts ...grpc_go.CallOption) (*CountCompetitiveReportByWorkUuidsResp, common.ErrorWithAttachment) CountCompetitiveReportByWorkUuids(ctx context.Context, in *CountCompetitiveReportByWorkUuidsReq, opts ...grpc_go.CallOption) (*CountCompetitiveReportByWorkUuidsResp, common.ErrorWithAttachment)
// 发布记录相关接口
ListPublishLog(ctx context.Context, in *ListPublishLogReq, opts ...grpc_go.CallOption) (*ListPublishLogResp, common.ErrorWithAttachment)
} }
type castClient struct { type castClient struct {
@ -235,6 +237,7 @@ type CastClientImpl struct {
DeleteCompetitiveReport func(ctx context.Context, in *DeleteCompetitiveReportReq) (*emptypb.Empty, error) DeleteCompetitiveReport func(ctx context.Context, in *DeleteCompetitiveReportReq) (*emptypb.Empty, error)
UpdateCompetitiveReportApprovalID func(ctx context.Context, in *UpdateCompetitiveReportApprovalIDReq) (*emptypb.Empty, error) UpdateCompetitiveReportApprovalID func(ctx context.Context, in *UpdateCompetitiveReportApprovalIDReq) (*emptypb.Empty, error)
CountCompetitiveReportByWorkUuids func(ctx context.Context, in *CountCompetitiveReportByWorkUuidsReq) (*CountCompetitiveReportByWorkUuidsResp, error) CountCompetitiveReportByWorkUuids func(ctx context.Context, in *CountCompetitiveReportByWorkUuidsReq) (*CountCompetitiveReportByWorkUuidsResp, error)
ListPublishLog func(ctx context.Context, in *ListPublishLogReq) (*ListPublishLogResp, error)
} }
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient { func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
@ -801,6 +804,12 @@ func (c *castClient) CountCompetitiveReportByWorkUuids(ctx context.Context, in *
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CountCompetitiveReportByWorkUuids", in, out) return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/CountCompetitiveReportByWorkUuids", in, out)
} }
func (c *castClient) ListPublishLog(ctx context.Context, in *ListPublishLogReq, opts ...grpc_go.CallOption) (*ListPublishLogResp, common.ErrorWithAttachment) {
out := new(ListPublishLogResp)
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/ListPublishLog", in, out)
}
// CastServer is the server API for Cast service. // CastServer is the server API for Cast service.
// All implementations must embed UnimplementedCastServer // All implementations must embed UnimplementedCastServer
// for forward compatibility // for forward compatibility
@ -912,6 +921,8 @@ type CastServer interface {
DeleteCompetitiveReport(context.Context, *DeleteCompetitiveReportReq) (*emptypb.Empty, error) DeleteCompetitiveReport(context.Context, *DeleteCompetitiveReportReq) (*emptypb.Empty, error)
UpdateCompetitiveReportApprovalID(context.Context, *UpdateCompetitiveReportApprovalIDReq) (*emptypb.Empty, error) UpdateCompetitiveReportApprovalID(context.Context, *UpdateCompetitiveReportApprovalIDReq) (*emptypb.Empty, error)
CountCompetitiveReportByWorkUuids(context.Context, *CountCompetitiveReportByWorkUuidsReq) (*CountCompetitiveReportByWorkUuidsResp, error) CountCompetitiveReportByWorkUuids(context.Context, *CountCompetitiveReportByWorkUuidsReq) (*CountCompetitiveReportByWorkUuidsResp, error)
// 发布记录相关接口
ListPublishLog(context.Context, *ListPublishLogReq) (*ListPublishLogResp, error)
mustEmbedUnimplementedCastServer() mustEmbedUnimplementedCastServer()
} }
@ -1196,6 +1207,9 @@ func (UnimplementedCastServer) UpdateCompetitiveReportApprovalID(context.Context
func (UnimplementedCastServer) CountCompetitiveReportByWorkUuids(context.Context, *CountCompetitiveReportByWorkUuidsReq) (*CountCompetitiveReportByWorkUuidsResp, error) { func (UnimplementedCastServer) CountCompetitiveReportByWorkUuids(context.Context, *CountCompetitiveReportByWorkUuidsReq) (*CountCompetitiveReportByWorkUuidsResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CountCompetitiveReportByWorkUuids not implemented") return nil, status.Errorf(codes.Unimplemented, "method CountCompetitiveReportByWorkUuids not implemented")
} }
func (UnimplementedCastServer) ListPublishLog(context.Context, *ListPublishLogReq) (*ListPublishLogResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListPublishLog not implemented")
}
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) { func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
s.proxyImpl = impl s.proxyImpl = impl
} }
@ -3892,6 +3906,35 @@ func _Cast_CountCompetitiveReportByWorkUuids_Handler(srv interface{}, ctx contex
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Cast_ListPublishLog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
in := new(ListPublishLogReq)
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("ListPublishLog", 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)
}
// Cast_ServiceDesc is the grpc_go.ServiceDesc for Cast service. // Cast_ServiceDesc is the grpc_go.ServiceDesc for Cast service.
// It's only intended for direct use with grpc_go.RegisterService, // It's only intended for direct use with grpc_go.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
@ -4267,6 +4310,10 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
MethodName: "CountCompetitiveReportByWorkUuids", MethodName: "CountCompetitiveReportByWorkUuids",
Handler: _Cast_CountCompetitiveReportByWorkUuids_Handler, Handler: _Cast_CountCompetitiveReportByWorkUuids_Handler,
}, },
{
MethodName: "ListPublishLog",
Handler: _Cast_ListPublishLog_Handler,
},
}, },
Streams: []grpc_go.StreamDesc{}, Streams: []grpc_go.StreamDesc{},
Metadata: "pb/fiee/cast.proto", Metadata: "pb/fiee/cast.proto",

View File

@ -50,6 +50,7 @@ func MediaRouter(r *gin.RouterGroup) {
work.POST("import-batch", serviceCast.ImportWorkBatch) work.POST("import-batch", serviceCast.ImportWorkBatch)
work.POST("list-published", serviceCast.WorkListPublished) work.POST("list-published", serviceCast.WorkListPublished)
work.POST("update-work-script", serviceCast.UpdateWorkScript) work.POST("update-work-script", serviceCast.UpdateWorkScript)
work.POST("publish-log-list", serviceCast.PublishLogList)
} }
workNoAuth := noAuth.Group("work") workNoAuth := noAuth.Group("work")

View File

@ -0,0 +1,25 @@
package cast
import (
"context"
"fonchain-fiee/api/cast"
"fonchain-fiee/pkg/service"
"github.com/gin-gonic/gin"
)
// PublishLogList 查询发布记录列表
func PublishLogList(ctx *gin.Context) {
var req cast.ListPublishLogReq
if err := ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
resp, err := service.CastProvider.ListPublishLog(context.Background(), &req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
}