Merge remote-tracking branch 'refs/remotes/origin/dev'

# Conflicts:
#	schisandra-cloud-storage-auth/schisandra-cloud-storage-auth-application/schisandra-cloud-storage-auth-application-controller/src/main/java/com/schisandra/auth/application/controller/SchisandraAuthUserController.java
#	schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssMinioController.java
#	schisandra-cloud-storage-oss/schisandra-cloud-storage-oss-application/schisandra-cloud-storage-oss-application-controller/src/main/java/com/schisandra/oss/application/controller/SchisandraOssUpController.java
This commit is contained in:
landaiqing
2024-07-13 11:24:21 +08:00
92 changed files with 3555 additions and 106 deletions

View File

@@ -29,6 +29,8 @@ import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.*;
@@ -372,6 +374,23 @@ public class SchisandraAuthUserController {
}
return Result.ok(JSONObject.parseObject(result));
}
/**
* @description: 获取用户信息
* @param: [userId]
* @return: com.schisandra.auth.common.entity.Result<com.schisandra.auth.application.dto.SchisandraAuthUserDTO>
* @author zlg
* @date: 2024/7/11 9:39
*/
@GetMapping("getUserInfo")
public Result<SchisandraAuthUserDTO> getUserInfo(@RequestParam("userId") Long userId) {
SchisandraAuthUserDTO schisandraAuthUserDTO = SchisandraAuthUserDTOConverter.INSTANCE.convertBOToDTO(schisandraAuthUserDomainService.queryById(userId));
if ( schisandraAuthUserDTO== null) {
return Result.fail("该用户不存在");
}else {
return Result.ok(schisandraAuthUserDTO);
}
}
}

View File

@@ -5,6 +5,9 @@ import com.schisandra.auth.common.entity.Result;
import com.schisandra.auth.domain.bo.SchisandraAuthUserBO;
import com.schisandra.auth.infra.basic.entity.SchisandraAuthUser;
import me.zhyd.oauth.model.AuthUser;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import java.util.HashMap;
@@ -61,6 +64,7 @@ public interface SchisandraAuthUserDomainService {
* @author schisandra
* @date 2024/3/21 23:14
*/
@CachePut(value = "userInfo", key = "#schisandraAuthUserBO.id")
Object update(SchisandraAuthUserBO schisandraAuthUserBO);
/**
@@ -70,6 +74,7 @@ public interface SchisandraAuthUserDomainService {
* @author: landaiqing
* @date: 2024/5/26 17:27
*/
Result insertAuthUserByOauth(AuthUser data, String type);
/**
@@ -79,7 +84,8 @@ public interface SchisandraAuthUserDomainService {
* @author: landaiqing
* @date: 2024/5/26 17:27
*/
SchisandraAuthUserBO queryById(SchisandraAuthUserBO schisandraAuthUserBO);
@Cacheable(value = "userInfo", key = "#userId")
SchisandraAuthUserBO queryById(Long userId);
/**
* @param schisandraAuthUserBO
@@ -95,6 +101,7 @@ public interface SchisandraAuthUserDomainService {
* @description 删除用户(物理)
* @author msz
*/
@CacheEvict(value = "userInfo",key = "id")
Object deleteById(Long id);
SchisandraAuthUser queryByPhone(String phone);

View File

@@ -167,15 +167,15 @@ public class SchisandraAuthUserDomainServiceImpl implements SchisandraAuthUserDo
/**
* @param schisandraAuthUserBO
* @param Long
* @return
* @description 查询用户信息
* @author msz
* @date 2024/4/3 22:10
*/
@Override
public SchisandraAuthUserBO queryById(SchisandraAuthUserBO schisandraAuthUserBO) {
SchisandraAuthUser schisandraAuthUser = schisandraAuthUserService.queryById(schisandraAuthUserBO.getId());
public SchisandraAuthUserBO queryById(Long userId) {
SchisandraAuthUser schisandraAuthUser = schisandraAuthUserService.queryById(userId);
SchisandraAuthUserBO schisandraAuthUserBO1 = SchisandraAuthUserBOConverter.INSTANCE.convertEntityToBO(schisandraAuthUser);
return schisandraAuthUserBO1;
}

View File

@@ -3,6 +3,7 @@ package com.schisandra.auth;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@@ -18,6 +19,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@MapperScan("com.schisandra.**.dao")
@EnableFeignClients(basePackages = "com.schisandra")
@EnableTransactionManagement
@EnableCaching
public class AuthApplication {
public static void main(String[] args) {
SpringApplication.run(AuthApplication.class);

View File

@@ -27,6 +27,11 @@ spring:
enabled: true
config:
enabled: true
#caffeine缓存
cache:
type: caffeine
caffeine:
spec: maximumSize=10000,expireAfterAccess=60s
# redis配置
redis:
# Redis数据库索引默认为0
@@ -108,3 +113,4 @@ rocketmq:
producer:
group: schisandra-cloud-storage-auth-group
send-message-timeout: 6000