Commit 35c1f910 authored by qinxunjia's avatar qinxunjia

短信插件优化

parent 6cd1184e
...@@ -18,7 +18,7 @@ public class BgyApi { ...@@ -18,7 +18,7 @@ public class BgyApi {
@PostMapping("/notify") @PostMapping("/notify")
public String notify(@RequestParam CLNotifyRequest notifyInfo) { public String notify(@RequestParam CLNotifyRequest notifyInfo) {
log.info("创蓝异步通知接口入参:{}", JSONObject.toJSONString(notifyInfo)); log.info("碧桂园异步通知接口入参:{}", JSONObject.toJSONString(notifyInfo));
String response = "success"; String response = "success";
try { try {
// bgySmsService.asyncNotify(notifyInfo); // bgySmsService.asyncNotify(notifyInfo);
...@@ -26,7 +26,7 @@ public class BgyApi { ...@@ -26,7 +26,7 @@ public class BgyApi {
log.error("处理创建模板异步通知异常:", e); log.error("处理创建模板异步通知异常:", e);
response = "fail"; response = "fail";
} }
log.info("创蓝异步通知接口出参:{}", response); log.info("碧桂园异步通知接口出参:{}", response);
return response; return response;
} }
...@@ -40,7 +40,7 @@ public class BgyApi { ...@@ -40,7 +40,7 @@ public class BgyApi {
log.error("处理回执逻辑异常:", e); log.error("处理回执逻辑异常:", e);
response = "fail"; response = "fail";
} }
log.info("创蓝异步通知接口出参:{}", response); log.info("碧桂园异步通知接口出参:{}", response);
return response; return response;
} }
......
...@@ -73,7 +73,7 @@ public class DmHubApi { ...@@ -73,7 +73,7 @@ public class DmHubApi {
log.error("发送批量短信异常", e); log.error("发送批量短信异常", e);
response = new DmHubResponse(ResponseCode.SYSTEM_ERROR); response = new DmHubResponse(ResponseCode.SYSTEM_ERROR);
} }
log.info("**********批量发送出参*******:{}", response); log.info("**********批量发送出参*******:{}", JSONObject.toJSONString(response));
return response; return response;
} }
......
...@@ -14,10 +14,8 @@ public class BgySMSConfig { ...@@ -14,10 +14,8 @@ public class BgySMSConfig {
public static String securityCode; public static String securityCode;
// 请求地址 // 请求地址
public static String url; public static String url;
// 通知类项目楼盘ID // 项目楼盘ID
public static String notifyAreaId; public static String areaId;
// 营销类项目楼盘ID
public static String marketAreaId;
// api // api
public static String api; public static String api;
...@@ -37,14 +35,9 @@ public class BgySMSConfig { ...@@ -37,14 +35,9 @@ public class BgySMSConfig {
BgySMSConfig.url = url; BgySMSConfig.url = url;
} }
@Value("${system.config.bgy.notifyAreaId}") @Value("${system.config.bgy.areaId}")
public void setNotifyAreaId(String notifyAreaId) { public void setAreaId(String areaId) {
BgySMSConfig.notifyAreaId = notifyAreaId; BgySMSConfig.areaId = areaId;
}
@Value("${system.config.bgy.marketAreaId}")
public void setMarketAreaId(String marketAreaId) {
BgySMSConfig.marketAreaId = marketAreaId;
} }
@Value("${system.config.bgy.api}") @Value("${system.config.bgy.api}")
......
...@@ -10,11 +10,11 @@ public enum ContentEnum { ...@@ -10,11 +10,11 @@ public enum ContentEnum {
SMS_TYPE_MARKETING("marketing", "营销类短信标识"), SMS_TYPE_MARKETING("marketing", "营销类短信标识"),
SMS_STATUS_SUCCESS("DELIVRD", "创蓝短信发送状态--成功"), SMS_STATUS_SUCCESS("DELIVRD", "碧桂园短信发送状态--成功"),
SMS_STATUS_UNKNOWN("UNKNOWN", "创蓝短信发送状态--未知"), SMS_STATUS_UNKNOWN("UNKNOWN", "碧桂园短信发送状态--未知"),
SMS_STATUS_REFUSE("REJECTD", "创蓝短信发送状态--短信中心拒绝"), SMS_STATUS_REFUSE("REJECTD", "碧桂园短信发送状态--短信中心拒绝"),
SMS_STATUS_MBBLACK("MBBLACK", "创蓝短信发送状态--黑名单号码"), SMS_STATUS_MBBLACK("MBBLACK", "碧桂园短信发送状态--黑名单号码"),
SMS_STATUS_REJECT("REJECT", "创蓝短信发送状态--驳回"); SMS_STATUS_REJECT("REJECT", "碧桂园短信发送状态--驳回");
private final String value; private final String value;
......
package com.bgy.sms.channel.bgy.dto;
import java.io.Serializable;
public class CLSendFixedRequest implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 创蓝API账号,必填
*/
private String account;
/**
* 创蓝API密码,必填
*/
private String password;
/**
* 短信内容。长度不能超过536个字符,必填
*/
private String msg;
/**
* 机号码。多个手机号码使用英文逗号分隔,必填
*/
private String phone;
/**
* 定时发送短信时间。格式为yyyyMMddHHmm,值小于或等于当前时间则立即发送,默认立即发送,选填
*/
private String sendtime;
/**
* 是否需要状态报告(默认false),选填
*/
private String report;
/**
* 下发短信号码扩展码,纯数字,建议1-3位,选填
*/
private String extend;
/**
* 该条短信在您业务系统内的ID,如订单号或者短信发送记录流水号,选填
*/
private String uid;
public CLSendFixedRequest() {
}
public CLSendFixedRequest(String account, String password, String msg, String phone) {
super();
this.account = account;
this.password = password;
this.msg = msg;
this.phone = phone;
}
public CLSendFixedRequest(String account, String password, String msg, String phone, String report) {
super();
this.account = account;
this.password = password;
this.msg = msg;
this.phone = phone;
this.report = report;
}
public CLSendFixedRequest(String account, String password, String msg, String phone, String report, String uid) {
super();
this.account = account;
this.password = password;
this.msg = msg;
this.phone = phone;
this.report = report;
this.uid = uid;
}
public CLSendFixedRequest(String account, String password, String msg, String phone, String sendtime, String report, String uid) {
super();
this.account = account;
this.password = password;
this.msg = msg;
this.phone = phone;
this.sendtime = sendtime;
this.report = report;
this.uid = uid;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getSendtime() {
return sendtime;
}
public void setSendtime(String sendtime) {
this.sendtime = sendtime;
}
public String getReport() {
return report;
}
public void setReport(String report) {
this.report = report;
}
public String getExtend() {
return extend;
}
public void setExtend(String extend) {
this.extend = extend;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
}
package com.bgy.sms.channel.bgy.dto;
import java.io.Serializable;
public class CLSendVariableRequest implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 创蓝API账号,必填
*/
private String account;
/**
* 创蓝API密码,必填
*/
private String password;
/**
* 短信内容。长度不能超过536个字符,必填
*/
private String msg;
/**
* 手机号码和变量参数,多组参数使用英文分号;区分,必填
*/
private String params;
/**
* 定时发送短信时间。格式为yyyyMMddHHmm,值小于或等于当前时间则立即发送,默认立即发送,选填
*/
private String sendtime;
/**
* 是否需要状态报告(默认false),选填
*/
private String report;
/**
* 下发短信号码扩展码,纯数字,建议1-3位,选填
*/
private String extend;
/**
* 该条短信在您业务系统内的ID,如订单号或者短信发送记录流水号,选填
*/
private String uid;
public CLSendVariableRequest() {
}
public CLSendVariableRequest(String account, String password, String msg, String params) {
super();
this.account = account;
this.password = password;
this.msg = msg;
this.params = params;
}
public CLSendVariableRequest(String account, String password, String msg, String params, String report) {
super();
this.account = account;
this.password = password;
this.msg = msg;
this.params = params;
this.report = report;
}
public CLSendVariableRequest(String account, String password, String msg, String params, String report,String uid) {
super();
this.account = account;
this.password = password;
this.msg = msg;
this.params = params;
this.report = report;
this.uid = uid;
}
// public SmsVarableRequest(String account, String password, String msg, String params, String sendtime) {
// super();
// this.account = account;
// this.password = password;
// this.msg = msg;
// this.params = params;
// this.sendtime = sendtime;
// }
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getSendtime() {
return sendtime;
}
public void setSendtime(String sendtime) {
this.sendtime = sendtime;
}
public String getReport() {
return report;
}
public void setReport(String report) {
this.report = report;
}
public String getExtend() {
return extend;
}
public void setExtend(String extend) {
this.extend = extend;
}
public String getUid() {
return uid;
}
public void setUid(String uid) {
this.uid = uid;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}
...@@ -6,7 +6,7 @@ public interface BgySmsService { ...@@ -6,7 +6,7 @@ public interface BgySmsService {
CLBizResponse sendSms(String mobile, String content,String areaId) throws Exception; CLBizResponse sendSms(String mobile, String content) throws Exception;
} }
...@@ -30,8 +30,8 @@ public class BgySmsServiceImpl implements BgySmsService { ...@@ -30,8 +30,8 @@ public class BgySmsServiceImpl implements BgySmsService {
private static final String retMsg = "msg"; // 响应描述 private static final String retMsg = "msg"; // 响应描述
private static final String createTemplateData = "data"; // 创建模板响应数据 private static final String createTemplateData = "data"; // 创建模板响应数据
private static final String notificationId = "49"; // 创蓝通知类短信ID private static final String notificationId = "49"; // 碧桂园通知类短信ID
private static final String marketingId = "52"; // 创蓝营销类短信ID private static final String marketingId = "52"; // 碧桂园营销类短信ID
@Autowired @Autowired
private SmsTemplateService templateService; private SmsTemplateService templateService;
...@@ -39,8 +39,10 @@ public class BgySmsServiceImpl implements BgySmsService { ...@@ -39,8 +39,10 @@ public class BgySmsServiceImpl implements BgySmsService {
private DmHubService dmHubService; private DmHubService dmHubService;
@Override @Override
public CLBizResponse sendSms(String mobile, String content, String areaId) throws Exception { public CLBizResponse sendSms(String mobile, String content) throws Exception {
log.info("进入碧桂园短信发送接口");
String appId = BgySMSConfig.appId; String appId = BgySMSConfig.appId;
String areaId = BgySMSConfig.areaId;
String securityCode = BgySMSConfig.securityCode; String securityCode = BgySMSConfig.securityCode;
String url = BgySMSConfig.url; String url = BgySMSConfig.url;
String api = BgySMSConfig.api; String api = BgySMSConfig.api;
...@@ -51,7 +53,9 @@ public class BgySmsServiceImpl implements BgySmsService { ...@@ -51,7 +53,9 @@ public class BgySmsServiceImpl implements BgySmsService {
requestParams.put("areaId", areaId); requestParams.put("areaId", areaId);
requestParams.put("content", content); requestParams.put("content", content);
requestParams.put("mobile", mobile); requestParams.put("mobile", mobile);
log.info("碧桂园短信接口参数:{}", requestParams);
String retStr = SendSmsUtil.sendSmsByPost(url, JSONObject.toJSONString(requestParams)); String retStr = SendSmsUtil.sendSmsByPost(url, JSONObject.toJSONString(requestParams));
log.info("碧桂园短信接口返回信息:{}", retStr);
if (retStr == null) { if (retStr == null) {
return new CLBizResponse(ResponseCode.UPSTREAM_BLANK); return new CLBizResponse(ResponseCode.UPSTREAM_BLANK);
} }
...@@ -59,8 +63,10 @@ public class BgySmsServiceImpl implements BgySmsService { ...@@ -59,8 +63,10 @@ public class BgySmsServiceImpl implements BgySmsService {
String err = retJson.getString("err"); String err = retJson.getString("err");
String retPack = retJson.getString("package"); String retPack = retJson.getString("package");
String retCode = retJson.getString("ret"); String retCode = retJson.getString("ret");
if (!sendSuccessCode.equals(retCode)) { if (!sendSuccessCode.equals(retCode)) {
if (err.contains("成功")) {
return new CLBizResponse(ResponseCode.SUCCESS);
}
return new CLBizResponse(ResponseCode.UPSTREAM_FAIL.getCode(), err); return new CLBizResponse(ResponseCode.UPSTREAM_FAIL.getCode(), err);
} else { } else {
return new CLBizResponse(ResponseCode.SUCCESS); return new CLBizResponse(ResponseCode.SUCCESS);
......
...@@ -20,7 +20,6 @@ public class DmHubResponse implements Serializable { ...@@ -20,7 +20,6 @@ public class DmHubResponse implements Serializable {
error = new JSONObject(); error = new JSONObject();
error.put("errorCode", code); error.put("errorCode", code);
error.put("message", msg); error.put("message", msg);
this.code = code;
} }
public DmHubResponse(ResponseCode responseCode) { public DmHubResponse(ResponseCode responseCode) {
......
...@@ -5,10 +5,10 @@ import com.alibaba.fastjson.JSONArray; ...@@ -5,10 +5,10 @@ import com.alibaba.fastjson.JSONArray;
public class TemplateChangeBean { public class TemplateChangeBean {
// 创蓝发送短信时需要用的模板内容 // 碧桂园发送短信时需要用的模板内容
private String upSendStr; private String upSendStr;
// 创蓝创建短信模板需要的模板内容 // 碧桂园创建短信模板需要的模板内容
private String upCreateStr; private String upCreateStr;
private JSONArray params; private JSONArray params;
......
...@@ -63,7 +63,7 @@ public class MessageServiceImpl implements MessageService { ...@@ -63,7 +63,7 @@ public class MessageServiceImpl implements MessageService {
String templateId = requestDTO.getTemplateId(); String templateId = requestDTO.getTemplateId();
String templateName = requestDTO.getTemplateName(); String templateName = requestDTO.getTemplateName();
// 替换模板格式,保存适合创蓝发送短信的模板,避免发送时修改模板格式 // 替换模板格式,保存适合碧桂园发送短信的模板,避免发送时修改模板格式
TemplateChangeBean bean = dmHub2BgyTemplateSend(templateContent); TemplateChangeBean bean = dmHub2BgyTemplateSend(templateContent);
String chuanglanSend = bean.getUpSendStr(); String chuanglanSend = bean.getUpSendStr();
String params = bean.getParams().toString(); String params = bean.getParams().toString();
...@@ -194,14 +194,6 @@ public class MessageServiceImpl implements MessageService { ...@@ -194,14 +194,6 @@ public class MessageServiceImpl implements MessageService {
String params = templateInfo.getParams(); String params = templateInfo.getParams();
JSONArray paramsArr = JSONArray.parseArray(params); JSONArray paramsArr = JSONArray.parseArray(params);
String smsType = templateInfo.getType(); String smsType = templateInfo.getType();
String areaId;
if ("notification".equals(smsType)) {
areaId = BgySMSConfig.notifyAreaId;
} else if ("marketing".equals(smsType)) {
areaId = BgySMSConfig.marketAreaId;
} else {
return new DmHubResponse("999", "未获取到短信类型");
}
// 封装参数 // 封装参数
List<String> paramList = new ArrayList<>(); List<String> paramList = new ArrayList<>();
Set<String> keys = data.keySet(); Set<String> keys = data.keySet();
...@@ -252,11 +244,14 @@ public class MessageServiceImpl implements MessageService { ...@@ -252,11 +244,14 @@ public class MessageServiceImpl implements MessageService {
String upContent = templateInfo.getUpContent(); String upContent = templateInfo.getUpContent();
content = getMsg(upContent, paramList); content = getMsg(upContent, paramList);
} }
response = bgySmsService.sendSms(mobile, content, areaId); response = bgySmsService.sendSms(mobile, content);
String code = response.getCode(); String code = response.getCode();
String msg = response.getMsg(); if (code.equals(ResponseCode.SUCCESS.getCode())) {
// TODO 根据DM hub需要的返回数据封装 return new DmHubResponse(ResponseCode.SUCCESS);
return new DmHubResponse(ResponseCode.SUCCESS); } else {
return new DmHubResponse(code, response.getMsg());
}
} catch (Exception e) { } catch (Exception e) {
log.error("调用短信发送逻辑错误", e); log.error("调用短信发送逻辑错误", e);
return new DmHubResponse("999", "插件系统异常"); return new DmHubResponse("999", "插件系统异常");
...@@ -265,18 +260,23 @@ public class MessageServiceImpl implements MessageService { ...@@ -265,18 +260,23 @@ public class MessageServiceImpl implements MessageService {
@Override @Override
public DmHubResponse sendCode(DmHubCodeRequest params) { public DmHubResponse sendCode(DmHubCodeRequest params) {
String notifyAreaId = BgySMSConfig.notifyAreaId;
String mobile = params.getMobile(); String mobile = params.getMobile();
String code = params.getCode(); String code = params.getCode();
CLBizResponse response = new CLBizResponse(); CLBizResponse response = new CLBizResponse();
String content = "您的验证码是:" + code; String content = "您的验证码是:" + code;
try { try {
bgySmsService.sendSms(mobile, content, notifyAreaId); response = bgySmsService.sendSms(mobile, content);
String retCode = response.getCode();
if (retCode.equals(ResponseCode.SUCCESS.getCode())) {
return new DmHubResponse(ResponseCode.SUCCESS);
} else {
return new DmHubResponse(retCode, response.getMsg());
}
} catch (Exception e) { } catch (Exception e) {
log.error("发送短信异常:", e); log.error("发送短信异常:", e);
return new DmHubResponse("999", "发送通道异常");
} }
return new DmHubResponse(ResponseCode.SUCCESS);
} }
/** /**
...@@ -371,7 +371,6 @@ public class MessageServiceImpl implements MessageService { ...@@ -371,7 +371,6 @@ public class MessageServiceImpl implements MessageService {
if (paramsArr == null || paramsArr.isEmpty()) { if (paramsArr == null || paramsArr.isEmpty()) {
try { try {
// response = bgySmsService.sendSms("", templateInfo.getUpContent());
String code = response.getCode(); String code = response.getCode();
String msg = response.getMsg(); String msg = response.getMsg();
// TODO 根据DM hub需要的返回数据封装 // TODO 根据DM hub需要的返回数据封装
...@@ -381,7 +380,7 @@ public class MessageServiceImpl implements MessageService { ...@@ -381,7 +380,7 @@ public class MessageServiceImpl implements MessageService {
return new DmHubResponse(code, msg); return new DmHubResponse(code, msg);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("调用创蓝逻辑错误", e); log.error("调用碧桂园逻辑错误", e);
// TODO 根据DM hub需要的返回数据封装 // TODO 根据DM hub需要的返回数据封装
return new DmHubResponse(ResponseCode.SYSTEM_ERROR); return new DmHubResponse(ResponseCode.SYSTEM_ERROR);
} }
...@@ -390,18 +389,15 @@ public class MessageServiceImpl implements MessageService { ...@@ -390,18 +389,15 @@ public class MessageServiceImpl implements MessageService {
Set<Map.Entry<String, List<String>>> entries = paramsMap.entrySet(); Set<Map.Entry<String, List<String>>> entries = paramsMap.entrySet();
try { try {
// 此处不做拆分操作 // 此处不做拆分操作
// for (Map.Entry<String, List<String>> entry : entries) { for (Map.Entry<String, List<String>> entry : entries) {
// String mobile = entry.getKey().toString(); String mobile = entry.getKey().toString();
// List<String> paramsList = entry.getValue(); List<String> paramsList = entry.getValue();
// String sendMsg = getMsg(templateInfo.getUpContent(), paramsList); String sendMsg = getMsg(templateInfo.getUpContent(), paramsList);
// response = bgySmsService.sendSms(mobile, sendMsg); response = bgySmsService.sendSms(mobile, sendMsg);
// String code = response.getCode(); }
// String msg = response.getMsg();
// }
// TODO 待优化
return new DmHubResponse(ResponseCode.SUCCESS); return new DmHubResponse(ResponseCode.SUCCESS);
} catch (Exception e) { } catch (Exception e) {
log.error("调用创蓝逻辑错误:", e); log.error("调用碧桂园逻辑错误:", e);
return new DmHubResponse(ResponseCode.SYSTEM_ERROR); return new DmHubResponse(ResponseCode.SYSTEM_ERROR);
} }
} }
...@@ -419,14 +415,6 @@ public class MessageServiceImpl implements MessageService { ...@@ -419,14 +415,6 @@ public class MessageServiceImpl implements MessageService {
return new DmHubResponse("999", "短信插件未获取到模板信息"); return new DmHubResponse("999", "短信插件未获取到模板信息");
} }
String smsType = templateInfo.getType(); String smsType = templateInfo.getType();
String areaId;
if ("notification".equals(smsType)) {
areaId = BgySMSConfig.notifyAreaId;
} else if ("marketing".equals(smsType)) {
areaId = BgySMSConfig.marketAreaId;
} else {
return new DmHubResponse("999", "未获取到短信类型");
}
// 模板参数占位符 // 模板参数占位符
String params = templateInfo.getParams(); String params = templateInfo.getParams();
JSONArray paramsArr = JSONArray.parseArray(params); JSONArray paramsArr = JSONArray.parseArray(params);
...@@ -496,13 +484,13 @@ public class MessageServiceImpl implements MessageService { ...@@ -496,13 +484,13 @@ public class MessageServiceImpl implements MessageService {
try { try {
for (String mobile : mobileList) { for (String mobile : mobileList) {
try { try {
response = bgySmsService.sendSms(mobile, templateInfo.getUpContent(), areaId); response = bgySmsService.sendSms(mobile, templateInfo.getUpContent());
} catch (Exception e) { } catch (Exception e) {
log.error("除0"); log.error("短信发送异常", e);
} }
} }
} catch (Exception e) { } catch (Exception e) {
log.error("调用创蓝逻辑错误", e); log.error("调用碧桂园逻辑错误", e);
// TODO 根据DM hub需要的返回数据封装 // TODO 根据DM hub需要的返回数据封装
return new DmHubResponse("999", "插件服务系统异常"); return new DmHubResponse("999", "插件服务系统异常");
} }
...@@ -515,7 +503,7 @@ public class MessageServiceImpl implements MessageService { ...@@ -515,7 +503,7 @@ public class MessageServiceImpl implements MessageService {
String mobile = entry.getKey().toString(); String mobile = entry.getKey().toString();
List<String> paramsList = entry.getValue(); List<String> paramsList = entry.getValue();
String sendMsg = getMsg(templateInfo.getUpContent(), paramsList); String sendMsg = getMsg(templateInfo.getUpContent(), paramsList);
response = bgySmsService.sendSms(mobile, sendMsg, areaId); response = bgySmsService.sendSms(mobile, sendMsg);
String code = response.getCode(); String code = response.getCode();
String msg = response.getMsg(); String msg = response.getMsg();
} catch (Exception e) { } catch (Exception e) {
...@@ -526,7 +514,7 @@ public class MessageServiceImpl implements MessageService { ...@@ -526,7 +514,7 @@ public class MessageServiceImpl implements MessageService {
// TODO 待优化 // TODO 待优化
return new DmHubResponse(ResponseCode.SUCCESS); return new DmHubResponse(ResponseCode.SUCCESS);
} catch (Exception e) { } catch (Exception e) {
log.error("调用创蓝逻辑错误:", e); log.error("调用碧桂园逻辑错误:", e);
return new DmHubResponse("999", "插件服务系统异常"); return new DmHubResponse("999", "插件服务系统异常");
} }
} }
......
...@@ -33,8 +33,7 @@ system: ...@@ -33,8 +33,7 @@ system:
appId: 2021 # 系统id appId: 2021 # 系统id
securityCode: 930844c7-7985-435b-af47-142b59b299c3 # 鉴权码 securityCode: 930844c7-7985-435b-af47-142b59b299c3 # 鉴权码
url: https://xstest.bgy.com.cn/ApiBgyTest/Open/Sms.ashx url: https://xstest.bgy.com.cn/ApiBgyTest/Open/Sms.ashx
notifyAreaId: XXJSB areaId: XXJSB
marketAreaId: XXJSB
api: SendSms api: SendSms
dmHub: dmHub:
applicationId: cl0300171a6012c21 applicationId: cl0300171a6012c21
......
...@@ -34,8 +34,7 @@ system: ...@@ -34,8 +34,7 @@ system:
appId: 2021 # 系统id appId: 2021 # 系统id
securityCode: 930844c7-7985-435b-af47-142b59b299c3 # 鉴权码 securityCode: 930844c7-7985-435b-af47-142b59b299c3 # 鉴权码
url: https://xstest.bgy.com.cn/ApiBgyTest/Open/Sms.ashx url: https://xstest.bgy.com.cn/ApiBgyTest/Open/Sms.ashx
notifyAreaId: XXJSB areaId: XXJSB
marketAreaId: XXJSB
api: SendSms api: SendSms
dmHub: dmHub:
applicationId: cl0300171a6012c21 applicationId: cl0300171a6012c21
......
...@@ -34,8 +34,6 @@ system: ...@@ -34,8 +34,6 @@ system:
securityCode: 930844c7-7985-435b-af47-142b59b299c3 # 鉴权码 securityCode: 930844c7-7985-435b-af47-142b59b299c3 # 鉴权码
url: https://xstest.bgy.com.cn/ApiBgyTest/Open/Sms.ashx url: https://xstest.bgy.com.cn/ApiBgyTest/Open/Sms.ashx
areaId: XXJSB areaId: XXJSB
notifyAreaId: XXJSB
marketAreaId: XXJSB
api: SendSms api: SendSms
dmHub: dmHub:
applicationId: cl0300171a6012c21 applicationId: cl0300171a6012c21
......
...@@ -8,7 +8,7 @@ info: ...@@ -8,7 +8,7 @@ info:
spring: spring:
profiles: profiles:
active: test active: dev
mybatis-plus: mybatis-plus:
mapper-locations: classpath:mapper/*.xml mapper-locations: classpath:mapper/*.xml
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" /> <!--定义日志文件的存储地址 -->
<include resource="org/springframework/boot/logging/logback/console-appender.xml" /> <property name="LOG_PATH" value="/opt/log/stash/sms-plug"/>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${LOG_PATH}</File> <File>${LOG_PATH}/smsplug.log</File>
<encoder> <encoder>
<pattern>%date [%level] [%thread] %logger{60} [%file : %line] %msg%n</pattern> <pattern>%date [%level] [%thread] %logger{60} [%file : %line] %msg%n</pattern>
</encoder> </encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_PATH}daily/${LOG_FILE}.%d{yyyy-MM-dd}.gz</fileNamePattern> <fileNamePattern>${LOG_PATH}daily/sms-plug.%d{yyyy-MM-dd}.gz</fileNamePattern>
<maxHistory>180</maxHistory> <!-- 保留180天 --> <maxHistory>30</maxHistory> <!-- 保留180天 -->
</rollingPolicy> </rollingPolicy>
</appender> </appender>
...@@ -21,13 +23,13 @@ ...@@ -21,13 +23,13 @@
</root> </root>
<!-- 开发、测试环境 --> <!-- 开发、测试环境 -->
<springProfile name="dev,test"> <springProfile name="dev,test">
<logger name="org.springboot.sample" level="DEBUG" /> <logger name="org.springboot.sample" level="DEBUG"/>
<logger name="com.bgy" level="DEBUG" /> <logger name="com.bgy" level="DEBUG"/>
</springProfile> </springProfile>
<!-- 生产环境 --> <!-- 生产环境 -->
<springProfile name="prod"> <springProfile name="prod">
<logger name="org.springframework.web" level="ERROR"/> <logger name="org.springframework.web" level="ERROR"/>
<logger name="org.springboot.sample" level="ERROR" /> <logger name="org.springboot.sample" level="ERROR"/>
<logger name="com.bgy" level="ERROR" /> <logger name="com.bgy" level="ERROR"/>
</springProfile> </springProfile>
</configuration> </configuration>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment