Skip to content

Commit

Permalink
Merge pull request #19 from lotteon2/dev-user-refactor
Browse files Browse the repository at this point in the history
feat: add the user get phoneNumber
  • Loading branch information
nowgnas authored Dec 26, 2023
2 parents d7e81fb + dae53f5 commit 7e94e33
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ dependencies {
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'com.h2database:h2:2.1.214'

}

dependencyManagement {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.bit.lotte.flower.user.common.valueobject.UserId;
import com.bit.lotte.flower.user.social.dto.command.UserLoginCommand;
import com.bit.lotte.flower.user.social.dto.response.UserLoginDataResponse;
import com.bit.lotte.flower.user.social.service.GetUserInfoService;
import com.bit.lotte.flower.user.social.service.MapAuthIdToUserIdService;
import com.bit.lotte.flower.user.social.service.SocialUserLoginManager;
import com.bit.lotte.flower.user.social.service.SoftDeleteStrategyService;
Expand All @@ -17,10 +18,11 @@

@RequiredArgsConstructor
@RestController
public class UserFeignController {
public class SocialUserFeignController {

private final MapAuthIdToUserIdService<AuthId> mapAuthIdToUserIdService;
private final SoftDeleteStrategyService softDeleteStrategyService;
private final GetUserInfoService getUserInfoService;
private final SocialUserLoginManager socialUserLoginManager;


Expand All @@ -32,6 +34,11 @@ public CommonResponse<UserLoginDataResponse> userLogin(
}


@PutMapping("/client/users/{userId}/phone-number")
CommonResponse<String> getUserPhoneNumber(@PathVariable Long userId) {
return CommonResponse.success(getUserInfoService.getUserdata(userId).getPhoneNumber());
}

@PutMapping("/client/users/{userId}")
CommonResponse<Boolean> delete(@PathVariable Long userId) {
UserId convertedUserId = mapAuthIdToUserIdService.convert(new AuthId(userId));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import bloomingblooms.response.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.bit.lotte.flower.user.store.http.feign;

import com.bit.lotte.flower.user.store.http.feign.dto.UpdateStoreManagerPendingStausDto;
import bloomingblooms.response.CommonResponse;
import com.bit.lotte.flower.user.store.http.feign.dto.UpdateStoreManagerPendingStatusDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "init-store-manager-status",url = "${service.auth.domain}")
public interface InitStoreManagerStatusPendingFeignRequest {
@PatchMapping("/client/admin/store-manager")
public void publish(@RequestBody UpdateStoreManagerPendingStausDto dto);
@PutMapping("/client/store-manager")
public CommonResponse<String> publish(@RequestBody UpdateStoreManagerPendingStatusDto dto);
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@AllArgsConstructor
@NoArgsConstructor
@Getter
public class UpdateStoreManagerPendingStausDto {
public class UpdateStoreManagerPendingStatusDto {

@NotNull
private final String status = "ROLE_STORE_MANAGER_PENDING";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.bit.lotte.flower.user.common.valueobject.UserId;
import com.bit.lotte.flower.user.store.http.feign.InitStoreManagerStatusPendingFeignRequest;
import com.bit.lotte.flower.user.store.http.feign.dto.UpdateStoreManagerPendingStausDto;
import com.bit.lotte.flower.user.store.http.feign.dto.UpdateStoreManagerPendingStatusDto;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

Expand All @@ -15,6 +15,6 @@ public class InitStoreManagerAuthorizationPublisherImpl implements

@Override
public void publish(UserId storeManagerId) {
request.publish(new UpdateStoreManagerPendingStausDto(storeManagerId.getValue()));
request.publish(new UpdateStoreManagerPendingStatusDto(storeManagerId.getValue()));
}
}

0 comments on commit 7e94e33

Please sign in to comment.