package com.template.api;

import com.template.model.pojo.SmartDataSource;
import com.template.model.pojo.SmartDataClass;
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 javax.servlet.http.HttpServletRequest;

/**
 * @Author: binguo
 * @Date: 2023/3/30 星期四 17:28
 * @Description: com.video.api
 * @Version: 1.0
 */
@RequestMapping("/api/smartDataClass")
@Api(tags = {"SmartDataClassControllerAPI"}, value = "数据源")
public interface SmartDataSourceControllerAPI {
    @PostMapping(value = "/insertSmartDataSource")
    @ApiOperation(value = "添加数据源", notes = "添加数据源数据", httpMethod = "POST")
    CommonResult insertSmartDataSource(@Validated @RequestBody SmartDataSource smartDataSource, HttpServletRequest httpServletRequest, BindingResult bindingResult);

    @PostMapping(value = "/vcoSmartDataSource")
    @ApiOperation(value = "测试数据源连接有效性", notes = "测试数据源连接有效性", httpMethod = "POST")
    CommonResult vcoSmartDataSource(@Validated @RequestBody SmartDataSource smartDataSource, BindingResult bindingResult);

    @PostMapping(value = "/updateSmartDataSourceById")
    @ApiOperation(value = "编辑数据源数据", notes = "编辑数据源数据", httpMethod = "POST")
    CommonResult updateSmartDataSourceById(@Validated @RequestBody SmartDataSource smartDataSource, HttpServletRequest httpServletRequest, BindingResult bindingResult);

    @GetMapping(value = "/queryPageSmartDataSource")
    @ApiOperation(value = "数据源分页数据", notes = "数据源分页数据", httpMethod = "GET")
    CommonResult queryPageSmartDataSources(@RequestParam int currentPage, @RequestParam int pageCount, SmartDataSource smartDataSource);

    @GetMapping(value = "/deleteSmartDataSourceById")
    @ApiOperation(value = "根据ID删除指定数据源", notes = "根据ID删除指定数据源", httpMethod = "GET")
    CommonResult deleteSmartDataSourceById(@RequestParam int id, HttpServletRequest httpServletRequest);
}
