package com.house365.service.interfaces;

import com.house365.beans.dto.MessageDTO;
import com.house365.service.impl.MessageClientHystrix;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Date: 2016/12/30</p>
 *
 * @author XN
 * @version 1.0
 */
@FeignClient(value = "wechat-service", fallback = MessageClientHystrix.class)
public interface MessageClient {

    @RequestMapping(value = "message/sendText", method = RequestMethod.POST)
    String sendText(
        @RequestParam(value = "corpId") String corpId, @RequestParam(value = "secret") String secret, MessageDTO message
    );

    @RequestMapping(value = "message/sendCardText", method = RequestMethod.POST)
    String sendCardText(
            @RequestParam(value = "corpId") String corpId, @RequestParam(value = "secret") String secret, MessageDTO message
    );

}
