package com.fs.course.service;

import com.fs.common.core.domain.R;
import com.fs.course.domain.FsUserCourse;
import com.fs.course.param.*;
import com.fs.course.param.newfs.FsUserCourseListParam;
import com.fs.course.vo.*;
import com.fs.course.vo.newfs.FsUserCourseListVO;
import com.fs.his.vo.OptionsVO;

import javax.validation.constraints.NotNull;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

/**
 * 课程Service接口
 *
 * @author fs
 * @date 2024-05-15
 */
public interface IFsUserCourseService {
    /**
     * 查询课程
     *
     * @param courseId 课程主键
     * @return 课程
     */
    public FsUserCourse selectFsUserCourseByCourseId(Long courseId);

    /**
     * 查询课程列表
     *
     * @param fsUserCourse 课程
     * @return 课程集合
     */
    public List<FsUserCourse> selectFsUserCourseList(FsUserCourse fsUserCourse);

    /**
     * 新增课程
     *
     * @param fsUserCourse 课程
     * @return 结果
     */
    public int insertFsUserCourse(FsUserCourse fsUserCourse);

    /**
     * 修改课程
     *
     * @param fsUserCourse 课程
     * @return 结果
     */
    public int updateFsUserCourse(FsUserCourse fsUserCourse);

    /**
     * 批量删除课程
     *
     * @param courseIds 需要删除的课程主键集合
     * @return 结果
     */
    public int deleteFsUserCourseByCourseIds(Long[] courseIds);

    /**
     * 删除课程信息
     *
     * @param courseId 课程主键
     * @return 结果
     */
    public int deleteFsUserCourseByCourseId(Long courseId);


    FsUserCourseUVO selectFsUserCourseUVOByCourseId(Long courseId);


    int updateViews(Long courseId);

    int updateShares(Long courseId);

    int updateLikes(Long courseId, Integer type);

    int updateFavorite(Long courseId, Integer type);

    List<FsUserCourseListUVO> selectFsUserCourseListUVO(FsUserCourseListUParam param);

    List<OptionsVO> selectFsUserCourseAllList();

    List<FsUserCourseListPVO> selectFsUserCourseListPVO(FsUserCourse param);

    int updateDuration(FsUserCourseAddStudyCourseParam param);

    R addStudyCourse(FsUserCourseAddStudyCourseParam param);

    int updateFsUserCourseIsShow(Long[] courseIds, int status);

    R getIntegralByCourseVideo(FsUserCourseGetIntegralParam param);


    List<FsUserCourseListUVO> selectFsUserCourseCommentListUVO(FsUserCourseListUParam param);


    FsUserCourseVideoH5VO selectFsUserCourseVideoH5VOByVideoId(Long videoId);

    FsUserCourseVideoH5DVO selectFsUserCourseVideoH5DVOByVideoId(Long videoId);

    List<FsUserCourseListPVO> selectFsUserCourseListCompanyPVO(FsUserCourseParam fsUserCourse);

    List<FsUserCourseListVO> getFsUserCourseList(FsUserCourseListParam param);

    void processQwSopCourseMaterialTimer();

    List<FsCourseListBySidebarVO> getFsCourseListBySidebar(FsCourseListBySidebarParam param);

    List<FsCourseListBySidebarVO> getFsCourseListBySidebarToday(FsCourseListBySidebarParam param);

    List<FsUserCourseParticipationRecordVO> getParticipationRecordByMap(Map<String, Object> params);

    R createCourseSortLink(FsCourseLinkCreateParam fsCourseLinkCreateParam);

    InputStream handleImage(String s, String path) throws IOException;

    String createCourseImageQR(String url, String backgroundImagePath, InputStream file, String outputFormat, String title, String duration) throws Exception;

    String createUserImageQR(@NotNull(message = "链接不能为空") String realLink, String backgroundImagePath, InputStream inputStream, String png, @NotNull(message = "销售id不能为空") Long companyUserId) throws Exception;

    int copyFsUserCourse(Long courseId);

    List<FsUserCourseVideoAppletVO> selectFsUserCourseVideoApplet();

    List<FsUserCourseVideoAppletVO.FsUserCourseVideo> selectFsUserCourseVideoAppletByCourseId(Long courseId);

    List<FsUserCourseVideoAppletVO> selectFsUserCourseVideoAppletListByCourseId(Long courseId);

    R createAppCourseSortLink(FsCourseLinkCreateParam fsCourseLinkCreateParam);

    /**
     * 修改课堂配置
     */
    void editConfig(Long id, String configJson);
}
