package com.zd.system.api.laboratory;

import com.zd.common.core.constant.ServiceNameConstants;
import com.zd.common.core.domain.R;
import com.zd.common.core.web.page.TableDataInfo;
import com.zd.system.api.factory.RemoteMessageContentFallbackFactory;
import com.zd.system.api.laboratory.domain.LabMessageUser;
import com.zd.system.api.laboratory.domain.vo.LabMessageUserListVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 消息内容feign调用服务
 *
 * @Author: zhoupan
 * @Date: 2021/09/06/11:28
 * @Description:
 */
@FeignClient(contextId = "remoteMessageContentService", value = ServiceNameConstants.LABORATORY_SERVICE, fallbackFactory = RemoteMessageContentFallbackFactory.class)
public interface RemoteMessageContentService {


    /**
     * 查询我的消息
     */
    @RequestMapping("/content/my/list")
    public TableDataInfo<LabMessageUserListVO> mylist(@RequestParam("pageNum") Long pageNum, @RequestParam("pageSize") Long pageSize);

    /**
     * 查询我的消息-发送人分组-(只查询管理员消息)
     */
    @RequestMapping("/content/my/group/list")
    public TableDataInfo myGrouplist(@RequestParam("pageNum") Long pageNum, @RequestParam("pageSize") Long pageSize);

    /**
     * 查询我的消息统计数量
     */
    @RequestMapping("/content/my/group/totalCount")
    public R<Object> myGroupTotalCount();


    /**
     * 查询安全准入消息信息
     */
    @RequestMapping("/content/my/group/read/{messageId}")
    public R<Object> myRead(@PathVariable("messageId") Long messageId);

    /**
     * 查询我的消息-发送人分组-分组内消息
     */
    @RequestMapping("/content/my/{id}/group/list")
    public TableDataInfo myGrouplistById(@RequestParam("pageNum") Long pageNum, @RequestParam("pageSize") Long pageSize,@PathVariable("id") Long id);

    /**
     * 查询消息内容
     *
     * @param id
     * @return
     */
    @GetMapping("/content/my/{id}")
    public R<LabMessageUser> message(@PathVariable("id") Long id);

    @PostMapping("/content/readByLoginUser")
    public void readByLoginUser(@RequestBody LabMessageUser labMessageUser);

    @PostMapping("/dynamic/addMessage")
    public R addDynamicMessage( @RequestBody Object obj);
}
