-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature : [구매자 선택] 스크린 컴포넌트 #88
Merged
Merged
Changes from 36 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
57bdb0b
feature: [게시글 상세 조회] 게시글 내용 컴포넌트 (#60)
begaonnuri 56e72e2
feat: front에서 새로고침, 스크롤 경계에 도달 시 데이터를 받아오는 기능 추가
begaonnuri eb4680b
feat: Member.java에 멤버 정보에 대한 필드 추가
begaonnuri 23c2d13
feature: [게시글 생성] 상,하단 컴포넌트 (#56)
lxxjn0 e7570f8
feature: [게시글 상세 조회] 판매자 정보 컴포넌트 (#61)
lxxjn0 78ce3c4
feature: [피드 조회] 게시글 카드 컴포넌트 (#58)
joseph415 7de6353
feature: [게시글 생성] 게시글 생성 API (#57)
jnsorn 84c772d
feature: [게시글 상세 조회] 사진 슬라이더 (#67)
kouz95 7b8a2ed
feature: [게시글 상세 조회] 하단 바 컴포넌트 (#68)
joseph415 64caf70
feature: [피드 조회] 페이지네이션 (#69)
begaonnuri 52846d5
feature: [회원 관리] 로그인 컴포넌트 (#72)
lxxjn0 82f7da5
feature: [전체] S3 이미지 연동 (#73)
kouz95 f5e406a
feature: [피드 조회] 피드 조회 API 변경 (#74)
begaonnuri 352ea2d
fix: ArticleServiceTest 변경
kouz95 4455a1d
fix: ArticleDetailFavorite catch 제거
kouz95 0b7836a
feat: 피드 최대 로딩 횟수 설정
kouz95 9078df1
feat: SelectBuyerScreen, SelectBuyerArticleInfo, BuyerCard 생성, chatti…
kouz95 1d4baa6
feat: 채팅 인수테스트 작성
kouz95 6bdcc55
feat: 채팅 컨트롤러 생성, 생성 구현
kouz95 fe4ab2a
refactor: chatting -> chatRoom으로 변경
kouz95 abae4ed
feat: ChatRoomService 구현, ChatRoom 도메인 생성
kouz95 97c585e
feat: ChatRoomController.showAllChatRoomOfArticle() 구현
kouz95 3263b22
feat: ChatRoomService.showChatRoomsOf() 구현
kouz95 eb8afba
refactor: data.sql member 아바타, 닉네임 추가
kouz95 cafa3f9
feat: BuyerCard 구현, server 연동
kouz95 11794f2
feat: Navigation Screeb title & headerLeft 추가
kouz95 b59ab90
docs: author 추가
kouz95 9a5b50b
refactor: ChatRoom 과 buyer, article의 연간관계 ManyToOne으로 변경
kouz95 22f39f0
refactor: memberIdState의 default 값을 51로 변경
kouz95 c075c26
refactor: data.sql에 chat_room 추가
kouz95 21cc15e
refactor: SALING -> ON_SALE 변경, AcceptanceTest 공백 라인 추가
kouz95 8caaa52
refactor: 게시글 등록 주석 추가
kouz95 12c2f7a
refactor: route 제거
kouz95 0108266
style: prettier 적용
kouz95 3001182
refactor: ObjectMapper Autowired 사용, getArticleDetailOf -> findArticl…
kouz95 25b04df
style: Cleanup
kouz95 1f26415
chore: pull remote develop, 컨플릭 해결
kouz95 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ node { | |
stage('build') { | ||
sh 'cd back && ./gradlew clean build' | ||
} | ||
} | ||
} |
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
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
32 changes: 32 additions & 0 deletions
32
back/src/main/java/sellerlee/back/chatroom/application/ChatRoomCreateRequest.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,32 @@ | ||
/** | ||
* @author kouz95 | ||
*/ | ||
|
||
package sellerlee.back.chatroom.application; | ||
|
||
import sellerlee.back.chatroom.domain.ChatRoom; | ||
|
||
public class ChatRoomCreateRequest { | ||
private Long articleId; | ||
private Long buyerId; | ||
|
||
private ChatRoomCreateRequest() { | ||
} | ||
|
||
public ChatRoomCreateRequest(Long articleId, Long buyerId) { | ||
this.articleId = articleId; | ||
this.buyerId = buyerId; | ||
} | ||
|
||
public ChatRoom toChatRoom() { | ||
return new ChatRoom(articleId, buyerId); | ||
} | ||
|
||
public Long getArticleId() { | ||
return articleId; | ||
} | ||
|
||
public Long getBuyerId() { | ||
return buyerId; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
back/src/main/java/sellerlee/back/chatroom/application/ChatRoomResponse.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,40 @@ | ||
/** | ||
* @author kouz95 | ||
*/ | ||
|
||
package sellerlee.back.chatroom.application; | ||
|
||
import static java.util.stream.Collectors.*; | ||
|
||
import java.util.List; | ||
|
||
import sellerlee.back.chatroom.domain.ChatRoom; | ||
|
||
public class ChatRoomResponse { | ||
private String avatar; | ||
private String nickname; | ||
// TODO: 2020/08/04 마지막 메세지 추가 | ||
|
||
private ChatRoomResponse() { | ||
} | ||
|
||
public ChatRoomResponse(String avatar, String nickname) { | ||
this.avatar = avatar; | ||
this.nickname = nickname; | ||
} | ||
|
||
public static List<ChatRoomResponse> listOf(List<ChatRoom> chatRooms) { | ||
return chatRooms.stream() | ||
.map(chatRoom -> new ChatRoomResponse(chatRoom.getBuyer().getAvatar(), | ||
chatRoom.getBuyer().getNickname())) | ||
.collect(toList()); | ||
} | ||
|
||
public String getAvatar() { | ||
return avatar; | ||
} | ||
|
||
public String getNickname() { | ||
return nickname; | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
back/src/main/java/sellerlee/back/chatroom/application/ChatRoomService.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,32 @@ | ||
/** | ||
* @author kouz95 | ||
*/ | ||
|
||
package sellerlee.back.chatroom.application; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.stereotype.Service; | ||
|
||
import sellerlee.back.chatroom.domain.ChatRoom; | ||
import sellerlee.back.chatroom.domain.ChatRoomRepository; | ||
|
||
@Service | ||
public class ChatRoomService { | ||
private final ChatRoomRepository chatRoomRepository; | ||
|
||
public ChatRoomService(ChatRoomRepository chatRoomRepository) { | ||
this.chatRoomRepository = chatRoomRepository; | ||
} | ||
|
||
public Long createChatRoom(ChatRoomCreateRequest request) { | ||
ChatRoom persist = chatRoomRepository.save(request.toChatRoom()); | ||
return persist.getId(); | ||
} | ||
|
||
public List<ChatRoomResponse> showChatRoomsOf(Long articleId) { | ||
List<ChatRoom> responses = chatRoomRepository.findChatRoomsByArticleId( | ||
articleId); | ||
return ChatRoomResponse.listOf(responses); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
back/src/main/java/sellerlee/back/chatroom/domain/ChatRoom.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,57 @@ | ||
/** | ||
* @author kouz95 | ||
*/ | ||
|
||
package sellerlee.back.chatroom.domain; | ||
|
||
import javax.persistence.Column; | ||
import javax.persistence.Entity; | ||
import javax.persistence.FetchType; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
|
||
import sellerlee.back.article.domain.Article; | ||
import sellerlee.back.member.domain.Member; | ||
|
||
@Entity | ||
public class ChatRoom { | ||
@Id | ||
@GeneratedValue | ||
@Column(name = "chat_room_id") | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "article_id") | ||
private Article article; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "member_id") | ||
private Member buyer; | ||
|
||
protected ChatRoom() { | ||
} | ||
|
||
public ChatRoom(Long id, Article article, Member buyer) { | ||
this.id = id; | ||
this.article = article; | ||
this.buyer = buyer; | ||
} | ||
|
||
public ChatRoom(Long articleId, Long buyerId) { | ||
this(null, new Article(articleId), new Member(buyerId)); | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public Article getArticle() { | ||
return article; | ||
} | ||
|
||
public Member getBuyer() { | ||
return buyer; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
back/src/main/java/sellerlee/back/chatroom/domain/ChatRoomRepository.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 @@ | ||
/** | ||
* @author kouz95 | ||
*/ | ||
|
||
package sellerlee.back.chatroom.domain; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface ChatRoomRepository extends JpaRepository<ChatRoom, Long> { | ||
List<ChatRoom> findChatRoomsByArticleId(Long articleId); | ||
} |
48 changes: 48 additions & 0 deletions
48
back/src/main/java/sellerlee/back/chatroom/presentation/ChatRoomController.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,48 @@ | ||
/** | ||
* @author kouz95 | ||
*/ | ||
|
||
package sellerlee.back.chatroom.presentation; | ||
|
||
import static sellerlee.back.chatroom.presentation.ChatRoomController.*; | ||
|
||
import java.net.URI; | ||
import java.util.List; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
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 sellerlee.back.chatroom.application.ChatRoomCreateRequest; | ||
import sellerlee.back.chatroom.application.ChatRoomResponse; | ||
import sellerlee.back.chatroom.application.ChatRoomService; | ||
|
||
@RestController | ||
@RequestMapping(CHAT_ROOM_URI) | ||
public class ChatRoomController { | ||
public static final String CHAT_ROOM_URI = "/chat-rooms"; | ||
|
||
private final ChatRoomService chatRoomService; | ||
|
||
public ChatRoomController(ChatRoomService chatRoomService) { | ||
this.chatRoomService = chatRoomService; | ||
} | ||
|
||
@PostMapping | ||
public ResponseEntity<Void> createChatRoom(@RequestBody ChatRoomCreateRequest request) { | ||
Long chatRoomId = chatRoomService.createChatRoom(request); | ||
return ResponseEntity.created(URI.create(CHAT_ROOM_URI + "/" + chatRoomId)).build(); | ||
} | ||
|
||
@GetMapping | ||
public ResponseEntity<List<ChatRoomResponse>> showAllChatRoomOfArticle( | ||
@RequestParam Long articleId) { | ||
List<ChatRoomResponse> responses = chatRoomService | ||
.showChatRoomsOf(articleId); | ||
return ResponseEntity.ok(responses); | ||
} | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
메서드 명
showAll
은 어떤가요?동사 뒤에 엔티티가 올지 말지 내일 이야기해보도록 해요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
동사 뒤에 엔티티가 올지 말지
월요일날 이야기 해봐야겠네요!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--- 동사 뒤에 엔티티는 생략하는 걸로 결정 ---