package cn.reghao.tnb.content.app.vod.rpc;

import cn.reghao.jutil.jdk.result.Result;
import cn.reghao.tnb.content.api.constant.VideoStatus;
import cn.reghao.tnb.content.api.iface.UserContentService;
import cn.reghao.tnb.content.app.vod.db.repository.VideoRepository;
import cn.reghao.tnb.common.db.GroupCount;
import cn.reghao.tnb.content.app.vod.model.po.VideoPost;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author reghao
 * @date 2024-08-03 23:04:28
 */
@DubboService
@Service
public class UserContentServiceImpl implements UserContentService {
    private final VideoRepository videoRepository;

    public UserContentServiceImpl(VideoRepository videoRepository) {
        this.videoRepository = videoRepository;
    }

    @Override
    public List<Long> getContentUser(int publishType) {
        List<GroupCount> list = videoRepository.getPublishUsers(publishType);
        return list.stream()
                .map(groupCount -> Long.valueOf(groupCount.getId()))
                .collect(Collectors.toList());
    }

    @Override
    public Result setVideoPostPublish(String videoId) {
        return Result.fail("not implement");
    }
}
