package com.njcn.system.api;

import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.system.api.fallback.EpdFeignClientFallbackFactory;
import com.njcn.system.pojo.dto.EpdDTO;
import com.njcn.system.pojo.param.EleEpdPqdParam;
import com.njcn.system.pojo.po.EleEpdPqd;
import com.njcn.system.pojo.vo.EleEpdPqdListVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author hongawen
 * @version 1.0.0
 * @date 2021年05月08日 15:11
 */
@FeignClient(value = ServerInfo.SYSTEM,path = "/csDictData",fallbackFactory = EpdFeignClientFallbackFactory.class,contextId = "csDictData")
public interface EpdFeignClient {

    @PostMapping("/update")
    HttpResult<String> update(@RequestBody EleEpdPqdParam.EleEpdPqdUpdateParam updateParam);

    @PostMapping("/addByModel")
    HttpResult<String> addByModel(@RequestBody List<EleEpdPqdParam> eleEpdPqdParam);

    @PostMapping("/add")
    HttpResult<EleEpdPqd> add(@RequestBody EleEpdPqdParam eleEpdPqdParam);

    @PostMapping("/dictMarkByDataType")
    HttpResult<List<EleEpdPqd>> dictMarkByDataType(@RequestParam("dataType") String dataType);

    @PostMapping("/addEvt")
    HttpResult<Map<String,String>> addEvt(@RequestBody List<EleEpdPqdParam> eleEpdPqdParam);

    @PostMapping("/selectById")
    HttpResult<EleEpdPqd> selectById(@RequestParam("id") String id);

    @PostMapping("/selectByIds")
    HttpResult<List<EleEpdPqd>> selectByIds(@RequestBody List<String> ids);

    @PostMapping("/judgeExist")
    HttpResult<List<EleEpdPqd>> judgeExist(@RequestParam("name") String name,@RequestParam("dataType") String dataType);

    @PostMapping("/findByParam")
    HttpResult<EleEpdPqd> findByParam(@RequestParam("name") String name, @RequestParam("dataType") String dataType, @RequestParam("phase") String phase);

    @PostMapping("/findAll")
    HttpResult<List<EpdDTO>> findAll();

    @PostMapping("/findByName")
    HttpResult<EleEpdPqd> findByName(@RequestParam("name") String name);

    @PostMapping("/findListByShowName")
    HttpResult<List<EleEpdPqd>> findListByShowName(@RequestParam("name") String name);

    @PostMapping("/selectByClassId")
    HttpResult<List<EleEpdPqd>> selectByClassId(@RequestParam("classId") String classId);

    @PostMapping("/selectAll")
    HttpResult<List<EleEpdPqdListVO>> selectAll();

    @PostMapping("/findListByCode")
    HttpResult<List<EleEpdPqd>> findListByCode(@RequestParam("code") @Validated String code);
}
