feat: 个人中心alpha阶段
This commit is contained in:
@@ -179,7 +179,7 @@ public class SysUserController {
|
|||||||
@PathVariable Long userId,
|
@PathVariable Long userId,
|
||||||
@RequestBody UserProfileForm formData
|
@RequestBody UserProfileForm formData
|
||||||
) {
|
) {
|
||||||
boolean result = userService.updateUserProfile(formData);
|
boolean result = userService.updateUserProfile(userId,formData);
|
||||||
return Result.judge(result);
|
return Result.judge(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,10 +105,11 @@ public interface SysUserService extends IService<SysUser> {
|
|||||||
/**
|
/**
|
||||||
* 修改个人中心用户信息
|
* 修改个人中心用户信息
|
||||||
*
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
* @param formData 表单数据
|
* @param formData 表单数据
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean updateUserProfile(UserProfileForm formData);
|
boolean updateUserProfile(Long userId, UserProfileForm formData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改用户密码
|
* 修改用户密码
|
||||||
@@ -122,7 +123,7 @@ public interface SysUserService extends IService<SysUser> {
|
|||||||
/**
|
/**
|
||||||
* 重置用户密码
|
* 重置用户密码
|
||||||
*
|
*
|
||||||
* @param userId 用户ID
|
* @param userId 用户ID
|
||||||
* @param password 重置后的密码
|
* @param password 重置后的密码
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -273,8 +273,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean updateUserProfile(UserProfileForm formData) {
|
public boolean updateUserProfile(Long userId, UserProfileForm formData) {
|
||||||
SysUser entity = userConverter.toEntity(formData);
|
SysUser entity = userConverter.toEntity(formData);
|
||||||
|
entity.setId(userId);
|
||||||
return this.updateById(entity);
|
return this.updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import jakarta.annotation.PostConstruct;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -29,7 +30,7 @@ import java.time.LocalDateTime;
|
|||||||
* @since 2.3.0
|
* @since 2.3.0
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@ConditionalOnProperty(value = "oss.type", havingValue = "aliyun")
|
@ConditionalOnExpression("'${oss.enabled}' == 'true' and '${oss.type}' == 'aliyun'")
|
||||||
@ConfigurationProperties(prefix = "oss.aliyun")
|
@ConfigurationProperties(prefix = "oss.aliyun")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import jakarta.annotation.PostConstruct;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.SneakyThrows;
|
import lombok.SneakyThrows;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -32,7 +33,7 @@ import java.time.LocalDateTime;
|
|||||||
* @since 2023/6/2
|
* @since 2023/6/2
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
@ConditionalOnProperty(value = "oss.type", havingValue = "minio")
|
@ConditionalOnExpression("'${oss.enabled}' == 'true' and '${oss.type}' == 'minio'")
|
||||||
@ConfigurationProperties(prefix = "oss.minio")
|
@ConfigurationProperties(prefix = "oss.minio")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
@@ -69,7 +70,7 @@ public class MinioOssService implements OssService {
|
|||||||
.credentials(accessKey, secretKey)
|
.credentials(accessKey, secretKey)
|
||||||
.build();
|
.build();
|
||||||
// 创建存储桶
|
// 创建存储桶
|
||||||
// createBucketIfAbsent(bucketName);
|
createBucketIfAbsent(bucketName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user