Skip to content

Commit

Permalink
Merge pull request #75 from Team-HMH/feat/#73-get-dummy-app-api
Browse files Browse the repository at this point in the history
feat - ๋”๋ฏธ ์•ฑ ์ƒ์„ฑ api ๊ตฌํ˜„
  • Loading branch information
kseysh authored Jan 18, 2024
2 parents 39abcdc + 611d55d commit 4b88bc9
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/main/java/sopt/org/HMH/domain/dummy/DummyApp.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package sopt.org.HMH.domain.dummy;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Deprecated
@Getter
@AllArgsConstructor
public class DummyApp {
String appName;
String appImageUrl;
}
21 changes: 21 additions & 0 deletions src/main/java/sopt/org/HMH/domain/dummy/DummyAppController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package sopt.org.HMH.domain.dummy;

import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import sopt.org.HMH.global.common.response.ApiResponse;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/dummy")
@Deprecated
public class DummyAppController {
@GetMapping("/app")
public ResponseEntity<ApiResponse<?>> orderModifyDailyChallenge() {
return ResponseEntity
.status(DummyAppSuccess.GET_DUMMY_SUCCESS.getHttpStatus())
.body(ApiResponse.success(DummyAppSuccess.GET_DUMMY_SUCCESS, DummyAppListResponse.of()));
}
}
17 changes: 17 additions & 0 deletions src/main/java/sopt/org/HMH/domain/dummy/DummyAppListResponse.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package sopt.org.HMH.domain.dummy;

import java.util.ArrayList;
import java.util.List;

@Deprecated
public record DummyAppListResponse(
List<DummyApp> apps
) {
public static DummyAppListResponse of() {
List<DummyApp> dummyAppList = new ArrayList<>();
dummyAppList.add(new DummyApp("Netflix","https://github.com/Team-HMH/HMH-Server/assets/69035864/dd068b83-641a-4bff-b4f5-381ea6e04d44"));
dummyAppList.add(new DummyApp("Instagram","https://github.com/Team-HMH/HMH-Server/assets/69035864/bd572377-9dd9-47e7-a9f4-9efbbe66cd2e"));
dummyAppList.add(new DummyApp("YouTube","https://github.com/Team-HMH/HMH-Server/assets/69035864/8afa60c0-bf1d-4ff0-9b50-4d1558a71f0a"));
return new DummyAppListResponse(dummyAppList);
}
}
31 changes: 31 additions & 0 deletions src/main/java/sopt/org/HMH/domain/dummy/DummyAppSuccess.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package sopt.org.HMH.domain.dummy;

import lombok.AllArgsConstructor;
import org.springframework.http.HttpStatus;
import sopt.org.HMH.global.common.exception.base.SuccessBase;

@AllArgsConstructor
@Deprecated
public enum DummyAppSuccess implements SuccessBase {

GET_DUMMY_SUCCESS(HttpStatus.OK, "๋”๋ฏธ ๋ฐ์ดํ„ฐ ๊ฐ€์ ธ์˜ค๊ธฐ์— ์„ฑ๊ณตํ•˜์˜€์Šต๋‹ˆ๋‹ค."),
;

private final HttpStatus status;
private final String successMessage;

@Override
public int getHttpStatusCode() {
return this.status.value();
}

@Override
public HttpStatus getHttpStatus() {
return this.status;
}

@Override
public String getSuccessMessage() {
return this.successMessage;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class SecurityConfig {
private final JwtAuthenticationEntryPoint customJwtAuthenticationEntryPoint;

private static final String[] AUTH_WHITELIST = {
"/", "/error", "/health",
"/", "/error", "/health", "/api/v1/dummy/**",

// Swagger
"/swagger-ui/**",
Expand Down

0 comments on commit 4b88bc9

Please sign in to comment.