mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 11:56:50 +08:00
提交配置及邮件配置修改
This commit is contained in:
@@ -8,8 +8,8 @@ import javax.annotation.Resource;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.xboe.core.SysConstant;
|
||||||
import com.xboe.core.utils.OkHttpUtil;
|
import com.xboe.core.utils.OkHttpUtil;
|
||||||
import com.xboe.module.assistance.service.IEmailService;
|
import com.xboe.module.assistance.service.IEmailService;
|
||||||
|
|
||||||
@@ -42,23 +42,31 @@ public class EmailServiceImpl implements IEmailService {
|
|||||||
// $r = TNetworkHelper::HttpPost($url, $arr);
|
// $r = TNetworkHelper::HttpPost($url, $arr);
|
||||||
// var_dump($r);
|
// var_dump($r);
|
||||||
// }
|
// }
|
||||||
private static final String PostUrl="https://u-pre.boe.com/api/b1/email/send";
|
//private static final String PostUrl="https://u-pre.boe.com/api/b1/email/send";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendMail(String to, String subject, String htmlMsg, String from) throws Exception {
|
public void sendMail(String to, String subject, String htmlMsg, String from) throws Exception {
|
||||||
|
|
||||||
|
String cfgUrl=SysConstant.getConfigValue("xboe.email.url");
|
||||||
|
if(StringUtils.isBlank(cfgUrl)) {
|
||||||
|
throw new Exception("发送邮件失败,未配置邮件信息");
|
||||||
|
}
|
||||||
|
String cfgFrom=SysConstant.getConfigValue("xboe.email.from","boeu_learning@boe.com.cn");
|
||||||
|
String cfgUser=SysConstant.getConfigValue("xboe.email.user");
|
||||||
|
String cfgWord=SysConstant.getConfigValue("xboe.email.password");
|
||||||
|
|
||||||
Map<String,Object> data=new HashMap<String,Object>();
|
Map<String,Object> data=new HashMap<String,Object>();
|
||||||
data.put("to",to);
|
data.put("to",to);
|
||||||
data.put("subject",subject);
|
data.put("subject",subject);
|
||||||
data.put("content", htmlMsg);
|
data.put("content", htmlMsg);
|
||||||
data.put("fromName", "boeu_learning@boe.com.cn");
|
data.put("fromName", cfgFrom);
|
||||||
data.put("cc", "");
|
data.put("cc", "");
|
||||||
data.put("type", 0);
|
data.put("type", 0);
|
||||||
ObjectMapper mapper=new ObjectMapper();
|
ObjectMapper mapper=new ObjectMapper();
|
||||||
String json=mapper.writeValueAsString(data);
|
String json=mapper.writeValueAsString(data);
|
||||||
|
|
||||||
String[] headers=new String[] {"Content-Type","application/json","Host","u.boe.com"};
|
String[] headers=new String[] {"Content-Type","application/json","Host","u.boe.com"};
|
||||||
String rs=httpUtil.doPostJson(PostUrl,json,headers);
|
String rs=httpUtil.doPostJson(cfgUrl,json,headers);
|
||||||
//System.out.println(mailInfo.toString());
|
//System.out.println(mailInfo.toString());
|
||||||
//System.out.println(rs);
|
//System.out.println(rs);
|
||||||
if(StringUtils.isNotBlank(rs)) {
|
if(StringUtils.isNotBlank(rs)) {
|
||||||
|
|||||||
@@ -475,6 +475,8 @@ public class CourseManageApi extends ApiBaseController{
|
|||||||
if(!isLocalDevelopment()) {
|
if(!isLocalDevelopment()) {
|
||||||
//只是非开发模式下才可以发送
|
//只是非开发模式下才可以发送
|
||||||
service.sendMail(email,"课程审核提醒", htmlEmail,"数字化学习平台");
|
service.sendMail(email,"课程审核提醒", htmlEmail,"数字化学习平台");
|
||||||
|
}else {
|
||||||
|
//service.sendMail("daihaixing@bjxask.com","课程审核提醒", htmlEmail,"数字化学习平台");
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ spring.jpa.show-sql = true
|
|||||||
spring.jpa.hibernate.ddl-auto=update
|
spring.jpa.hibernate.ddl-auto=update
|
||||||
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
spring.datasource.driverClassName=com.mysql.jdbc.Driver
|
||||||
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
# spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
spring.datasource.url=jdbc:mysql://192.168.0.11:3306/boeu_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/boeu_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
||||||
spring.datasource.username=root
|
spring.datasource.username=root
|
||||||
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
spring.datasource.password=ENC(lAoFOYuc8CAypPtigTNLYg==)
|
||||||
|
|
||||||
@@ -52,11 +52,17 @@ jasypt.encryptor.algorithm=PBEWithMD5AndDES
|
|||||||
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
||||||
|
|
||||||
# elasticsearch config
|
# elasticsearch config
|
||||||
xboe.elasticsearch.server.ip=192.168.0.11
|
xboe.elasticsearch.server.ip=127.0.0.1
|
||||||
xboe.elasticsearch.server.port=9200
|
xboe.elasticsearch.server.port=9200
|
||||||
xboe.elasticsearch.server.user=
|
xboe.elasticsearch.server.user=
|
||||||
xboe.elasticsearch.server.password=
|
xboe.elasticsearch.server.password=
|
||||||
# 默认搜索的索引
|
# 默认搜索的索引
|
||||||
xboe.elasticsearch.index.name=new_resource_list
|
xboe.elasticsearch.index.name=new_resource_list
|
||||||
|
|
||||||
|
## 邮件的配置
|
||||||
|
xboe.email.url=https://u-pre.boe.com/api/b1/email/send
|
||||||
|
xboe.email.from=boeu_learning@boe.com.cn
|
||||||
|
xboe.email.user=
|
||||||
|
xboe.email.password=
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -48,3 +48,9 @@ xboe.elasticsearch.server.ip=10.251.129.25
|
|||||||
xboe.elasticsearch.server.port=9200
|
xboe.elasticsearch.server.port=9200
|
||||||
xboe.elasticsearch.server.user=elastic
|
xboe.elasticsearch.server.user=elastic
|
||||||
xboe.elasticsearch.server.password=Boe@es123
|
xboe.elasticsearch.server.password=Boe@es123
|
||||||
|
|
||||||
|
## 邮件的配置
|
||||||
|
xboe.email.url=https://u.boe.com/api/b1/email/send
|
||||||
|
xboe.email.from=boeu_learning@boe.com.cn
|
||||||
|
xboe.email.user=
|
||||||
|
xboe.email.password=
|
||||||
|
|||||||
@@ -85,3 +85,9 @@ xboe.elasticsearch.server.ip=127.0.0.1
|
|||||||
xboe.elasticsearch.server.port=9200
|
xboe.elasticsearch.server.port=9200
|
||||||
xboe.elasticsearch.server.user=elastic
|
xboe.elasticsearch.server.user=elastic
|
||||||
xboe.elasticsearch.server.password=Boe@es123
|
xboe.elasticsearch.server.password=Boe@es123
|
||||||
|
|
||||||
|
## 邮件的配置
|
||||||
|
xboe.email.url=https://u.boe.com/api/b1/email/send
|
||||||
|
xboe.email.from=boeu_learning@boe.com.cn
|
||||||
|
xboe.email.user=
|
||||||
|
xboe.email.password=
|
||||||
|
|||||||
@@ -59,4 +59,10 @@ jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
|
|||||||
xboe.elasticsearch.server.ip=10.251.129.25
|
xboe.elasticsearch.server.ip=10.251.129.25
|
||||||
xboe.elasticsearch.server.port=9200
|
xboe.elasticsearch.server.port=9200
|
||||||
xboe.elasticsearch.server.user=elastic
|
xboe.elasticsearch.server.user=elastic
|
||||||
xboe.elasticsearch.server.password=Boe@es123
|
xboe.elasticsearch.server.password=Boe@es123
|
||||||
|
|
||||||
|
## 邮件的配置
|
||||||
|
xboe.email.url=https://u-pre.boe.com/api/b1/email/send
|
||||||
|
xboe.email.from=boeu_learning@boe.com.cn
|
||||||
|
xboe.email.user=
|
||||||
|
xboe.email.password=
|
||||||
Reference in New Issue
Block a user