package com.sptg.estate.api.feigns;

import com.sptg.estate.api.entity.BillsItem;
import com.sptg.estate.api.feigns.fallback.BillsItemFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping("/billsItem")
@FeignClient(value = "smart-house-estate",fallbackFactory = BillsItemFeignFallbackFactory.class)
public interface BillsItemFeign {

    /**
     *  获取缴费项列表
     * */
    @GetMapping("/list")
    List<BillsItem> list(@RequestParam("billsId") Long billsId);

    /**
     *  获取缴费项详情
     * */
    @GetMapping("/detail")
    BillsItem detail(@RequestParam(value = "id",required = true) Long id);

    /**
     *  根据id删除缴费项
     * */
    @GetMapping("/delete")
    boolean delete(@RequestParam(value = "id",required = true) Long id);

    /**
     *  编辑缴费项
     * */
    @GetMapping("/edit")
    boolean edit(@RequestBody BillsItem billsItem);

    /**
     *  添加缴费项
     * */
    @PostMapping("/add")
    boolean add(@RequestBody BillsItem billsItem);
}
