Documentation ¶
Index ¶
- type Comment
- type CommentActionResponse
- type CommentListResponse
- type FeedResponse
- type Response
- type Service
- func (s *Service) DeleteComment(selfId uint64, commentId uint64) (*CommentActionResponse, error)
- func (s *Service) Follow(userId uint64, to_userId uint64) Response
- func (s *Service) GetCommentList(selfId uint64, videoId uint64) (*CommentListResponse, error)
- func (s *Service) GetCoverFileName(filename string) string
- func (s *Service) GetCoverFromVideoFile(data io.Reader) (io.Reader, error)
- func (s *Service) GetFeed(ctx context.Context, userId uint64, isnew bool, isTour bool, ...) (*FeedResponse, error)
- func (s *Service) GetFollowList(selfId uint64, userId uint64) UserListResponse
- func (s *Service) GetFollowerList(selfId uint64, userId uint64) UserListResponse
- func (s *Service) GetLikeList(selfId uint64, userId uint64) *VideoListResponse
- func (s *Service) GetUserInfo(selfId uint64, UserID uint64) (*UserResponse, error)
- func (s *Service) GetVideoList(ctx context.Context, selfId uint64, userId uint64) *VideoListResponse
- func (s *Service) Hash(data []byte) string
- func (s *Service) LikeDisliakeVideo(userId uint64, videoId uint64, like bool) *Response
- func (s *Service) Login(username string, password string) (*UserLoginResponse, error)
- func (s *Service) PreSignUrl(filename *string) (string, error)
- func (s *Service) PublishComment(userId uint64, videoId uint64, content string) (*CommentActionResponse, error)
- func (s *Service) PublishVideo(ctx context.Context, UserID uint64, filename string, videodata io.Reader, ...) Response
- func (s *Service) PutVideoInfoToRedis(ctx context.Context, video *model.Video)
- func (s *Service) Register(username string, password string) (*UserRegisterResponse, error)
- func (s *Service) UnFollow(userId uint64, to_userId uint64) Response
- func (s *Service) UploadCoverToS3(ctx context.Context, filename string, coverdata io.Reader)
- func (s *Service) UploadToS3(ctx context.Context, filename string, data io.Reader, contenttype string)
- func (s *Service) UploadVideoToS3(ctx context.Context, filename string, videodata io.Reader)
- type User
- type UserListResponse
- type UserLoginResponse
- type UserRegisterResponse
- type UserResponse
- type Video
- type VideoListResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommentActionResponse ¶
type CommentListResponse ¶
type FeedResponse ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg *config.Config, db *gorm.DB, rds *redis.Client, logger *zap.Logger, producer sarama.AsyncProducer, s3 s3Object.S3ObjectAPI) *Service
启动一个新的service实例,当然是单例模式
func (*Service) DeleteComment ¶
func (s *Service) DeleteComment(selfId uint64, commentId uint64) (*CommentActionResponse, error)
func (*Service) GetCommentList ¶
func (s *Service) GetCommentList(selfId uint64, videoId uint64) (*CommentListResponse, error)
func (*Service) GetCoverFileName ¶
func (*Service) GetCoverFromVideoFile ¶
func (*Service) GetFollowList ¶
func (s *Service) GetFollowList(selfId uint64, userId uint64) UserListResponse
func (*Service) GetFollowerList ¶
func (s *Service) GetFollowerList(selfId uint64, userId uint64) UserListResponse
func (*Service) GetLikeList ¶
func (s *Service) GetLikeList(selfId uint64, userId uint64) *VideoListResponse
func (*Service) GetUserInfo ¶
func (s *Service) GetUserInfo(selfId uint64, UserID uint64) (*UserResponse, error)
func (*Service) GetVideoList ¶
func (*Service) LikeDisliakeVideo ¶
func (*Service) Login ¶
func (s *Service) Login(username string, password string) (*UserLoginResponse, error)
func (*Service) PublishComment ¶
func (*Service) PublishVideo ¶
func (s *Service) PublishVideo(ctx context.Context, UserID uint64, filename string, videodata io.Reader, title string) Response
上传video的部分,上传到s3是异步的,所以这里不需要等待立刻返回
func (*Service) PutVideoInfoToRedis ¶
func (*Service) Register ¶
func (s *Service) Register(username string, password string) (*UserRegisterResponse, error)
func (*Service) UploadCoverToS3 ¶
func (*Service) UploadToS3 ¶
type UserListResponse ¶
type UserLoginResponse ¶
type UserRegisterResponse ¶
type UserResponse ¶
type Video ¶
type Video struct { Id uint64 `json:"id,omitempty"` Author User `json:"author"` PlayUrl string `json:"play_url,omitempty"` CoverUrl string `json:"cover_url,omitempty"` FavoriteCount uint64 `json:"favorite_count,omitempty"` CommentCount uint64 `json:"comment_count,omitempty"` IsFavorite bool `json:"is_favorite,omitempty"` Title string `json:"title,omitempty"` }
type VideoListResponse ¶
Click to show internal directories.
Click to hide internal directories.