package com.fs.app.controller;

import com.fs.common.annotation.Log;
import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.AjaxResult;
import com.fs.common.core.domain.R;
import com.fs.common.core.page.TableDataInfo;
import com.fs.common.enums.BusinessType;
import com.fs.common.utils.poi.ExcelUtil;
import com.fs.course.domain.FsUserCoursePeriod;
import com.fs.course.domain.FsUserCoursePeriodDays;
import com.fs.course.domain.FsUserCourseVideoRedPackage;
import com.fs.course.param.CompanyRedPacketParam;
import com.fs.course.param.FsBatchPeriodRedPackageParam;
import com.fs.course.param.PeriodCountParam;
import com.fs.course.param.PeriodStatisticCountParam;
import com.fs.course.service.IFsUserCoursePeriodDaysService;
import com.fs.course.service.IFsUserCoursePeriodService;
import com.fs.course.service.IFsUserCourseVideoRedPackageService;
import com.fs.course.vo.FsPeriodCountVO;
import com.fs.course.vo.FsUserCoursePeriodVO;
import com.fs.course.vo.PeriodRedPacketVO;
import com.fs.course.vo.UpdateCourseTimeVo;
import com.fs.his.vo.OptionsVO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 会员营期Controller
 *
 * @author fs
 * @date 2025-04-11
 */
@RestController
@AllArgsConstructor
@RequestMapping("/course/period")
@Slf4j
public class FsUserCoursePeriodController extends BaseController {

    private final IFsUserCoursePeriodService fsUserCoursePeriodService;

    @PostMapping("/periodCourseStatisticCount")
    @ApiOperation("会员详情训练营数据总览")
    public R periodCourseStatisticCount(@RequestBody PeriodStatisticCountParam param) {
        if (param == null) {
            return R.error("请求参数不能为空！");
        }
        return R.ok().put("data", fsUserCoursePeriodService.periodCourseStatisticCount(param));
    }

    @PostMapping("/periodlist")
    public R periodList(@RequestBody PeriodStatisticCountParam param)
    {
        List<FsUserCoursePeriod> list = fsUserCoursePeriodService.selectFsPeriodlist(param);
        return R.ok().put("data", list);
    }
}
