Compare commits

..

9 Commits

Author SHA1 Message Date
曾文豪
70c6d7568e publish zjut-1.1.2
All checks were successful
/ local-deploy (push) Successful in 20s
2025-12-29 17:49:31 +08:00
曾文豪
051e7a063b publish zjut-1.1.4
Some checks failed
/ local-deploy (push) Failing after 4s
2025-12-29 17:47:34 +08:00
曾文豪
345d99e6a9 publish zjut-1.1.3 2025-12-29 17:45:59 +08:00
曾文豪
88bc553213 publish 1.1.2 2024-04-17 13:56:38 +08:00
曾文豪
5942c4cea4 publish 1.1.1 2024-04-17 13:46:51 +08:00
曾文豪
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
23 changed files with 395 additions and 60 deletions

View File

@@ -0,0 +1,25 @@
## 工作流触发时机
on:
push:
tags:
- '*'
jobs:
## 任务名称
local-deploy:
## 任务执行的服务器
runs-on: tiesheng-local
## 任务步骤
steps:
## 检出代码(固定配置)
- name: Check out repository code
uses: https://git.tieshengkeji.com/actions/checkout@v4
## maven打包
- name: Maven deploy
run: |
mvn deploy

31
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
<packaging>pom</packaging>
<name>springboot-parent</name>
<description>杭州铁晟科技有限公司基础依赖</description>
@@ -57,55 +57,55 @@
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-database</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-encrypt</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-poi</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
@@ -123,10 +123,17 @@
</dependencies>
</dependencyManagement>
<distributionManagement>
<repository>
<id>gitea</id>
<url>https://git.tieshengkeji.com/api/packages/tieshengkeji/maven</url>
</repository>
</distributionManagement>
<pluginRepositories>
<pluginRepository>
<id>kepai-repo-plugin</id>
<url>http://git.kepai365.com/tiesheng/repository/raw/master</url>
<id>tiesheng-repo-plugin</id>
<url>https://git.tieshengkeji.com/api/packages/tieshengkeji/maven</url>
</pluginRepository>
</pluginRepositories>

View File

@@ -6,11 +6,11 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-ademo</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-annotation</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-database</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-encrypt</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-login</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<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.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.tiesheng.message.pojos.AliyunTempParam;
import com.tiesheng.message.pojos.MessageReqResp;
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.context.annotation.Configuration;
import javax.annotation.Resource;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
@@ -39,7 +43,9 @@ public class AliyunSmsSender implements TieshengMessageSender {
private String accessKeyId;
private String accessKeySecret;
private String signName;
@Autowired(required = false)
AliyunSmsHandler aliyunSmsHandler;
/**
* 特殊字符替换
@@ -105,29 +111,28 @@ public class AliyunSmsSender implements TieshengMessageSender {
* 创建发送请求
*
* @param phoneNumbers 手机号,多个用,隔开
* @param templateCode 短信模板
* @param params 模板参数
* @param tempParam 短信模板
* @return
*/
public MessageReqResp sendSms(String phoneNumbers, String templateCode, JSONObject params) {
public MessageReqResp sendSms(String phoneNumbers, AliyunTempParam tempParam) {
MessageReqResp reqResp = new MessageReqResp("阿里云短信");
reqResp.setTarget(phoneNumbers);
reqResp.setResult(1);
reqResp.setContent(JSONUtil.createObj()
.putOpt("PhoneNumbers", phoneNumbers)
.putOpt("SignName", getSignName())
.putOpt("TemplateCode", templateCode)
.putOpt("TemplateParam", params)
.putOpt("SignName", tempParam.getSignName())
.putOpt("TemplateCode", tempParam.getTemplateCode())
.putOpt("TemplateParam", tempParam.getTemplateParam())
.toString());
// 业务API参数
ConcurrentHashMap<String, String> queryMap = new ConcurrentHashMap<>();
queryMap.put("PhoneNumbers", phoneNumbers);
queryMap.put("SignName", getSignName());
queryMap.put("TemplateCode", templateCode);
if (params != null) {
queryMap.put("TemplateParam", params.toString());
queryMap.put("SignName", tempParam.getSignName());
queryMap.put("TemplateCode", tempParam.getTemplateCode());
if (tempParam.getTemplateParam() != null) {
queryMap.put("TemplateParam", tempParam.getTemplateParam().toString());
}
reqResp.setRespBody(request("SendSms", queryMap));
@@ -146,11 +151,17 @@ public class AliyunSmsSender implements TieshengMessageSender {
if (!mobile) {
return null;
}
String templateCode = body.getStr("template_code");
if (StrUtil.isEmpty(templateCode)) {
return null;
if (aliyunSmsHandler == 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
@@ -160,7 +171,7 @@ public class AliyunSmsSender implements TieshengMessageSender {
@Override
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;
}
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>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-platform</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-poi</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-util</artifactId>

View File

@@ -7,7 +7,6 @@ import com.tiesheng.util.config.DesensitizeValueFilter;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
public class CommonUtil {
@@ -19,7 +18,6 @@ public class CommonUtil {
*/
public static FastJsonConfig fastJsonConfig() {
FastJsonConfig config = new FastJsonConfig();
config.setCharset(StandardCharsets.UTF_8);
config.setSerializerFeatures(SerializerFeature.WriteMapNullValue,
SerializerFeature.WriteNullStringAsEmpty,
SerializerFeature.WriteEnumUsingName,

View File

@@ -23,17 +23,26 @@ public class EncryptConfig {
/**
* 加解密对象
*/
private final SM4 sm4;
private static SM4 sm4;
/**
* 加密密钥
*/
private String key = "WmdUzPJXbngVNiaSsQrihg==";
private String key = "Z1mn6fKe6ubnm5762KR3Cg==";
private Integer saltSize = 8;
private boolean body = false;
public EncryptConfig() {
sm4 = SmUtil.sm4(Base64.decode(getKey()));
/**
* 获取SM4对象
*
* @return
*/
private SM4 getSm4() {
if (sm4 == null) {
sm4 = SmUtil.sm4(Base64.decode(getKey()));
}
return sm4;
}
/**
@@ -46,7 +55,7 @@ public class EncryptConfig {
if (StrUtil.isEmpty(content)) {
return "";
}
return sm4.encryptBase64(content);
return getSm4().encryptBase64(content);
}
@@ -58,7 +67,7 @@ public class EncryptConfig {
*/
public String decrypt(String base64) {
try {
return sm4.decryptStr(base64);
return getSm4().decryptStr(base64);
} catch (Exception ignore) {
}
return base64;
@@ -117,7 +126,8 @@ public class EncryptConfig {
///////////////////////////////////////////////////////////////////////////
// setter\getter
///////////////////////////////////////////////////////////////////////////
/// ////////////////////////////////////////////////////////////////////////
public String getKey() {
return key;

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>1.0.24-test2</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-web</artifactId>
@@ -85,7 +85,7 @@
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-encrypt</artifactId>
</dependency>
</dependency><dependency><groupId>org.apache.xmlbeans</groupId><artifactId>xmlbeans</artifactId><version>3.1.0</version><scope>compile</scope></dependency>
</dependencies>

View File

@@ -0,0 +1,34 @@
package com.tiesheng.core.config.template;
import com.tiesheng.core.pojos.dto.TemplateDealDTO;
import org.springframework.stereotype.Service;
@Service
public class TieshengTemplateHandler implements ToolTemplateHandler {
@Override
public String handler(TemplateDealDTO dto) {
return "";
}
@Override
public String getTemplateUrl() {
return "";
}
@Override
public Object getParms(Object params) {
return "";
}
@Override
public String getAction() {
return "";
}
@Override
public int getSort() {
return 0;
}
}

View File

@@ -0,0 +1,54 @@
package com.tiesheng.core.config.template;
import cn.hutool.core.util.StrUtil;
import com.tiesheng.core.pojos.dto.TemplateDealDTO;
import org.springframework.stereotype.Service;
@Service
public interface ToolTemplateHandler {
/**
* 处理对象
*
* @param dto
* @return
*/
String handler(TemplateDealDTO dto);
/**
* 获取模版地址
*
* @return
*/
String getTemplateUrl();
Object getParms(Object params);
/**
* 动作说明(唯一)
*
* @return
*/
String getAction();
/**
* 排序如果action相同只会使用sort大的来处理
*
* @return
*/
int getSort();
/**
* 获取模版ID
*
* @return
*/
default String getTeamplateId() {
return StrUtil.format("{}_{}", getAction(), getSort());
}
}

View File

@@ -2,20 +2,26 @@ package com.tiesheng.core.controller;
import cn.hutool.captcha.LineCaptcha;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.tiesheng.annotation.token.TokenIgnore;
import com.tiesheng.core.pojos.dto.ChunkCheckDTO;
import com.tiesheng.core.pojos.dto.ChunkMergeDTO;
import com.tiesheng.core.pojos.dto.ChunkStartDTO;
import com.tiesheng.core.pojos.dto.ImageCodeDTO;
import com.tiesheng.core.config.template.ToolTemplateHandler;
import com.tiesheng.core.pojos.dto.*;
import com.tiesheng.core.pojos.vo.TemplateInfoVO;
import com.tiesheng.core.pojos.vo.PicVerifyVo;
import com.tiesheng.core.service.FileUploadService;
import com.tiesheng.core.service.TimedCacheService;
import com.tiesheng.util.exception.ApiException;
import com.tiesheng.util.pojos.ApiResp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 工具类
*
@@ -29,6 +35,8 @@ public class ToolController {
TimedCacheService timedCacheService;
@Autowired
FileUploadService fileUploadService;
@Autowired
List<ToolTemplateHandler> templateHandlerList;
/**
@@ -117,4 +125,40 @@ public class ToolController {
}
@TokenIgnore
@GetMapping("/template/info")
public ApiResp<TemplateInfoVO> templateInfo(TemplateInfoDTO dto) {
List<ToolTemplateHandler> collect = templateHandlerList.stream()
.filter(it -> Objects.equals(it.getAction(), dto.getAction()))
.sorted((it, it2) -> it2.getSort() - it.getSort())
.collect(Collectors.toList());
if (CollUtil.isEmpty(collect)) {
throw new ApiException("没有找到对应的模版");
}
ToolTemplateHandler toolTemplateHandler = collect.get(0);
TemplateInfoVO template = new TemplateInfoVO();
template.setTemplateUrl(toolTemplateHandler.getTemplateUrl());
template.setParams(toolTemplateHandler.getParms(dto.getParams()));
template.setTemplateId(toolTemplateHandler.getTeamplateId());
return ApiResp.respOK(template);
}
@TokenIgnore
@PostMapping("/template/deal")
public ApiResp<String> templateDeal(@RequestBody TemplateDealDTO dto) {
List<ToolTemplateHandler> collect = templateHandlerList.stream().
filter(it -> Objects.equals(it.getTeamplateId(), dto.getTemplateId()))
.collect(Collectors.toList());
if (CollUtil.isEmpty(collect)) {
throw new ApiException("模版ID不存在");
}
return ApiResp.respOK(collect.get(0).handler(dto));
}
}

View File

@@ -0,0 +1,40 @@
package com.tiesheng.core.pojos.dto;
import javax.validation.constraints.NotEmpty;
public class TemplateDealDTO {
@NotEmpty(message = "模版ID")
private String templateId;
@NotEmpty(message = "文件路径必填")
private String file;
private Object params;
///////////////////////////////////////////////////////////////////////////
// setter\getter
///////////////////////////////////////////////////////////////////////////
public String getTemplateId() {
return templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public String getFile() {
return file;
}
public void setFile(String file) {
this.file = file;
}
public Object getParams() {
return params;
}
public void setParams(Object params) {
this.params = params;
}
}

View File

@@ -0,0 +1,28 @@
package com.tiesheng.core.pojos.dto;
public class TemplateInfoDTO {
private String action;
private Object params;
///////////////////////////////////////////////////////////////////////////
// setter\getter
///////////////////////////////////////////////////////////////////////////
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public Object getParams() {
return params;
}
public void setParams(Object params) {
this.params = params;
}
}

View File

@@ -0,0 +1,37 @@
package com.tiesheng.core.pojos.vo;
public class TemplateInfoVO {
private String templateId;
private String templateUrl;
private Object params;
///////////////////////////////////////////////////////////////////////////
// setter\getter
///////////////////////////////////////////////////////////////////////////
public String getTemplateId() {
return templateId;
}
public void setTemplateId(String templateId) {
this.templateId = templateId;
}
public String getTemplateUrl() {
return templateUrl;
}
public void setTemplateUrl(String templateUrl) {
this.templateUrl = templateUrl;
}
public Object getParams() {
return params;
}
public void setParams(Object params) {
this.params = params;
}
}