Compare commits
No commits in common. "48343889e2400bcef7dcb26c84eca0cef6de7c1a" and "d6fd80400506e54e8ada0e3fb45f762d571e7d24" have entirely different histories.
48343889e2
...
d6fd804005
1161
api/cast/cast.pb.go
1161
api/cast/cast.pb.go
File diff suppressed because it is too large
Load Diff
@ -743,92 +743,7 @@ func (m *UpdateWorkImageReq) validate(all bool) error {
|
|||||||
|
|
||||||
// no validation rules for Content
|
// no validation rules for Content
|
||||||
|
|
||||||
if all {
|
// no validation rules for ForbidComment
|
||||||
switch v := interface{}(m.GetPublishConfig1()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkImageReqValidationError{
|
|
||||||
field: "PublishConfig1",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkImageReqValidationError{
|
|
||||||
field: "PublishConfig1",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPublishConfig1()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return UpdateWorkImageReqValidationError{
|
|
||||||
field: "PublishConfig1",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetPublishConfig2()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkImageReqValidationError{
|
|
||||||
field: "PublishConfig2",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkImageReqValidationError{
|
|
||||||
field: "PublishConfig2",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPublishConfig2()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return UpdateWorkImageReqValidationError{
|
|
||||||
field: "PublishConfig2",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetPublishConfig3()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkImageReqValidationError{
|
|
||||||
field: "PublishConfig3",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkImageReqValidationError{
|
|
||||||
field: "PublishConfig3",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPublishConfig3()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return UpdateWorkImageReqValidationError{
|
|
||||||
field: "PublishConfig3",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// no validation rules for Action
|
// no validation rules for Action
|
||||||
|
|
||||||
@ -838,8 +753,6 @@ func (m *UpdateWorkImageReq) validate(all bool) error {
|
|||||||
|
|
||||||
// no validation rules for ArtistPhone
|
// no validation rules for ArtistPhone
|
||||||
|
|
||||||
// no validation rules for ArtistName
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
if len(errors) > 0 {
|
||||||
return UpdateWorkImageReqMultiError(errors)
|
return UpdateWorkImageReqMultiError(errors)
|
||||||
}
|
}
|
||||||
@ -1024,118 +937,6 @@ var _ interface {
|
|||||||
ErrorName() string
|
ErrorName() string
|
||||||
} = UpdateWorkImageRespValidationError{}
|
} = UpdateWorkImageRespValidationError{}
|
||||||
|
|
||||||
// Validate checks the field values on PublishConfig 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 *PublishConfig) Validate() error {
|
|
||||||
return m.validate(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateAll checks the field values on PublishConfig 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 PublishConfigMultiError, or
|
|
||||||
// nil if none found.
|
|
||||||
func (m *PublishConfig) ValidateAll() error {
|
|
||||||
return m.validate(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *PublishConfig) validate(all bool) error {
|
|
||||||
if m == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var errors []error
|
|
||||||
|
|
||||||
// no validation rules for ForbidComment
|
|
||||||
|
|
||||||
// no validation rules for PublicType
|
|
||||||
|
|
||||||
// no validation rules for CanJoin
|
|
||||||
|
|
||||||
// no validation rules for CanQuote
|
|
||||||
|
|
||||||
// no validation rules for CanComment
|
|
||||||
|
|
||||||
// no validation rules for IsAI
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
|
||||||
return PublishConfigMultiError(errors)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// PublishConfigMultiError is an error wrapping multiple validation errors
|
|
||||||
// returned by PublishConfig.ValidateAll() if the designated constraints
|
|
||||||
// aren't met.
|
|
||||||
type PublishConfigMultiError []error
|
|
||||||
|
|
||||||
// Error returns a concatenation of all the error messages it wraps.
|
|
||||||
func (m PublishConfigMultiError) Error() string {
|
|
||||||
var msgs []string
|
|
||||||
for _, err := range m {
|
|
||||||
msgs = append(msgs, err.Error())
|
|
||||||
}
|
|
||||||
return strings.Join(msgs, "; ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// AllErrors returns a list of validation violation errors.
|
|
||||||
func (m PublishConfigMultiError) AllErrors() []error { return m }
|
|
||||||
|
|
||||||
// PublishConfigValidationError is the validation error returned by
|
|
||||||
// PublishConfig.Validate if the designated constraints aren't met.
|
|
||||||
type PublishConfigValidationError struct {
|
|
||||||
field string
|
|
||||||
reason string
|
|
||||||
cause error
|
|
||||||
key bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field function returns field value.
|
|
||||||
func (e PublishConfigValidationError) Field() string { return e.field }
|
|
||||||
|
|
||||||
// Reason function returns reason value.
|
|
||||||
func (e PublishConfigValidationError) Reason() string { return e.reason }
|
|
||||||
|
|
||||||
// Cause function returns cause value.
|
|
||||||
func (e PublishConfigValidationError) Cause() error { return e.cause }
|
|
||||||
|
|
||||||
// Key function returns key value.
|
|
||||||
func (e PublishConfigValidationError) Key() bool { return e.key }
|
|
||||||
|
|
||||||
// ErrorName returns error name.
|
|
||||||
func (e PublishConfigValidationError) ErrorName() string { return "PublishConfigValidationError" }
|
|
||||||
|
|
||||||
// Error satisfies the builtin error interface
|
|
||||||
func (e PublishConfigValidationError) 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 %sPublishConfig.%s: %s%s",
|
|
||||||
key,
|
|
||||||
e.field,
|
|
||||||
e.reason,
|
|
||||||
cause)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ error = PublishConfigValidationError{}
|
|
||||||
|
|
||||||
var _ interface {
|
|
||||||
Field() string
|
|
||||||
Reason() string
|
|
||||||
Key() bool
|
|
||||||
Cause() error
|
|
||||||
ErrorName() string
|
|
||||||
} = PublishConfigValidationError{}
|
|
||||||
|
|
||||||
// Validate checks the field values on UpdateWorkVideoReq with the rules
|
// Validate checks the field values on UpdateWorkVideoReq with the rules
|
||||||
// defined in the proto definition for this message. If any rules are
|
// 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.
|
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||||
@ -1166,92 +967,7 @@ func (m *UpdateWorkVideoReq) validate(all bool) error {
|
|||||||
|
|
||||||
// no validation rules for CoverUrl
|
// no validation rules for CoverUrl
|
||||||
|
|
||||||
if all {
|
// no validation rules for PublicConfig
|
||||||
switch v := interface{}(m.GetPublishConfig1()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkVideoReqValidationError{
|
|
||||||
field: "PublishConfig1",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkVideoReqValidationError{
|
|
||||||
field: "PublishConfig1",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPublishConfig1()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return UpdateWorkVideoReqValidationError{
|
|
||||||
field: "PublishConfig1",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetPublishConfig2()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkVideoReqValidationError{
|
|
||||||
field: "PublishConfig2",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkVideoReqValidationError{
|
|
||||||
field: "PublishConfig2",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPublishConfig2()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return UpdateWorkVideoReqValidationError{
|
|
||||||
field: "PublishConfig2",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetPublishConfig3()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkVideoReqValidationError{
|
|
||||||
field: "PublishConfig3",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, UpdateWorkVideoReqValidationError{
|
|
||||||
field: "PublishConfig3",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPublishConfig3()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return UpdateWorkVideoReqValidationError{
|
|
||||||
field: "PublishConfig3",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// no validation rules for Action
|
// no validation rules for Action
|
||||||
|
|
||||||
@ -1261,8 +977,6 @@ func (m *UpdateWorkVideoReq) validate(all bool) error {
|
|||||||
|
|
||||||
// no validation rules for ArtistPhone
|
// no validation rules for ArtistPhone
|
||||||
|
|
||||||
// no validation rules for ArtistName
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
if len(errors) > 0 {
|
||||||
return UpdateWorkVideoReqMultiError(errors)
|
return UpdateWorkVideoReqMultiError(errors)
|
||||||
}
|
}
|
||||||
@ -1473,20 +1187,6 @@ func (m *WorkListReq) validate(all bool) error {
|
|||||||
|
|
||||||
// no validation rules for PlatformID
|
// no validation rules for PlatformID
|
||||||
|
|
||||||
// no validation rules for WorkCategory
|
|
||||||
|
|
||||||
// no validation rules for SubmitStartTime
|
|
||||||
|
|
||||||
// no validation rules for SubmitEndTime
|
|
||||||
|
|
||||||
// no validation rules for StatusUpdateTimeStart
|
|
||||||
|
|
||||||
// no validation rules for StatusUpdateTimeEnd
|
|
||||||
|
|
||||||
// no validation rules for Title
|
|
||||||
|
|
||||||
// no validation rules for WorkStatus
|
|
||||||
|
|
||||||
// no validation rules for Page
|
// no validation rules for Page
|
||||||
|
|
||||||
// no validation rules for PageSize
|
// no validation rules for PageSize
|
||||||
@ -1703,419 +1403,6 @@ var _ interface {
|
|||||||
ErrorName() string
|
ErrorName() string
|
||||||
} = WorkListRespValidationError{}
|
} = WorkListRespValidationError{}
|
||||||
|
|
||||||
// Validate checks the field values on WorkDetailReq 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 *WorkDetailReq) Validate() error {
|
|
||||||
return m.validate(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateAll checks the field values on WorkDetailReq 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 WorkDetailReqMultiError, or
|
|
||||||
// nil if none found.
|
|
||||||
func (m *WorkDetailReq) ValidateAll() error {
|
|
||||||
return m.validate(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *WorkDetailReq) validate(all bool) error {
|
|
||||||
if m == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var errors []error
|
|
||||||
|
|
||||||
// no validation rules for WorkUuid
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
|
||||||
return WorkDetailReqMultiError(errors)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// WorkDetailReqMultiError is an error wrapping multiple validation errors
|
|
||||||
// returned by WorkDetailReq.ValidateAll() if the designated constraints
|
|
||||||
// aren't met.
|
|
||||||
type WorkDetailReqMultiError []error
|
|
||||||
|
|
||||||
// Error returns a concatenation of all the error messages it wraps.
|
|
||||||
func (m WorkDetailReqMultiError) Error() string {
|
|
||||||
var msgs []string
|
|
||||||
for _, err := range m {
|
|
||||||
msgs = append(msgs, err.Error())
|
|
||||||
}
|
|
||||||
return strings.Join(msgs, "; ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// AllErrors returns a list of validation violation errors.
|
|
||||||
func (m WorkDetailReqMultiError) AllErrors() []error { return m }
|
|
||||||
|
|
||||||
// WorkDetailReqValidationError is the validation error returned by
|
|
||||||
// WorkDetailReq.Validate if the designated constraints aren't met.
|
|
||||||
type WorkDetailReqValidationError struct {
|
|
||||||
field string
|
|
||||||
reason string
|
|
||||||
cause error
|
|
||||||
key bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field function returns field value.
|
|
||||||
func (e WorkDetailReqValidationError) Field() string { return e.field }
|
|
||||||
|
|
||||||
// Reason function returns reason value.
|
|
||||||
func (e WorkDetailReqValidationError) Reason() string { return e.reason }
|
|
||||||
|
|
||||||
// Cause function returns cause value.
|
|
||||||
func (e WorkDetailReqValidationError) Cause() error { return e.cause }
|
|
||||||
|
|
||||||
// Key function returns key value.
|
|
||||||
func (e WorkDetailReqValidationError) Key() bool { return e.key }
|
|
||||||
|
|
||||||
// ErrorName returns error name.
|
|
||||||
func (e WorkDetailReqValidationError) ErrorName() string { return "WorkDetailReqValidationError" }
|
|
||||||
|
|
||||||
// Error satisfies the builtin error interface
|
|
||||||
func (e WorkDetailReqValidationError) 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 %sWorkDetailReq.%s: %s%s",
|
|
||||||
key,
|
|
||||||
e.field,
|
|
||||||
e.reason,
|
|
||||||
cause)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ error = WorkDetailReqValidationError{}
|
|
||||||
|
|
||||||
var _ interface {
|
|
||||||
Field() string
|
|
||||||
Reason() string
|
|
||||||
Key() bool
|
|
||||||
Cause() error
|
|
||||||
ErrorName() string
|
|
||||||
} = WorkDetailReqValidationError{}
|
|
||||||
|
|
||||||
// Validate checks the field values on WorkDetailResp 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 *WorkDetailResp) Validate() error {
|
|
||||||
return m.validate(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateAll checks the field values on WorkDetailResp 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 WorkDetailRespMultiError,
|
|
||||||
// or nil if none found.
|
|
||||||
func (m *WorkDetailResp) ValidateAll() error {
|
|
||||||
return m.validate(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *WorkDetailResp) validate(all bool) error {
|
|
||||||
if m == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var errors []error
|
|
||||||
|
|
||||||
// no validation rules for WorkUuid
|
|
||||||
|
|
||||||
// no validation rules for Title
|
|
||||||
|
|
||||||
// no validation rules for Content
|
|
||||||
|
|
||||||
// no validation rules for WorkStatus
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetPublishConfig1()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, WorkDetailRespValidationError{
|
|
||||||
field: "PublishConfig1",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, WorkDetailRespValidationError{
|
|
||||||
field: "PublishConfig1",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPublishConfig1()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return WorkDetailRespValidationError{
|
|
||||||
field: "PublishConfig1",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetPublishConfig2()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, WorkDetailRespValidationError{
|
|
||||||
field: "PublishConfig2",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, WorkDetailRespValidationError{
|
|
||||||
field: "PublishConfig2",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPublishConfig2()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return WorkDetailRespValidationError{
|
|
||||||
field: "PublishConfig2",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetPublishConfig3()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, WorkDetailRespValidationError{
|
|
||||||
field: "PublishConfig3",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, WorkDetailRespValidationError{
|
|
||||||
field: "PublishConfig3",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPublishConfig3()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return WorkDetailRespValidationError{
|
|
||||||
field: "PublishConfig3",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// no validation rules for VideoUrl
|
|
||||||
|
|
||||||
// no validation rules for CoverUrl
|
|
||||||
|
|
||||||
// no validation rules for ApprovalID
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
|
||||||
return WorkDetailRespMultiError(errors)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// WorkDetailRespMultiError is an error wrapping multiple validation errors
|
|
||||||
// returned by WorkDetailResp.ValidateAll() if the designated constraints
|
|
||||||
// aren't met.
|
|
||||||
type WorkDetailRespMultiError []error
|
|
||||||
|
|
||||||
// Error returns a concatenation of all the error messages it wraps.
|
|
||||||
func (m WorkDetailRespMultiError) Error() string {
|
|
||||||
var msgs []string
|
|
||||||
for _, err := range m {
|
|
||||||
msgs = append(msgs, err.Error())
|
|
||||||
}
|
|
||||||
return strings.Join(msgs, "; ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// AllErrors returns a list of validation violation errors.
|
|
||||||
func (m WorkDetailRespMultiError) AllErrors() []error { return m }
|
|
||||||
|
|
||||||
// WorkDetailRespValidationError is the validation error returned by
|
|
||||||
// WorkDetailResp.Validate if the designated constraints aren't met.
|
|
||||||
type WorkDetailRespValidationError struct {
|
|
||||||
field string
|
|
||||||
reason string
|
|
||||||
cause error
|
|
||||||
key bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field function returns field value.
|
|
||||||
func (e WorkDetailRespValidationError) Field() string { return e.field }
|
|
||||||
|
|
||||||
// Reason function returns reason value.
|
|
||||||
func (e WorkDetailRespValidationError) Reason() string { return e.reason }
|
|
||||||
|
|
||||||
// Cause function returns cause value.
|
|
||||||
func (e WorkDetailRespValidationError) Cause() error { return e.cause }
|
|
||||||
|
|
||||||
// Key function returns key value.
|
|
||||||
func (e WorkDetailRespValidationError) Key() bool { return e.key }
|
|
||||||
|
|
||||||
// ErrorName returns error name.
|
|
||||||
func (e WorkDetailRespValidationError) ErrorName() string { return "WorkDetailRespValidationError" }
|
|
||||||
|
|
||||||
// Error satisfies the builtin error interface
|
|
||||||
func (e WorkDetailRespValidationError) 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 %sWorkDetailResp.%s: %s%s",
|
|
||||||
key,
|
|
||||||
e.field,
|
|
||||||
e.reason,
|
|
||||||
cause)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ error = WorkDetailRespValidationError{}
|
|
||||||
|
|
||||||
var _ interface {
|
|
||||||
Field() string
|
|
||||||
Reason() string
|
|
||||||
Key() bool
|
|
||||||
Cause() error
|
|
||||||
ErrorName() string
|
|
||||||
} = WorkDetailRespValidationError{}
|
|
||||||
|
|
||||||
// Validate checks the field values on UpdateStatusReq 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 *UpdateStatusReq) Validate() error {
|
|
||||||
return m.validate(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateAll checks the field values on UpdateStatusReq 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
|
|
||||||
// UpdateStatusReqMultiError, or nil if none found.
|
|
||||||
func (m *UpdateStatusReq) ValidateAll() error {
|
|
||||||
return m.validate(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *UpdateStatusReq) validate(all bool) error {
|
|
||||||
if m == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var errors []error
|
|
||||||
|
|
||||||
// no validation rules for WorkAction
|
|
||||||
|
|
||||||
// no validation rules for WorkUuid
|
|
||||||
|
|
||||||
// no validation rules for ApprovalID
|
|
||||||
|
|
||||||
// no validation rules for ConfirmRemark
|
|
||||||
|
|
||||||
// no validation rules for ConfirmStatus
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
|
||||||
return UpdateStatusReqMultiError(errors)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateStatusReqMultiError is an error wrapping multiple validation errors
|
|
||||||
// returned by UpdateStatusReq.ValidateAll() if the designated constraints
|
|
||||||
// aren't met.
|
|
||||||
type UpdateStatusReqMultiError []error
|
|
||||||
|
|
||||||
// Error returns a concatenation of all the error messages it wraps.
|
|
||||||
func (m UpdateStatusReqMultiError) Error() string {
|
|
||||||
var msgs []string
|
|
||||||
for _, err := range m {
|
|
||||||
msgs = append(msgs, err.Error())
|
|
||||||
}
|
|
||||||
return strings.Join(msgs, "; ")
|
|
||||||
}
|
|
||||||
|
|
||||||
// AllErrors returns a list of validation violation errors.
|
|
||||||
func (m UpdateStatusReqMultiError) AllErrors() []error { return m }
|
|
||||||
|
|
||||||
// UpdateStatusReqValidationError is the validation error returned by
|
|
||||||
// UpdateStatusReq.Validate if the designated constraints aren't met.
|
|
||||||
type UpdateStatusReqValidationError struct {
|
|
||||||
field string
|
|
||||||
reason string
|
|
||||||
cause error
|
|
||||||
key bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field function returns field value.
|
|
||||||
func (e UpdateStatusReqValidationError) Field() string { return e.field }
|
|
||||||
|
|
||||||
// Reason function returns reason value.
|
|
||||||
func (e UpdateStatusReqValidationError) Reason() string { return e.reason }
|
|
||||||
|
|
||||||
// Cause function returns cause value.
|
|
||||||
func (e UpdateStatusReqValidationError) Cause() error { return e.cause }
|
|
||||||
|
|
||||||
// Key function returns key value.
|
|
||||||
func (e UpdateStatusReqValidationError) Key() bool { return e.key }
|
|
||||||
|
|
||||||
// ErrorName returns error name.
|
|
||||||
func (e UpdateStatusReqValidationError) ErrorName() string { return "UpdateStatusReqValidationError" }
|
|
||||||
|
|
||||||
// Error satisfies the builtin error interface
|
|
||||||
func (e UpdateStatusReqValidationError) 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 %sUpdateStatusReq.%s: %s%s",
|
|
||||||
key,
|
|
||||||
e.field,
|
|
||||||
e.reason,
|
|
||||||
cause)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ error = UpdateStatusReqValidationError{}
|
|
||||||
|
|
||||||
var _ interface {
|
|
||||||
Field() string
|
|
||||||
Reason() string
|
|
||||||
Key() bool
|
|
||||||
Cause() error
|
|
||||||
ErrorName() string
|
|
||||||
} = UpdateStatusReqValidationError{}
|
|
||||||
|
|
||||||
// Validate checks the field values on MediaUserListResp_Info with the rules
|
// Validate checks the field values on MediaUserListResp_Info with the rules
|
||||||
// defined in the proto definition for this message. If any rules are
|
// 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.
|
// violated, the first error encountered is returned, or nil if there are no violations.
|
||||||
@ -2256,20 +1543,26 @@ func (m *WorkListResp_Info) validate(all bool) error {
|
|||||||
|
|
||||||
// no validation rules for WorkUuid
|
// no validation rules for WorkUuid
|
||||||
|
|
||||||
// no validation rules for ArtistName
|
|
||||||
|
|
||||||
// no validation rules for ArtistPhone
|
|
||||||
|
|
||||||
// no validation rules for Title
|
// no validation rules for Title
|
||||||
|
|
||||||
|
// no validation rules for Content
|
||||||
|
|
||||||
// no validation rules for WorkCategory
|
// no validation rules for WorkCategory
|
||||||
|
|
||||||
|
// no validation rules for WorkUrl
|
||||||
|
|
||||||
|
// no validation rules for WorkCover
|
||||||
|
|
||||||
// no validation rules for WorkStatus
|
// no validation rules for WorkStatus
|
||||||
|
|
||||||
// no validation rules for SubmitTime
|
// no validation rules for SubmitTime
|
||||||
|
|
||||||
// no validation rules for StatusUpdateTime
|
// no validation rules for StatusUpdateTime
|
||||||
|
|
||||||
|
// no validation rules for ArtistName
|
||||||
|
|
||||||
|
// no validation rules for ArtistPhone
|
||||||
|
|
||||||
if len(errors) > 0 {
|
if len(errors) > 0 {
|
||||||
return WorkListResp_InfoMultiError(errors)
|
return WorkListResp_InfoMultiError(errors)
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,6 @@ type CastClient interface {
|
|||||||
UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment)
|
UpdateWorkImage(ctx context.Context, in *UpdateWorkImageReq, opts ...grpc_go.CallOption) (*UpdateWorkImageResp, common.ErrorWithAttachment)
|
||||||
UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment)
|
UpdateWorkVideo(ctx context.Context, in *UpdateWorkVideoReq, opts ...grpc_go.CallOption) (*UpdateWorkVideoResp, common.ErrorWithAttachment)
|
||||||
WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment)
|
WorkList(ctx context.Context, in *WorkListReq, opts ...grpc_go.CallOption) (*WorkListResp, common.ErrorWithAttachment)
|
||||||
WorkDetail(ctx context.Context, in *WorkDetailReq, opts ...grpc_go.CallOption) (*WorkDetailResp, common.ErrorWithAttachment)
|
|
||||||
UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type castClient struct {
|
type castClient struct {
|
||||||
@ -52,8 +50,6 @@ type CastClientImpl struct {
|
|||||||
UpdateWorkImage func(ctx context.Context, in *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
UpdateWorkImage func(ctx context.Context, in *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
||||||
UpdateWorkVideo func(ctx context.Context, in *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
UpdateWorkVideo func(ctx context.Context, in *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
||||||
WorkList func(ctx context.Context, in *WorkListReq) (*WorkListResp, error)
|
WorkList func(ctx context.Context, in *WorkListReq) (*WorkListResp, error)
|
||||||
WorkDetail func(ctx context.Context, in *WorkDetailReq) (*WorkDetailResp, error)
|
|
||||||
UpdateStatus func(ctx context.Context, in *UpdateStatusReq) (*emptypb.Empty, error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
|
func (c *CastClientImpl) GetDubboStub(cc *triple.TripleConn) CastClient {
|
||||||
@ -110,18 +106,6 @@ func (c *castClient) WorkList(ctx context.Context, in *WorkListReq, opts ...grpc
|
|||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkList", in, out)
|
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkList", in, out)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *castClient) WorkDetail(ctx context.Context, in *WorkDetailReq, opts ...grpc_go.CallOption) (*WorkDetailResp, common.ErrorWithAttachment) {
|
|
||||||
out := new(WorkDetailResp)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/WorkDetail", in, out)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *castClient) UpdateStatus(ctx context.Context, in *UpdateStatusReq, opts ...grpc_go.CallOption) (*emptypb.Empty, common.ErrorWithAttachment) {
|
|
||||||
out := new(emptypb.Empty)
|
|
||||||
interfaceKey := ctx.Value(constant.InterfaceKey).(string)
|
|
||||||
return out, c.cc.Invoke(ctx, "/"+interfaceKey+"/UpdateStatus", 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
|
||||||
@ -133,8 +117,6 @@ type CastServer interface {
|
|||||||
UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
UpdateWorkImage(context.Context, *UpdateWorkImageReq) (*UpdateWorkImageResp, error)
|
||||||
UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
UpdateWorkVideo(context.Context, *UpdateWorkVideoReq) (*UpdateWorkVideoResp, error)
|
||||||
WorkList(context.Context, *WorkListReq) (*WorkListResp, error)
|
WorkList(context.Context, *WorkListReq) (*WorkListResp, error)
|
||||||
WorkDetail(context.Context, *WorkDetailReq) (*WorkDetailResp, error)
|
|
||||||
UpdateStatus(context.Context, *UpdateStatusReq) (*emptypb.Empty, error)
|
|
||||||
mustEmbedUnimplementedCastServer()
|
mustEmbedUnimplementedCastServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,12 +146,6 @@ func (UnimplementedCastServer) UpdateWorkVideo(context.Context, *UpdateWorkVideo
|
|||||||
func (UnimplementedCastServer) WorkList(context.Context, *WorkListReq) (*WorkListResp, error) {
|
func (UnimplementedCastServer) WorkList(context.Context, *WorkListReq) (*WorkListResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method WorkList not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method WorkList not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedCastServer) WorkDetail(context.Context, *WorkDetailReq) (*WorkDetailResp, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method WorkDetail not implemented")
|
|
||||||
}
|
|
||||||
func (UnimplementedCastServer) UpdateStatus(context.Context, *UpdateStatusReq) (*emptypb.Empty, error) {
|
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateStatus not implemented")
|
|
||||||
}
|
|
||||||
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
func (s *UnimplementedCastServer) XXX_SetProxyImpl(impl protocol.Invoker) {
|
||||||
s.proxyImpl = impl
|
s.proxyImpl = impl
|
||||||
}
|
}
|
||||||
@ -401,64 +377,6 @@ func _Cast_WorkList_Handler(srv interface{}, ctx context.Context, dec func(inter
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
func _Cast_WorkDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(WorkDetailReq)
|
|
||||||
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("WorkDetail", 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 _Cast_UpdateStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc_go.UnaryServerInterceptor) (interface{}, error) {
|
|
||||||
in := new(UpdateStatusReq)
|
|
||||||
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("UpdateStatus", 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)
|
||||||
@ -494,14 +412,6 @@ var Cast_ServiceDesc = grpc_go.ServiceDesc{
|
|||||||
MethodName: "WorkList",
|
MethodName: "WorkList",
|
||||||
Handler: _Cast_WorkList_Handler,
|
Handler: _Cast_WorkList_Handler,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
MethodName: "WorkDetail",
|
|
||||||
Handler: _Cast_WorkDetail_Handler,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
MethodName: "UpdateStatus",
|
|
||||||
Handler: _Cast_UpdateStatus_Handler,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
Streams: []grpc_go.StreamDesc{},
|
Streams: []grpc_go.StreamDesc{},
|
||||||
Metadata: "pb/fiee/cast.proto",
|
Metadata: "pb/fiee/cast.proto",
|
||||||
|
@ -114,7 +114,6 @@ type System struct {
|
|||||||
HttpPort string
|
HttpPort string
|
||||||
Host string
|
Host string
|
||||||
RedirectUri string
|
RedirectUri string
|
||||||
ErpHost string
|
|
||||||
}
|
}
|
||||||
type Oss struct {
|
type Oss struct {
|
||||||
AccessKeyId string
|
AccessKeyId string
|
||||||
|
@ -4,7 +4,7 @@ AppMode = "dev"
|
|||||||
HttpPort = ":8085"
|
HttpPort = ":8085"
|
||||||
Host = "https://common.szjixun.cn"
|
Host = "https://common.szjixun.cn"
|
||||||
RedirectUri = "/api/redirect/url"
|
RedirectUri = "/api/redirect/url"
|
||||||
ErpHost = "http://114.218.158.24:9020"
|
|
||||||
[bos]
|
[bos]
|
||||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||||
|
@ -45,43 +45,3 @@ dubbo:
|
|||||||
CastClientImpl:
|
CastClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
interface: com.fontree.microservices.fiee.multicast
|
interface: com.fontree.microservices.fiee.multicast
|
||||||
logger:
|
|
||||||
zap-config:
|
|
||||||
level: error # 日志级别
|
|
||||||
development: false
|
|
||||||
disableCaller: false
|
|
||||||
disableStacktrace: false
|
|
||||||
encoding: "json"
|
|
||||||
# zap encoder 配置
|
|
||||||
encoderConfig:
|
|
||||||
messageKey: "message"
|
|
||||||
levelKey: "level"
|
|
||||||
timeKey: "time"
|
|
||||||
nameKey: "logger"
|
|
||||||
callerKey: "caller"
|
|
||||||
stacktraceKey: "stacktrace"
|
|
||||||
lineEnding: ""
|
|
||||||
levelEncoder: "capitalColor"
|
|
||||||
timeEncoder: "iso8601"
|
|
||||||
durationEncoder: "seconds"
|
|
||||||
callerEncoder: "short"
|
|
||||||
nameEncoder: ""
|
|
||||||
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
|
|
||||||
EncodeDuration: zapcore.SecondsDurationEncoder,
|
|
||||||
outputPaths:
|
|
||||||
- "stderr"
|
|
||||||
errorOutputPaths:
|
|
||||||
- "stderr"
|
|
||||||
lumberjack-config:
|
|
||||||
# 写日志的文件名称
|
|
||||||
filename: "runtime/logs/fiee.log"
|
|
||||||
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
|
|
||||||
maxSize: 5
|
|
||||||
# 日志保留的最大天数(只保留最近多少天的日志)
|
|
||||||
maxAge: 30
|
|
||||||
# 只保留最近多少个日志文件,用于控制程序总日志的大小
|
|
||||||
maxBackups: 30
|
|
||||||
# 是否使用本地时间,默认使用 UTC 时间
|
|
||||||
localTime: true
|
|
||||||
# 是否压缩日志文件,压缩方法 gzip
|
|
||||||
compress: false
|
|
@ -4,7 +4,7 @@ AppMode = "prod"
|
|||||||
HttpPort = ":8085"
|
HttpPort = ":8085"
|
||||||
Host = "https://common.szjixun.cn"
|
Host = "https://common.szjixun.cn"
|
||||||
RedirectUri = "/api/redirect/url"
|
RedirectUri = "/api/redirect/url"
|
||||||
ErpHost = "https://erpapi.fontree.cn"
|
|
||||||
[bos]
|
[bos]
|
||||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||||
|
@ -45,43 +45,3 @@ dubbo:
|
|||||||
CastClientImpl:
|
CastClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
interface: com.fontree.microservices.fiee.multicast
|
interface: com.fontree.microservices.fiee.multicast
|
||||||
logger:
|
|
||||||
zap-config:
|
|
||||||
level: error # 日志级别
|
|
||||||
development: false
|
|
||||||
disableCaller: false
|
|
||||||
disableStacktrace: false
|
|
||||||
encoding: "json"
|
|
||||||
# zap encoder 配置
|
|
||||||
encoderConfig:
|
|
||||||
messageKey: "message"
|
|
||||||
levelKey: "level"
|
|
||||||
timeKey: "time"
|
|
||||||
nameKey: "logger"
|
|
||||||
callerKey: "caller"
|
|
||||||
stacktraceKey: "stacktrace"
|
|
||||||
lineEnding: ""
|
|
||||||
levelEncoder: "capitalColor"
|
|
||||||
timeEncoder: "iso8601"
|
|
||||||
durationEncoder: "seconds"
|
|
||||||
callerEncoder: "short"
|
|
||||||
nameEncoder: ""
|
|
||||||
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
|
|
||||||
EncodeDuration: zapcore.SecondsDurationEncoder,
|
|
||||||
outputPaths:
|
|
||||||
- "stderr"
|
|
||||||
errorOutputPaths:
|
|
||||||
- "stderr"
|
|
||||||
lumberjack-config:
|
|
||||||
# 写日志的文件名称
|
|
||||||
filename: "runtime/logs/fiee.log"
|
|
||||||
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
|
|
||||||
maxSize: 5
|
|
||||||
# 日志保留的最大天数(只保留最近多少天的日志)
|
|
||||||
maxAge: 30
|
|
||||||
# 只保留最近多少个日志文件,用于控制程序总日志的大小
|
|
||||||
maxBackups: 30
|
|
||||||
# 是否使用本地时间,默认使用 UTC 时间
|
|
||||||
localTime: true
|
|
||||||
# 是否压缩日志文件,压缩方法 gzip
|
|
||||||
compress: false
|
|
@ -4,7 +4,7 @@ AppMode = "test"
|
|||||||
HttpPort = ":8085"
|
HttpPort = ":8085"
|
||||||
Host = "https://common.szjixun.cn"
|
Host = "https://common.szjixun.cn"
|
||||||
RedirectUri = "/api/redirect/url"
|
RedirectUri = "/api/redirect/url"
|
||||||
ErpHost = "http://114.218.158.24:9020"
|
|
||||||
[bos]
|
[bos]
|
||||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||||
|
@ -45,43 +45,3 @@ dubbo:
|
|||||||
CastClientImpl:
|
CastClientImpl:
|
||||||
protocol: tri
|
protocol: tri
|
||||||
interface: com.fontree.microservices.fiee.multicast
|
interface: com.fontree.microservices.fiee.multicast
|
||||||
logger:
|
|
||||||
zap-config:
|
|
||||||
level: error # 日志级别
|
|
||||||
development: false
|
|
||||||
disableCaller: false
|
|
||||||
disableStacktrace: false
|
|
||||||
encoding: "json"
|
|
||||||
# zap encoder 配置
|
|
||||||
encoderConfig:
|
|
||||||
messageKey: "message"
|
|
||||||
levelKey: "level"
|
|
||||||
timeKey: "time"
|
|
||||||
nameKey: "logger"
|
|
||||||
callerKey: "caller"
|
|
||||||
stacktraceKey: "stacktrace"
|
|
||||||
lineEnding: ""
|
|
||||||
levelEncoder: "capitalColor"
|
|
||||||
timeEncoder: "iso8601"
|
|
||||||
durationEncoder: "seconds"
|
|
||||||
callerEncoder: "short"
|
|
||||||
nameEncoder: ""
|
|
||||||
EncodeTime: zapcore.TimeEncoderOfLayout("2006-01-02 15:04:05.000"),
|
|
||||||
EncodeDuration: zapcore.SecondsDurationEncoder,
|
|
||||||
outputPaths:
|
|
||||||
- "stderr"
|
|
||||||
errorOutputPaths:
|
|
||||||
- "stderr"
|
|
||||||
lumberjack-config:
|
|
||||||
# 写日志的文件名称
|
|
||||||
filename: "runtime/logs/fiee.log"
|
|
||||||
# 每个日志文件长度的最大大小,单位是 MiB。默认 100MiB
|
|
||||||
maxSize: 5
|
|
||||||
# 日志保留的最大天数(只保留最近多少天的日志)
|
|
||||||
maxAge: 30
|
|
||||||
# 只保留最近多少个日志文件,用于控制程序总日志的大小
|
|
||||||
maxBackups: 30
|
|
||||||
# 是否使用本地时间,默认使用 UTC 时间
|
|
||||||
localTime: true
|
|
||||||
# 是否压缩日志文件,压缩方法 gzip
|
|
||||||
compress: false
|
|
@ -1,24 +0,0 @@
|
|||||||
package cast
|
|
||||||
|
|
||||||
type ApprovalDetailResponse struct {
|
|
||||||
Status int `json:"status"`
|
|
||||||
Data Data `json:"data"`
|
|
||||||
Msg string `json:"msg"`
|
|
||||||
Code int `json:"code"`
|
|
||||||
Error *string `json:"error"`
|
|
||||||
Err string `json:"err"`
|
|
||||||
Keys []string `json:"keys"`
|
|
||||||
Positions *interface{} `json:"positions"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Data struct {
|
|
||||||
Count int `json:"Count"`
|
|
||||||
Data []Item `json:"data"`
|
|
||||||
Status int `json:"Status"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Item struct {
|
|
||||||
ID int `json:"ID"`
|
|
||||||
Domain string `json:"Domain"`
|
|
||||||
Status int `json:"Status"`
|
|
||||||
}
|
|
@ -23,8 +23,5 @@ func MediaRouter(r *gin.RouterGroup) {
|
|||||||
{
|
{
|
||||||
work.POST("update-work-image", serviceCast.UpdateWorkImage)
|
work.POST("update-work-image", serviceCast.UpdateWorkImage)
|
||||||
work.POST("update-work-video", serviceCast.UpdateWorkVideo)
|
work.POST("update-work-video", serviceCast.UpdateWorkVideo)
|
||||||
work.POST("update-approval", serviceCast.UpdateApproval)
|
|
||||||
work.POST("list", serviceCast.WorkList)
|
|
||||||
work.POST("detail", serviceCast.WorkDetail)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
package cast
|
|
||||||
|
|
||||||
import (
|
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
|
||||||
"fmt"
|
|
||||||
"fonchain-fiee/cmd/config"
|
|
||||||
"fonchain-fiee/pkg/e"
|
|
||||||
"fonchain-fiee/pkg/utils"
|
|
||||||
modelCast "fonchain-fiee/pkg/model/cast"
|
|
||||||
)
|
|
||||||
|
|
||||||
type CastService struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *CastService) ApprovalDetail(approvalIds []int) (data map[int]int, err error) {
|
|
||||||
idsBytes, _ := json.Marshal(approvalIds)
|
|
||||||
var respBody string
|
|
||||||
url := fmt.Sprintf(config.AppConfig.System.ErpHost + "/approval/list/ex")
|
|
||||||
respBody, err = utils.Post(url, string(idsBytes))
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
var respDetail modelCast.ApprovalDetailResponse
|
|
||||||
if err = json.Unmarshal([]byte(respBody), &respDetail); err != nil {
|
|
||||||
err = errors.New(e.GetMsg(e.JsonUnmarshal))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if respDetail.Status == 0 && len(respDetail.Data.Data) > 0 {
|
|
||||||
data = make(map[int]int, len(respDetail.Data.Data))
|
|
||||||
for _, v := range respDetail.Data.Data {
|
|
||||||
data[v.ID] = v.Status
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err = errors.New(e.GetMsg(e.ErrorHttp))
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
@ -34,7 +34,6 @@ func UpdateWorkImage(ctx *gin.Context) {
|
|||||||
TelNum: "18288888888",
|
TelNum: "18288888888",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
req.ArtistName = infoResp.Name
|
|
||||||
req.ArtistPhone = infoResp.TelNum
|
req.ArtistPhone = infoResp.TelNum
|
||||||
resp, err := service.CastProvider.UpdateWorkImage(ctx, req)
|
resp, err := service.CastProvider.UpdateWorkImage(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -69,7 +68,6 @@ func UpdateWorkVideo(ctx *gin.Context) {
|
|||||||
TelNum: "18288888888",
|
TelNum: "18288888888",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
req.ArtistName = infoResp.Name
|
|
||||||
req.ArtistPhone = infoResp.TelNum
|
req.ArtistPhone = infoResp.TelNum
|
||||||
resp, err := service.CastProvider.UpdateWorkVideo(ctx, req)
|
resp, err := service.CastProvider.UpdateWorkVideo(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -79,58 +77,3 @@ func UpdateWorkVideo(ctx *gin.Context) {
|
|||||||
service.Success(ctx, resp)
|
service.Success(ctx, resp)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateApproval(ctx *gin.Context) {
|
|
||||||
var req *cast.UpdateStatusReq
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
req.WorkAction = cast.WorkActionENUM_APPROVAL
|
|
||||||
resp, err := service.CastProvider.UpdateStatus(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func WorkList(ctx *gin.Context) {
|
|
||||||
var (
|
|
||||||
req *cast.WorkListReq
|
|
||||||
resp *cast.WorkListResp
|
|
||||||
)
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, err = service.CastProvider.WorkList(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
func WorkDetail(ctx *gin.Context) {
|
|
||||||
var (
|
|
||||||
req *cast.WorkDetailReq
|
|
||||||
resp *cast.WorkDetailResp
|
|
||||||
)
|
|
||||||
var err error
|
|
||||||
if err = ctx.ShouldBind(&req); err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
resp, err = service.CastProvider.WorkDetail(ctx, req)
|
|
||||||
if err != nil {
|
|
||||||
service.Error(ctx, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
service.Success(ctx, resp)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
package utils
|
|
||||||
|
|
||||||
import (
|
|
||||||
"bytes"
|
|
||||||
"io/ioutil"
|
|
||||||
"net/http"
|
|
||||||
)
|
|
||||||
|
|
||||||
func Post(url, data string) (string, error) {
|
|
||||||
reader := bytes.NewReader([]byte(data))
|
|
||||||
|
|
||||||
request, err := http.NewRequest("POST", url, reader)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
defer request.Body.Close() //程序在使用完回复后必须关闭回复的主体
|
|
||||||
request.Header.Set("Content-Type", "application/json;charset=UTF-8")
|
|
||||||
//必须设定该参数,POST参数才能正常提交,意思是以json串提交数据
|
|
||||||
|
|
||||||
client := http.Client{}
|
|
||||||
resp, err := client.Do(request) //Do 方法发送请求,返回 HTTP 回复
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
respBytes, err := ioutil.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
|
|
||||||
//byte数组直接转成string,优化内存
|
|
||||||
// str := (*string)(unsafe.Pointer(&respBytes))
|
|
||||||
return string(respBytes), nil
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user