package com.template.api;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.template.model.pojo.SmartDepartment;
import com.template.model.request.insertDepartmentRequest;
import com.template.model.request.updateDepartmentRequest;
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 java.io.UnsupportedEncodingException;

/**
 * @Author: binguo
 * @Date: 2023/3/30 星期四 17:28
 * @Description: com.video.api
 * @Version: 1.0
 */
@RequestMapping("/api/smartDepartment")
@Api(tags = {"SmartDepartmentControllerAPI"}, value = "部门")
public interface SmartDepartmentControllerAPI {
    @PostMapping(value = "/insertSmartDepartment")
    @ApiOperation(value = "添加部门", notes = "添加部门数据", httpMethod = "POST")
    CommonResult insertSmartDepartment(@Validated @RequestBody insertDepartmentRequest smartApply, BindingResult bindingResult) throws Exception;

    @PostMapping(value = "/updateSmartDepartmentById")
    @ApiOperation(value = "编辑部门数据", notes = "编辑部门数据", httpMethod = "POST")
    CommonResult updateSmartDepartmentById(@Validated @RequestBody updateDepartmentRequest udr, BindingResult bindingResult) throws Exception;

    @GetMapping(value = "/queryPageSmartDepartment")
    @ApiOperation(value = "部门分页数据", notes = "部门分页数据", httpMethod = "GET")
    CommonResult queryPageSmartDepartments(@RequestParam int currentPage, @RequestParam int pageCount, String name);

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

    @GetMapping(value = "/queryDepartmentTree")
    @ApiOperation(value = "查询部门树形结构数据", notes = "查询部门树形结构数据", httpMethod = "GET")
    CommonResult queryDepartmentTree(String name);
}
