update
This commit is contained in:
@@ -15,9 +15,9 @@ import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* 单体启动类2
|
||||
* 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class}
|
||||
*/
|
||||
* 单体启动类2
|
||||
* 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class}
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootApplication
|
||||
@ImportAutoConfiguration(JustAuthAutoConfiguration.class) // spring boot 3.x justauth 兼容性处理
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
//import org.springframework.http.MediaType;
|
||||
//import org.springframework.http.ResponseEntity;
|
||||
//
|
||||
///**
|
||||
/// **
|
||||
// * @Description: TODO
|
||||
// * @author: scott
|
||||
// * @date: 2022年05月10日 14:02
|
||||
|
||||
@@ -56,7 +56,7 @@ public class SendMessageTest {
|
||||
//业务ID
|
||||
String busId = "11111";
|
||||
//发送带业务参数的系统消息
|
||||
BusMessageDTO busMessageDTO = new BusMessageDTO(fromUser, toUser, title, msgContent, msgCategory, busType,busId);
|
||||
BusMessageDTO busMessageDTO = new BusMessageDTO(fromUser, toUser, title, msgContent, msgCategory, busType, busId);
|
||||
sysBaseAPI.sendBusAnnouncement(busMessageDTO);
|
||||
}
|
||||
|
||||
@@ -75,14 +75,14 @@ public class SendMessageTest {
|
||||
String templateCode = "412358";
|
||||
//模版参数
|
||||
Map templateParam = new HashMap<>();
|
||||
templateParam.put("realname","JEECG用户");
|
||||
sysBaseAPI.sendTemplateAnnouncement(new TemplateMessageDTO(fromUser,toUser,title,templateParam,templateCode));
|
||||
templateParam.put("realname", "JEECG用户");
|
||||
sysBaseAPI.sendTemplateAnnouncement(new TemplateMessageDTO(fromUser, toUser, title, templateParam, templateCode));
|
||||
//业务类型
|
||||
String busType = SysAnnmentTypeEnum.EMAIL.getType();
|
||||
//业务ID
|
||||
String busId = "11111";
|
||||
//发送带业务参数的模版消息
|
||||
BusTemplateMessageDTO busMessageDTO = new BusTemplateMessageDTO(fromUser, toUser, title, templateParam ,templateCode, busType,busId);
|
||||
BusTemplateMessageDTO busMessageDTO = new BusTemplateMessageDTO(fromUser, toUser, title, templateParam, templateCode, busType, busId);
|
||||
sysBaseAPI.sendBusTemplateAnnouncement(busMessageDTO);
|
||||
//新发送模版消息
|
||||
MessageDTO messageDTO = new MessageDTO();
|
||||
@@ -97,6 +97,7 @@ public class SendMessageTest {
|
||||
messageDTO.setContent("TEST:流程执行失败!任务节点未找到");
|
||||
sysBaseAPI.sendTemplateMessage(messageDTO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送邮件
|
||||
*/
|
||||
@@ -105,8 +106,9 @@ public class SendMessageTest {
|
||||
String title = "【日程提醒】您的日程任务即将开始";
|
||||
String content = "TEST:尊敬的王先生,您购买的演唱会将于本周日10:08分在国家大剧院如期举行,届时请携带好您的门票和身份证到场";
|
||||
String email = "250678106@qq.com";
|
||||
sysBaseAPI.sendEmailMsg(email,title,content);
|
||||
sysBaseAPI.sendEmailMsg(email, title, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送html模版邮件
|
||||
*/
|
||||
@@ -115,13 +117,14 @@ public class SendMessageTest {
|
||||
String title = "收到一个催办";
|
||||
String email = "250678106@qq.com";
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("bpm_name","高级设置");
|
||||
params.put("bpm_task","审批人");
|
||||
params.put("datetime","2023-10-07 18:00:49");
|
||||
params.put("url","http://boot3.jeecg.com/message/template");
|
||||
params.put("remark","快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点");
|
||||
sysBaseAPI.sendHtmlTemplateEmail(email,title, EmailTemplateEnum.BPM_CUIBAN_EMAIL,params);
|
||||
params.put("bpm_name", "高级设置");
|
||||
params.put("bpm_task", "审批人");
|
||||
params.put("datetime", "2023-10-07 18:00:49");
|
||||
params.put("url", "http://boot3.jeecg.com/message/template");
|
||||
params.put("remark", "快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点快点");
|
||||
sysBaseAPI.sendHtmlTemplateEmail(email, title, EmailTemplateEnum.BPM_CUIBAN_EMAIL, params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信
|
||||
*/
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
* 系统用户单元测试
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = PhysicalApplication.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = PhysicalApplication.class)
|
||||
public class InsertDemoTest {
|
||||
/**
|
||||
* 测试地址:实际使用时替换成你自己的地址
|
||||
@@ -38,7 +38,7 @@ public class InsertDemoTest {
|
||||
@Test
|
||||
public void testAdd() {
|
||||
// 请求地址
|
||||
String url = BASE_URL + "add" ;
|
||||
String url = BASE_URL + "add";
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders();
|
||||
// 请求方式是 POST 代表提交新增数据
|
||||
@@ -47,7 +47,7 @@ public class InsertDemoTest {
|
||||
System.out.println("请求地址:" + url);
|
||||
System.out.println("请求方式:" + method);
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < 100; i++) {
|
||||
String name = "李哈哈" + i;
|
||||
JSONObject params = new JSONObject();
|
||||
|
||||
@@ -20,7 +20,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
* 系统用户单元测试
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,classes = PhysicalApplication.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, classes = PhysicalApplication.class)
|
||||
public class SysUserTest {
|
||||
/**
|
||||
* 测试地址:实际使用时替换成你自己的地址
|
||||
@@ -62,7 +62,7 @@ public class SysUserTest {
|
||||
@Test
|
||||
public void testAdd() {
|
||||
// 请求地址
|
||||
String url = BASE_URL + "add" ;
|
||||
String url = BASE_URL + "add";
|
||||
// 请求 Header (用于传递Token)
|
||||
HttpHeaders headers = this.getHeaders();
|
||||
// 请求方式是 POST 代表提交新增数据
|
||||
@@ -74,11 +74,11 @@ public class SysUserTest {
|
||||
JSONObject params = new JSONObject();
|
||||
params.put("username", "wangwuTest");
|
||||
params.put("password", "123456");
|
||||
params.put("confirmpassword","123456");
|
||||
params.put("confirmpassword", "123456");
|
||||
params.put("realname", "单元测试");
|
||||
params.put("activitiSync", "1");
|
||||
params.put("userIdentity","1");
|
||||
params.put("workNo","0025");
|
||||
params.put("userIdentity", "1");
|
||||
params.put("workNo", "0025");
|
||||
|
||||
System.out.println("请求参数:" + params.toJSONString());
|
||||
|
||||
@@ -113,9 +113,9 @@ public class SysUserTest {
|
||||
params.put("username", "wangwuTest");
|
||||
params.put("realname", "单元测试1111");
|
||||
params.put("activitiSync", "1");
|
||||
params.put("userIdentity","1");
|
||||
params.put("workNo","0025");
|
||||
params.put("id",dataId);
|
||||
params.put("userIdentity", "1");
|
||||
params.put("workNo", "0025");
|
||||
params.put("id", dataId);
|
||||
|
||||
System.out.println("请求参数:" + params.toJSONString());
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import org.junit.Test;
|
||||
|
||||
/**
|
||||
* 测试sql分割、替换等操作
|
||||
*
|
||||
*
|
||||
* @author: scott
|
||||
* @date: 2023年09月05日 16:13
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@ public class TestStr {
|
||||
public void testStringSplitError() {
|
||||
String conditionValue = "qweqwe";
|
||||
String[] conditionValueArray = conditionValue.split(",");
|
||||
System.out.println("length = "+ conditionValueArray.length);
|
||||
System.out.println("length = " + conditionValueArray.length);
|
||||
Arrays.stream(conditionValueArray).forEach(System.out::println);
|
||||
}
|
||||
|
||||
@@ -45,16 +45,16 @@ public class TestStr {
|
||||
valArray.add("qwe");
|
||||
System.out.println("值: " + StringUtils.join(valArray, ","));
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSql() {
|
||||
String sql = "select * from sys_user where sex = ${sex}";
|
||||
sql = sql.replaceAll("'?\\$\\{sex}'?","1");
|
||||
sql = sql.replaceAll("'?\\$\\{sex}'?", "1");
|
||||
System.out.println(sql);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void base64(){
|
||||
public void base64() {
|
||||
String encodedString = "5L+d5a2Y5aSx6LSl77yM5YWN6LS554mI5pyA5aSa5Yib5bu6ezB95p2h6L+e5o6l77yM6K+35Y2H57qn5ZWG5Lia54mI77yB";
|
||||
byte[] decodedBytes = Base64.getDecoder().decode(encodedString);
|
||||
String decodedString = new String(decodedBytes);
|
||||
|
||||
Reference in New Issue
Block a user