package com.template.api;

import com.template.model.request.insertImageRequest;
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.*;


@RequestMapping("/api/alumniImage")
@Api(tags = {"AlumniImageController"}, value = "校友相册")
public interface AlumniImageControllerAPI {

    //管理端
    @GetMapping(value = "/queryImagePage")
    @ApiOperation(value = "获取照片分页数据", notes = "获取照片分页数据", httpMethod = "GET")
    CommonResult queryImagePage( @RequestParam int currentPage, @RequestParam int pageCount, String userName, String orgName, Integer collegeId, Integer periodId, Integer majorId, Integer classId);

    @PostMapping(value = "/insertImage")
    @ApiOperation(value = "移动端上传照片", notes = "移动端上传照片", httpMethod = "POST")
    CommonResult insertImage(@Validated @RequestBody insertImageRequest iir,@RequestAttribute Integer userId, BindingResult bindingResult);

    @GetMapping(value = "/deleteImageById")
    @ApiOperation(value = "删除相册数据", notes = "删除相册数据", httpMethod = "GET")
    CommonResult deleteImageById(@RequestParam int id);


    //管理端
    @GetMapping(value = "/queryImageApplyPage")
    @ApiOperation(value = "获取相册审核分页数据", notes = "获取相册审核分页数据", httpMethod = "GET")
    CommonResult queryImageApplyPage(@RequestAttribute Integer userId, @RequestParam int currentPage, @RequestParam int pageCount, String userName, String orgName, Integer collegeId, Integer periodId, Integer majorId, Integer classId, Integer isPass, String startTime, String endTime);

    /**
     * 审核校友相册数据
     *
     * @param userId 用户ID
     * @param id     数据ID
     * @param isPass 是否通过
     *               通过：2
     *               拒绝：3
     * @return
     */
    @GetMapping("/toExamineImage")
    @ApiOperation(value = "审核校友相册数据", httpMethod = "GET")
    CommonResult toExamineImage(@RequestAttribute Integer userId, @RequestParam Integer id,@RequestParam Integer isPass,String passValue) throws Exception;


    //移动端根据相册分类ID获取校友相册数据
    @GetMapping(value = "/queryMobileImagePage")
    @ApiOperation(value = "获取照片分页数据", notes = "获取照片分页数据", httpMethod = "GET")
    CommonResult queryMobileImagePage(@RequestAttribute Integer userId, @RequestParam int currentPage, @RequestParam int pageCount, String keyword, Integer categoryId);

    //移动端获取我上传的照片分页数据
    @GetMapping(value = "/queryMyImagePage")
    @ApiOperation(value = "获取我上传的照片分页数据", notes = "获取我上传的照片分页数据", httpMethod = "GET")
    CommonResult queryMyImagePage(@RequestAttribute Integer userId, @RequestParam int currentPage, @RequestParam int pageCount, Integer isPass);
}
