-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat:엔티티 설정 * fix:comment 반영해서 엔티티 수정 * fix:엔티티 최종 수정 * feat:카카오 로그인 구현 * fix:ci cd 구현 * fix:카카오 로그인 수정 + Swagger * feat:cors 허용 * fix:comment 받고 수정 * fix:순환참조 문제 해결
- Loading branch information
1 parent
a6466f1
commit e1cb499
Showing
45 changed files
with
1,574 additions
and
118 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
Empty file.
17 changes: 17 additions & 0 deletions
17
src/main/java/com/onna/onnaback/domain/member/adapter/in/web/MemberController.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,17 @@ | ||
package com.onna.onnaback.domain.member.adapter.in.web; | ||
|
||
import org.springframework.security.core.Authentication; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.security.oauth2.core.user.OAuth2User; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class MemberController { | ||
@GetMapping("/test") | ||
public String index() { | ||
return "Hello World"; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/onna/onnaback/domain/member/adapter/in/web/response/LoginResponse.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,4 @@ | ||
package com.onna.onnaback.domain.member.adapter.in.web.response; | ||
|
||
public class LoginResponse { | ||
} |
Empty file.
4 changes: 4 additions & 0 deletions
4
...ava/com/onna/onnaback/domain/member/adapter/out/persistence/MemberPersistenceAdapter.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,4 @@ | ||
package com.onna.onnaback.domain.member.adapter.out.persistence; | ||
|
||
public class MemberPersistenceAdapter { | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/onna/onnaback/domain/member/adapter/out/persistence/MemberRepository.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,11 +1,23 @@ | ||
package com.onna.onnaback.domain.member.adapter.out.persistence; | ||
|
||
import com.onna.onnaback.domain.member.domain.Member; | ||
import com.onna.onnaback.domain.member.domain.SocialType; | ||
import com.onna.onnaback.global.oauth.OAuthAttributes; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Optional; | ||
|
||
@Repository | ||
@EnableJpaRepositories | ||
public interface MemberRepository extends JpaRepository<Member,Long> { | ||
|
||
public Optional<Member> findByName(String username); | ||
|
||
public Optional<Member> findByEmail(String email); | ||
|
||
public Optional<Member> findBySocialTypeAndSocialId(SocialType socialType, String socialId); | ||
|
||
public Optional<Member> findByRefreshToken(String refreshToken); | ||
} |
Empty file.
4 changes: 4 additions & 0 deletions
4
src/main/java/com/onna/onnaback/domain/member/application/port/in/MemberUseCase.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,4 @@ | ||
package com.onna.onnaback.domain.member.application.port.in; | ||
|
||
public class MemberUseCase { | ||
} |
Empty file.
4 changes: 4 additions & 0 deletions
4
src/main/java/com/onna/onnaback/domain/member/application/service/MemberService.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,4 @@ | ||
package com.onna.onnaback.domain.member.application.service; | ||
|
||
public class MemberService { | ||
} |
Empty file.
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
5 changes: 5 additions & 0 deletions
5
src/main/java/com/onna/onnaback/domain/member/domain/Role.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,5 @@ | ||
package com.onna.onnaback.domain.member.domain; | ||
|
||
public enum Role { | ||
ADMIN,MANAGER,USER,GUEST | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/com/onna/onnaback/domain/member/domain/SocialType.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,5 @@ | ||
package com.onna.onnaback.domain.member.domain; | ||
|
||
public enum SocialType { | ||
KAKAO,GOOGLE,NAVER | ||
} |
5 changes: 0 additions & 5 deletions
5
src/main/java/com/onna/onnaback/domain/memberSparkMapping/AcceptStatus.java
This file was deleted.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
src/main/java/com/onna/onnaback/domain/memberSparkMapping/domain/AcceptStatus.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,5 @@ | ||
package com.onna.onnaback.domain.memberSparkMapping.domain; | ||
|
||
public enum AcceptStatus { | ||
PENDING,ACCEPT,REFUSE | ||
} |
8 changes: 3 additions & 5 deletions
8
...emberSparkMapping/MemberSparkMapping.java → ...arkMapping/domain/MemberSparkMapping.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
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.
2 changes: 1 addition & 1 deletion
2
...a/onnaback/domain/spark/DurationHour.java → ...ack/domain/spark/domain/DurationHour.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
7 changes: 2 additions & 5 deletions
7
...com/onna/onnaback/domain/spark/Spark.java → ...a/onnaback/domain/spark/domain/Spark.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
5 changes: 5 additions & 0 deletions
5
src/main/java/com/onna/onnaback/domain/spark/domain/SparkType.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,5 @@ | ||
package com.onna.onnaback.domain.spark.domain; | ||
|
||
public enum SparkType { | ||
CLASS,MEETING | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/com/onna/onnaback/global/config/SwaggerConfig.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,59 @@ | ||
package com.onna.onnaback.global.config; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import springfox.documentation.builders.ApiInfoBuilder; | ||
import springfox.documentation.builders.PathSelectors; | ||
import springfox.documentation.builders.RequestHandlerSelectors; | ||
import springfox.documentation.service.ApiInfo; | ||
import springfox.documentation.service.ApiKey; | ||
import springfox.documentation.service.AuthorizationScope; | ||
import springfox.documentation.service.SecurityReference; | ||
import springfox.documentation.spi.DocumentationType; | ||
import springfox.documentation.spi.service.contexts.SecurityContext; | ||
import springfox.documentation.spring.web.plugins.Docket; | ||
import springfox.documentation.swagger2.annotations.EnableSwagger2; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
@Configuration | ||
public class SwaggerConfig { | ||
|
||
@Bean | ||
public Docket api() { | ||
return new Docket(DocumentationType.OAS_30) | ||
.securityContexts(Arrays.asList(securityContext())) | ||
.securitySchemes(Arrays.asList(apiKey())) | ||
.useDefaultResponseMessages(false) | ||
.select() | ||
.apis(RequestHandlerSelectors.basePackage("com.onna.onnaback.domain")) | ||
.paths(PathSelectors.any()) | ||
.build() | ||
.apiInfo(apiInfo()); | ||
} | ||
|
||
private ApiInfo apiInfo() { | ||
return new ApiInfoBuilder() | ||
.title("ON;na API") | ||
.description("ON;na API입니다") | ||
.version("1.0") | ||
.build(); | ||
} | ||
private SecurityContext securityContext() { | ||
return SecurityContext.builder() | ||
.securityReferences(defaultAuth()) | ||
.build(); | ||
} | ||
|
||
private List<SecurityReference> defaultAuth() { | ||
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything"); | ||
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1]; | ||
authorizationScopes[0] = authorizationScope; | ||
return Arrays.asList(new SecurityReference("Authorization", authorizationScopes)); | ||
} | ||
|
||
private ApiKey apiKey() { | ||
return new ApiKey("Authorization", "Authorization", "header"); | ||
} | ||
} |
Oops, something went wrong.