6 changed files with 125 additions and 0 deletions
@ -0,0 +1,35 @@ |
|||
package com.elink.esua.epdc.async; |
|||
|
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.feign.MessageFeignClient; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.scheduling.annotation.Async; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* |
|||
* 内容审核-违规 - 发送短信 |
|||
* |
|||
* @Author:wangtong |
|||
* @Date:2020/7/16 10:31 |
|||
*/ |
|||
@Component |
|||
public class RejectCheckResultsTask { |
|||
|
|||
@Autowired |
|||
private MessageFeignClient messageFeignClient; |
|||
|
|||
/** |
|||
* @describe: 短信通知 |
|||
* @author wangtong |
|||
* @date 2020/7/16 9:49 |
|||
* @params [smsNoticeFormDTO] |
|||
* @return void |
|||
*/ |
|||
@Async |
|||
public void sendSmsNotice(SmsNoticeFormDTO smsNoticeFormDTO) { |
|||
messageFeignClient.sendSmsNotice(smsNoticeFormDTO); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.elink.esua.epdc.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.feign.fallback.MessageFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
|
|||
/** |
|||
* 消息通知模块 |
|||
* |
|||
* @Author:wangtong |
|||
* @Date:2020/7/16 10:31 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_MESSAGE_SERVER, fallback = MessageFeignClientFallback.class) |
|||
public interface MessageFeignClient { |
|||
|
|||
/** |
|||
* 议题:待回应事件 审核结果短信通知 议题发起人 |
|||
* |
|||
* @param smsNoticeFormDTO |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* @author zy |
|||
* @Date:2020/01/08 10:31 |
|||
*/ |
|||
@PostMapping(value = "message/epdc-app/smstemplate/sendSmsNotice", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) |
|||
Result sendSmsNotice(@RequestBody SmsNoticeFormDTO smsNoticeFormDTO); |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.elink.esua.epdc.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.form.SmsNoticeFormDTO; |
|||
import com.elink.esua.epdc.feign.MessageFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author:wangtong |
|||
* @Date:2020/7/16 10:31 |
|||
*/ |
|||
@Component |
|||
public class MessageFeignClientFallback implements MessageFeignClient { |
|||
|
|||
@Override |
|||
public Result sendSmsNotice(SmsNoticeFormDTO smsNoticeFormDTO) { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_MESSAGE_SERVER, "sendSmsNotice", smsNoticeFormDTO); |
|||
} |
|||
} |
Loading…
Reference in new issue