package com.sptg.estate.api.feigns;

import com.baomidou.mybatisplus.plugins.Page;
import com.sptg.common.core.beans.ResultBean;
import com.sptg.estate.api.dto.NoticeDto;
import com.sptg.estate.api.entity.Notice;
import com.sptg.estate.api.feigns.fallback.NoticeFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
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;

/**
 * title: NoticeFeign
 * package: com.sptg.estate.api.feigns
 * description:公告-服务接口
 *
 *                
 *                
 */
@FeignClient(value="smart-house-estate",fallbackFactory= NoticeFeignFallbackFactory.class)
public interface NoticeFeign {
    /**
     * 功能描述:展示公告列表
     * @param noticeDto
     * @return com.sptg.common.core.beans.ResultBean<com.baomidou.mybatisplus.plugins.Page<com.sptg.estate.api.entity.Notice>>
     *                
     *                      
     */
    @PostMapping(value = "/notice/showNoticeList")
    ResultBean<Page<Notice>> showNoticeList(@RequestBody NoticeDto noticeDto);
    /**
     * 功能描述:查询公告
     * @param noticeDto
     * @return com.sptg.common.core.beans.ResultBean<java.util.List<com.sptg.estate.api.entity.Notice>>
     *                
     *                      
     */
    @PostMapping(value = "/notice/getList")
     ResultBean<List<Notice>> getList(@RequestBody NoticeDto noticeDto);
    /**
     * 功能描述:添加或编辑公告
     * @param notice
     * @return com.sptg.common.core.beans.ResultBean<java.lang.Boolean>
     *                
     *                      
     */
    @PostMapping(value = "/notice/addOrEditNotice")
    ResultBean<Boolean> addOrEditNotice(@RequestBody Notice notice);
    /**
     * 功能描述:根据id查询公告
     * @param id
     * @return com.sptg.common.core.beans.ResultBean<com.sptg.estate.api.entity.Notice>
     *                
     *                      
     */
    @PostMapping(value = "/notice/findNoticeById")
    ResultBean<Notice> findNoticeById(@RequestParam(value = "id") long id);
    /**
     * 功能描述:删除公告
     * @param id
     * @return com.sptg.common.core.beans.ResultBean<java.lang.Boolean>
     *                
     *                      
     */
    @PostMapping(value = "/notice/deleteNoticeById")
    ResultBean<Boolean> deleteNoticeById(@RequestParam(value = "id") long id);
    /**
     * 功能描述:批量删除公告
     * @param noticeDto
     * @return  ResultBean<Boolean>
     *             
     *                      
     */
    @PostMapping(value = "/notice/deleteNoticeList")
    ResultBean<Boolean> deleteNoticeList(@RequestBody NoticeDto noticeDto);

    @PostMapping(value = "/notice/updateNoticeList")
    boolean updateNoticeList(@RequestBody List<Notice> noticeList);
}
