package com.bonus.zlpt.equip.api;

import com.bonus.zlpt.common.core.constant.ServiceNameConstants;
import com.bonus.zlpt.common.core.utils.poi.ExcelUtil;
import com.bonus.zlpt.common.core.web.domain.AjaxResult;
import com.bonus.zlpt.common.core.web.page.TableDataInfo;
import com.bonus.zlpt.equip.api.domain.TypeInfo;
import com.bonus.zlpt.equip.api.factory.TypeInfoServiceApiFallBackFotory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;

@FeignClient(contextId = "TypeInfoServiceApi", value = ServiceNameConstants.EQUIP_SERVICE, fallbackFactory = TypeInfoServiceApiFallBackFotory.class)
public interface TypeInfoServiceApi {



    String PREFIX = "/type";

    @GetMapping(PREFIX+"/list")
    TableDataInfo list(TypeInfo typeInfo);

    /**
     * 导出设备类型列表
     */
    @PostMapping(PREFIX+"/export")
    void export(HttpServletResponse response, TypeInfo typeInfo);

    /**
     * 获取设备类型详细信息
     */
    @GetMapping(value = PREFIX+"/{typeId}")
    AjaxResult getInfo(@PathVariable("typeId") Long typeId);

    /**
     * 新增设备类型
     */
    @PostMapping(PREFIX)
    AjaxResult add(@RequestBody TypeInfo typeInfo);

    /**
     * 修改设备类型
     */
    @PutMapping(PREFIX)
    AjaxResult edit(@RequestBody TypeInfo typeInfo);

    /**
     * 删除设备类型
     */
    @DeleteMapping(PREFIX+"/{typeIds}")
    AjaxResult remove(@PathVariable("typeIds") Long[] typeIds);

    /**
     * 删除设备类型
     */
    @DeleteMapping(PREFIX+"/remove/{typeId}")
    AjaxResult remove(@PathVariable("typeId") Long typeId);

    /**
     * 获取设备类型树结构
     * @return
     */
    @GetMapping(PREFIX+"/treeSelect")
    AjaxResult treeSelect();



}
