package com.template.api;

import com.template.model.request.alumniClubExcelRequest;
import com.template.model.request.clubTopupRequest;
import com.template.model.request.insertClubRequest;
import com.template.model.request.updateClubRequest;
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;


@RequestMapping("/api/alumniClub")
@Api(tags = {"AlumniClubController"}, value = "部门")
public interface AlumniClubControllerAPI {

    @PostMapping("/insertClubData")
    @ApiOperation(value = "新增组织", httpMethod = "POST")
    CommonResult insertClubData(@Validated @RequestBody insertClubRequest icr, BindingResult bindingResult);

    @PostMapping("/updateClubData")
    @ApiOperation(value = "更新组织", httpMethod = "POST")
    CommonResult updateClubData(@Validated @RequestBody updateClubRequest ucr, BindingResult bindingResult);

    /**
     * 获取组织分页数据
     *
     * @param currentPage
     * @param pageCount
     * @param name        组织名称
     * @param userName    创建人
     * @param startTime   创建开始时间
     * @param endTime     创建结束时间
     * @param categoryId  分类ID
     * @return
     */
    @GetMapping(value = "/queryClubPage")
    @ApiOperation(value = "获取组织分页数据", notes = "获取组织分页数据", httpMethod = "GET")
    CommonResult queryClubPage(@RequestParam int currentPage, @RequestParam int pageCount, String name, String userName, String startTime, String endTime, Integer categoryId);

    @PostMapping("/clubTopup")
    @ApiOperation(value = "置顶", httpMethod = "POST")
    CommonResult clubTopup(@Validated @RequestBody clubTopupRequest ctr, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/getAlumniClubExcel")
    @ApiOperation(value = "导出校友组织数据", httpMethod = "POST")
    CommonResult getAlumniClubExcel(@Validated @RequestBody alumniClubExcelRequest acer, HttpServletResponse response, BindingResult bindingResult);


    @GetMapping("/queryHomeClub")
    @ApiOperation(value = "移动端首页校友组织", httpMethod = "GET")
    CommonResult queryHomeClub(@RequestAttribute Integer userId);

    /**
     * 按分类展示组织分页数据
     */
    @GetMapping(value = "/queryClubByCategoryId")
    @ApiOperation(value = "按分类展示组织分页数据", notes = "按分类展示组织分页数据", httpMethod = "GET")
    CommonResult queryClubByCategoryId(@RequestParam int currentPage, @RequestParam int pageCount,@RequestAttribute Integer userId, @RequestParam int categoryId, String keyword);


    @GetMapping("/queryPassTypes")
    @ApiOperation(value = "获取审核下拉状态列表数据", httpMethod = "GET")
    CommonResult queryPassTypes();
}
