parent
1a683d216d
commit
c3ad285992
@ -0,0 +1,40 @@
|
|||||||
|
package com.mashibing.api.service.sendCheck;
|
||||||
|
|
||||||
|
import com.mashibing.api.pojo.SingleSendRequest;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.cloud.context.config.annotation.RefreshScope;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author heqijun
|
||||||
|
* @ClassName: SendCheckContext
|
||||||
|
* @Description: TODO(这里用一句话描述这个类的作用)
|
||||||
|
* @date 2025/6/4 20:19
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Component
|
||||||
|
@RefreshScope
|
||||||
|
public class SendCheckContext {
|
||||||
|
|
||||||
|
//Spring的IoC容器会把所有管理的bean方到一个map里
|
||||||
|
//可以指定bean的类型获取到bean的map集合
|
||||||
|
@Autowired
|
||||||
|
Map<String, SendCheckService> sendCheckServiceMap;
|
||||||
|
|
||||||
|
// 从配置中心获取到的校验项目和顺序
|
||||||
|
@Value("${filters}")
|
||||||
|
private String[] filters;
|
||||||
|
|
||||||
|
public void check(SingleSendRequest request) {
|
||||||
|
for (String filter : filters) {
|
||||||
|
SendCheckService check = sendCheckServiceMap.get(filter);
|
||||||
|
if (check != null) {
|
||||||
|
check.check(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.mashibing.api.service.sendCheck;
|
||||||
|
|
||||||
|
import com.mashibing.api.pojo.SingleSendRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author heqijun
|
||||||
|
* @ClassName: SendCheckService
|
||||||
|
* @Description: 短信发送校验父接口
|
||||||
|
* @date 2025/6/4 19:29
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface SendCheckService {
|
||||||
|
|
||||||
|
void check(SingleSendRequest request);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.mashibing.api.service.sendCheck.impl;
|
||||||
|
|
||||||
|
import com.mashibing.api.pojo.SingleSendRequest;
|
||||||
|
import com.mashibing.api.service.sendCheck.SendCheckService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author heqijun
|
||||||
|
* @ClassName: ApikeyServiceImpl
|
||||||
|
* @Description: 发送短信Apikey校验
|
||||||
|
* @date 2025/6/4 19:30
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("ApikeySendCheck")
|
||||||
|
public class ApikeySendCheckServiceImpl implements SendCheckService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void check(SingleSendRequest request) {
|
||||||
|
log.info("Check apikey...");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.mashibing.api.service.sendCheck.impl;
|
||||||
|
|
||||||
|
import com.mashibing.api.pojo.SingleSendRequest;
|
||||||
|
import com.mashibing.api.service.sendCheck.SendCheckService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author heqijun
|
||||||
|
* @ClassName: FeeSendCheckServiceImpl
|
||||||
|
* @Description: 发送短信客户余额费用校验
|
||||||
|
* @date 2025/6/4 19:37
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("FeeSendCheck")
|
||||||
|
public class FeeSendCheckServiceImpl implements SendCheckService {
|
||||||
|
@Override
|
||||||
|
public void check(SingleSendRequest request) {
|
||||||
|
log.info("Check Fee Send Check");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.mashibing.api.service.sendCheck.impl;
|
||||||
|
|
||||||
|
import com.mashibing.api.pojo.SingleSendRequest;
|
||||||
|
import com.mashibing.api.service.sendCheck.SendCheckService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author heqijun
|
||||||
|
* @ClassName: IpSendCheckServiceImpl
|
||||||
|
* @Description: 发送短信客户端ip地址校验
|
||||||
|
* @date 2025/6/4 19:34
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("IpSendCheck")
|
||||||
|
public class IpSendCheckServiceImpl implements SendCheckService {
|
||||||
|
@Override
|
||||||
|
public void check(SingleSendRequest request) {
|
||||||
|
log.info("Check IpSendCheck");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.mashibing.api.service.sendCheck.impl;
|
||||||
|
|
||||||
|
import com.mashibing.api.pojo.SingleSendRequest;
|
||||||
|
import com.mashibing.api.service.sendCheck.SendCheckService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author heqijun
|
||||||
|
* @ClassName: MobileSendCheckServiceImpl
|
||||||
|
* @Description: 发送短信目标手机号校验
|
||||||
|
* @date 2025/6/4 19:36
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("MobileSendCheck")
|
||||||
|
public class MobileSendCheckServiceImpl implements SendCheckService {
|
||||||
|
@Override
|
||||||
|
public void check(SingleSendRequest request) {
|
||||||
|
log.info("Check mobile send check");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.mashibing.api.service.sendCheck.impl;
|
||||||
|
|
||||||
|
import com.mashibing.api.pojo.SingleSendRequest;
|
||||||
|
import com.mashibing.api.service.sendCheck.SendCheckService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author heqijun
|
||||||
|
* @ClassName: SignSendCheckServiceImpl
|
||||||
|
* @Description: 发送短信客户签名校验
|
||||||
|
* @date 2025/6/4 19:34
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("SignSendCheck")
|
||||||
|
public class SignSendCheckServiceImpl implements SendCheckService {
|
||||||
|
@Override
|
||||||
|
public void check(SingleSendRequest request) {
|
||||||
|
log.info("Check SignSendCheck");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.mashibing.api.service.sendCheck.impl;
|
||||||
|
|
||||||
|
import com.mashibing.api.pojo.SingleSendRequest;
|
||||||
|
import com.mashibing.api.service.sendCheck.SendCheckService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author heqijun
|
||||||
|
* @ClassName: TemplateSendCheckServiceImpl
|
||||||
|
* @Description: 发送短信短信模板校验
|
||||||
|
* @date 2025/6/4 19:35
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service("TemplateSendCheck")
|
||||||
|
public class TemplateSendCheckServiceImpl implements SendCheckService {
|
||||||
|
@Override
|
||||||
|
public void check(SingleSendRequest request) {
|
||||||
|
log.info("Check TemplateSendCheckServiceImpl");
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue