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