package com.template.api;

import com.template.model.request.insertAlumniNewsRequest;
import com.template.model.request.updateAlumniNewsRequest;
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/alumniNews")
@Api(tags = {"AlumniNewsController"}, value = "校友新闻")
public interface AlumniNewsControllerAPI {

    @PostMapping(value = "/insertAlumniNews")
    @ApiOperation(value = "新增新闻数据", notes = "新增新闻数据", httpMethod = "POST")
    CommonResult insertAlumniNews(@Validated @RequestBody insertAlumniNewsRequest ianr, BindingResult bindingResult);

    @PostMapping(value = "/updateAlumniNews")
    @ApiOperation(value = "更新新闻数据", notes = "更新新闻数据", httpMethod = "POST")
    CommonResult updateAlumniNews(@Validated @RequestBody updateAlumniNewsRequest uanr, BindingResult bindingResult);

    @GetMapping(value = "/deleteAlumniNews")
    @ApiOperation(value = "删除新闻数据", notes = "删除新闻数据", httpMethod = "GET")
    CommonResult deleteAlumniNews(@RequestParam int id);

    /**
     * @param currentPage   当前页
     * @param pageCount     一页数据条数
     * @param startTime     创建开始时间
     * @param endTime       创建结束时间
     * @return
     */
    @GetMapping(value = "/queryAlumniNewsPage")
    @ApiOperation(value = "获取新闻分页数据", notes = "获取新闻分页数据", httpMethod = "GET")
    CommonResult queryAlumniNewsPage(@RequestParam int currentPage, @RequestParam int pageCount,String userName, String theme, String startTime, String endTime);

    //根据分类ID获取新闻分页数据
    /**
     * @param currentPage   当前页
     * @param pageCount     一页数据条数
     * @param categoryId    分类ID
     * @return
     */
    @GetMapping(value = "/queryPageByCategoryId")
    @ApiOperation(value = "根据分类ID获取新闻分页数据", notes = "根据分类ID获取新闻分页数据", httpMethod = "GET")
    CommonResult queryPageByCategoryId(@RequestParam int currentPage, @RequestParam int pageCount,Integer categoryId);

}
