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.NoticePushDto;
import com.sptg.estate.api.dto.UserDto;
import com.sptg.estate.api.entity.NoticePush;
import com.sptg.estate.api.entity.NoticePushDetails;
import com.sptg.estate.api.entity.NoticePushImg;
import com.sptg.estate.api.feigns.fallback.NoticePushFeignFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * title: NoticePushFeign
 * package: com.sptg.estate.api.feigns
 * description:公告发布-服务接口
 *
 *                
 *                
 */
@FeignClient(value= "smart-house-estate",fallbackFactory= NoticePushFeignFallbackFactory.class)
public interface NoticePushFeign {

    /**
     * 功能描述:分页展示公告发布
     * @param noticePushDto
     * @return ResultBean<Page<NoticePush>>
     *                
     *                      
     */
    @PostMapping(value = "/noticePush/showNoticePushList")
    ResultBean<Page<NoticePush>> showNoticePushList(@RequestBody NoticePushDto noticePushDto);

    /**
     * 功能描述:添加公共发布信息
     * @param noticePush
     * @return ResultBean<Long> 返回id
     *                
     *                      
     */
    @PostMapping(value = "/noticePush/addNoticePush")
    ResultBean<Long> addNoticePush(@RequestBody NoticePush noticePush);

    /**
     * 功能描述:根据id查询公共发布信息
     * @param id
     * @return ResultBean<NoticePush>
     *                
     *                       
     */
    @PostMapping(value = "/noticePush/findNoticePushById")
    ResultBean<NoticePush> findNoticePushById(@RequestParam(value = "id") long id);

    /**
     * 功能描述:撤销公告发布
     * @param id
     * @return ResultBean<Boolean>
     *                
     *                       
     */
    @GetMapping(value = "/noticePush/cancelNoticePush/{id}")
    ResultBean<Boolean> cancelNoticePush(@PathVariable("id") long id);

    /**
     * 功能描述:获取公告发布的图片
     * @param noticePushId
     * @return List<NoticePushImg>
     *                
     *                      
     */
    @GetMapping(value = "/noticePush/selectNoticePushImgList/{noticePushId}")
    List<NoticePushImg> selectNoticePushImgList(@PathVariable("noticePushId") long noticePushId);

    /**
     * 功能描述:公告发布详细
     * @param noticePushId
     * @return List<NoticePushDetails>
     *                
     *                      
     */
    @GetMapping(value = "/noticePush/getListByNoticePushId/{noticePushId}")
    List<NoticePushDetails> getListByNoticePushId(@PathVariable("noticePushId") long noticePushId);

    /**
     * 功能描述:更新公告发布
     * @param noticePush
     * @return Boolean
     *                
     *                      
     */
    @PostMapping(value = "/noticePush/updateNoticePushById")
    Boolean updateNoticePushById(@RequestBody NoticePush noticePush);

    /**
     * 功能描述:根据住户信息获取公告信息
     * @param userDto
     * @return Boolean
     *                
     *                      
     */
    @PostMapping(value = "/noticePush/getListByUser")
    List<NoticePush> getListByUser(@RequestBody UserDto userDto);
}
