Skip to content

Commit

Permalink
[#6] 카카오 OAuth 로그인 구현
Browse files Browse the repository at this point in the history
[#6] 카카오 OAuth 로그인 구현
  • Loading branch information
puleugo authored Sep 20, 2023
2 parents fa4709a + fcebb21 commit dc09aaf
Show file tree
Hide file tree
Showing 64 changed files with 1,266 additions and 888 deletions.
11 changes: 10 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,16 @@ dependencies {
implementation("org.springframework:spring-context-support")
implementation("org.springdoc:springdoc-openapi-ui:1.6.9")
implementation("org.projectlombok:lombok")
implementation("com.googlecode.json-simple:json-simple:1.1.1")
implementation("org.json:json:20200518")
// implementation("org.springframework.session:spring-session-core")
// implementation("org.springframework.session:spring-session-jdbc")
compile("io.lettuce:lettuce-core:6.2.6.RELEASE")
runtimeOnly("org.postgresql:postgresql")
annotationProcessor("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
testImplementation("org.springframework.boot:spring-boot-starter-test")
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
implementation("org.springframework.boot:spring-boot-configuration-processor")

implementation("com.querydsl:querydsl-jpa:${queryDslVersion}")
annotationProcessor("com.querydsl:querydsl-apt:${queryDslVersion}")
Expand All @@ -96,10 +101,14 @@ configurations {
named("querydsl") {
extendsFrom(configurations.compileClasspath.get())
}
compileOnly {
extendsFrom(annotationProcessor.get())
}
}
tasks.withType<QuerydslCompile> {
options.annotationProcessorPath = configurations.querydsl.get()
dependsOn("sourcesJar")
dependsOn("compileQuerydslJava")
}

// 테스트
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ services:
- 5001:5001
networks:
- gg-backend
depends_on:
- postgres
postgres:
container_name: gg-postgres
image: postgres:14.1
Expand All @@ -34,4 +36,4 @@ volumes:
postgres-data:

networks:
gg-backend:
gg-backend:
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,59 @@

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.util.List;
import lombok.RequiredArgsConstructor;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.domain.repostiory.AuctionItemCommentRepository;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.AuctionItemCommentDeleteRequest;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.Comment.AuctionItemCommentParentDto;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.AuctionItemCommentRequest;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.AuctionItemCommentUpdateRequest;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.Comment.AuctionItemCommentParentDto;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.service.Comment.AuctionItemCommentService;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.service.Comment.AuctionItemCommentServiceImpl;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Tag(name = "경매품에 답글 작성", description = "경매품 댓글 관련 API")
@RequestMapping({"api/auctions/comments"})
@RestController
@RequiredArgsConstructor
public class AuctionItemCommentController {

private final AuctionItemCommentRepository auctionItemCommentRepository;
private final AuctionItemCommentService auctionItemCommentService;

@Operation(summary = "댓글 쓰기 ", description = "경매품 댓글 쓰기")
@ResponseStatus(HttpStatus.CREATED)
@PostMapping({"{id}"})
public ResponseEntity<HttpStatus> createAuctionItemComment(@PathVariable Long id, @RequestBody AuctionItemCommentRequest auctionItemCommentRequest) {
Long memberId = auctionItemCommentRequest.getUserId();
this.auctionItemCommentService.createAuctionItemComment(auctionItemCommentRequest, id, memberId);
return ResponseEntity.status(HttpStatus.CREATED).build();
}

@Operation(summary = "경매품에 대한 댓글 보기", description = "경매품에 대한 경매품 댓글 보기")
@GetMapping({"{id}"})
public ResponseEntity<List<AuctionItemCommentParentDto>> findAuctionItemCommentById(@PathVariable Long id) {
List<AuctionItemCommentParentDto> commentViews = this.auctionItemCommentService.findAuctionItemCommentById(id);
return ResponseEntity.ok(commentViews);
}


@Operation(summary = "경매품 댓글 수정 ", description = "경매품 댓글 수정")
@PutMapping({""})
public ResponseEntity<HttpStatus> updateAuctionItemComment(@RequestBody AuctionItemCommentUpdateRequest auctionItemCommentUpdateRequest) {
this.auctionItemCommentService.updateAuctionItemComment(auctionItemCommentUpdateRequest);
return ResponseEntity.status(HttpStatus.OK).build();
}

@Operation(summary = "경매품 댓글 삭제",description = "경매품 댓글 삭제")
@DeleteMapping({""})
public ResponseEntity<HttpStatus> deleteAuctionItemComment(AuctionItemCommentDeleteRequest auctionItemCommentDeleteRequest) {
this.auctionItemCommentService.deleteAuctionItemComment(auctionItemCommentDeleteRequest);
return ResponseEntity.status(HttpStatus.OK).build();
}
private final AuctionItemCommentRepository auctionItemCommentRepository;
private final AuctionItemCommentService auctionItemCommentService;

@Operation(summary = "댓글 쓰기 ", description = "경매품 댓글 쓰기")
@ResponseStatus(HttpStatus.CREATED)
@PostMapping({"{id}"})
public ResponseEntity<HttpStatus> createAuctionItemComment(
@PathVariable Long id, @RequestBody AuctionItemCommentRequest auctionItemCommentRequest) {
Long userId = auctionItemCommentRequest.getUserId();
this.auctionItemCommentService.createAuctionItemComment(auctionItemCommentRequest, id, userId);
return ResponseEntity.status(HttpStatus.CREATED).build();
}

@Operation(summary = "경매품에 대한 댓글 보기", description = "경매품에 대한 경매품 댓글 보기")
@GetMapping({"{id}"})
public ResponseEntity<List<AuctionItemCommentParentDto>> findAuctionItemCommentById(
@PathVariable Long id) {
List<AuctionItemCommentParentDto> commentViews =
this.auctionItemCommentService.findAuctionItemCommentById(id);
return ResponseEntity.ok(commentViews);
}

@Operation(summary = "경매품 댓글 수정 ", description = "경매품 댓글 수정")
@PutMapping({""})
public ResponseEntity<HttpStatus> updateAuctionItemComment(
@RequestBody AuctionItemCommentUpdateRequest auctionItemCommentUpdateRequest) {
this.auctionItemCommentService.updateAuctionItemComment(auctionItemCommentUpdateRequest);
return ResponseEntity.status(HttpStatus.OK).build();
}

@Operation(summary = "경매품 댓글 삭제", description = "경매품 댓글 삭제")
@DeleteMapping({""})
public ResponseEntity<HttpStatus> deleteAuctionItemComment(
AuctionItemCommentDeleteRequest auctionItemCommentDeleteRequest) {
this.auctionItemCommentService.deleteAuctionItemComment(auctionItemCommentDeleteRequest);
return ResponseEntity.status(HttpStatus.OK).build();
}
}


Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.UpdateAuctionItemRequest;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.service.Item.AuctionItemService;
import megabrain.gyeongnamgyeongmae.domain.category.service.CategoryService;
import megabrain.gyeongnamgyeongmae.domain.member.service.MemberService;
import megabrain.gyeongnamgyeongmae.domain.user.service.UserService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand All @@ -23,7 +23,7 @@ public class AuctionItemController {

private final AuctionItemService auctionItemService;
private final CategoryService categoryService;
private final MemberService memberService;
private final UserService userService;

@Operation(summary = "Post AuctionItem", description = "경매품 올리기")
@ResponseStatus(HttpStatus.CREATED)
Expand Down Expand Up @@ -59,9 +59,9 @@ public ResponseEntity<HttpStatus> deleteAuctionItemById(@PathVariable Long id) {

@Operation(summary = "경매품 좋아요", description = "경매품 관심")
@PostMapping("{id}/like")
public ResponseEntity<HttpStatus> likeAuctionItemById(@PathVariable Long id, @RequestBody AuctionItemLikeRequest auctionItemLikeRequest) {
public ResponseEntity<HttpStatus> likeAuctionItemById(
@PathVariable Long id, @RequestBody AuctionItemLikeRequest auctionItemLikeRequest) {
this.auctionItemService.likeAuctionItemById(id, auctionItemLikeRequest);
return ResponseEntity.status(HttpStatus.OK).build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import megabrain.gyeongnamgyeongmae.domain.auctionItem.dto.SearchItem.SearchAuctionItemSortedRequest;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.service.Item.AuctionItemService;
import megabrain.gyeongnamgyeongmae.domain.auctionItem.service.Search.AuctionItemSearchService;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
Expand All @@ -21,14 +20,16 @@
@RequiredArgsConstructor
public class AuctionItemSearchController {

private final AuctionItemService auctionItemService;
private final AuctionItemRepository AuctionItemRepository;
private final AuctionItemSearchService auctionItemSearchService;
private final AuctionItemService auctionItemService;
private final AuctionItemRepository AuctionItemRepository;
private final AuctionItemSearchService auctionItemSearchService;

@Operation(summary = "Search AuctionItem", description = "경매품 검색하기")
@GetMapping("")
public ResponseEntity<AuctionItemSearchResponse> findItemCategory(@ModelAttribute SearchAuctionItemSortedRequest searchAuctionItemSortedRequest){
AuctionItemSearchResponse result = this.auctionItemSearchService.findAuctionItemByRequest(searchAuctionItemSortedRequest);
return ResponseEntity.ok(result);
}
@Operation(summary = "Search AuctionItem", description = "경매품 검색하기")
@GetMapping("")
public ResponseEntity<AuctionItemSearchResponse> findItemCategory(
@ModelAttribute SearchAuctionItemSortedRequest searchAuctionItemSortedRequest) {
AuctionItemSearchResponse result =
this.auctionItemSearchService.findAuctionItemByRequest(searchAuctionItemSortedRequest);
return ResponseEntity.ok(result);
}
}
Loading

0 comments on commit dc09aaf

Please sign in to comment.