feat: 更改字段类型
This commit is contained in:
@@ -13,5 +13,5 @@ public interface SchisandraAuthFeignService {
|
||||
Boolean wechatRegister(@RequestParam(name = "appId") String appId, @RequestParam(name = "openId") String openId, @RequestParam("clientId") String clientId);
|
||||
|
||||
@GetMapping("/auth/user/getUserInfo")
|
||||
Result<SchisandraAuthUserDTO> getUserInfo(@RequestParam("userId") Long userId);
|
||||
Result<SchisandraAuthUserDTO> getUserInfo(@RequestParam("userId") String userId);
|
||||
}
|
||||
|
@@ -128,7 +128,7 @@ public class SchisandraAuthPermissionController {
|
||||
* @date: 2024/7/8 下午4:09
|
||||
*/
|
||||
@GetMapping("selectUserPermission")
|
||||
public Result<Object> selectUserPermission(@RequestParam("userId") Long userId) {
|
||||
public Result<Object> selectUserPermission(@RequestParam("userId") String userId) {
|
||||
if (userId == null) {
|
||||
return Result.fail("userId不能为空");
|
||||
}
|
||||
|
@@ -100,7 +100,7 @@ public class SchisandraAuthRoleController {
|
||||
* @date 2024/4/3 22:12
|
||||
*/
|
||||
@GetMapping("delete/{id}")
|
||||
public Result delete(@PathVariable Long id){
|
||||
public Result delete(@PathVariable String id){
|
||||
try{
|
||||
if(log.isInfoEnabled()){
|
||||
log.info("RoleController.insert.dto:{}",id);
|
||||
|
@@ -249,9 +249,9 @@ public class SchisandraAuthUserController {
|
||||
* @author: landaiqing
|
||||
* @date: 2024/6/2 0:37
|
||||
*/
|
||||
private void userInfoPersistence(Long authUserId) {
|
||||
private void userInfoPersistence(String authUserId) {
|
||||
// 查询用户角色并存入redis
|
||||
SchisandraAuthRole schisandraAuthRole = schisandraAuthRoleDomainService.queryByRoleId(UserRoleEnum.NORMAL_USER.getCode());
|
||||
SchisandraAuthRole schisandraAuthRole = schisandraAuthRoleDomainService.queryByRoleId(String.valueOf(UserRoleEnum.NORMAL_USER.getCode()));
|
||||
String roleKey = redisUtil.buildKey(AUTH_ROLE_PREFIX, String.valueOf(authUserId));
|
||||
List<SchisandraAuthRole> roleList = new LinkedList<>();
|
||||
roleList.add(schisandraAuthRole);
|
||||
@@ -259,10 +259,10 @@ public class SchisandraAuthUserController {
|
||||
|
||||
// 查询用户权限并存入redis
|
||||
SchisandraAuthRolePermissionDTO schisandraAuthRolePermission = new SchisandraAuthRolePermissionDTO();
|
||||
schisandraAuthRolePermission.setRoleId(UserRoleEnum.NORMAL_USER.getCode());
|
||||
schisandraAuthRolePermission.setRoleId(String.valueOf(UserRoleEnum.NORMAL_USER.getCode()));
|
||||
SchisandraAuthRolePermissionBO schisandraAuthRolePermissionBO = SchisandraAuthRolePermissionDTOConverter.INSTANCE.convertDTOToBO(schisandraAuthRolePermission);
|
||||
List<SchisandraAuthRolePermissionBO> rolePermissionList = schisandraAuthRolePermissionDomainService.queryByRoleId(schisandraAuthRolePermissionBO);
|
||||
List<Long> permissionIdList = rolePermissionList.stream()
|
||||
List<String> permissionIdList = rolePermissionList.stream()
|
||||
.map(SchisandraAuthRolePermissionBO::getPermissionId).collect(Collectors.toList());
|
||||
List<SchisandraAuthPermission> permissionList = schisandraAuthPermissionDomainService.queryListByIds(permissionIdList);
|
||||
String permissionKey = redisUtil.buildKey(AUTH_PERMISSION_PREFIX, String.valueOf(authUserId));
|
||||
@@ -382,7 +382,7 @@ public class SchisandraAuthUserController {
|
||||
* @date: 2024/7/11 9:39
|
||||
*/
|
||||
@GetMapping("getUserInfo")
|
||||
public Result<SchisandraAuthUserDTO> getUserInfo(@RequestParam("userId") Long userId) {
|
||||
public Result<SchisandraAuthUserDTO> getUserInfo(@RequestParam("userId") String userId) {
|
||||
SchisandraAuthUserDTO schisandraAuthUserDTO = SchisandraAuthUserDTOConverter.INSTANCE.convertBOToDTO(schisandraAuthUserDomainService.queryById(userId));
|
||||
if ( schisandraAuthUserDTO== null) {
|
||||
return Result.fail("该用户不存在");
|
||||
|
@@ -16,7 +16,7 @@ public class SchisandraAuthPermissionDTO implements Serializable {
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
/**
|
||||
* 权限名称
|
||||
*/
|
||||
@@ -24,7 +24,7 @@ public class SchisandraAuthPermissionDTO implements Serializable {
|
||||
/**
|
||||
* 权限父id
|
||||
*/
|
||||
private Long parentId;
|
||||
private String parentId;
|
||||
/**
|
||||
* 权限类型
|
||||
*/
|
||||
|
@@ -20,7 +20,7 @@ public class SchisandraAuthRoleDTO implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
|
@@ -17,17 +17,17 @@ public class SchisandraAuthRolePermissionDTO implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long roleId;
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 权限id
|
||||
*/
|
||||
private Long permissionId;
|
||||
private String permissionId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
@@ -17,7 +17,7 @@ public class SchisandraAuthUserDTO implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
|
@@ -17,17 +17,17 @@ public class SchisandraAuthUserRoleDTO implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Long roleId;
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
@@ -17,17 +17,17 @@ public class SchisandraSocialUserAuthDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long socialUserId;
|
||||
private String socialUserId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
@@ -17,7 +17,7 @@ public class SchisandraSocialUserDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 第三方系统的唯一ID
|
||||
|
@@ -18,11 +18,11 @@ SchisandraAuthPermissionBO implements Serializable {
|
||||
|
||||
|
||||
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private Long parentId;
|
||||
private String parentId;
|
||||
|
||||
private Integer type;
|
||||
|
||||
|
@@ -22,7 +22,7 @@ public class SchisandraAuthRoleBO implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
|
@@ -17,17 +17,17 @@ public class SchisandraAuthRolePermissionBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long roleId;
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long permissionId;
|
||||
private String permissionId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
@@ -17,7 +17,7 @@ public class SchisandraAuthUserBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@@ -17,17 +17,17 @@ public class SchisandraAuthUserRoleBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long roleId;
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
@@ -16,17 +16,17 @@ public class SchisandraSocialUserAuthBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long socialUserId;
|
||||
private String socialUserId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
@@ -16,7 +16,7 @@ public class SchisandraSocialUserBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 第三方系统的唯一ID
|
||||
|
@@ -11,11 +11,11 @@ import java.util.List;
|
||||
|
||||
public interface SchisandraAuthPermissionDomainService {
|
||||
|
||||
Result<Object> selectUserPermissionTree(Long userId);
|
||||
Result<Object> selectUserPermissionTree(String userId);
|
||||
int update(SchisandraAuthPermissionBO schisandraAuthPermissionBO);
|
||||
Object delete(SchisandraAuthPermissionBO schisandraAuthPermissionBO);
|
||||
Object insert(SchisandraAuthPermissionBO schisandraAuthPermissionBO);
|
||||
SchisandraAuthPermissionBO select(SchisandraAuthPermissionBO schisandraAuthPermissionBO);
|
||||
|
||||
List<SchisandraAuthPermission> queryListByIds(List<Long> permissionIdList);
|
||||
List<SchisandraAuthPermission> queryListByIds(List<String> permissionIdList);
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ public interface SchisandraAuthRoleDomainService {
|
||||
*@Date 2024/4/4
|
||||
*@Time 21:03
|
||||
*/
|
||||
Object delete(Long id);
|
||||
Object delete(String id);
|
||||
|
||||
/***
|
||||
*@ClassName: SchisandraAuthRoleDomainService
|
||||
@@ -52,5 +52,5 @@ public interface SchisandraAuthRoleDomainService {
|
||||
|
||||
Object select(SchisandraAuthRoleBO schisandraAuthRoleBO);
|
||||
|
||||
SchisandraAuthRole queryByRoleId(Long code);
|
||||
SchisandraAuthRole queryByRoleId(String code);
|
||||
}
|
||||
|
@@ -85,7 +85,7 @@ public interface SchisandraAuthUserDomainService {
|
||||
* @date: 2024/5/26 17:27
|
||||
*/
|
||||
@Cacheable(value = "userInfo", key = "#userId")
|
||||
SchisandraAuthUserBO queryById(Long userId);
|
||||
SchisandraAuthUserBO queryById(String userId);
|
||||
|
||||
/**
|
||||
* @param schisandraAuthUserBO
|
||||
@@ -102,7 +102,7 @@ public interface SchisandraAuthUserDomainService {
|
||||
* @author msz
|
||||
*/
|
||||
@CacheEvict(value = "userInfo",key = "id")
|
||||
Object deleteById(Long id);
|
||||
Object deleteById(String id);
|
||||
|
||||
SchisandraAuthUser queryByPhone(String phone);
|
||||
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.schisandra.auth.domain.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.schisandra.auth.common.entity.Result;
|
||||
import com.schisandra.auth.domain.bo.SchisandraAuthPermissionBO;
|
||||
import com.schisandra.auth.domain.convert.SchisandraAuthPermissionBOConverter;
|
||||
@@ -15,7 +14,9 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
@@ -27,20 +28,19 @@ public class SchisandraAuthPermissionDomainServiceImpl implements SchisandraAuth
|
||||
@Resource
|
||||
SchisandraAuthRolePermissionService schisandraAuthRolePermissionService;
|
||||
|
||||
public List<Object> selectTree(List<SchisandraAuthPermissionBO> schisandraAuthPermissions,List<SchisandraAuthPermissionBO> schisandraAuthPermissionsParent) {
|
||||
public List<Object> selectTree(List<SchisandraAuthPermissionBO> schisandraAuthPermissions, List<SchisandraAuthPermissionBO> schisandraAuthPermissionsParent) {
|
||||
List<Object> selectTreeList1 = new ArrayList<>();
|
||||
schisandraAuthPermissionsParent.forEach(e -> {
|
||||
List<SchisandraAuthPermissionBO> schisandraAuthPermissions1 = new ArrayList<>();
|
||||
schisandraAuthPermissions.forEach(e1 -> {
|
||||
if (e1.getParentId()==e.getId()){
|
||||
if (e1.getParentId() == e.getId()) {
|
||||
schisandraAuthPermissions1.add(e1);
|
||||
}
|
||||
});
|
||||
if (schisandraAuthPermissions1.size()==0){
|
||||
if (schisandraAuthPermissions1.size() == 0) {
|
||||
selectTreeList1.add(e);
|
||||
}
|
||||
else {
|
||||
List<Object> list1 = selectTree(schisandraAuthPermissions,schisandraAuthPermissions1);
|
||||
} else {
|
||||
List<Object> list1 = selectTree(schisandraAuthPermissions, schisandraAuthPermissions1);
|
||||
e.setRoutes(list1);
|
||||
selectTreeList1.add(e);
|
||||
}
|
||||
@@ -49,29 +49,29 @@ public class SchisandraAuthPermissionDomainServiceImpl implements SchisandraAuth
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<Object> selectUserPermissionTree(Long userId) {
|
||||
public Result<Object> selectUserPermissionTree(String userId) {
|
||||
SchisandraAuthUserRole schisandraAuthRole = schisandraAuthUserRoleService.queryById(userId);
|
||||
if (schisandraAuthRole == null||schisandraAuthRole.getRoleId()==null) {
|
||||
if (schisandraAuthRole == null || schisandraAuthRole.getRoleId() == null) {
|
||||
return Result.fail("用户没有角色");
|
||||
}
|
||||
List<SchisandraAuthRolePermission> schisandraAuthRolePermissions = schisandraAuthRolePermissionService.queryByRoleId(schisandraAuthRole.getRoleId());
|
||||
if (schisandraAuthRolePermissions.size()==0){
|
||||
List<SchisandraAuthRolePermission> schisandraAuthRolePermissions = schisandraAuthRolePermissionService.queryByRoleId(Long.valueOf(schisandraAuthRole.getRoleId()));
|
||||
if (schisandraAuthRolePermissions.size() == 0) {
|
||||
return Result.fail("当前角色用户没有权限");
|
||||
}
|
||||
List<SchisandraAuthPermissionBO> schisandraAuthPermissions =new ArrayList<>();
|
||||
List<SchisandraAuthPermissionBO> schisandraAuthPermissions = new ArrayList<>();
|
||||
List<SchisandraAuthPermissionBO> schisandraAuthPermissionParents = new ArrayList<>();
|
||||
schisandraAuthRolePermissions.forEach(e -> {
|
||||
schisandraAuthPermissions.add(SchisandraAuthPermissionBOConverter.INSTANCE.convertEntityToBO(schisandraAuthPermissionService.queryById(e.getPermissionId())));
|
||||
});
|
||||
|
||||
schisandraAuthPermissions.forEach(e -> {
|
||||
if (e.getParentId()==0){
|
||||
if (Long.parseLong(e.getParentId()) == 0) {
|
||||
schisandraAuthPermissionParents.add(e);
|
||||
}
|
||||
});
|
||||
HashMap<Object,Object>map=new HashMap<>();
|
||||
map.put("path","/");
|
||||
map.put("routes",selectTree(schisandraAuthPermissions,schisandraAuthPermissionParents));
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("path", "/");
|
||||
map.put("routes", selectTree(schisandraAuthPermissions, schisandraAuthPermissionParents));
|
||||
return Result.ok(map);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class SchisandraAuthPermissionDomainServiceImpl implements SchisandraAuth
|
||||
@Override
|
||||
public Object delete(SchisandraAuthPermissionBO schisandraAuthPermissionBO) {
|
||||
SchisandraAuthPermission schisandraAuthPermission = SchisandraAuthPermissionBOConverter.INSTANCE.convertBOToEntity(schisandraAuthPermissionBO);
|
||||
boolean schisandraAuthPermission1 = schisandraAuthPermissionService.deleteById(schisandraAuthPermission.getId());
|
||||
boolean schisandraAuthPermission1 = schisandraAuthPermissionService.deleteById(Long.valueOf(schisandraAuthPermission.getId()));
|
||||
return schisandraAuthPermission1;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class SchisandraAuthPermissionDomainServiceImpl implements SchisandraAuth
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SchisandraAuthPermission> queryListByIds(List<Long> permissionIdList) {
|
||||
public List<SchisandraAuthPermission> queryListByIds(List<String> permissionIdList) {
|
||||
return schisandraAuthPermissionService.queryListByIds(permissionIdList);
|
||||
}
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ public class SchisandraAuthRoleDomainServiceImpl implements SchisandraAuthRoleDo
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object delete(Long id) {
|
||||
public Object delete(String id) {
|
||||
boolean isDeleted = schisandraAuthRoleService.deleteById(id);
|
||||
return isDeleted;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class SchisandraAuthRoleDomainServiceImpl implements SchisandraAuthRoleDo
|
||||
}
|
||||
|
||||
@Override
|
||||
public SchisandraAuthRole queryByRoleId(Long code) {
|
||||
public SchisandraAuthRole queryByRoleId(String code) {
|
||||
return schisandraAuthRoleService.queryByRoleId(code);
|
||||
}
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ public class SchisandraAuthRolePermissionDomainServiceImpl implements Schisandra
|
||||
@Override
|
||||
public List<SchisandraAuthRolePermissionBO> queryByRoleId(SchisandraAuthRolePermissionBO schisandraAuthRolePermissionBO) {
|
||||
SchisandraAuthRolePermission schisandraAuthRolePermission = SchisandraAuthRolePermissionBOConverter.INSTANCE.convertBOToEntity(schisandraAuthRolePermissionBO);
|
||||
List<SchisandraAuthRolePermission> schisandraAuthRolePermissions = schisandraAuthRolePermissionService.queryByRoleId(schisandraAuthRolePermission.getRoleId());
|
||||
List<SchisandraAuthRolePermission> schisandraAuthRolePermissions = schisandraAuthRolePermissionService.queryByRoleId(Long.valueOf(schisandraAuthRolePermission.getRoleId()));
|
||||
List<SchisandraAuthRolePermissionBO> schisandraAuthRolePermissionBOS = SchisandraAuthRolePermissionBOConverter.INSTANCE.convertEntityToBOList(schisandraAuthRolePermissions);
|
||||
return schisandraAuthRolePermissionBOS;
|
||||
}
|
||||
|
@@ -99,7 +99,7 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
if (insert) {
|
||||
SchisandraAuthUserRoleBO schisandraAuthUserRoleBO = new SchisandraAuthUserRoleBO();
|
||||
schisandraAuthUserRoleBO.setUserId(authUser.getId());
|
||||
schisandraAuthUserRoleBO.setRoleId(UserRoleEnum.NORMAL_USER.getCode());
|
||||
schisandraAuthUserRoleBO.setRoleId(String.valueOf(UserRoleEnum.NORMAL_USER.getCode()));
|
||||
SchisandraAuthUserRole schisandraAuthUserRole = SchisandraAuthUserRoleBOConverter.INSTANCE.convertBOToEntity(schisandraAuthUserRoleBO);
|
||||
return schisandraAuthUserRoleService.insert(schisandraAuthUserRole) > 0;
|
||||
} else {
|
||||
@@ -174,7 +174,7 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
* @date 2024/4/3 22:10
|
||||
*/
|
||||
@Override
|
||||
public SchisandraAuthUserBO queryById(Long userId) {
|
||||
public SchisandraAuthUserBO queryById(String userId) {
|
||||
SchisandraAuthUser schisandraAuthUser = schisandraAuthUserService.queryById(userId);
|
||||
SchisandraAuthUserBO schisandraAuthUserBO1 = SchisandraAuthUserBOConverter.INSTANCE.convertEntityToBO(schisandraAuthUser);
|
||||
return schisandraAuthUserBO1;
|
||||
@@ -201,7 +201,7 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
* @date 2024/4/3 22:30
|
||||
*/
|
||||
@Override
|
||||
public Object deleteById(Long id) {
|
||||
public Object deleteById(String id) {
|
||||
return schisandraAuthUserService.deleteById(id);
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
public Boolean wechatRegister(String appId, String openId,String clientId) {
|
||||
SchisandraSocialUser socialUser = schisandraSocialUserService.selectByOpenId(openId);
|
||||
if (ObjectUtils.isNotEmpty(socialUser)) {
|
||||
Long userId = socialUser.getId();
|
||||
String userId = socialUser.getId();
|
||||
// redis存储用户角色与权限信息
|
||||
userInfoPersistence(userId);
|
||||
StpUtil.login(userId);
|
||||
@@ -260,12 +260,12 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Long authUserId = schisandraAuthUser.getId();
|
||||
Long socialUserId = schisandraSocialUser.getId();
|
||||
String authUserId = schisandraAuthUser.getId();
|
||||
String socialUserId = schisandraSocialUser.getId();
|
||||
// 建立社会用户与用户信息映射
|
||||
SchisandraSocialUserAuthBO socialUserAuthBO = new SchisandraSocialUserAuthBO();
|
||||
socialUserAuthBO.setUserId(authUserId);
|
||||
socialUserAuthBO.setSocialUserId(socialUserId);
|
||||
socialUserAuthBO.setUserId(String.valueOf(authUserId));
|
||||
socialUserAuthBO.setSocialUserId(String.valueOf(socialUserId));
|
||||
SchisandraSocialUserAuth schisandraSocialUserAuth = SchisandraSocialUserAuthBOConverter.INSTANCE.convertBOToEntity(socialUserAuthBO);
|
||||
int insertMapper = schisandraSocialUserAuthService.insert(schisandraSocialUserAuth);
|
||||
if (insertMapper <= 0) {
|
||||
@@ -276,8 +276,8 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
}
|
||||
// 建立用户与角色映射关系
|
||||
SchisandraAuthUserRoleBO schisandraAuthUserRoleBO = new SchisandraAuthUserRoleBO();
|
||||
schisandraAuthUserRoleBO.setUserId(authUserId);
|
||||
schisandraAuthUserRoleBO.setRoleId(UserRoleEnum.NORMAL_USER.getCode());
|
||||
schisandraAuthUserRoleBO.setUserId(String.valueOf(authUserId));
|
||||
schisandraAuthUserRoleBO.setRoleId(String.valueOf(UserRoleEnum.NORMAL_USER.getCode()));
|
||||
schisandraAuthUserRoleBO.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
|
||||
SchisandraAuthUserRole schisandraAuthUserRole = SchisandraAuthUserRoleBOConverter.INSTANCE.convertBOToEntity(schisandraAuthUserRoleBO);
|
||||
int insert = schisandraAuthUserRoleService.insert(schisandraAuthUserRole);
|
||||
@@ -338,7 +338,7 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
}
|
||||
return Result.fail("Social User update fail");
|
||||
}
|
||||
Long userId = socialUser.getId();
|
||||
String userId = socialUser.getId();
|
||||
// redis存储用户角色与权限信息
|
||||
userInfoPersistence(userId);
|
||||
StpUtil.login(userId, SaLoginConfig.setToken(token.getAccessToken()));
|
||||
@@ -388,13 +388,13 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
}
|
||||
return Result.fail("insertAuthUser fail");
|
||||
}
|
||||
Long authUserId = schisandraAuthUser.getId();
|
||||
Long socialUserId = schisandraSocialUser.getId();
|
||||
String authUserId = schisandraAuthUser.getId();
|
||||
String socialUserId = schisandraSocialUser.getId();
|
||||
|
||||
// 建立社会用户与用户信息映射
|
||||
SchisandraSocialUserAuthBO socialUserAuthBO = new SchisandraSocialUserAuthBO();
|
||||
socialUserAuthBO.setUserId(authUserId);
|
||||
socialUserAuthBO.setSocialUserId(socialUserId);
|
||||
socialUserAuthBO.setUserId(String.valueOf(authUserId));
|
||||
socialUserAuthBO.setSocialUserId(String.valueOf(socialUserId));
|
||||
SchisandraSocialUserAuth schisandraSocialUserAuth = SchisandraSocialUserAuthBOConverter.INSTANCE.convertBOToEntity(socialUserAuthBO);
|
||||
int insertMapper = schisandraSocialUserAuthService.insert(schisandraSocialUserAuth);
|
||||
if (insertMapper <= 0) {
|
||||
@@ -406,8 +406,8 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
|
||||
// 建立用户与角色映射关系
|
||||
SchisandraAuthUserRoleBO schisandraAuthUserRoleBO = new SchisandraAuthUserRoleBO();
|
||||
schisandraAuthUserRoleBO.setUserId(authUserId);
|
||||
schisandraAuthUserRoleBO.setRoleId(UserRoleEnum.NORMAL_USER.getCode());
|
||||
schisandraAuthUserRoleBO.setUserId(String.valueOf(authUserId));
|
||||
schisandraAuthUserRoleBO.setRoleId(String.valueOf(UserRoleEnum.NORMAL_USER.getCode()));
|
||||
schisandraAuthUserRoleBO.setIsDeleted(IsDeletedFlagEnum.UN_DELETED.getCode());
|
||||
SchisandraAuthUserRole schisandraAuthUserRole = SchisandraAuthUserRoleBOConverter.INSTANCE.convertBOToEntity(schisandraAuthUserRoleBO);
|
||||
int insert = schisandraAuthUserRoleService.insert(schisandraAuthUserRole);
|
||||
@@ -432,9 +432,9 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
* @author: landaiqing
|
||||
* @date: 2024/6/2 0:37
|
||||
*/
|
||||
private void userInfoPersistence(Long authUserId) {
|
||||
private void userInfoPersistence(String authUserId) {
|
||||
// 查询用户角色并存入redis
|
||||
SchisandraAuthRole schisandraAuthRole = schisandraAuthRoleService.queryByRoleId(UserRoleEnum.NORMAL_USER.getCode());
|
||||
SchisandraAuthRole schisandraAuthRole = schisandraAuthRoleService.queryByRoleId(String.valueOf(UserRoleEnum.NORMAL_USER.getCode()));
|
||||
String roleKey = redisUtil.buildKey(AUTH_ROLE_PREFIX, String.valueOf(authUserId));
|
||||
List<SchisandraAuthRole> roleList = new LinkedList<>();
|
||||
roleList.add(schisandraAuthRole);
|
||||
@@ -442,9 +442,9 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
|
||||
|
||||
// 查询用户权限并存入redis
|
||||
SchisandraAuthRolePermission schisandraAuthRolePermission = new SchisandraAuthRolePermission();
|
||||
schisandraAuthRolePermission.setRoleId(UserRoleEnum.NORMAL_USER.getCode());
|
||||
List<SchisandraAuthRolePermission> rolePermissionList = schisandraAuthRolePermissionService.queryByRoleId(schisandraAuthRolePermission.getRoleId());
|
||||
List<Long> permissionIdList = rolePermissionList.stream()
|
||||
schisandraAuthRolePermission.setRoleId(String.valueOf(UserRoleEnum.NORMAL_USER.getCode()));
|
||||
List<SchisandraAuthRolePermission> rolePermissionList = schisandraAuthRolePermissionService.queryByRoleId(Long.valueOf(schisandraAuthRolePermission.getRoleId()));
|
||||
List<String> permissionIdList = rolePermissionList.stream()
|
||||
.map(SchisandraAuthRolePermission::getPermissionId).collect(Collectors.toList());
|
||||
List<SchisandraAuthPermission> permissionList = schisandraAuthPermissionService.queryListByIds(permissionIdList);
|
||||
String permissionKey = redisUtil.buildKey(AUTH_PERMISSION_PREFIX, String.valueOf(authUserId));
|
||||
|
@@ -21,7 +21,7 @@ import java.util.Date;
|
||||
public class SchisandraAuthPermission implements Serializable {
|
||||
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
|
@@ -24,7 +24,7 @@ public class SchisandraAuthRole implements Serializable {
|
||||
* id
|
||||
*/
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 角色名称
|
||||
|
@@ -24,19 +24,19 @@ public class SchisandraAuthRolePermission implements Serializable {
|
||||
*
|
||||
*/
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column("role_id")
|
||||
private Long roleId;
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column("permission_id")
|
||||
private Long permissionId;
|
||||
private String permissionId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
@@ -23,7 +23,7 @@ public class SchisandraAuthUser implements Serializable {
|
||||
*
|
||||
*/
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
@Column(value = "user_name")
|
||||
private String userName;
|
||||
|
@@ -25,19 +25,19 @@ public class SchisandraAuthUserRole implements Serializable {
|
||||
*
|
||||
*/
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column("user_id")
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column("role_id")
|
||||
private Long roleId;
|
||||
private String roleId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
@@ -24,7 +24,7 @@ public class SchisandraSocialUser implements Serializable {
|
||||
*
|
||||
*/
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 第三方系统的唯一ID
|
||||
|
@@ -24,19 +24,19 @@ public class SchisandraSocialUserAuth implements Serializable {
|
||||
*
|
||||
*/
|
||||
@Id(keyType=KeyType.Generator, value= KeyGenerators.flexId)
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column("user_id")
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column("social_user_id")
|
||||
private Long socialUserId;
|
||||
private String socialUserId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
|
@@ -1,8 +1,6 @@
|
||||
package com.schisandra.auth.infra.basic.service;
|
||||
|
||||
import com.schisandra.auth.infra.basic.entity.SchisandraAuthPermission;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -20,7 +18,7 @@ public interface SchisandraAuthPermissionService {
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraAuthPermission queryById(Long id);
|
||||
SchisandraAuthPermission queryById(String id);
|
||||
|
||||
|
||||
/**
|
||||
@@ -47,5 +45,5 @@ public interface SchisandraAuthPermissionService {
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
|
||||
List<SchisandraAuthPermission> queryListByIds(List<Long> permissionIdList);
|
||||
List<SchisandraAuthPermission> queryListByIds(List<String> permissionIdList);
|
||||
}
|
||||
|
@@ -18,7 +18,7 @@ public interface SchisandraAuthRolePermissionService {
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraAuthRolePermission queryById(Long id);
|
||||
SchisandraAuthRolePermission queryById(String id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
|
@@ -18,7 +18,7 @@ public interface SchisandraAuthRoleService {
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraAuthRole queryById(Long id);
|
||||
SchisandraAuthRole queryById(String id);
|
||||
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,7 @@ public interface SchisandraAuthRoleService {
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
boolean deleteById(String id);
|
||||
|
||||
SchisandraAuthRole queryByRoleId(Long code);
|
||||
SchisandraAuthRole queryByRoleId(String code);
|
||||
}
|
||||
|
@@ -17,7 +17,7 @@ public interface SchisandraAuthUserRoleService {
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraAuthUserRole queryById(Long id);
|
||||
SchisandraAuthUserRole queryById(String id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
@@ -41,7 +41,7 @@ public interface SchisandraAuthUserRoleService {
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
boolean deleteById(String id);
|
||||
|
||||
|
||||
|
||||
|
@@ -22,7 +22,7 @@ public interface SchisandraAuthUserService {
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraAuthUser queryById(Long id);
|
||||
SchisandraAuthUser queryById(String id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
@@ -46,7 +46,7 @@ public interface SchisandraAuthUserService {
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
boolean deleteById(String id);
|
||||
|
||||
|
||||
int insertAuthUserByOauth(SchisandraAuthUser schisandraAuthUser);
|
||||
|
@@ -16,7 +16,7 @@ public interface SchisandraSocialUserAuthService {
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraSocialUserAuth queryById(Long id);
|
||||
SchisandraSocialUserAuth queryById(String id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
@@ -40,7 +40,7 @@ public interface SchisandraSocialUserAuthService {
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
boolean deleteById(String id);
|
||||
|
||||
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ public interface SchisandraSocialUserService {
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
SchisandraSocialUser queryById(Long id);
|
||||
SchisandraSocialUser queryById(String id);
|
||||
|
||||
/**
|
||||
* 新增数据
|
||||
@@ -40,7 +40,7 @@ public interface SchisandraSocialUserService {
|
||||
* @param id 主键
|
||||
* @return 是否成功
|
||||
*/
|
||||
boolean deleteById(Long id);
|
||||
boolean deleteById(String id);
|
||||
|
||||
|
||||
SchisandraSocialUser selectByUuidAndType(String uuid, String type);
|
||||
|
@@ -31,7 +31,7 @@ public class SchisandraAuthPermissionServiceImpl extends CacheableServiceImpl<Sc
|
||||
*/
|
||||
@Override
|
||||
@Cacheable(key = "#id")
|
||||
public SchisandraAuthPermission queryById(Long id) {
|
||||
public SchisandraAuthPermission queryById(String id) {
|
||||
return this.schisandraAuthPermissionDao.selectOneById(id);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class SchisandraAuthPermissionServiceImpl extends CacheableServiceImpl<Sc
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SchisandraAuthPermission> queryListByIds(List<Long> permissionIdList) {
|
||||
public List<SchisandraAuthPermission> queryListByIds(List<String> permissionIdList) {
|
||||
return schisandraAuthPermissionDao.selectListByIds(permissionIdList);
|
||||
}
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ public class SchisandraAuthRolePermissionServiceImpl implements SchisandraAuthRo
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraAuthRolePermission queryById(Long id) {
|
||||
public SchisandraAuthRolePermission queryById(String id) {
|
||||
return this.schisandraAuthRolePermissionDao.selectOneById(id);
|
||||
}
|
||||
|
||||
|
@@ -28,7 +28,7 @@ public class SchisandraAuthRoleServiceImpl implements SchisandraAuthRoleService
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraAuthRole queryById(Long id) {
|
||||
public SchisandraAuthRole queryById(String id) {
|
||||
return this.schisandraAuthRoleDao.selectOneById(id);
|
||||
}
|
||||
|
||||
@@ -64,12 +64,12 @@ public class SchisandraAuthRoleServiceImpl implements SchisandraAuthRoleService
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
public boolean deleteById(String id) {
|
||||
return this.schisandraAuthRoleDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SchisandraAuthRole queryByRoleId(Long code) {
|
||||
public SchisandraAuthRole queryByRoleId(String code) {
|
||||
return schisandraAuthRoleDao.selectOneByCondition(SchisandraAuthRoleTableDef.SCHISANDRA_AUTH_ROLE.ID.eq(code));
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ public class SchisandraAuthUserRoleServiceImpl implements SchisandraAuthUserRole
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraAuthUserRole queryById(Long id) {
|
||||
public SchisandraAuthUserRole queryById(String id) {
|
||||
return this.schisandraAuthUserRoleDao.selectOneByCondition(SchisandraAuthUserRoleTableDef.SCHISANDRA_AUTH_USER_ROLE.USER_ID.eq(id));
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class SchisandraAuthUserRoleServiceImpl implements SchisandraAuthUserRole
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
public boolean deleteById(String id) {
|
||||
return this.schisandraAuthUserRoleDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
|
@@ -41,7 +41,7 @@ public class SchisandraAuthUserServiceImpl implements SchisandraAuthUserService
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraAuthUser queryById(Long id) {
|
||||
public SchisandraAuthUser queryById(String id) {
|
||||
return this.schisandraAuthUserDao.selectOneById(id);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class SchisandraAuthUserServiceImpl implements SchisandraAuthUserService
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
public boolean deleteById(String id) {
|
||||
return this.schisandraAuthUserDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ public class SchisandraSocialUserAuthServiceImpl implements SchisandraSocialUser
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSocialUserAuth queryById(Long id) {
|
||||
public SchisandraSocialUserAuth queryById(String id) {
|
||||
return this.schisandraSocialUserAuthDao.selectOneById(id);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class SchisandraSocialUserAuthServiceImpl implements SchisandraSocialUser
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
public boolean deleteById(String id) {
|
||||
return this.schisandraSocialUserAuthDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ public class SchisandraSocialUserServiceImpl implements SchisandraSocialUserServ
|
||||
* @return 实例对象
|
||||
*/
|
||||
@Override
|
||||
public SchisandraSocialUser queryById(Long id) {
|
||||
public SchisandraSocialUser queryById(String id) {
|
||||
return this.schisandraSocialUserDao.selectOneById(id);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class SchisandraSocialUserServiceImpl implements SchisandraSocialUserServ
|
||||
* @return 是否成功
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(Long id) {
|
||||
public boolean deleteById(String id) {
|
||||
return this.schisandraSocialUserDao.deleteById(id) > 0;
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@ public class SmsConfigInfo implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Integer id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 配置id
|
||||
|
@@ -3,9 +3,9 @@
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraAuthPermissionDao">
|
||||
|
||||
<resultMap type="com.schisandra.auth.infra.basic.entity.SchisandraAuthPermission" id="SchisandraAuthPermissionMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
||||
<result property="parentId" column="parent_id" jdbcType="INTEGER"/>
|
||||
<result property="parentId" column="parent_id" jdbcType="VARCHAR"/>
|
||||
<result property="type" column="type" jdbcType="INTEGER"/>
|
||||
<result property="path" column="path" jdbcType="VARCHAR"/>
|
||||
<result property="status" column="status" jdbcType="INTEGER"/>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraAuthRoleDao">
|
||||
|
||||
<resultMap type="com.schisandra.auth.infra.basic.entity.SchisandraAuthRole" id="SchisandraAuthRoleMap">
|
||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="id" column="id" jdbcType="VARCHAR"/>
|
||||
<result property="roleName" column="role_name" jdbcType="VARCHAR"/>
|
||||
<result property="roleKey" column="role_key" jdbcType="VARCHAR"/>
|
||||
<result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
|
||||
|
@@ -3,9 +3,9 @@
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraAuthRolePermissionDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.auth.infra.basic.entity.SchisandraAuthRolePermission">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="role_id" jdbcType="BIGINT" property="roleId"/>
|
||||
<result column="permission_id" jdbcType="BIGINT" property="permissionId"/>
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="role_id" jdbcType="VARCHAR" property="roleId"/>
|
||||
<result column="permission_id" jdbcType="VARCHAR" property="permissionId"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraAuthUserDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.auth.infra.basic.entity.SchisandraAuthUser">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="user_name" jdbcType="VARCHAR" property="userName"/>
|
||||
<result column="uuid" jdbcType="VARCHAR" property="uuid"/>
|
||||
<result column="source" jdbcType="VARCHAR" property="source"/>
|
||||
|
@@ -3,9 +3,9 @@
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraAuthUserRoleDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.auth.infra.basic.entity.SchisandraAuthUserRole">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="user_id" jdbcType="BIGINT" property="userId"/>
|
||||
<result column="role_id" jdbcType="BIGINT" property="roleId"/>
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="role_id" jdbcType="VARCHAR" property="roleId"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
||||
|
@@ -3,9 +3,9 @@
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraSocialUserAuthDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.auth.infra.basic.entity.SchisandraSocialUserAuth">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="user_id" jdbcType="BIGINT" property="userId"/>
|
||||
<result column="social_user_id" jdbcType="BIGINT" property="socialUserId"/>
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="user_id" jdbcType="VARCHAR" property="userId"/>
|
||||
<result column="social_user_id" jdbcType="VARCHAR" property="socialUserId"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<mapper namespace="com.schisandra.auth.infra.basic.dao.SchisandraSocialUserDao">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.schisandra.auth.infra.basic.entity.SchisandraSocialUser">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<id column="id" jdbcType="VARCHAR" property="id"/>
|
||||
<result column="uuid" jdbcType="VARCHAR" property="uuid"/>
|
||||
<result column="source" jdbcType="VARCHAR" property="source"/>
|
||||
<result column="access_token" jdbcType="VARCHAR" property="accessToken"/>
|
||||
|
@@ -5,7 +5,6 @@ import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.schisandra.oss.application.convert.SchisandraOssAliDTOConverter;
|
||||
import com.schisandra.oss.application.convert.SchisandraOssMinioDTOConverter;
|
||||
import com.schisandra.oss.application.dto.SchisandraOssAliDTO;
|
||||
import com.schisandra.oss.application.oss.constant.OssConstant;
|
||||
import com.schisandra.oss.application.oss.core.ali.AliOssClient;
|
||||
@@ -13,11 +12,9 @@ import com.schisandra.oss.application.oss.core.ali.AliOssConfiguration;
|
||||
import com.schisandra.oss.application.oss.model.OssInfo;
|
||||
import com.schisandra.oss.common.entity.Result;
|
||||
import com.schisandra.oss.domain.bo.SchisandraOssAliBO;
|
||||
import com.schisandra.oss.domain.bo.SchisandraOssMinioBO;
|
||||
import com.schisandra.oss.domain.redis.RedisUtil;
|
||||
import com.schisandra.oss.domain.service.SchisandraOssAliDomainService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.util.StreamUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -28,10 +25,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -62,13 +57,14 @@ public class SchisandraOssAliController {
|
||||
|
||||
/**
|
||||
* 返回当前用户ali表所有数据
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("return_online")
|
||||
public Result returnOnline(Long userId) {
|
||||
public Result returnOnline(String userId) {
|
||||
List<SchisandraOssAliBO> list = schisandraOssAliDomainService.selectAllPresent(userId);
|
||||
if(list.isEmpty()){
|
||||
if (list.isEmpty()) {
|
||||
return Result.fail();
|
||||
}
|
||||
return Result.ok(SchisandraOssAliDTOConverter.INSTANCE.convertBOToDTOList(list));
|
||||
@@ -83,7 +79,7 @@ public class SchisandraOssAliController {
|
||||
@GetMapping("returnAll")
|
||||
public Result returnAll() {
|
||||
List<SchisandraOssAliBO> list = schisandraOssAliDomainService.selectAll();
|
||||
if(list.isEmpty()){
|
||||
if (list.isEmpty()) {
|
||||
return Result.fail();
|
||||
}
|
||||
return Result.ok(SchisandraOssAliDTOConverter.INSTANCE.convertBOToDTOList(list));
|
||||
@@ -91,35 +87,35 @@ public class SchisandraOssAliController {
|
||||
|
||||
|
||||
@GetMapping("init")
|
||||
public Result init(@RequestParam String userId,@RequestParam String Id) {
|
||||
public Result init(@RequestParam String userId, @RequestParam String Id) {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraOssAliController.init.userId:{}", userId);
|
||||
}
|
||||
Preconditions.checkNotNull(userId, "用户id不能为空!");
|
||||
SchisandraOssAliBO bo = new SchisandraOssAliBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(true));
|
||||
if(schisandraOssAliDomainService.update(bo)){
|
||||
if (schisandraOssAliDomainService.update(bo)) {
|
||||
return aliOssConfiguration.aliOssClient(userId);
|
||||
}else{
|
||||
} else {
|
||||
return Result.fail("初始化失败");
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("shutdown")
|
||||
public Result shutdownAli(@RequestParam String userId,@RequestParam String Id){
|
||||
public Result shutdownAli(@RequestParam String userId, @RequestParam String Id) {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraOssAliController.shutdown.userId:{}", JSON.toJSONString(userId));
|
||||
}
|
||||
SchisandraOssAliBO bo = new SchisandraOssAliBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(false));
|
||||
if(schisandraOssAliDomainService.update(bo)){
|
||||
SpringUtil.unregisterBean(OssConstant.OssType.ALI+ userId);
|
||||
if (schisandraOssAliDomainService.update(bo)) {
|
||||
SpringUtil.unregisterBean(OssConstant.OssType.ALI + userId);
|
||||
return Result.ok("关闭成功");
|
||||
}else{
|
||||
} else {
|
||||
return Result.fail("关闭失败");
|
||||
}
|
||||
}
|
||||
@@ -173,7 +169,7 @@ public class SchisandraOssAliController {
|
||||
if (log.isInfoEnabled()) {
|
||||
log.info("SchisandraOssAliController.delete.dto:{}", JSON.toJSONString(schisandraOssAliDTO));
|
||||
}
|
||||
parameterCheck(schisandraOssAliDTO);
|
||||
Preconditions.checkNotNull(schisandraOssAliDTO.getId(), "ID不能为空");
|
||||
SchisandraOssAliBO schisandraOssAliBO = SchisandraOssAliDTOConverter.INSTANCE.convertDTOToBO(schisandraOssAliDTO);
|
||||
return Result.ok(schisandraOssAliDomainService.delete(schisandraOssAliBO));
|
||||
} catch (Exception e) {
|
||||
@@ -191,13 +187,13 @@ public class SchisandraOssAliController {
|
||||
@GetMapping("listDir")
|
||||
public Result<String> listAliDir(@RequestParam String userId, @RequestParam String bucket, @RequestParam String prefix) throws Exception {
|
||||
Preconditions.checkNotNull(userId, "不能为空");
|
||||
AliOssClient bean = SpringUtil.getBean(OssConstant.OssType.ALI+ userId);
|
||||
AliOssClient bean = SpringUtil.getBean(OssConstant.OssType.ALI + userId);
|
||||
bean.getAliOssConfig().setBucketName(bucket);
|
||||
if (prefix == null)
|
||||
prefix = "";
|
||||
if(bean.listAliInfo(bucket, prefix) != null){
|
||||
if (bean.listAliInfo(bucket, prefix) != null) {
|
||||
return Result.ok(bean.listAliInfo(bucket, prefix));
|
||||
}else{
|
||||
} else {
|
||||
return Result.fail("获取文件目录信息失败");
|
||||
}
|
||||
|
||||
@@ -212,10 +208,10 @@ public class SchisandraOssAliController {
|
||||
@PostMapping("seleteBucket")
|
||||
public Result seleteBucket(@RequestParam String userId) {
|
||||
Preconditions.checkNotNull(userId, "不能为空");
|
||||
AliOssClient bean = SpringUtil.getBean(OssConstant.OssType.ALI+ userId);
|
||||
if(bean.selectAllBucket() != null){
|
||||
AliOssClient bean = SpringUtil.getBean(OssConstant.OssType.ALI + userId);
|
||||
if (bean.selectAllBucket() != null) {
|
||||
return Result.ok(bean.selectAllBucket());
|
||||
}else{
|
||||
} else {
|
||||
return Result.fail("查询失败");
|
||||
}
|
||||
|
||||
@@ -232,11 +228,11 @@ public class SchisandraOssAliController {
|
||||
public Result<String> createBucket(@RequestParam String userId, @RequestParam String bucket) {
|
||||
Preconditions.checkNotNull(userId, "不能为空");
|
||||
Preconditions.checkNotNull(bucket, "不能为空");
|
||||
AliOssClient bean = SpringUtil.getBean(OssConstant.OssType.ALI+ userId);
|
||||
AliOssClient bean = SpringUtil.getBean(OssConstant.OssType.ALI + userId);
|
||||
bean.getAliOssConfig().setBucketName(bucket);
|
||||
if(bean.createBucket(bucket).equals(bucket)){
|
||||
if (bean.createBucket(bucket).equals(bucket)) {
|
||||
return Result.ok(bean.createBucket(bucket));
|
||||
}else{
|
||||
} else {
|
||||
return Result.fail("创建失败");
|
||||
}
|
||||
}
|
||||
@@ -254,9 +250,9 @@ public class SchisandraOssAliController {
|
||||
Preconditions.checkNotNull(bucket, "不能为空");
|
||||
AliOssClient bean = SpringUtil.getBean(OssConstant.OssType.ALI + userId);
|
||||
bean.getAliOssConfig().setBucketName(bucket);
|
||||
if(bean.deleteBucket(bucket).equals("yes")){
|
||||
if (bean.deleteBucket(bucket).equals("yes")) {
|
||||
return Result.ok(bean.deleteBucket(bucket));
|
||||
}else{
|
||||
} else {
|
||||
return Result.fail("删除失败,或许桶已经不存在");
|
||||
}
|
||||
}
|
||||
@@ -290,16 +286,15 @@ public class SchisandraOssAliController {
|
||||
InputStream is = file.getInputStream();
|
||||
AliOssClient bean = SpringUtil.getBean(OssConstant.OssType.ALI + userId);
|
||||
bean.getAliOssConfig().setBucketName(bucket);
|
||||
if(bean.upLoad(is, fileName, true) != null){
|
||||
if (bean.upLoad(is, fileName, true) != null) {
|
||||
return Result.ok(bean.upLoad(is, fileName, true));
|
||||
}else{
|
||||
} else {
|
||||
return Result.fail();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description: 下载文件
|
||||
* @param: [schisandraOssAliDTO]
|
||||
@@ -317,7 +312,7 @@ public class SchisandraOssAliController {
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("下载.zip", "UTF-8"));
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
HashMap<String,InputStream> list=bean.downLoadMany(filePath);
|
||||
HashMap<String, InputStream> list = bean.downLoadMany(filePath);
|
||||
String[] path = new String[list.size()];
|
||||
InputStream[] inputStreams = new InputStream[list.size()];
|
||||
path = list.keySet().toArray(path);
|
||||
@@ -328,14 +323,14 @@ public class SchisandraOssAliController {
|
||||
String formattedDate = dateFormat.format(date);
|
||||
AtomicInteger count = new AtomicInteger(0);
|
||||
InputStream[] inputStream2 = new InputStream[list.size()];
|
||||
list.keySet().forEach( name -> {
|
||||
list.keySet().forEach(name -> {
|
||||
try {
|
||||
byte[] bytes = StreamUtils.copyToByteArray(list.get(name));
|
||||
inputStream2[count.get()] = new ByteArrayInputStream(bytes);
|
||||
String key = redisUtil.buildKey(USER_OSS_PREFIX, "download", formattedDate, userId, name);
|
||||
HashMap<Object, Object> map = new HashMap<>();
|
||||
map.put("size", bytes.length);
|
||||
map.put("time",formattedDate);
|
||||
map.put("time", formattedDate);
|
||||
redisUtil.setNx(key, map, 30L, TimeUnit.DAYS);
|
||||
count.incrementAndGet();
|
||||
} catch (IOException e) {
|
||||
|
@@ -47,8 +47,6 @@ import java.util.concurrent.TimeUnit;
|
||||
@RequestMapping("/oss/minio/")
|
||||
@Slf4j
|
||||
public class SchisandraOssMinioController {
|
||||
@Resource
|
||||
MinioOssClient minioOssClient;
|
||||
|
||||
@Resource
|
||||
private SchisandraOssMinioDomainService schisandraOssMinioDomainService;
|
||||
@@ -65,7 +63,7 @@ public class SchisandraOssMinioController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("return_online")
|
||||
public Result returnOnline(Long userId) {
|
||||
public Result returnOnline(String userId) {
|
||||
List<SchisandraOssMinioBO> list = schisandraOssMinioDomainService.selectAllPresent(userId);
|
||||
if(list.isEmpty()){
|
||||
return Result.fail();
|
||||
@@ -102,14 +100,14 @@ public class SchisandraOssMinioController {
|
||||
log.info("SchisandraOssMinioController.init.userId:{}", userId);
|
||||
}
|
||||
Preconditions.checkNotNull(userId, "用户id不能为空!");
|
||||
List<SchisandraOssMinioBO> list = schisandraOssMinioDomainService.getAllMinioInfoByUserId(Long.valueOf(userId));
|
||||
List<SchisandraOssMinioBO> list = schisandraOssMinioDomainService.getAllMinioInfoByUserId(userId);
|
||||
if (list.size() != 0) {
|
||||
return Result.fail(list);
|
||||
}
|
||||
|
||||
SchisandraOssMinioBO bo = new SchisandraOssMinioBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(true));
|
||||
if (schisandraOssMinioDomainService.update(bo)) {
|
||||
return minioOssConfiguration.minioOssClient(userId);
|
||||
@@ -124,8 +122,8 @@ public class SchisandraOssMinioController {
|
||||
log.info("SchisandraOssMinioController.shutdown.userId:{}", userId);
|
||||
}
|
||||
SchisandraOssMinioBO bo = new SchisandraOssMinioBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(false));
|
||||
if (schisandraOssMinioDomainService.update(bo)) {
|
||||
SpringUtil.unregisterBean(OssConstant.OssType.MINIO + userId);
|
||||
@@ -413,7 +411,7 @@ public class SchisandraOssMinioController {
|
||||
|
||||
@PostMapping("get")
|
||||
public SchisandraOssMinioDTO getMinioOss(@RequestParam String userId) {
|
||||
return SchisandraOssMinioDTOConverter.INSTANCE.convertBOToDTO(schisandraOssMinioDomainService.getMinioConfig(Long.valueOf(userId)));
|
||||
return SchisandraOssMinioDTOConverter.INSTANCE.convertBOToDTO(schisandraOssMinioDomainService.getMinioConfig(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -62,7 +62,7 @@ public class SchisandraOssQiniuController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("return_online")
|
||||
public Result returnOnline(Long userId) {
|
||||
public Result returnOnline(String userId) {
|
||||
List<SchisandraOssQiniuBO> list = schisandraOssQiniuDomainService.selectAllPresent(userId);
|
||||
if(list.isEmpty()){
|
||||
return Result.fail();
|
||||
@@ -163,7 +163,7 @@ public class SchisandraOssQiniuController {
|
||||
public Result download_open(@RequestParam String userId, @RequestParam String bucket, @RequestParam List<String> listObjectsArgs, HttpServletResponse response) throws IOException {
|
||||
QiNiuOssClient bean = SpringUtil.getBean(OssConstant.OssType.QINIU + userId);
|
||||
ServletOutputStream output = response.getOutputStream();
|
||||
SchisandraOssQiniuBO schisandraOssQiniuBO = schisandraOssQiniuDomainService.getEndpointByuserIdAndBucket(Long.valueOf(userId), bucket);
|
||||
SchisandraOssQiniuBO schisandraOssQiniuBO = schisandraOssQiniuDomainService.getEndpointByuserIdAndBucket(userId, bucket);
|
||||
if (schisandraOssQiniuBO.getEndpoint() == null) {
|
||||
return Result.fail("请配置该存储桶的相关配置:endpoint");
|
||||
}
|
||||
@@ -332,8 +332,8 @@ public class SchisandraOssQiniuController {
|
||||
}
|
||||
Preconditions.checkNotNull(userId, "用户id不能为空!");
|
||||
SchisandraOssQiniuBO bo = new SchisandraOssQiniuBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(true));
|
||||
if (schisandraOssQiniuDomainService.update(bo)) {
|
||||
return qiNiuOssConfiguration.qiNiuOssClient(userId);
|
||||
@@ -348,8 +348,8 @@ public class SchisandraOssQiniuController {
|
||||
log.info("SchisandraOssQiniuController.shutdown.userId:{}", JSON.toJSONString(userId));
|
||||
}
|
||||
SchisandraOssQiniuBO bo = new SchisandraOssQiniuBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(false));
|
||||
if (schisandraOssQiniuDomainService.update(bo)) {
|
||||
SpringUtil.unregisterBean(OssConstant.OssType.QINIU + userId);
|
||||
|
@@ -192,8 +192,8 @@ public class SchisandraOssSftpController {
|
||||
}
|
||||
Preconditions.checkNotNull(userId, "用户id不能为空!");
|
||||
SchisandraOssSftpBO bo = new SchisandraOssSftpBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(true));
|
||||
if(schisandraOssSftpDomainService.update(bo)){
|
||||
return sftpOssConfiguration.sftpOssClient(userId);
|
||||
@@ -208,8 +208,8 @@ public class SchisandraOssSftpController {
|
||||
log.info("SchisandraOssSftpController.shutdown.userId:{}", JSON.toJSONString(userId));
|
||||
}
|
||||
SchisandraOssSftpBO bo = new SchisandraOssSftpBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(false));
|
||||
if(schisandraOssSftpDomainService.update(bo)){
|
||||
SpringUtil.unregisterBean(OssConstant.OssType.SFTP+ userId);
|
||||
|
@@ -67,7 +67,7 @@ public class SchisandraOssTencentController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("return_online")
|
||||
public Result returnOnline(Long userId) {
|
||||
public Result returnOnline(String userId) {
|
||||
List<SchisandraOssTencentBO> list = schisandraOssTencentDomainService.selectAllPresent(userId);
|
||||
if(list.isEmpty()){
|
||||
return Result.fail();
|
||||
@@ -97,8 +97,8 @@ public class SchisandraOssTencentController {
|
||||
}
|
||||
Preconditions.checkNotNull(userId, "用户id不能为空!");
|
||||
SchisandraOssTencentBO bo = new SchisandraOssTencentBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(true));
|
||||
if (schisandraOssTencentDomainService.update(bo)) {
|
||||
return tencentOssConfiguration.tencentOssClient(userId);
|
||||
@@ -113,8 +113,8 @@ public class SchisandraOssTencentController {
|
||||
log.info("SchisandraOssTencentController.shutdown.userId:{}", JSON.toJSONString(userId));
|
||||
}
|
||||
SchisandraOssTencentBO bo = new SchisandraOssTencentBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(false));
|
||||
if (schisandraOssTencentDomainService.update(bo)) {
|
||||
SpringUtil.unregisterBean(OssConstant.OssType.TENCENT + userId);
|
||||
|
@@ -68,8 +68,8 @@ public class SchisandraOssUpController {
|
||||
}
|
||||
Preconditions.checkNotNull(userId, "用户id不能为空!");
|
||||
SchisandraOssUpBO bo = new SchisandraOssUpBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(true));
|
||||
if(schisandraOssUpDomainService.update(bo)){
|
||||
return upOssConfiguration.upOssClient(userId);
|
||||
@@ -84,8 +84,8 @@ public class SchisandraOssUpController {
|
||||
log.info("SchisandraOssUpController.shutdown.userId:{}", JSON.toJSONString(userId));
|
||||
}
|
||||
SchisandraOssUpBO bo = new SchisandraOssUpBO();
|
||||
bo.setId(Long.valueOf(Id));
|
||||
bo.setUserId(Long.valueOf(userId));
|
||||
bo.setId(Id);
|
||||
bo.setUserId(userId);
|
||||
bo.setStatus(String.valueOf(false));
|
||||
if(schisandraOssUpDomainService.update(bo)){
|
||||
SpringUtil.unregisterBean(OssConstant.OssType.UP+ userId);
|
||||
|
@@ -140,7 +140,7 @@ public class SchisandraUserOssController {
|
||||
* @date: 2024/7/11 14:41
|
||||
*/
|
||||
@GetMapping("selectUserOSSType")
|
||||
public Result<Object> selectUserOSSType(Long userId) {
|
||||
public Result<Object> selectUserOSSType(String userId) {
|
||||
Preconditions.checkNotNull(userId, "不能为空");
|
||||
List<SchisandraUserOssDTO> SchisandraUserOssDTOList = SchisandraUserOssDTOConverter.INSTANCE.convertBOListToDTOList(schisandraUserOssDomainService.queryOSSByUserId(userId));
|
||||
if (SchisandraUserOssDTOList.isEmpty()) {
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraFileHeatmapDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -7,7 +7,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* dto
|
||||
* dto
|
||||
*
|
||||
* @author landaiqing
|
||||
* @since 2024-05-14 20:45:32
|
||||
@@ -18,7 +18,7 @@ public class SchisandraOssAliDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -187,7 +187,7 @@ public class SchisandraOssAliDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 是否开启HTTP重定向。
|
||||
说明: Java SDK 3.10.1及以上版本支持设置是否开启HTTP重定向,默认开启。
|
||||
* 说明: Java SDK 3.10.1及以上版本支持设置是否开启HTTP重定向,默认开启。
|
||||
*/
|
||||
private String redirectEnable;
|
||||
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssAwsDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 数据存储路径
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssBaiduDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssFtpDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssHuaweiDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssJdDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssJdbcDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssJdbcDataDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssJdbcStoreDTO implements Serializable {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 文件/目录名
|
||||
|
@@ -15,14 +15,14 @@ import java.util.Date;
|
||||
public class SchisandraOssJinshanDTO implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
* 主键
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssLocalDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -18,12 +18,12 @@ public class SchisandraOssMinioDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssPinganDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long systemUserId;
|
||||
private String systemUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssQingyunDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -18,12 +18,12 @@ public class SchisandraOssQiniuDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -18,12 +18,12 @@ public class SchisandraOssSftpDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 主机
|
||||
|
@@ -18,12 +18,12 @@ public class SchisandraOssTencentDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssUcloudDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -18,12 +18,12 @@ public class SchisandraOssUpDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssWangyiDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraUserOssDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -36,7 +36,7 @@ public class SchisandraUserOssDTO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String configCount;
|
||||
private Integer configCount;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -38,7 +38,7 @@ public class AliOssConfiguration {
|
||||
|
||||
public Result aliOssClient(String userId) {
|
||||
CompletableFuture<SchisandraOssAliDTO> futurePrice = CompletableFuture.supplyAsync(() -> {
|
||||
SchisandraOssAliBO schisandraOssAliBO = schisandraOssAliDomainService.getAliOssConfig(Long.valueOf(userId));
|
||||
SchisandraOssAliBO schisandraOssAliBO = schisandraOssAliDomainService.getAliOssConfig(userId);
|
||||
SchisandraOssAliDTO schisandraOssAliDTO = SchisandraOssAliDTOConverter.INSTANCE.convertBOToDTO(schisandraOssAliBO);
|
||||
return schisandraOssAliDTO;
|
||||
});
|
||||
|
@@ -85,7 +85,7 @@ public class MinioOssConfiguration {
|
||||
|
||||
public SchisandraOssMinioDTO getSchisandraOssMinioDTO(String userId) {
|
||||
CompletableFuture<SchisandraOssMinioDTO> futurePrice = CompletableFuture.supplyAsync(() -> {
|
||||
SchisandraOssMinioBO minioBO = schisandraOssMinioDomainService.getMinioConfig(Long.valueOf(userId));
|
||||
SchisandraOssMinioBO minioBO = schisandraOssMinioDomainService.getMinioConfig(userId);
|
||||
SchisandraOssMinioDTO minioDTO = SchisandraOssMinioDTOConverter.INSTANCE.convertBOToDTO(minioBO);
|
||||
return minioDTO;
|
||||
});
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraFileHeatmapBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssAliBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* OSS地址
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraOssAwsBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 数据存储路径
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraOssBaiduBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraOssFtpBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -16,13 +16,12 @@ public class SchisandraOssHuaweiBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
private String userId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraOssJdBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraOssJdbcBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraOssJdbcDataBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 数据
|
||||
|
@@ -14,14 +14,14 @@ import java.util.Date;
|
||||
public class SchisandraOssJdbcStoreBO implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 文件/目录名
|
||||
|
@@ -13,16 +13,16 @@ import java.util.Date;
|
||||
*/
|
||||
@Data
|
||||
public class SchisandraOssJinshanBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraOssLocalBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -17,12 +17,12 @@ public class SchisandraOssMinioBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraOssPinganBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long systemUserId;
|
||||
private String systemUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -16,12 +16,12 @@ public class SchisandraOssQingyunBO implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long userId;
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
*
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user