Compare commits

..

3 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
23 changed files with 55 additions and 194 deletions

View File

@@ -22,4 +22,4 @@ jobs:
## maven打包
- name: Maven deploy
run: |
mvn deploy
mvn deploy

17
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,17 @@
stages:
- deploy
deploy-jar:
stage: deploy
tags:
- zengos
rules:
- if: $CI_COMMIT_TAG
script:
- mvn clean deploy -Dmaven.test.skip -DaltDeploymentRepository=master::default::file:$TAG_REPO_FOLDER
- cd $TAG_REPO_FOLDER
- git checkout master
- git pull
- git add .
- git commit -m "deploy $CI_PROJECT_NAME $CI_COMMIT_TAG"
- git push origin master

34
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>zjut-1.1.6</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>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-encrypt</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-poi</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</dependency>
<dependency>
@@ -123,13 +123,6 @@
</dependencies>
</dependencyManagement>
<pluginRepositories>
<pluginRepository>
<id>gitea</id>
<url>https://git.tieshengkeji.com/api/packages/tieshengkeji/maven</url>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>gitea</id>
@@ -137,6 +130,13 @@
</repository>
</distributionManagement>
<pluginRepositories>
<pluginRepository>
<id>tiesheng-repo-plugin</id>
<url>https://git.tieshengkeji.com/api/packages/tieshengkeji/maven</url>
</pluginRepository>
</pluginRepositories>
<build>
<pluginManagement>
<plugins>

View File

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

View File

@@ -1,43 +0,0 @@
//package com.tiesheng.demo.config;
//
//import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
//import org.springframework.security.core.GrantedAuthority;
//import org.springframework.security.core.authority.SimpleGrantedAuthority;
//import org.springframework.security.core.context.SecurityContextHolder;
//import org.springframework.security.web.authentication.WebAuthenticationDetailsSource;
//import org.springframework.web.filter.OncePerRequestFilter;
//
//import javax.servlet.FilterChain;
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.List;
//
//public class JWTAuthenticationFilter extends OncePerRequestFilter {
//
// public JWTAuthenticationFilter(JwtTokenProvider tokenProvider) {
// this.tokenProvider = tokenProvider;
// }
//
// @Override
// protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
// String authHeader = request.getHeader("Authorization");
// if (authHeader != null && authHeader.startsWith("Bearer ")) {
// String token = authHeader.substring(7);
// String username = tokenProvider.getUsername(token);
// if (username != null && SecurityContextHolder.getContext().getAuthentication() == null) {
// if (tokenProvider.validateToken(token)) {
// List<GrantedAuthority> authorities = new ArrayList<>();
// // 根据你的应用程序需求设置权限
// authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
// UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, null, authorities);
// authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request));
// SecurityContextHolder.getContext().setAuthentication(authenticationToken);
// }
// }
// }
// filterChain.doFilter(request, response);
// }
//}

View File

@@ -1,29 +0,0 @@
//package com.tiesheng.demo.config;
//
//import cn.hutool.extra.spring.SpringUtil;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.security.config.annotation.web.builders.HttpSecurity;
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
//import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
//
//import javax.servlet.http.HttpServletResponse;
//
//@Configuration
//@EnableWebSecurity
//public class TieshengSecurityAdapter extends WebSecurityConfigurerAdapter {
//
// @Override
// protected void configure(HttpSecurity http) throws Exception {
// SpringUtil.getBeanFactory().getA
// http.csrf().disable() // JWT 通常与状态无关,因此 CSRF 保护不适用
// .authorizeRequests()
// .antMatchers("/login").permitAll() // 登录接口允许所有人访问
// .anyRequest().authenticated() // 其他所有请求需要认证
// .and()
// .exceptionHandling()
// .authenticationEntryPoint((request, response, authException) -> response.sendError(HttpServletResponse.SC_UNAUTHORIZED))
// .and()
// .addFilterBefore(new JWTAuthenticationFilter(tokenProvider), UsernamePasswordAuthenticationFilter.class);
// }
//}

View File

@@ -58,6 +58,7 @@ public class TestController {
@RequestMapping("/index")
public ApiResp<String> index() {
dbBackupConfig.dbBackup();
return ApiResp.respOK("hello world");
}
@@ -93,7 +94,7 @@ public class TestController {
public ApiResp<MessageReqResp> sendMessage() {
MessageReqResp reqResp = coreMessageService.send(new UserChannel("13567116463", "sms"),
JSONUtil.createObj().putOpt("action", "sms-visitor-invite"));
JSONUtil.createObj().putOpt("code", "123456").putOpt("template_code", "SMS_154950909"));
return ApiResp.respOK(reqResp);
}

View File

@@ -1,32 +0,0 @@
package com.tiesheng.demo.service;
import cn.hutool.core.date.DateUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.tiesheng.message.config.aliyun.AliyunSmsHandler;
import com.tiesheng.message.pojos.AliyunTempParam;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Service
public class DemoSmsHandler implements AliyunSmsHandler {
@Override
public AliyunTempParam handler(JSONObject obj) {
String action = obj.getStr("action");
AliyunTempParam param = new AliyunTempParam();
param.setSignName("智慧校园");
if (Objects.equals(action, "sms-visitor-invite")) {
param.setTemplateCode("SMS_276125463");
param.setTemplateParam(JSONUtil.createObj()
.putOpt("date", DateUtil.today())
);
}
return param;
}
}

View File

@@ -25,5 +25,4 @@ tiesheng:
aliyun:
access-key-id: LTAI5tJtbgBCnTY5eS4SmrTf
access-key-secret: JIHqpRUFffCHhXaJEVvWN31WcexWqG
encrypt:
body: true
sign-name: 阿里云短信测试

View File

@@ -9,7 +9,6 @@ spring:
servlet:
multipart:
max-file-size: 20MB
max-request-size: 20MB
web:
resources:
static-locations: classpath:/static/,file:static/
@@ -25,4 +24,3 @@ tiesheng:
token:
ignore-paths:
- /test/index

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>zjut-1.1.6</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>zjut-1.1.6</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>zjut-1.1.6</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>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-login</artifactId>

View File

@@ -27,7 +27,7 @@ public class TsTokenConfig {
private String encryptKey = "%kIp9frQCu";
private Integer expireHours = 48;
private String[] ignorePaths;
private boolean validLoginSign = true;
private boolean validLoginSign = false;
/**

View File

@@ -23,7 +23,7 @@ public class UniqueIndexDTO extends LoginToInfo {
if (StrUtil.isEmpty(getNo()) || getTimestamp() == null) {
return false;
}
if ((DateUtil.currentSeconds() - getTimestamp()) > 10) {
if ((DateUtil.currentSeconds() - getTimestamp()) > 60) {
return false;
}
String mySign = getNo() + getTimestamp();

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-message</artifactId>

View File

@@ -3,8 +3,10 @@ package com.tiesheng.message.config.aliyun;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Validator;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.extra.validation.ValidationUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
@@ -16,6 +18,7 @@ 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;
@@ -100,16 +103,7 @@ public class AliyunSmsSender implements TieshengMessageSender {
String signature = specialUrlEncode(digest);
queryMap.put("Signature", signature);
String respBody = "";
try {
respBody = HttpUtil.get(ENDPOINT + "?Signature=" + signature + sortQueryStringTmp, 10 * 1000);
} catch (Exception e) {
respBody = JSONUtil.createObj()
.putOpt("Code", "Error")
.putOpt("Message", "消息通道异常")
.toString();
}
return respBody;
return HttpUtil.get(ENDPOINT + "?Signature=" + signature + sortQueryStringTmp, 10 * 1000);
}

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>zjut-1.1.6</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>zjut-1.1.6</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>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-util</artifactId>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>zjut-1.1.6</version>
<version>zjut-1.1.2</version>
</parent>
<artifactId>springboot-web</artifactId>

View File

@@ -1,44 +0,0 @@
package com.tiesheng.core.util;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import java.util.Map;
public class CharacterUtils {
/**
* 移除特殊字符
*
* @param o 类
*/
public static void removeSymbol(Object o) {
removeSymbol(o, "\n|\r|\t| ");
}
/**
* 移除特殊字符
*
* @param o 类
* @param searchStr 规则
*/
public static void removeSymbol(Object o, String searchStr) {
JSONObject object = JSONUtil.parseObj(o, false);
for (Map.Entry<String, Object> entry : object) {
if (ObjectUtil.isEmpty(entry.getValue()) || StrUtil.equals("null", String.valueOf(entry.getValue()))) {
entry.setValue("");
continue;
}
if (StrUtil.isNotEmpty(entry.getKey())) {
entry.setValue(StrUtil.trim(StrUtil.replace(entry.getValue().toString(), searchStr, "")));
}
}
BeanUtil.copyProperties(object, o);
}
}