Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4c9c247

Browse files
author
Thomasr
committed
#1445: API: Delete/Update user profile photo
1 parent3543827 commit4c9c247

File tree

2 files changed

+38
-5
lines changed

2 files changed

+38
-5
lines changed

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/UserController.java‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,28 @@ public Mono<ResponseView<Boolean>> uploadProfilePhoto(@RequestPart("file") Mono<
114114
.map(ResponseView::success);
115115
}
116116

117+
@Override
118+
publicMono<ResponseView<Boolean>>uploadProfilePhotoById(@PathVariableStringorgId,@PathVariableStringuserId,@RequestPart("file")Mono<Part>fileMono) {
119+
returnorgApiService.checkVisitorAdminRole(orgId).flatMap(__ ->userService.findById(userId))
120+
.zipWith(fileMono)
121+
.flatMap(tuple ->userService.saveProfilePhoto(tuple.getT2(),tuple.getT1()))
122+
.map(ResponseView::success);
123+
}
124+
117125
@Override
118126
publicMono<ResponseView<Void>>deleteProfilePhoto() {
119127
returnsessionUserService.getVisitor()
120128
.flatMap(visitor ->userService.deleteProfilePhoto(visitor)
121129
.map(ResponseView::success));
122130
}
123131

132+
@Override
133+
publicMono<ResponseView<Void>>deleteProfilePhotoById(@PathVariableStringorgId,@PathVariableStringuserId) {
134+
returnorgApiService.checkVisitorAdminRole(orgId).flatMap(__ ->userService.findById(userId))
135+
.flatMap(user ->userService.deleteProfilePhoto(user)
136+
.map(ResponseView::success));
137+
}
138+
124139
@Override
125140
publicMono<Void>getProfilePhoto(ServerWebExchangeexchange) {
126141
returnsessionUserService.getVisitorId()

‎server/api-service/lowcoder-server/src/main/java/org/lowcoder/api/usermanagement/UserEndpoints.java‎

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,30 @@ public interface UserEndpoints
9595

9696
@Operation(
9797
tags =TAG_USER_PROFILE_PHOTO_MANAGEMENT,
98-
operationId ="deleteUserProfilePhoto",
99-
summary ="Delete current users profile photo",
100-
description ="Remove the profile Photo associated with the current Userwithin Lowcoder."
98+
operationId ="uploadUserProfilePhotoById",
99+
summary ="Upload specific Users profile photo",
100+
description ="Upload or change specific profile photowithin Lowcoder for personalization."
101101
)
102-
@DeleteMapping("/photo")
103-
publicMono<ResponseView<Void>>deleteProfilePhoto();
102+
@PostMapping(value ="/photo/{orgId}/{userId}",consumes =MediaType.MULTIPART_FORM_DATA_VALUE)
103+
publicMono<ResponseView<Boolean>>uploadProfilePhotoById(@PathVariableStringorgId,@PathVariableStringuserId,@RequestPart("file")Mono<Part>fileMono);
104+
105+
@Operation(
106+
tags =TAG_USER_PROFILE_PHOTO_MANAGEMENT,
107+
operationId ="deleteUserProfilePhotoById",
108+
summary ="Delete specific users profile photo",
109+
description ="Remove the profile Photo associated with the specific User within Lowcoder."
110+
)
111+
112+
@DeleteMapping("/photo/{orgId}/{userId}")
113+
publicMono<ResponseView<Void>>deleteProfilePhotoById(@PathVariableStringorgId,@PathVariableStringuserId);
114+
@Operation(
115+
tags =TAG_USER_PROFILE_PHOTO_MANAGEMENT,
116+
operationId ="deleteUserProfilePhoto",
117+
summary ="Delete current users profile photo",
118+
description ="Remove the profile Photo associated with the current User within Lowcoder."
119+
)
120+
@DeleteMapping("/photo")
121+
publicMono<ResponseView<Void>>deleteProfilePhoto();
104122

105123
@Operation(
106124
tags =TAG_USER_PROFILE_PHOTO_MANAGEMENT,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp