yang_shj
5 months ago
11 changed files with 1 additions and 282 deletions
@ -1,55 +0,0 @@ |
|||||||
package com.hnac.hzims.message.fegin; |
|
||||||
|
|
||||||
import com.hnac.hzims.message.MessageConstants; |
|
||||||
import com.hnac.hzims.message.dto.PushDto; |
|
||||||
import com.hnac.hzims.message.req.PushExtrasReq; |
|
||||||
import com.hnac.hzims.message.req.PushReq; |
|
||||||
import org.springblade.core.tool.api.R; |
|
||||||
import org.springframework.cloud.openfeign.FeignClient; |
|
||||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||||
import org.springframework.web.bind.annotation.RequestParam; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author xiashandong |
|
||||||
* @created 2021/6/25 15:27 |
|
||||||
**/ |
|
||||||
@FeignClient( |
|
||||||
value = MessageConstants.APP_NAME |
|
||||||
) |
|
||||||
public interface IMessagePushClient { |
|
||||||
String API_PREFIX = "/feign/sms"; |
|
||||||
String SEND_MESSAGE_BY_USER_ID = API_PREFIX + "/send-message-by-user-id"; |
|
||||||
String SEND_MESSAGE_BY_TAG = API_PREFIX + "/send-message-by-tag"; |
|
||||||
String SEND_MESSAGE_ALL = API_PREFIX + "/send-message-all"; |
|
||||||
String SEND_MESSAGE = API_PREFIX + "/send-message"; |
|
||||||
|
|
||||||
/** |
|
||||||
* 根据账户ID发送消息 |
|
||||||
* |
|
||||||
* @param userIds 账户ID,多个值用,分隔 |
|
||||||
* @param req |
|
||||||
*/ |
|
||||||
@PostMapping(SEND_MESSAGE_BY_USER_ID) |
|
||||||
void sendMessage(@RequestParam("userIds") String userIds, @RequestBody PushExtrasReq req, @RequestParam("tenantId") String tenantId |
|
||||||
, @RequestParam("createDept") Long createDept,@RequestParam("createUser") Long createUser); |
|
||||||
|
|
||||||
/** |
|
||||||
* 根据标签发送消息 |
|
||||||
* |
|
||||||
* @param tags 标签,多个值用,分隔 |
|
||||||
* @param req |
|
||||||
*/ |
|
||||||
@PostMapping(SEND_MESSAGE_BY_TAG) |
|
||||||
void sendMessage(@RequestParam("tags") String tags, @RequestBody PushReq req); |
|
||||||
|
|
||||||
/** |
|
||||||
* 给所有账户发送消息 |
|
||||||
* |
|
||||||
* @param req |
|
||||||
*/ |
|
||||||
@PostMapping(SEND_MESSAGE_ALL) |
|
||||||
void sendMessage(@RequestBody PushExtrasReq req); |
|
||||||
|
|
||||||
|
|
||||||
} |
|
@ -1,32 +0,0 @@ |
|||||||
package com.hnac.hzims.message.fegin; |
|
||||||
|
|
||||||
|
|
||||||
import com.hnac.hzims.message.MessageConstants; |
|
||||||
import com.hnac.hzims.message.req.SmsReq; |
|
||||||
import org.springframework.cloud.openfeign.FeignClient; |
|
||||||
import org.springframework.stereotype.Component; |
|
||||||
import org.springframework.stereotype.Repository; |
|
||||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||||
|
|
||||||
|
|
||||||
/** |
|
||||||
* @author xiashandong |
|
||||||
* @created 2021/6/25 15:27 |
|
||||||
**/ |
|
||||||
@FeignClient( |
|
||||||
value = MessageConstants.APP_NAME |
|
||||||
) |
|
||||||
public interface IMessageSmsClient { |
|
||||||
String API_PREFIX = "/feign/sms"; |
|
||||||
String SEND_MESSAGE = API_PREFIX + "/send-message"; |
|
||||||
|
|
||||||
/** |
|
||||||
* 发送短信 |
|
||||||
* |
|
||||||
* @param req |
|
||||||
*/ |
|
||||||
@PostMapping(SEND_MESSAGE) |
|
||||||
void sendMessage(@RequestBody SmsReq req); |
|
||||||
|
|
||||||
} |
|
@ -1,54 +0,0 @@ |
|||||||
package com.hnac.hzims.message.fegin; |
|
||||||
|
|
||||||
import com.hnac.hzims.message.MessageConstants; |
|
||||||
import com.hnac.hzims.message.dto.PushDto; |
|
||||||
import com.hnac.hzims.message.req.PushExtrasReq; |
|
||||||
import com.hnac.hzims.message.req.PushReq; |
|
||||||
import com.hnac.hzims.message.req.SmsReq; |
|
||||||
import com.hnac.hzims.message.service.IMessageService; |
|
||||||
import com.hnac.hzims.message.service.PushService; |
|
||||||
import com.hnac.hzims.message.service.impl.SmsMessageServiceImpl; |
|
||||||
import lombok.AllArgsConstructor; |
|
||||||
import org.springblade.core.tool.api.R; |
|
||||||
import org.springblade.core.tool.utils.SpringUtil; |
|
||||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||||
import org.springframework.web.bind.annotation.RequestParam; |
|
||||||
import org.springframework.web.bind.annotation.RestController; |
|
||||||
|
|
||||||
import java.util.Arrays; |
|
||||||
import java.util.List; |
|
||||||
import java.util.stream.Collectors; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author xiashandong |
|
||||||
* @created 2021/6/25 15:44 |
|
||||||
**/ |
|
||||||
@AllArgsConstructor |
|
||||||
@RestController |
|
||||||
public class MessagePushClient implements IMessagePushClient { |
|
||||||
|
|
||||||
private final PushService service; |
|
||||||
|
|
||||||
@Override |
|
||||||
@PostMapping(SEND_MESSAGE_BY_USER_ID) |
|
||||||
public void sendMessage(@RequestParam("userIds") String userIds, @RequestBody PushExtrasReq req |
|
||||||
, @RequestParam("tenantId") String tenantId, @RequestParam("createDept") Long createDept, @RequestParam("createUser") Long createUser) { |
|
||||||
List<String> userIdList = Arrays.stream(userIds.split(",")).collect(Collectors.toSet()).stream().collect(Collectors.toList()); |
|
||||||
//service.sendByUserId(userIdList, req, tenantId, createDept, createUser);
|
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
@PostMapping(SEND_MESSAGE_BY_TAG) |
|
||||||
public void sendMessage(@RequestParam("tags") String tags, @RequestBody PushReq req) { |
|
||||||
List<String> tagList = Arrays.stream(tags.split(",")).collect(Collectors.toSet()).stream().collect(Collectors.toList()); |
|
||||||
//service.sendByTags(tagList, req);
|
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
@PostMapping(SEND_MESSAGE_ALL) |
|
||||||
public void sendMessage(@RequestBody PushExtrasReq req) { |
|
||||||
service.sendAll(req); |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
@ -1,24 +0,0 @@ |
|||||||
package com.hnac.hzims.message.fegin; |
|
||||||
|
|
||||||
import com.hnac.hzims.message.req.SmsReq; |
|
||||||
import com.hnac.hzims.message.service.SmsService; |
|
||||||
import lombok.AllArgsConstructor; |
|
||||||
import org.springframework.web.bind.annotation.PostMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestBody; |
|
||||||
import org.springframework.web.bind.annotation.RestController; |
|
||||||
|
|
||||||
/** |
|
||||||
* @author xiashandong |
|
||||||
* @created 2021/6/25 15:29 |
|
||||||
**/ |
|
||||||
@AllArgsConstructor |
|
||||||
@RestController |
|
||||||
public class MessageSmsClient implements IMessageSmsClient { |
|
||||||
private final SmsService service; |
|
||||||
|
|
||||||
@Override |
|
||||||
@PostMapping(SEND_MESSAGE) |
|
||||||
public void sendMessage(@RequestBody SmsReq req) { |
|
||||||
service.sendMessage(req); |
|
||||||
} |
|
||||||
} |
|
Loading…
Reference in new issue