Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

안드 요청사항 우선반영 #17

Merged
merged 4 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,19 @@ public class WalkieController {
public ResponseEntity<WalkieSignUpResponse> signUp(@RequestBody WalkieSignUpRequest walkieSignUpRequest) {
return ResponseEntity.ok(walkieService.joinWalkie(walkieSignUpRequest));
}

@Operation(description = "닉네임 중복 확인 -- 회원가입과 동일한 dto 사용")
@Parameters({
@Parameter(name = "userName", required = true, description = "닉네임", example = "군자동 불주먹")
})
@GetMapping("/signup/check")
public ResponseEntity<WalkieSignUpResponse> check(@RequestBody WalkieSignUpRequest walkieSignUpRequest) {
return ResponseEntity.ok(
WalkieSignUpResponse.builder()
.hasDuplicatedName(
walkieService.checkNameDuplication(walkieSignUpRequest.getUserName())
)
.build()
);
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/whyranoid/walkie/dto/WalkieDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
@Getter
public class WalkieDto {

private Long uid;
private Long walkieId;
private String name;
private String profileImg;
private Character status;

@QueryProjection
public WalkieDto(Walkie walkie) {
this.uid = walkie.getUserId();
this.walkieId = walkie.getUserId();
this.name = walkie.getUserName();
this.profileImg = walkie.getProfileImg();
this.status = walkie.getStatus();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/whyranoid/walkie/dto/WalkingDto.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public class WalkingDto {

@Schema(description = "요청 필수 파라미터 - 워키 아이디", example = "3")
private Long uid;
private Long walkieId;

@Schema(description = "요청 필수 파라미터 - 운동 시작 시간", example = "2023-07-31T15:08:31.689Z")
private Date startTime;
Expand All @@ -25,8 +25,8 @@ public class WalkingDto {
private String authId;

@Builder
public WalkingDto(Long uid, Date startTime, Long historyId, Character newStatus, String authId) {
this.uid = uid;
public WalkingDto(Long walkieId, Date startTime, Long historyId, Character newStatus, String authId) {
this.walkieId = walkieId;
this.startTime = startTime;
this.historyId = historyId;
this.newStatus = newStatus;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
package com.whyranoid.walkie.dto.response;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
import lombok.Getter;

@Getter
@Builder
public class WalkieSignUpResponse {

@Schema(description = "요청 후 중복 발생한 경우 true 반환")
private boolean hasDuplicatedName;
private String accessToken;
private String refreshToken;

@Schema(description = "가입된 사용자 고유 키 -- 사용자 조회 시 사용")
private Long walkieId;

@Schema(description = "(검증용) 가입 요청했던 닉네임 반환")
private String walkieName;

// private String accessToken;
// private String refreshToken;
}
4 changes: 2 additions & 2 deletions src/main/java/com/whyranoid/walkie/service/WalkieService.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public WalkieSignUpResponse joinWalkie(WalkieSignUpRequest walkieSignUpRequest)

return WalkieSignUpResponse.builder()
.hasDuplicatedName(false)
.accessToken("아이디=" + walkie.getUserId())
.refreshToken("상태=" + walkie.getStatus())
.walkieId(walkie.getUserId())
.walkieName(walkie.getUserName())
.build();
}

Expand Down