package com.repair.api;

import com.repair.model.pojo.RepairArticleType;
import com.repair.model.request.updateArticleNumRequest;
import com.repair.model.request.updateRepairArticleTypeRequest;
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.*;

@RequestMapping("/api/repairArticleType")
@Api(tags = {"RepairArticleTypeController"}, value = "报修故障类型")
public interface RepairArticleTypeControllerAPI {

    @PostMapping(value = "/insertRepairArticleType")
    @ApiOperation(value = "添加报修故障类型", notes = "添加报修故障类型数据", httpMethod = "POST")
    CommonResult InsertRepairArticleType(@Validated @RequestBody RepairArticleType rwt, BindingResult bindingResult);

    @PostMapping(value = "/updateRepairArticleTypeById")
    @ApiOperation(value = "编辑报修故障类型数据", notes = "编辑报修故障类型数据", httpMethod = "POST")
    CommonResult updateRepairArticleTypeById(@Validated @RequestBody updateRepairArticleTypeRequest uratr, BindingResult bindingResult);

    @GetMapping(value = "/queryPageRepairArticleType")
    @ApiOperation(value = "报修故障类型分页数据", notes = "报修故障类型分页数据", httpMethod = "GET")
    CommonResult queryPageRepairArticleTypes(@RequestParam int currentPage, @RequestParam int pageCount, String name);

    @GetMapping(value = "/deleteRepairArticleTypeById")
    @ApiOperation(value = "根据ID删除指定报修故障类型", notes = "根据ID删除指定报修故障类型", httpMethod = "GET")
    CommonResult deleteRepairArticleTypeById(@RequestParam int id);

    @GetMapping(value = "/queryRepairArticleTypeTree")
    @ApiOperation(value = "获取故障类型树形结构数据", notes = "获取故障类型树形结构数据", httpMethod = "GET")
    CommonResult queryRepairArticleTypeTree(@RequestParam int schoolId);

    @GetMapping(value = "/queryRepairArticleType")
    @ApiOperation(value = "物品类型关联", notes = "物品类型关联", httpMethod = "GET")
    CommonResult queryRepairArticleType(@RequestParam int schoolId);

    @GetMapping(value = "/queryConsumeMaterial")
    @ApiOperation(value = "关联耗材", notes = "关联耗材", httpMethod = "GET")
    CommonResult queryConsumeMaterial(@RequestParam int schoolId, String keyWord);

    @PostMapping(value = "/dragArticle")
    @ApiOperation(value = "拖拽物品", notes = "拖拽物品", httpMethod = "POST")
    CommonResult dragArticle(@RequestBody updateArticleNumRequest datas);
}
