v0.0.30.2 Убран duration из клипов
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2282c5b1ac
commit
8320de7d6e
@ -7,7 +7,6 @@ type Clip struct {
|
||||
Title string `json:"title"`
|
||||
VideoURL string `json:"videoUrl"`
|
||||
ThumbnailURL string `json:"thumbnailUrl"`
|
||||
Duration int `json:"duration"`
|
||||
AuthorID int `json:"-"`
|
||||
Author *User `json:"author"`
|
||||
LikesCount int `json:"likesCount"`
|
||||
|
||||
@ -346,7 +346,6 @@ func (r *Resolver) protoClipToDomain(protoClip *proto.Clip) *domain.Clip {
|
||||
Title: protoClip.Title,
|
||||
VideoURL: protoClip.VideoUrl,
|
||||
ThumbnailURL: protoClip.ThumbnailUrl,
|
||||
Duration: int(protoClip.Duration),
|
||||
AuthorID: int(protoClip.AuthorId),
|
||||
LikesCount: int(protoClip.LikesCount),
|
||||
CommentsCount: int(protoClip.CommentsCount),
|
||||
|
||||
@ -74,7 +74,6 @@ type ComplexityRoot struct {
|
||||
Author func(childComplexity int) int
|
||||
CommentsCount func(childComplexity int) int
|
||||
CreatedAt func(childComplexity int) int
|
||||
Duration func(childComplexity int) int
|
||||
ID func(childComplexity int) int
|
||||
IsLiked func(childComplexity int) int
|
||||
LikesCount func(childComplexity int) int
|
||||
@ -505,13 +504,6 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
||||
|
||||
return e.complexity.Clip.CreatedAt(childComplexity), true
|
||||
|
||||
case "Clip.duration":
|
||||
if e.complexity.Clip.Duration == nil {
|
||||
break
|
||||
}
|
||||
|
||||
return e.complexity.Clip.Duration(childComplexity), true
|
||||
|
||||
case "Clip.id":
|
||||
if e.complexity.Clip.ID == nil {
|
||||
break
|
||||
@ -3268,50 +3260,6 @@ func (ec *executionContext) fieldContext_Clip_thumbnailUrl(_ context.Context, fi
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Clip_duration(ctx context.Context, field graphql.CollectedField, obj *domain.Clip) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Clip_duration(ctx, field)
|
||||
if err != nil {
|
||||
return graphql.Null
|
||||
}
|
||||
ctx = graphql.WithFieldContext(ctx, fc)
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
ec.Error(ctx, ec.Recover(ctx, r))
|
||||
ret = graphql.Null
|
||||
}
|
||||
}()
|
||||
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
|
||||
ctx = rctx // use context from middleware stack in children
|
||||
return obj.Duration, nil
|
||||
})
|
||||
if err != nil {
|
||||
ec.Error(ctx, err)
|
||||
return graphql.Null
|
||||
}
|
||||
if resTmp == nil {
|
||||
if !graphql.HasFieldError(ctx, fc) {
|
||||
ec.Errorf(ctx, "must not be null")
|
||||
}
|
||||
return graphql.Null
|
||||
}
|
||||
res := resTmp.(int)
|
||||
fc.Result = res
|
||||
return ec.marshalNInt2int(ctx, field.Selections, res)
|
||||
}
|
||||
|
||||
func (ec *executionContext) fieldContext_Clip_duration(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
||||
fc = &graphql.FieldContext{
|
||||
Object: "Clip",
|
||||
Field: field,
|
||||
IsMethod: false,
|
||||
IsResolver: false,
|
||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
||||
return nil, errors.New("field of type Int does not have child fields")
|
||||
},
|
||||
}
|
||||
return fc, nil
|
||||
}
|
||||
|
||||
func (ec *executionContext) _Clip_author(ctx context.Context, field graphql.CollectedField, obj *domain.Clip) (ret graphql.Marshaler) {
|
||||
fc, err := ec.fieldContext_Clip_author(ctx, field)
|
||||
if err != nil {
|
||||
@ -7246,8 +7194,6 @@ func (ec *executionContext) fieldContext_Mutation_createClip(ctx context.Context
|
||||
return ec.fieldContext_Clip_videoUrl(ctx, field)
|
||||
case "thumbnailUrl":
|
||||
return ec.fieldContext_Clip_thumbnailUrl(ctx, field)
|
||||
case "duration":
|
||||
return ec.fieldContext_Clip_duration(ctx, field)
|
||||
case "author":
|
||||
return ec.fieldContext_Clip_author(ctx, field)
|
||||
case "commentsCount":
|
||||
@ -9458,8 +9404,6 @@ func (ec *executionContext) fieldContext_Query_clip(ctx context.Context, field g
|
||||
return ec.fieldContext_Clip_videoUrl(ctx, field)
|
||||
case "thumbnailUrl":
|
||||
return ec.fieldContext_Clip_thumbnailUrl(ctx, field)
|
||||
case "duration":
|
||||
return ec.fieldContext_Clip_duration(ctx, field)
|
||||
case "author":
|
||||
return ec.fieldContext_Clip_author(ctx, field)
|
||||
case "commentsCount":
|
||||
@ -9537,8 +9481,6 @@ func (ec *executionContext) fieldContext_Query_clips(ctx context.Context, field
|
||||
return ec.fieldContext_Clip_videoUrl(ctx, field)
|
||||
case "thumbnailUrl":
|
||||
return ec.fieldContext_Clip_thumbnailUrl(ctx, field)
|
||||
case "duration":
|
||||
return ec.fieldContext_Clip_duration(ctx, field)
|
||||
case "author":
|
||||
return ec.fieldContext_Clip_author(ctx, field)
|
||||
case "commentsCount":
|
||||
@ -9616,8 +9558,6 @@ func (ec *executionContext) fieldContext_Query_userClips(ctx context.Context, fi
|
||||
return ec.fieldContext_Clip_videoUrl(ctx, field)
|
||||
case "thumbnailUrl":
|
||||
return ec.fieldContext_Clip_thumbnailUrl(ctx, field)
|
||||
case "duration":
|
||||
return ec.fieldContext_Clip_duration(ctx, field)
|
||||
case "author":
|
||||
return ec.fieldContext_Clip_author(ctx, field)
|
||||
case "commentsCount":
|
||||
@ -10346,8 +10286,6 @@ func (ec *executionContext) fieldContext_Subscription_clipCreated(_ context.Cont
|
||||
return ec.fieldContext_Clip_videoUrl(ctx, field)
|
||||
case "thumbnailUrl":
|
||||
return ec.fieldContext_Clip_thumbnailUrl(ctx, field)
|
||||
case "duration":
|
||||
return ec.fieldContext_Clip_duration(ctx, field)
|
||||
case "author":
|
||||
return ec.fieldContext_Clip_author(ctx, field)
|
||||
case "commentsCount":
|
||||
@ -13966,11 +13904,6 @@ func (ec *executionContext) _Clip(ctx context.Context, sel ast.SelectionSet, obj
|
||||
if out.Values[i] == graphql.Null {
|
||||
atomic.AddUint32(&out.Invalids, 1)
|
||||
}
|
||||
case "duration":
|
||||
out.Values[i] = ec._Clip_duration(ctx, field, obj)
|
||||
if out.Values[i] == graphql.Null {
|
||||
atomic.AddUint32(&out.Invalids, 1)
|
||||
}
|
||||
case "author":
|
||||
out.Values[i] = ec._Clip_author(ctx, field, obj)
|
||||
if out.Values[i] == graphql.Null {
|
||||
|
||||
@ -177,7 +177,6 @@ type Clip {
|
||||
title: String!
|
||||
videoUrl: String!
|
||||
thumbnailUrl: String!
|
||||
duration: Int!
|
||||
author: User!
|
||||
commentsCount: Int!
|
||||
likesCount: Int!
|
||||
|
||||
@ -1129,12 +1129,11 @@ type Clip struct {
|
||||
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
|
||||
VideoUrl string `protobuf:"bytes,3,opt,name=video_url,json=videoUrl,proto3" json:"video_url,omitempty"`
|
||||
ThumbnailUrl string `protobuf:"bytes,4,opt,name=thumbnail_url,json=thumbnailUrl,proto3" json:"thumbnail_url,omitempty"`
|
||||
Duration int32 `protobuf:"varint,5,opt,name=duration,proto3" json:"duration,omitempty"`
|
||||
AuthorId int32 `protobuf:"varint,6,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
|
||||
LikesCount int32 `protobuf:"varint,7,opt,name=likes_count,json=likesCount,proto3" json:"likes_count,omitempty"`
|
||||
CommentsCount int32 `protobuf:"varint,8,opt,name=comments_count,json=commentsCount,proto3" json:"comments_count,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,10,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
AuthorId int32 `protobuf:"varint,5,opt,name=author_id,json=authorId,proto3" json:"author_id,omitempty"`
|
||||
LikesCount int32 `protobuf:"varint,6,opt,name=likes_count,json=likesCount,proto3" json:"likes_count,omitempty"`
|
||||
CommentsCount int32 `protobuf:"varint,7,opt,name=comments_count,json=commentsCount,proto3" json:"comments_count,omitempty"`
|
||||
CreatedAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
|
||||
UpdatedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@ -1197,13 +1196,6 @@ func (x *Clip) GetThumbnailUrl() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Clip) GetDuration() int32 {
|
||||
if x != nil {
|
||||
return x.Duration
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Clip) GetAuthorId() int32 {
|
||||
if x != nil {
|
||||
return x.AuthorId
|
||||
@ -1466,22 +1458,20 @@ const file_clip_proto_rawDesc = "" +
|
||||
"\x14DeleteCommentRequest\x12\x1d\n" +
|
||||
"\n" +
|
||||
"comment_id\x18\x01 \x01(\x05R\tcommentId\x12\x17\n" +
|
||||
"\auser_id\x18\x02 \x01(\x05R\x06userId\"\xe5\x02\n" +
|
||||
"\auser_id\x18\x02 \x01(\x05R\x06userId\"\xc9\x02\n" +
|
||||
"\x04Clip\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x05R\x02id\x12\x14\n" +
|
||||
"\x05title\x18\x02 \x01(\tR\x05title\x12\x1b\n" +
|
||||
"\tvideo_url\x18\x03 \x01(\tR\bvideoUrl\x12#\n" +
|
||||
"\rthumbnail_url\x18\x04 \x01(\tR\fthumbnailUrl\x12\x1a\n" +
|
||||
"\bduration\x18\x05 \x01(\x05R\bduration\x12\x1b\n" +
|
||||
"\tauthor_id\x18\x06 \x01(\x05R\bauthorId\x12\x1f\n" +
|
||||
"\vlikes_count\x18\a \x01(\x05R\n" +
|
||||
"\rthumbnail_url\x18\x04 \x01(\tR\fthumbnailUrl\x12\x1b\n" +
|
||||
"\tauthor_id\x18\x05 \x01(\x05R\bauthorId\x12\x1f\n" +
|
||||
"\vlikes_count\x18\x06 \x01(\x05R\n" +
|
||||
"likesCount\x12%\n" +
|
||||
"\x0ecomments_count\x18\b \x01(\x05R\rcommentsCount\x129\n" +
|
||||
"\x0ecomments_count\x18\a \x01(\x05R\rcommentsCount\x129\n" +
|
||||
"\n" +
|
||||
"created_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"created_at\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x129\n" +
|
||||
"\n" +
|
||||
"updated_at\x18\n" +
|
||||
" \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\x87\x01\n" +
|
||||
"updated_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\tupdatedAt\"\x87\x01\n" +
|
||||
"\bClipLike\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x05R\x02id\x12\x17\n" +
|
||||
"\aclip_id\x18\x02 \x01(\x05R\x06clipId\x12\x17\n" +
|
||||
|
||||
@ -138,12 +138,11 @@ message Clip {
|
||||
string title = 2;
|
||||
string video_url = 3;
|
||||
string thumbnail_url = 4;
|
||||
int32 duration = 5;
|
||||
int32 author_id = 6;
|
||||
int32 likes_count = 7;
|
||||
int32 comments_count = 8;
|
||||
google.protobuf.Timestamp created_at = 9;
|
||||
google.protobuf.Timestamp updated_at = 10;
|
||||
int32 author_id = 5;
|
||||
int32 likes_count = 6;
|
||||
int32 comments_count = 7;
|
||||
google.protobuf.Timestamp created_at = 8;
|
||||
google.protobuf.Timestamp updated_at = 9;
|
||||
}
|
||||
|
||||
message ClipLike {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user