package com.template.api;

import com.template.model.request.*;
import com.template.model.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;


@RequestMapping("/api/alumniEndorse")
@Api(tags = {"AlumniEndorseController"}, value = "母校代言")
public interface AlumniEndorseControllerAPI {

    //新增母校代言
    @PostMapping("/insertEndorseData")
    @ApiOperation(value = "新增母校代言", httpMethod = "POST")
    CommonResult insertEndorseData(@Validated @RequestBody insertEndorseRequest ier, @RequestAttribute Integer userId, BindingResult bindingResult);

    //母校代言分页数据
    @GetMapping(value = "/queryEndorsePage")
    @ApiOperation(value = "获取母校代言分页数据", notes = "获取母校代言分页数据", httpMethod = "GET")
    CommonResult queryEndorsePage(@RequestParam int currentPage, @RequestParam int pageCount, String keyword, Integer collegeId, Integer periodId, Integer majorId, Integer classId, String startTime, String endTime);


    //导出母校代言
    @PostMapping(value = "/getAlumniEndorseExcel")
    @ApiOperation(value = "导出母校代言数据", httpMethod = "POST")
    CommonResult getAlumniEndorseExcel(@Validated @RequestBody alumniEndorseExcelRequest aeer, HttpServletResponse response, BindingResult bindingResult) throws ParseException;

    //删除
    @GetMapping(value = "/deleteEndorseById")
    @ApiOperation(value = "删除母校代言分页", notes = "删除母校代言分页", httpMethod = "GET")
    CommonResult deleteEndorseById(@RequestParam int id);


    //审核列表分页数据
    @GetMapping(value = "/queryEndorseApplyPage")
    @ApiOperation(value = "获取母校代言审核分页数据", notes = "获取母校代言审核分页数据", httpMethod = "GET")
    CommonResult queryEndorseApplyPage(@RequestParam int currentPage, @RequestParam int pageCount,@RequestAttribute Integer userId, String keyword, String name, Integer isPass, Integer collegeId, Integer periodId, Integer majorId, Integer classId, String startTime, String endTime);

    //导出审核
    @PostMapping(value = "/getAlumniEndorseApplyExcel")
    @ApiOperation(value = "导出母校代言审核数据", httpMethod = "POST")
    CommonResult getAlumniEndorseApplyExcel(@Validated @RequestBody alumniEndorseApplyExcelRequest aeaer,@RequestAttribute Integer userId, HttpServletResponse response, BindingResult bindingResult) throws ParseException;

    //审核
    @GetMapping("/toExamineEndorse")
    @ApiOperation(value = "审核母校代言数据", httpMethod = "GET")
    CommonResult toExamineEndorse(@RequestAttribute Integer userId, @RequestParam Integer id, @RequestParam Integer isPass, String passValue) throws Exception;

    //region 移动端
    //母校代言首页数据
    @GetMapping(value = "/queryMobileEndorsePage")
    @ApiOperation(value = "获取母校代言分页数据", notes = "获取母校代言分页数据", httpMethod = "GET")
    CommonResult queryMobileEndorsePage(@RequestParam int currentPage, @RequestParam int pageCount, String keyword);

    //查看详情
    @GetMapping(value = "/queryEndorseById")
    @ApiOperation(value = "根据数据ID获取详情", notes = "根据数据ID获取详情", httpMethod = "GET")
    CommonResult queryEndorseById(@RequestParam int id);

    //发起申请
    @PostMapping("/initiateApplication")
    @ApiOperation(value = "发起申请", httpMethod = "POST")
    CommonResult initiateApplication(@Validated @RequestBody initiateEndorseRequest ier,@RequestAttribute Integer userId,  BindingResult bindingResult);

    //申请记录
    @GetMapping("/applicationRecord")
    @ApiOperation(value = "申请记录", httpMethod = "GET")
    CommonResult applicationRecord(@RequestParam int currentPage, @RequestParam int pageCount,@RequestAttribute Integer userId,@RequestParam int weekType);

    //时间类型
    @GetMapping("/queryWeekTypes")
    @ApiOperation(value = "获取时间类型列表数据", httpMethod = "GET")
    CommonResult queryWeekTypes();
    //endregion
}
