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.DictTreeFeignClientFallbackFactory;
import com.njcn.system.pojo.po.SysDicTreePO;
import com.njcn.system.pojo.vo.DictTreeVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author xuyang
 */
@FeignClient(value = ServerInfo.SYSTEM, path = "/dictTree", fallbackFactory = DictTreeFeignClientFallbackFactory.class, contextId = "dictTree")
public interface DictTreeFeignClient {

    @PostMapping("/queryById")
    HttpResult<SysDicTreePO> queryById(@RequestParam("id") String id);

    @PostMapping("/queryByCode")
    HttpResult<DictTreeVO> queryByCode(@RequestParam("code") String code);

    @PostMapping("/query")
    HttpResult<List<DictTreeVO>> query(@RequestParam("pid") String pid);

    @PostMapping("/queryByCodeList")
    HttpResult<List<SysDicTreePO>> queryByCodeList(@RequestParam("code") String code);

    @GetMapping("/queryAll")
    HttpResult<List<SysDicTreePO>> queryAll();

    @GetMapping("/queryAllByType")
    HttpResult<List<SysDicTreePO>> queryAllByType(@RequestParam("type")Integer type);



    @GetMapping("/queryTree")
    HttpResult<List<SysDicTreePO>> queryTree() ;


}
