package com.yuchen.saas.message.api.feign.notice;

import com.yuchen.saas.message.api.dto.PmgBatNoticeQueryDto;
import com.yuchen.saas.message.api.vo.PmgBatNoticeListVo;
import com.yuchen.saas.message.api.vo.PmgBatNoticeVo;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.mp.support.NestPage;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * <p>
 * 公告/资讯feign调用
 * </p>
 *
 * @author caiwq
 * @since 2024-02-28
 */
@FeignClient(
        value = AppNameConstant.SAAS_MESSAGE,
        fallbackFactory = NoticeFeignFallback.class
)
public interface NoticeFeignServer {

    /**
     * 公告/资讯详情
     * @param id 公告/资讯ID
     * @return 公告/资讯详情Vo
     */
    @GetMapping("/notice/getNoticeById/{id}")
    R<PmgBatNoticeVo> getNoticeById(@PathVariable("id") Long id);

    /**
     * 公告/资讯列表(分页)
     * @param queryDto 公告/资讯列表查询参数
     * @return 公告/资讯列表Vo
     */
    @PostMapping("/notice/getNoticePageList")
    R<NestPage<PmgBatNoticeListVo>> getNoticePageList(@RequestBody PmgBatNoticeQueryDto queryDto);

}
