-
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.
Merge pull request #258 from FashionWeek-Runway/feature/issue-257
관리자 페이지 일부구현 (#257)
- Loading branch information
Showing
24 changed files
with
354 additions
and
67 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 @@ | ||
client_max_body_size 30M; |
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
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 com.example.runway.config; | ||
|
||
import java.util.concurrent.TimeUnit; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.CacheControl; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.EnableWebMvc; | ||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
public class WebConfig implements WebMvcConfigurer { | ||
|
||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/**") | ||
.allowedOrigins( | ||
"http://localhost:3000", | ||
"http://localhost:8080", | ||
"http://localhost:9000" | ||
) | ||
// 모든 HTTP Method를 허용한다. | ||
.allowedMethods("*", "PUT", "POST", "DELETE", "OPTIONS", "PATCH", "GET") | ||
// HTTP 요청의 Header에 어떤 값이든 들어갈 수 있도록 허용한다. | ||
.allowedHeaders("*") | ||
.exposedHeaders("Set-Cookie") | ||
// 자격증명 사용을 허용한다. | ||
// 해당 옵션 사용시 allowedOrigins를 * (전체)로 설정할 수 없다. | ||
.allowCredentials(true); | ||
} | ||
|
||
} |
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
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
44 changes: 44 additions & 0 deletions
44
src/main/java/com/example/runway/controller/AdminUserController.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,44 @@ | ||
package com.example.runway.controller; | ||
|
||
import javax.validation.constraints.Min; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.example.runway.common.CommonResponse; | ||
import com.example.runway.dto.PageResponse; | ||
import com.example.runway.dto.user.UserReq; | ||
import com.example.runway.dto.user.UserRes; | ||
import com.example.runway.service.admin.auth.AdminAuthService; | ||
|
||
import io.swagger.v3.oas.annotations.Parameter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/admin/users") | ||
public class AdminUserController { | ||
private final AdminAuthService adminAuthService; | ||
|
||
@PostMapping("/logIn") | ||
public CommonResponse<UserRes.Token> logIn(@RequestBody UserReq.LoginUserInfo loginUserInfo) { | ||
return CommonResponse.onSuccess(adminAuthService.logIn(loginUserInfo)); | ||
} | ||
|
||
@GetMapping("/info") | ||
public CommonResponse<UserRes.DashBoardDto> getUserDto(){ | ||
return CommonResponse.onSuccess(adminAuthService.getUserDto()); | ||
} | ||
|
||
@GetMapping("") | ||
public CommonResponse<PageResponse<UserRes.UserInfoDto>> getUserInfo( | ||
@Parameter(description = "페이지", example = "0") @RequestParam(required = true) @Min(value = 0) Integer page, | ||
@Parameter(description = "페이지 사이즈", example = "10") @RequestParam(required = true) Integer size){ | ||
|
||
return null; | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -29,6 +29,4 @@ public class BaseEntity { | |
@Column(name = "updated_at") | ||
private LocalDateTime updatedAt; | ||
|
||
} | ||
// test | ||
// test2 | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/example/runway/domain/enums/Category.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,10 @@ | ||
package com.example.runway.domain.enums; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
public enum Category { | ||
미니멀, 캐주얼, 시티보이, 스트릿, 빈티지, 페미닌 | ||
} |
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
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
10 changes: 10 additions & 0 deletions
10
src/main/java/com/example/runway/service/admin/auth/AdminAuthService.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,10 @@ | ||
package com.example.runway.service.admin.auth; | ||
|
||
import com.example.runway.dto.user.UserReq; | ||
import com.example.runway.dto.user.UserRes; | ||
|
||
public interface AdminAuthService { | ||
UserRes.Token logIn(UserReq.LoginUserInfo loginUserInfo); | ||
|
||
UserRes.DashBoardDto getUserDto(); | ||
} |
Oops, something went wrong.