Compare commits

..

13 Commits

Author SHA1 Message Date
曾文豪
ef34146563 publish 1.1.0 2024-04-16 20:00:41 +08:00
曾文豪
1c8bc648ea Revert "publish 1.0.24-test2"
This reverts commit b4334f4a5b.
2024-04-15 13:57:07 +08:00
曾文豪
144ca50fea Revert "publish 1.0.24-test3"
This reverts commit 1d2cabb048.
2024-04-15 13:56:55 +08:00
曾文豪
1d2cabb048 publish 1.0.24-test3 2024-04-15 13:36:50 +08:00
曾文豪
b4334f4a5b publish 1.0.24-test2 2024-04-15 13:09:00 +08:00
曾文豪
ce44e4a05a Revert "publish 1.0.24-test"
This reverts commit a7024f7a8d.
2024-04-15 12:34:59 +08:00
曾文豪
a7024f7a8d publish 1.0.24-test 2024-04-15 12:31:15 +08:00
曾文豪
c2fe494ed9 publish 1.0.24 2024-04-13 10:51:03 +08:00
曾文豪
07de3f6ba7 feat:获取系统配置增加一个方法 2024-04-13 10:50:37 +08:00
曾文豪
1c521e5378 fix:修复token是否有效的判定条件 2024-04-13 10:45:57 +08:00
曾文豪
e98e98d659 publish 1.0.23 2024-02-28 09:36:58 +08:00
曾文豪
75d052bd0c perf:钉钉工作通知的内容完全自定义 2024-02-28 09:36:21 +08:00
曾文豪
3758826987 perf:更新一个文案 2024-02-23 16:17:17 +08:00
20 changed files with 129 additions and 47 deletions

BIN
.DS_Store vendored

Binary file not shown.

20
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>springboot-parent</name> <name>springboot-parent</name>
<description>杭州铁晟科技有限公司基础依赖</description> <description>杭州铁晟科技有限公司基础依赖</description>
@@ -57,55 +57,55 @@
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-database</artifactId> <artifactId>springboot-database</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-encrypt</artifactId> <artifactId>springboot-encrypt</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-poi</artifactId> <artifactId>springboot-poi</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@@ -6,11 +6,11 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-ademo</artifactId> <artifactId>springboot-ademo</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
<properties> <properties>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-annotation</artifactId> <artifactId>springboot-annotation</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-database</artifactId> <artifactId>springboot-database</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-encrypt</artifactId> <artifactId>springboot-encrypt</artifactId>

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-login</artifactId> <artifactId>springboot-login</artifactId>

View File

@@ -86,7 +86,7 @@ public class LoginController {
public ApiResp<String> uniqueIndex(@RequestBody UniqueIndexDTO dto) { public ApiResp<String> uniqueIndex(@RequestBody UniqueIndexDTO dto) {
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("web_unique_index", TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("web_unique_index",
dto.getNo(), dto.getPlatform(), dto.getInfo())); dto.getNo(), dto.getPlatform(), dto.getInfo()));
if (tokenBean == null) { if (tokenBean == null || StrUtil.isEmpty(tokenBean.getId())) {
throw new ApiException("登录失败"); throw new ApiException("登录失败");
} }
return ApiResp.respOK(tokenBean.toToken()); return ApiResp.respOK(tokenBean.toToken());

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-message</artifactId> <artifactId>springboot-message</artifactId>

View File

@@ -0,0 +1,16 @@
package com.tiesheng.message.config.aliyun;
import cn.hutool.json.JSONObject;
import com.tiesheng.message.pojos.AliyunTempParam;
public interface AliyunSmsHandler {
/**
* 数据处理
*
* @param obj
*/
AliyunTempParam handler(JSONObject obj);
}

View File

@@ -10,11 +10,15 @@ import cn.hutool.extra.validation.ValidationUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.tiesheng.message.pojos.AliyunTempParam;
import com.tiesheng.message.pojos.MessageReqResp; import com.tiesheng.message.pojos.MessageReqResp;
import com.tiesheng.message.service.TieshengMessageSender; import com.tiesheng.message.service.TieshengMessageSender;
import com.tiesheng.util.exception.ApiException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@@ -39,7 +43,9 @@ public class AliyunSmsSender implements TieshengMessageSender {
private String accessKeyId; private String accessKeyId;
private String accessKeySecret; private String accessKeySecret;
private String signName;
@Autowired(required = false)
AliyunSmsHandler aliyunSmsHandler;
/** /**
* 特殊字符替换 * 特殊字符替换
@@ -105,29 +111,28 @@ public class AliyunSmsSender implements TieshengMessageSender {
* 创建发送请求 * 创建发送请求
* *
* @param phoneNumbers 手机号,多个用,隔开 * @param phoneNumbers 手机号,多个用,隔开
* @param templateCode 短信模板 * @param tempParam 短信模板
* @param params 模板参数
* @return * @return
*/ */
public MessageReqResp sendSms(String phoneNumbers, String templateCode, JSONObject params) { public MessageReqResp sendSms(String phoneNumbers, AliyunTempParam tempParam) {
MessageReqResp reqResp = new MessageReqResp("阿里云短信"); MessageReqResp reqResp = new MessageReqResp("阿里云短信");
reqResp.setTarget(phoneNumbers); reqResp.setTarget(phoneNumbers);
reqResp.setResult(1); reqResp.setResult(1);
reqResp.setContent(JSONUtil.createObj() reqResp.setContent(JSONUtil.createObj()
.putOpt("PhoneNumbers", phoneNumbers) .putOpt("PhoneNumbers", phoneNumbers)
.putOpt("SignName", getSignName()) .putOpt("SignName", tempParam.getSignName())
.putOpt("TemplateCode", templateCode) .putOpt("TemplateCode", tempParam.getTemplateCode())
.putOpt("TemplateParam", params) .putOpt("TemplateParam", tempParam.getTemplateParam())
.toString()); .toString());
// 业务API参数 // 业务API参数
ConcurrentHashMap<String, String> queryMap = new ConcurrentHashMap<>(); ConcurrentHashMap<String, String> queryMap = new ConcurrentHashMap<>();
queryMap.put("PhoneNumbers", phoneNumbers); queryMap.put("PhoneNumbers", phoneNumbers);
queryMap.put("SignName", getSignName()); queryMap.put("SignName", tempParam.getSignName());
queryMap.put("TemplateCode", templateCode); queryMap.put("TemplateCode", tempParam.getTemplateCode());
if (params != null) { if (tempParam.getTemplateParam() != null) {
queryMap.put("TemplateParam", params.toString()); queryMap.put("TemplateParam", tempParam.getTemplateParam().toString());
} }
reqResp.setRespBody(request("SendSms", queryMap)); reqResp.setRespBody(request("SendSms", queryMap));
@@ -146,11 +151,17 @@ public class AliyunSmsSender implements TieshengMessageSender {
if (!mobile) { if (!mobile) {
return null; return null;
} }
String templateCode = body.getStr("template_code");
if (StrUtil.isEmpty(templateCode)) { if (aliyunSmsHandler == null) {
return null; throw new ApiException("未注册短信参数处理器");
} }
return sendSms(user, templateCode, body);
AliyunTempParam tempParam = aliyunSmsHandler.handler(body);
if (tempParam == null) {
throw new ApiException("未配置短信参数处理器");
}
return sendSms(user, tempParam);
} }
@Override @Override
@@ -160,7 +171,7 @@ public class AliyunSmsSender implements TieshengMessageSender {
@Override @Override
public boolean support() { public boolean support() {
return StrUtil.isAllNotEmpty(accessKeyId, accessKeySecret, signName); return StrUtil.isAllNotEmpty(accessKeyId, accessKeySecret);
} }
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@@ -183,12 +194,5 @@ public class AliyunSmsSender implements TieshengMessageSender {
this.accessKeySecret = accessKeySecret; this.accessKeySecret = accessKeySecret;
} }
public String getSignName() {
return signName;
}
public void setSignName(String signName) {
this.signName = signName;
}
} }

View File

@@ -0,0 +1,38 @@
package com.tiesheng.message.pojos;
import cn.hutool.json.JSONObject;
public class AliyunTempParam {
private String signName;
private String templateCode;
private JSONObject templateParam;
///////////////////////////////////////////////////////////////////////////
// setter\getter
///////////////////////////////////////////////////////////////////////////
public String getSignName() {
return signName;
}
public void setSignName(String signName) {
this.signName = signName;
}
public String getTemplateCode() {
return templateCode;
}
public void setTemplateCode(String templateCode) {
this.templateCode = templateCode;
}
public JSONObject getTemplateParam() {
return templateParam;
}
public void setTemplateParam(JSONObject templateParam) {
this.templateParam = templateParam;
}
}

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-platform</artifactId> <artifactId>springboot-platform</artifactId>

View File

@@ -226,6 +226,8 @@ public class PlatformDingConfig {
/** /**
* 同步钉钉的通讯录 * 同步钉钉的通讯录
* <br />
* PS如果需要钉钉用户手机号需要开通权限企业员工手机号信息
* *
* @param deptVo 为null时从第一级获取 * @param deptVo 为null时从第一级获取
* @param consumer 回调 * @param consumer 回调
@@ -266,7 +268,7 @@ public class PlatformDingConfig {
* @param userIds * @param userIds
* @return * @return
*/ */
public DingResponse<String> messageNotification(String service, String title, String content, String actionUrl, List<String> userIds) { public DingResponse<String> messageNotification(String service, String title, String markdown, String actionUrl, List<String> userIds) {
if (CollUtil.isEmpty(userIds)) { if (CollUtil.isEmpty(userIds)) {
return null; return null;
@@ -276,7 +278,7 @@ public class PlatformDingConfig {
JSONObject actionCard = new JSONObject(); JSONObject actionCard = new JSONObject();
actionCard.set("title", title); actionCard.set("title", title);
actionCard.set("markdown", "### " + title + "\n" + content); actionCard.set("markdown", markdown);
actionCard.set("single_title", "点击查看"); actionCard.set("single_title", "点击查看");
actionCard.set("single_url", actionUrl); actionCard.set("single_url", actionUrl);

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-poi</artifactId> <artifactId>springboot-poi</artifactId>

BIN
springboot-util/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-util</artifactId> <artifactId>springboot-util</artifactId>

BIN
springboot-util/src/main/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>com.tiesheng.springboot-parent</groupId> <groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId> <artifactId>springboot-parent</artifactId>
<version>1.0.22</version> <version>1.1.0</version>
</parent> </parent>
<artifactId>springboot-web</artifactId> <artifactId>springboot-web</artifactId>

View File

@@ -28,6 +28,28 @@ public class CoreConfigService extends TsServiceBase<CoreConfigSystemMapper, Cor
} }
/**
* 获取(或创建)一个文本类型的配置
*
* @param configKey
* @param defaultValue
* @return
*/
public CoreConfigSystem getTextOrCreate(String configKey, String defaultValue) {
CoreConfigSystem oneByColumn = getOneByColumn("config_key", configKey);
if (oneByColumn == null) {
oneByColumn = new CoreConfigSystem();
oneByColumn.setId(configKey);
oneByColumn.setConfigKey(configKey);
oneByColumn.setConfigVal(defaultValue);
oneByColumn.setRemark(defaultValue);
oneByColumn.setConfigType(0);
save(oneByColumn);
}
return oneByColumn;
}
/** /**
* 刷新功能点 * 刷新功能点
* *