package com.repair.api;

import com.repair.model.pojo.RepairNoticeSetting;
import com.repair.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 java.text.ParseException;

@RequestMapping("/api/repairNoticeSetting")
@Api(tags = {"RepairNoticeSettingController"}, value = "公告")
public interface RepairNoticeSettingControllerAPI {

    @PostMapping(value = "/insertRepairNoticeSetting")
    @ApiOperation(value = "添加公告", notes = "添加公告数据", httpMethod = "POST")
    CommonResult InsertRepairNoticeSetting(@Validated @RequestBody RepairNoticeSetting repairNoticeSetting, BindingResult bindingResult);

    @PostMapping(value = "/updateRepairNoticeSettingById")
    @ApiOperation(value = "编辑公告数据", notes = "编辑公告数据", httpMethod = "POST")
    CommonResult updateRepairNoticeSettingById(@Validated @RequestBody RepairNoticeSetting ra, BindingResult bindingResult);

    @GetMapping(value = "/queryPageRepairNoticeSetting")
    @ApiOperation(value = "公告分页数据", notes = "公告分页数据", httpMethod = "GET")
    CommonResult queryPageRepairNoticeSettings(@RequestParam int currentPage, @RequestParam int pageCount, String createTime) throws ParseException;

    @GetMapping(value = "/cancelOrTopNoticeById")
    @ApiOperation(value = "取消/置顶公告", notes = "取消/置顶公告置顶", httpMethod = "GET")
    CommonResult cancelOrTopNoticeById(@RequestParam int id, @RequestParam int is_top);

    @GetMapping(value = "/deleteRepairNoticeSettingById")
    @ApiOperation(value = "根据ID删除指定公告", notes = "根据ID删除指定公告", httpMethod = "GET")
    CommonResult deleteRepairNoticeSettingById(@RequestParam int id);

    @GetMapping(value = "/queryRepairNoticeSettingByTop")
    @ApiOperation(value = "公告置顶数据", notes = "公告置顶数据", httpMethod = "GET")
    CommonResult queryRepairNoticeSettingByTop();
}
