Skip to content
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

[코드리뷰] #306

Open
wants to merge 971 commits into
base: review
Choose a base branch
from
Open

[코드리뷰] #306

wants to merge 971 commits into from

Conversation

minsu20
Copy link
Member

@minsu20 minsu20 commented Aug 14, 2024

No description provided.

seungueonn and others added 30 commits February 4, 2024 00:42
MNG 13 : 미션 설명 강제로 노출시키기
[release] MNG-08, MNG-12, MNG-07, MNG-06, MNG-13
MNG-13 : 미션 확인하기 메서드 수정
MNG-13 test: 개시글 조회 테스트코드 작성
MNG-13 fix: gradle test 오류 수정
MNG-14 fix: 알림 히스토리 전체 조회할 때 모두 읽음 처리
[release] MNG-14, MNG-10, MNG-12
Copy link

@VSFe VSFe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습나다~~~~

testImplementation 'org.springframework.security:spring-security-test'
implementation 'org.springframework:spring-context:5.3.15'

implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '4.2.2'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gradle 형식이 일치하지 않습니다.
다른 곳과 동일하게 조정해주세요.

implementation 'com.squareup.okhttp3:okttp:4.2.2

//log
implementation 'org.springframework.boot:spring-boot-starter-logging'
implementation 'org.springframework.boot:spring-boot-starter-aop'
implementation("org.springframework.boot:spring-boot-starter-actuator")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전체적인 형식 조정이 필요하겠네요.

@Async
@EventListener
public void onMultiAlarmEvent(MultiFcmEvent event) {
if (event.getIdAndTokensByPush().isPresent() && !event.getIdAndTokensByPush().get().isEmpty()) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oneline 으로 넣기에는 가독성이 썩 좋아보이진 않네요.
변수로 분리 가능한 부분이 없을까요?

multiMessageSender.send(new MultiRequest(event.getIdAndTokensByPush().get(), event.getTitle(), event.getBody(), event.getIdInfo(), event.getName(), event.getAlarmType(), event.getPath()));
}
if (event.getIdAndTokensBySave().isPresent() && !event.getIdAndTokensBySave().get().isEmpty()) {
saveMultiAlarmHistoryUseCase.saveAlarmHistories(AlarmHistoryMapper.getMemberIds(event.getIdAndTokensBySave().get()), event.getIdInfo(), event.getTitle(), event.getBody(), event.getName(), event.getAlarmType(), event.getPath());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코드 스타일 가이드를 적용했으면 합니다.
https://naver.github.io/hackday-conventions-java/
해당 링크 등의 다양한 스타일 컨벤션을 찾아서, 적용해보셨으면 합니다.

@Getter
public class SignInRequest {
@NotBlank(message="socialToken 을 입력해주세요.")
private String socialToken;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

데이터가 변할 수 있나요?
Setter를 사용할 것이 아니라면, private final 등으로 불변 객체 선언이 나을 듯 합니다.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

그렇게 되면 불필요한 @NoArgsConstructor 도 뺄 수 있겠죠.

Member member = memberGetService.getMemberBySocialId(socialId);
Team team = teamGetService.getTeamByTeamId(teamId);
checkLeaderUseCase.validateTeamLeader(member, team);
team.deleteTeam();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재는 데이터 삭제가 완전히 불가능할 것 같고...
장기적으로는 배치로 돌려야겠네요. (유예기간 후 데이터 완전 삭제)

private final BoardGetService boardGetService;
private final TeamMemberGetService teamMemberGetService;

public GetTeamResponse getTeam(String socialId) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

장기적으로는....

public GetTeamResponse getTeam(@MoingMember member) {
    return teamGetService.getTeamByMember(member);
}

public GetTeamCountResponse getTeamCount(String socialId, Long teamId) {
Member member = memberGetService.getMemberBySocialId(socialId);
GetTeamCountResponse response= teamGetService.getTeamCountAndName(teamId, member.getMemberId());
response.updateMemberName(member.getNickName());
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

설명한 것 처럼, dto는 최대한 정적 구조를 유지해 주세요.


String oldProfileImgUrl = team.getProfileImgUrl();
team.updateTeam(
UpdateUtils.getUpdatedValue(updateTeamRequest.getName(), team.getName()),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Objects.requireNonNullElse(updateTeamRequest.getName(), team.getName()),
Objects.requireNonNullElse(updateTeamRequest.getIntroduction(), team.getIntroduction()),
Objects.requireNonNullElse(updateTeamRequest.getProfileImgUrl(), team.getProfileImgUrl())

private final MemberGetService memberGetService;
private final TeamGetService teamGetService;

public DeleteTeamResponse withdrawTeam(String socialId, Long teamId) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

방어로직이 필요합니다.
소모임장은 해당 API 호출 시 진행할 수 없도록 방지를 해야할 것 같아요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants