publish 0.7.0

This commit is contained in:
曾文豪
2023-02-23 11:57:01 +08:00
parent d28f3250e3
commit a22c08738a
16 changed files with 49 additions and 53 deletions

22
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.6.2</version>
<version>0.7.0</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>0.6.2</version>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-encrypt</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-poi</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
</dependency>
<dependency>
@@ -136,7 +136,7 @@
<plugin>
<groupId>com.tiesheng.springboot-plugin</groupId>
<artifactId>tiesheng-maven-plugin</artifactId>
<version>0.0.4</version>
<version>0.0.5</version>
<executions>
<execution>
<goals>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.6.2</version>
<version>0.7.0</version>
</parent>
<artifactId>springboot-ademo</artifactId>

View File

@@ -1,7 +1,7 @@
package com.tiesheng.demo.config;
import cn.hutool.core.util.StrUtil;
import com.tiesheng.core.pojos.CurrentWebUser;
import com.tiesheng.core.pojos.RequestUserInfo;
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
import com.tiesheng.core.service.TieshengWebConfigurer;
import com.tiesheng.login.config.token.bean.TokenBean;
@@ -19,7 +19,7 @@ public class DemoWebConfigurer implements TieshengWebConfigurer {
GlobalConfig globalConfig;
@Override
public CurrentWebUser getCurrentUserName(TokenBean tokenBean) {
public RequestUserInfo getCurrentUserName(TokenBean tokenBean) {
return null;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,11 @@
package com.tiesheng.core.pojos;
public class CurrentWebUser {
/**
* 当前token的数据
*
* @author hao
*/
public class RequestUserInfo {
private String id;
private String name;

View File

@@ -6,7 +6,7 @@ import cn.hutool.json.JSONUtil;
import com.tiesheng.core.mapper.CoreLogLoginMapper;
import com.tiesheng.core.mapper.CoreLogMessageMapper;
import com.tiesheng.core.mapper.CoreLogOperationMapper;
import com.tiesheng.core.pojos.CurrentWebUser;
import com.tiesheng.core.pojos.RequestUserInfo;
import com.tiesheng.core.pojos.dao.CoreLogLogin;
import com.tiesheng.core.pojos.dao.CoreLogMessage;
import com.tiesheng.core.pojos.dao.CoreLogOperation;
@@ -55,9 +55,9 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
*/
public void addOperationLog(String title, String subject, Object params) {
CoreLogOperation operation = new CoreLogOperation();
CurrentWebUser currentWebUser = tieshengWebConfigurer.getCurrentUserName(TsTokenConfig.get());
operation.setUserId(currentWebUser.getId());
operation.setUserName(currentWebUser.getName());
RequestUserInfo requestUserInfo = tieshengWebConfigurer.getCurrentUserName(TsTokenConfig.get());
operation.setUserId(requestUserInfo.getId());
operation.setUserName(requestUserInfo.getName());
operation.setTitle(title);
operation.setSubject(subject);
if (params != null) {
@@ -85,8 +85,8 @@ public class CoreLogService extends TsServiceBase<CoreLogOperationMapper, CoreLo
login.setUserId(platformUnique.getUserId());
login.setPlatform(platformUnique.getPlatform());
CurrentWebUser currentWebUser = tieshengWebConfigurer.getCurrentUserName(tokenBean);
login.setUserName(currentWebUser.getName());
RequestUserInfo requestUserInfo = tieshengWebConfigurer.getCurrentUserName(tokenBean);
login.setUserName(requestUserInfo.getName());
login.setIp(ip);
login.setAddress(ip2regionConfig.search(login.getIp()));

View File

@@ -1,7 +1,6 @@
package com.tiesheng.core.service;
import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.tiesheng.core.mapper.CorePlatformUniqueMapper;
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
import com.tiesheng.login.config.token.bean.TokenBean;
@@ -11,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author hao
@@ -35,15 +33,12 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
platformUnique.setUniqueId(loginInfo.getUnique());
}
platformUnique.setInfo(loginInfo.getInfo());
saveOrUpdate(platformUnique);
TokenBean tokenBean = tieshengWebConfigurer.loginConfigurer().doLogin(platformUnique, loginInfo.getTo());
if (tokenBean != null) {
platformUnique.setUserId(tokenBean.getId());
platformUnique.setIsDeleted(0);
saveOrUpdate(platformUnique);
// 添加登录日志
coreLogService.addLoginLog(platformUnique,tokenBean);
coreLogService.addLoginLog(platformUnique, tokenBean);
}
return tokenBean;
}
@@ -55,22 +50,18 @@ public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueM
/**
* 通过平台和用户id查询
* 更新用户id
*
* @param platform
* @param userIds
* @param uniqueId
* @param userId
* @return
*/
private List<CorePlatformUnique> getByPlatformAndUser(String platform, List<String> userIds) {
if (CollUtil.isEmpty(userIds)) {
return CollUtil.newArrayList();
}
QueryWrapper<CorePlatformUnique> queryWrapper = new QueryWrapper<>();
queryWrapper.in("user_id", userIds);
queryWrapper.eq("platform", platform);
queryWrapper.last("limit 1");
return list(queryWrapper);
public boolean updateUserId(String uniqueId, String userId) {
return update(new UpdateWrapper<CorePlatformUnique>().eq("unique_id", uniqueId)
.set("user_id", userId)
.set("is_deleted", 0)
);
}
}

View File

@@ -1,7 +1,7 @@
package com.tiesheng.core.service;
import cn.hutool.log.LogFactory;
import com.tiesheng.core.pojos.CurrentWebUser;
import com.tiesheng.core.pojos.RequestUserInfo;
import com.tiesheng.core.pojos.dao.CorePlatformUnique;
import com.tiesheng.login.config.token.bean.TokenBean;
import com.tiesheng.util.exception.ApiRespEnum;
@@ -22,7 +22,7 @@ public interface TieshengWebConfigurer {
*
* @return
*/
CurrentWebUser getCurrentUserName(TokenBean userId);
RequestUserInfo getCurrentUserName(TokenBean userId);
/**