Skip to content

Commit

Permalink
Merge pull request #117 from Modagbul/feat/mission-alarm
Browse files Browse the repository at this point in the history
Feat/mission alarm
  • Loading branch information
seungueonn authored Dec 6, 2023
2 parents e84953f + 6b63796 commit c317866
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

import lombok.*;

import javax.validation.constraints.Size;

@Builder
@NoArgsConstructor
@Getter
public class MissionArchiveReq {

private String status;
@Size(min = 1, max = 4000)
private String archive; //사진일 경우 파일명, 이외에는 text,link

@Builder
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.moing.backend.domain.missionArchive.presentation;

import com.moing.backend.domain.member.domain.entity.Member;
import com.moing.backend.domain.mission.application.dto.res.GatherRepeatMissionRes;
import com.moing.backend.domain.missionArchive.application.dto.req.MissionArchiveReq;
import com.moing.backend.domain.missionArchive.application.dto.res.MissionArchiveRes;
Expand All @@ -8,6 +9,7 @@
import com.moing.backend.domain.missionArchive.application.dto.res.PersonalArchiveRes;
import com.moing.backend.domain.missionArchive.application.service.*;
import com.moing.backend.domain.missionArchive.domain.service.MissionArchiveDeleteService;
import com.moing.backend.domain.missionArchive.domain.service.MissionArchiveScheduleQueryService;
import com.moing.backend.domain.missionHeart.application.dto.MissionHeartRes;
import com.moing.backend.domain.missionHeart.application.service.MissionHeartUseCase;
import com.moing.backend.global.config.security.dto.User;
Expand All @@ -17,6 +19,7 @@
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

import static com.moing.backend.domain.missionArchive.domain.constant.MissionArchiveResponseMessage.*;
Expand Down Expand Up @@ -46,8 +49,8 @@ public class MissionArchiveController {
public ResponseEntity<SuccessResponse<MissionArchiveRes>> createArchive(@AuthenticationPrincipal User user,
@PathVariable("teamId") Long teamId,
@PathVariable("missionId") Long missionId,
@RequestBody MissionArchiveReq missionArchiveReq) {
return ResponseEntity.ok(SuccessResponse.create(CREATE_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveCreateUseCase.createArchive(user.getSocialId(), missionId,missionArchiveReq)));
@Valid @RequestBody MissionArchiveReq missionArchiveReq) {
return ResponseEntity.ok(SuccessResponse.create(CREATE_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveCreateUseCase.createArchive(user.getSocialId(), missionId, missionArchiveReq)));
}

/**
Expand All @@ -61,8 +64,9 @@ public ResponseEntity<SuccessResponse<MissionArchiveRes>> updateArchive(@Authent
@PathVariable("teamId") Long teamId,
@PathVariable("missionId") Long missionId,
@RequestBody MissionArchiveReq missionArchiveReq) {
return ResponseEntity.ok(SuccessResponse.create(UPDATE_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveUpdateUseCase.updateArchive(user.getSocialId(), missionId,missionArchiveReq)));
return ResponseEntity.ok(SuccessResponse.create(UPDATE_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveUpdateUseCase.updateArchive(user.getSocialId(), missionId, missionArchiveReq)));
}

/**
* 미션 인증 취소하기
* [DELETE] {teamId}/missions/{missionId}/archive
Expand Down Expand Up @@ -99,7 +103,7 @@ public ResponseEntity<SuccessResponse<MyMissionArchiveRes>> getMyArchive(@Authen
public ResponseEntity<SuccessResponse<List<PersonalArchiveRes>>> getOtherPeopleArchives(@AuthenticationPrincipal User user,
@PathVariable("teamId") Long teamId,
@PathVariable("missionId") Long missionId) {
return ResponseEntity.ok(SuccessResponse.create(READ_TEAM_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveReadUseCase.getPersonalArchive(user.getSocialId(),missionId)));
return ResponseEntity.ok(SuccessResponse.create(READ_TEAM_ARCHIVE_SUCCESS.getMessage(), this.missionArchiveReadUseCase.getPersonalArchive(user.getSocialId(), missionId)));
}


Expand All @@ -115,7 +119,7 @@ public ResponseEntity<SuccessResponse<MissionHeartRes>> pushHeart(@Authenticatio
@PathVariable("missionId") Long missionId,
@PathVariable("archiveId") Long archiveId,
@PathVariable("missionHeartStatus") String missionHeartStatus) {
return ResponseEntity.ok(SuccessResponse.create(CREATE_ARCHIVE_SUCCESS.getMessage(), this.missionHeartUseCase.pushHeart(user.getSocialId(),archiveId,missionHeartStatus)));
return ResponseEntity.ok(SuccessResponse.create(CREATE_ARCHIVE_SUCCESS.getMessage(), this.missionHeartUseCase.pushHeart(user.getSocialId(), archiveId, missionHeartStatus)));
}

/**
Expand All @@ -132,7 +136,6 @@ public ResponseEntity<SuccessResponse<MissionArchiveStatusRes>> getMissionDoneSt
}



/**
* 반복미션 - 나의 성공 횟수 조회
* [GET] {teamId}/missions/{missionId}/archive/my-status
Expand All @@ -141,14 +144,10 @@ public ResponseEntity<SuccessResponse<MissionArchiveStatusRes>> getMissionDoneSt

@GetMapping("/my-status")
public ResponseEntity<SuccessResponse<MissionArchiveStatusRes>> getMyMissionDoneStatus(@AuthenticationPrincipal User user,
@PathVariable("teamId") Long teamId,
@PathVariable("missionId") Long missionId) {
return ResponseEntity.ok(SuccessResponse.create(MISSION_ARCHIVE_PEOPLE_STATUS_SUCCESS.getMessage(), this.repeatMissionArchiveReadUseCase.getMyMissionDoneStatus(user.getSocialId(),missionId)));
@PathVariable("teamId") Long teamId,
@PathVariable("missionId") Long missionId) {
return ResponseEntity.ok(SuccessResponse.create(MISSION_ARCHIVE_PEOPLE_STATUS_SUCCESS.getMessage(), this.repeatMissionArchiveReadUseCase.getMyMissionDoneStatus(user.getSocialId(), missionId)));
}






}

0 comments on commit c317866

Please sign in to comment.