-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from depromeet/develop
deploy-22.11.15.1
- Loading branch information
Showing
36 changed files
with
1,131 additions
and
149 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
fairer-api/src/main/java/com/depromeet/fairer/api/HouseWorkCompleteController.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,44 @@ | ||
package com.depromeet.fairer.api; | ||
|
||
import com.depromeet.fairer.dto.houseworkComplete.response.HouseWorkCompleteResponseDto; | ||
import com.depromeet.fairer.global.resolver.RequestMemberId; | ||
import com.depromeet.fairer.global.util.DateTimeUtils; | ||
import com.depromeet.fairer.service.houseworkComplete.HouseWorkCompleteService; | ||
import io.swagger.annotations.ApiOperation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.time.LocalDate; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequiredArgsConstructor | ||
@Tag(name = "houseWorkComplete", description = "집안일 완료 API") | ||
@RequestMapping("/api/houseworks/complete") | ||
public class HouseWorkCompleteController { | ||
|
||
private final HouseWorkCompleteService houseWorkCompleteService; | ||
|
||
@Tag(name = "houseWorkComplete") | ||
@ApiOperation(value = "집안일 완료 생성 - 반복 기능 구현 후") | ||
@PostMapping(value = "/{houseWorkId}") | ||
public ResponseEntity<HouseWorkCompleteResponseDto> createHouseWorkComp(@PathVariable("houseWorkId") Long houseWorkId, | ||
@RequestParam("scheduledDate") String scheduledDate) { | ||
final LocalDate date = DateTimeUtils.stringToLocalDate(scheduledDate); | ||
|
||
final Long houseWorkCompleteId = houseWorkCompleteService.create(houseWorkId, date); | ||
return new ResponseEntity<>(HouseWorkCompleteResponseDto.create(houseWorkCompleteId), HttpStatus.CREATED); | ||
} | ||
|
||
@Tag(name = "houseWorkComplete") | ||
@ApiOperation(value = "집안일 완료 삭제 - 반복 기능 구현 후") | ||
@DeleteMapping("/{houseWorkCompleteId}") | ||
public ResponseEntity<?> deleteHouseWorkComp(@PathVariable("houseWorkCompleteId") Long houseWorkCompleteId) { | ||
houseWorkCompleteService.delete(houseWorkCompleteId); | ||
return new ResponseEntity<>(HttpStatus.OK); | ||
} | ||
} |
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
Oops, something went wrong.