对接
This commit is contained in:
@@ -10,7 +10,18 @@ import (
|
||||
|
||||
type CatalogService struct {
|
||||
categories *bizlive.CategoryUsecase
|
||||
rooms *bizlive.RoomUsecase
|
||||
rooms roomCatalogUsecase
|
||||
}
|
||||
|
||||
type roomCatalogUsecase interface {
|
||||
List(context.Context, bizlive.RoomFilter, bizlive.ListOptions) ([]*bizlive.Room, int64, error)
|
||||
Get(context.Context, uint) (*bizlive.Room, error)
|
||||
GetPublic(context.Context, uint) (*bizlive.Room, error)
|
||||
Create(context.Context, *bizlive.Room) (*bizlive.Room, error)
|
||||
Update(context.Context, *bizlive.Room) (*bizlive.Room, error)
|
||||
Delete(context.Context, uint) error
|
||||
SetEnabled(context.Context, uint, bool) error
|
||||
SaveSort(context.Context, map[uint]int) error
|
||||
}
|
||||
|
||||
func NewCatalogService(categories *bizlive.CategoryUsecase, rooms *bizlive.RoomUsecase) *CatalogService {
|
||||
@@ -78,7 +89,7 @@ func (s *CatalogService) ListRooms(ctx context.Context, input *dto.LiveRoomListR
|
||||
}
|
||||
func (s *CatalogService) ListPublicRooms(ctx context.Context, input *dto.LiveRoomListRequest) ([]*dto.LiveRoomResponse, int64, error) {
|
||||
enabled := true
|
||||
items, total, err := s.rooms.List(ctx, bizlive.RoomFilter{Name: input.Name, CategoryID: input.CategoryID, Status: bizlive.RoomStatusLive, Enabled: &enabled, CategoryEnabled: &enabled}, liveListOptions(input.LiveListRequest))
|
||||
items, total, err := s.rooms.List(ctx, bizlive.RoomFilter{Name: input.Name, CategoryID: input.CategoryID, Status: input.Status, Enabled: &enabled, CategoryEnabled: &enabled}, liveListOptions(input.LiveListRequest))
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user