package com.ycwl.basic.integration.message.client;

import com.ycwl.basic.integration.common.response.CommonResponse;
import com.ycwl.basic.integration.message.dto.ChannelsResponse;
import com.ycwl.basic.integration.message.dto.MessageListData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "zt-message", contextId = "zt-message", path = "")
public interface MessageClient {

    @GetMapping("/messages")
    CommonResponse<MessageListData> listMessages(
            @RequestParam(name = "page", defaultValue = "1") Integer page,
            @RequestParam(name = "pageSize", defaultValue = "20") Integer pageSize,
            @RequestParam(name = "channelId", required = false) String channelId,
            @RequestParam(name = "title", required = false) String title,
            @RequestParam(name = "content", required = false) String content,
            @RequestParam(name = "sendBiz", required = false) String sendBiz,
            @RequestParam(name = "sentAtStart", required = false) String sentAtStart,
            @RequestParam(name = "sentAtEnd", required = false) String sentAtEnd,
            @RequestParam(name = "createdAtStart", required = false) String createdAtStart,
            @RequestParam(name = "createdAtEnd", required = false) String createdAtEnd
    );

    @GetMapping("/channels")
    CommonResponse<ChannelsResponse> listChannels();
}
