-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test: add helper class (persister) * feat: add api of seeing context of workout * feat: add api of seeing workout records of workoutHistory * refactor: rename package and delete legacy exception class * feat: add api of registering favorite mission in workspace * feat: add api of seeing favorite missions * refactor: rename class and enum name * refactor: merge method into persister * feat: add api of getting presigned url * feat: modify api of working mission * refactor: modify response * fix: fix calculate best workout score method * refactor: s3 upload
- Loading branch information
Showing
135 changed files
with
1,496 additions
and
583 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package gymmi.controller; | ||
|
||
import gymmi.response.PresignedUrlResponse; | ||
import gymmi.service.S3Service; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
public class S3Controller { | ||
|
||
private final S3Service s3Service; | ||
|
||
@GetMapping("/images/workout-proof/presignedUrl") | ||
public ResponseEntity<PresignedUrlResponse> s3( | ||
) { | ||
PresignedUrlResponse response = s3Service.getPresingedUrlWithPut(); | ||
return ResponseEntity.ok().body(response); | ||
} | ||
|
||
@GetMapping("/images/workout-proof/presignedUrl/get") | ||
public ResponseEntity<String> s3( | ||
@RequestParam("imageUrl") String filenmae | ||
) { | ||
String presignedUrl = s3Service.getPresignedUrl(filenmae); | ||
return ResponseEntity.ok().body(presignedUrl); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/main/java/gymmi/exception/class1/AlreadyExistException.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/gymmi/exception/class1/InvalidFileException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/gymmi/exception/class1/InvalidNumberException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/gymmi/exception/class1/InvalidPatternException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/gymmi/exception/class1/InvalidRangeException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/gymmi/exception/class1/InvalidStateException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/gymmi/exception/class1/NotFoundException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/gymmi/exception/class1/NotHavePermissionException.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/gymmi/exception/class1/UnsupportedException.java
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...n/java/gymmi/exception/ErrorResponse.java → ...gymmi/exceptionhandler/ErrorResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package gymmi.exception; | ||
package gymmi.exceptionhandler; | ||
|
||
import lombok.Getter; | ||
|
||
|
4 changes: 2 additions & 2 deletions
4
.../gymmi/exception/ExceptionController.java → ...exceptionhandler/ExceptionController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/main/java/gymmi/exceptionhandler/exception/AlreadyExistException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package gymmi.exceptionhandler.exception; | ||
|
||
import gymmi.exceptionhandler.message.ErrorCode; | ||
import gymmi.exceptionhandler.message.ExceptionType; | ||
|
||
public class AlreadyExistException extends GymmiException { | ||
|
||
public static final ExceptionType EXCEPTION_CODE = ExceptionType.ALREADY_EXISTS; | ||
|
||
public AlreadyExistException(ErrorCode errorCode) { | ||
super(errorCode, EXCEPTION_CODE); | ||
} | ||
} |
16 changes: 8 additions & 8 deletions
16
...n/class1/AuthenticationFailException.java → ...xception/AuthenticationFailException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
package gymmi.exception.class1; | ||
package gymmi.exceptionhandler.exception; | ||
|
||
import gymmi.exception.message.ErrorCode; | ||
import gymmi.exception.message.ExceptionCode; | ||
import gymmi.exceptionhandler.message.ErrorCode; | ||
import gymmi.exceptionhandler.message.ExceptionType; | ||
|
||
public class AuthenticationFailException extends NotMatchedException { | ||
|
||
public static final ExceptionCode EXCEPTION_CODE = ExceptionCode.AUTHENTICATION_FAIL; | ||
public static final ExceptionType EXCEPTION_CODE = ExceptionType.AUTHENTICATION_FAIL; | ||
|
||
public AuthenticationFailException(ErrorCode errorCode) { | ||
super(errorCode, EXCEPTION_CODE); | ||
} | ||
|
||
protected AuthenticationFailException(ErrorCode errorCode, ExceptionCode exceptionCode) { | ||
super(errorCode, exceptionCode); | ||
protected AuthenticationFailException(ErrorCode errorCode, ExceptionType exceptionType) { | ||
super(errorCode, exceptionType); | ||
} | ||
|
||
public AuthenticationFailException(ErrorCode errorCode, Throwable throwable) { | ||
super(errorCode, EXCEPTION_CODE, throwable); | ||
} | ||
|
||
protected AuthenticationFailException(ErrorCode errorCode, ExceptionCode exceptionCode, Throwable throwable) { | ||
super(errorCode, exceptionCode, throwable); | ||
protected AuthenticationFailException(ErrorCode errorCode, ExceptionType exceptionType, Throwable throwable) { | ||
super(errorCode, exceptionType, throwable); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/gymmi/exceptionhandler/exception/FileException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package gymmi.exceptionhandler.exception; | ||
|
||
import gymmi.exceptionhandler.message.ErrorCode; | ||
import gymmi.exceptionhandler.message.ExceptionType; | ||
|
||
public class FileException extends GymmiException { | ||
|
||
public static final ExceptionType EXCEPTION_CODE = ExceptionType.FILE_RELATED; | ||
|
||
public FileException(ErrorCode errorCode) { | ||
super(errorCode, EXCEPTION_CODE); | ||
} | ||
|
||
public FileException(ErrorCode errorCode, Throwable throwable) { | ||
super(errorCode, EXCEPTION_CODE, throwable); | ||
} | ||
|
||
protected FileException(ErrorCode errorCode, ExceptionType exceptionType) { | ||
super(errorCode, exceptionType); | ||
} | ||
|
||
protected FileException(ErrorCode errorCode, ExceptionType exceptionType, Throwable throwable) { | ||
super(errorCode, exceptionType, throwable); | ||
} | ||
|
||
} |
8 changes: 4 additions & 4 deletions
8
...exception/class1/FileIOFailException.java → ...andler/exception/FileIOFailException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/main/java/gymmi/exceptionhandler/exception/GymmiException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package gymmi.exceptionhandler.exception; | ||
|
||
import gymmi.exceptionhandler.message.ErrorCode; | ||
import gymmi.exceptionhandler.message.ExceptionType; | ||
|
||
public class GymmiException extends RuntimeException { | ||
|
||
private final ErrorCode errorCode; | ||
private final ExceptionType exceptionType; | ||
|
||
protected GymmiException(ErrorCode errorCode, ExceptionType exceptionType) { | ||
super(errorCode.getMessage()); | ||
this.errorCode = errorCode; | ||
this.exceptionType = exceptionType; | ||
} | ||
|
||
protected GymmiException(ErrorCode errorCode, ExceptionType exceptionType, Throwable throwable) { | ||
super(errorCode.getMessage(), throwable); | ||
this.errorCode = errorCode; | ||
this.exceptionType = exceptionType; | ||
} | ||
|
||
public int getStatusCode() { | ||
return errorCode.getStatusCode(); | ||
} | ||
|
||
public ExceptionType getExceptionCode() { | ||
return exceptionType; | ||
} | ||
} |
Oops, something went wrong.