generated from CyanAsterisk/.github
-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
video.go
28 lines (23 loc) · 818 Bytes
/
video.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package pkg
import (
"context"
"github.com/CyanAsterisk/TikGok/server/shared/errno"
"github.com/CyanAsterisk/TikGok/server/shared/kitex_gen/video"
"github.com/CyanAsterisk/TikGok/server/shared/kitex_gen/video/videoservice"
)
type VideoManager struct {
client videoservice.Client
}
func NewVideoManager(client videoservice.Client) *VideoManager {
return &VideoManager{client: client}
}
func (m *VideoManager) GetPublishedVideoIdList(ctx context.Context, userId int64) ([]int64, error) {
resp, err := m.client.GetPublishedVideoIdList(ctx, &video.DouyinGetPublishedVideoIdListRequest{UserId: userId})
if err != nil {
return nil, err
}
if resp.BaseResp.StatusCode != int32(errno.Success.ErrCode) {
return nil, errno.VideoServerErr.WithMessage(resp.BaseResp.StatusMsg)
}
return resp.VideoIdList, nil
}