Skip to content

Commit 6f68013

Browse files
committed
Merge branch 'CLAP-47' of https://github.com/TaskFlow-CLAP/TaskFlow-Server into develop
2 parents 9538c20 + 6849435 commit 6f68013

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+676
-94
lines changed

.github/image/gyudong.jpg

605 KB
Loading

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
</div>
88

99
## 🔎 TaskFlow
10-
10+
Coming Soon...
1111

1212
## 💁‍♂️ Team Member
1313
| 서주원 (PL) | 나은비(BE) | 박재학(BE) | 양시훈(BE) | 이규동(BE) | 최효성(BE & INFRA) |
1414
|:---------:|:--------:|:--------:|:--------:|:--------:|:--------:|
15-
| <img src="https://github.com/TaskFlow-CLAP/TaskFlow-Server/blob/develop/.github/image/joowojr.JPG" width="150px" > | <img src="https://github.com/user-attachments/assets/5c59f742-8f2b-4472-bff4-d8dff350481b" width="150px"> | <img src="https://github.com/TaskFlow-CLAP/TaskFlow-Server/blob/develop/.github/image/jaehak.jpg" width="150px" > | <img src="https://github.com/TaskFlow-CLAP/TaskFlow-Server/blob/develop/.github/image/Sihun23.jpeg" width="150px" > | ![](사진) | <img src="https://github.com/TaskFlow-CLAP/TaskFlow-Server/blob/develop/.github/image/hyoseong.jpg" width="150px" > |
15+
| <img src="https://github.com/TaskFlow-CLAP/TaskFlow-Server/blob/develop/.github/image/joowojr.JPG" width="150px" > | <img src="https://github.com/user-attachments/assets/5c59f742-8f2b-4472-bff4-d8dff350481b" width="150px"> | <img src="https://github.com/TaskFlow-CLAP/TaskFlow-Server/blob/develop/.github/image/jaehak.jpg" width="150px" > | <img src="https://github.com/TaskFlow-CLAP/TaskFlow-Server/blob/develop/.github/image/Sihun23.jpeg" width="150px" > | <img src="https://github.com/TaskFlow-CLAP/TaskFlow-Server/blob/develop/.github/image/gyudong.jpg" width="150px" > | <img src="https://github.com/TaskFlow-CLAP/TaskFlow-Server/blob/develop/.github/image/hyoseong.jpg" width="150px" > |
1616
| [Github](https://github.com/joowojr) | [Github](https://github.com/nano-mm) | [Github](https://github.com/parkjaehak) | [Github](https://github.com/Sihun23) | [Github](https://github.com/starboxxxx) | [Github](https://github.com/hyoseong-Choi) |
1717

1818
## ⚒️ Stack
@@ -22,13 +22,9 @@
2222
<img src="https://img.shields.io/badge/Framework-555555?style=for-the-badge">![SpringBoot](https://img.shields.io/badge/springboot-%236DB33F.svg?style=for-the-badge&logo=springboot&logoColor=white)![spring_data_JPA](https://img.shields.io/badge/spring_data_JPA-%236DB33F?style=for-the-badge&logo=databricks&logoColor=white)![spring_security](https://img.shields.io/badge/spring_security-%236DB33F.svg?style=for-the-badge&logo=springsecurity&logoColor=white)
2323

2424
<img src="https://img.shields.io/badge/build-555555?style=for-the-badge">![Gradle](https://img.shields.io/badge/Gradle-02303A.svg?style=for-the-badge&logo=Gradle&logoColor=white)
25-
2625
<img src="https://img.shields.io/badge/Test-555555?style=for-the-badge">![junit5](https://img.shields.io/badge/junit5-25A162?style=for-the-badge&logo=junit5&logoColor=white)
2726

2827
<img src="https://img.shields.io/badge/Security-555555?style=for-the-badge">![JWT](https://img.shields.io/badge/json%20web%20tokens-323330?style=for-the-badge&logo=json-web-tokens&logoColor=pink)
29-
30-
31-
### DB
3228
<img src="https://img.shields.io/badge/DB Migration-555555?style=for-the-badge">![Flyway](https://img.shields.io/badge/Flyway-F7B500?style=for-the-badge&logo=flyway&logoColor=white)
3329

3430
### Infra
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package clap.server;
2+
3+
import lombok.RequiredArgsConstructor;
4+
import org.springframework.http.ResponseEntity;
5+
import org.springframework.web.bind.annotation.*;
6+
7+
@RestController
8+
@RequiredArgsConstructor
9+
@RequestMapping("/health")
10+
public class HealthCheckController {
11+
@GetMapping
12+
public ResponseEntity<?> healthcheck(){
13+
return ResponseEntity.ok("health check");
14+
}
15+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package clap.server.adapter.inbound.web.dto.task;
2+
3+
import jakarta.validation.constraints.NotBlank;
4+
import jakarta.validation.constraints.NotNull;
5+
6+
import java.util.List;
7+
8+
public record CreateTaskRequest(
9+
@NotNull
10+
Long categoryId,
11+
@NotNull
12+
Long mainCategoryId,
13+
@NotBlank
14+
String title,
15+
String description,
16+
List<@NotBlank String> fileUrls
17+
) {
18+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package clap.server.adapter.inbound.web.dto.task;
2+
3+
4+
5+
public record CreateTaskResponse(
6+
Long taskId,
7+
Long categoryId,
8+
String title
9+
) {
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package clap.server.adapter.inbound.web.dto.task;
2+
3+
4+
import clap.server.adapter.outbound.persistense.entity.task.constant.TaskStatus;
5+
6+
public record FindTaskListRequest(
7+
Integer term, //조회기간
8+
Long categoryId,
9+
Long mainCategoryId,
10+
String title,
11+
String nickName, //처리자 닉네임
12+
TaskStatus taskStatus
13+
) {
14+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package clap.server.adapter.inbound.web.dto.task;
2+
3+
import clap.server.adapter.outbound.persistense.entity.task.constant.TaskStatus;
4+
5+
import java.time.LocalDateTime;
6+
7+
public record FindTaskListResponse(
8+
Long taskId,
9+
String taskCode,
10+
LocalDateTime createdAt,
11+
String mainCategoryName,
12+
String categoryName,
13+
String title,
14+
String processorName,
15+
TaskStatus taskStatus,
16+
LocalDateTime completedAt
17+
) {
18+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package clap.server.adapter.inbound.web.task;
2+
3+
import clap.server.adapter.inbound.web.dto.task.CreateTaskRequest;
4+
import clap.server.application.port.inbound.task.CreateTaskUsecase;
5+
import clap.server.common.annotation.architecture.WebAdapter;
6+
import jakarta.validation.Valid;
7+
import lombok.RequiredArgsConstructor;
8+
import org.springframework.http.ResponseEntity;
9+
import org.springframework.web.bind.annotation.*;
10+
11+
12+
@WebAdapter
13+
@RestController
14+
@RequiredArgsConstructor
15+
@RequestMapping("/api/tasks")
16+
public class CreateTaskController {
17+
18+
private final CreateTaskUsecase taskCreateUsecase;
19+
private static final Long memberId = 4L;
20+
21+
@PostMapping
22+
public ResponseEntity<?> createTask(
23+
@RequestBody @Valid CreateTaskRequest createTaskRequest){
24+
return ResponseEntity.ok(taskCreateUsecase.createTask(memberId, createTaskRequest));
25+
}
26+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package clap.server.adapter.inbound.web.task;
2+
3+
import clap.server.adapter.inbound.web.dto.task.FindTaskListRequest;
4+
import clap.server.application.port.inbound.task.FindTaskListUsecase;
5+
import clap.server.common.annotation.architecture.WebAdapter;
6+
import lombok.RequiredArgsConstructor;
7+
import org.springframework.data.domain.PageRequest;
8+
import org.springframework.data.domain.Pageable;
9+
import org.springframework.http.ResponseEntity;
10+
import org.springframework.web.bind.annotation.*;
11+
12+
@WebAdapter
13+
@RestController
14+
@RequiredArgsConstructor
15+
@RequestMapping("/api/tasks")
16+
public class FindTaskListController {
17+
private final FindTaskListUsecase taskListUsecase;
18+
private static final Long memberId = 4L;
19+
20+
21+
@GetMapping("/requests")
22+
public ResponseEntity<?> getRequestedTaskList(
23+
@RequestParam(defaultValue = "0") int page,
24+
@RequestParam(defaultValue = "20") int size,
25+
@RequestBody FindTaskListRequest findTaskListRequest){
26+
Pageable pageable = PageRequest.of(page, size);
27+
return ResponseEntity.ok(taskListUsecase.findRequestedTaskList(memberId, pageable, findTaskListRequest));
28+
}
29+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package clap.server.adapter.outbound.persistense;
2+
3+
import clap.server.adapter.outbound.persistense.entity.task.AttachmentEntity;
4+
import clap.server.adapter.outbound.persistense.mapper.AttachmentPersistenceMapper;
5+
import clap.server.adapter.outbound.persistense.repository.task.AttachmentRepository;
6+
import clap.server.application.port.outbound.task.CommandAttachmentPort;
7+
import clap.server.common.annotation.architecture.PersistenceAdapter;
8+
import clap.server.domain.model.task.Attachment;
9+
10+
import lombok.RequiredArgsConstructor;
11+
12+
import java.util.List;
13+
import java.util.stream.Collectors;
14+
15+
16+
@PersistenceAdapter
17+
@RequiredArgsConstructor
18+
public class AttachmentPersistenceAdapter implements CommandAttachmentPort {
19+
20+
private final AttachmentRepository attachmentRepository;
21+
private final AttachmentPersistenceMapper attachmentPersistenceMapper;
22+
23+
24+
@Override
25+
public void save(Attachment attachment) {
26+
attachmentRepository.save(attachmentPersistenceMapper.toEntity(attachment));
27+
}
28+
29+
30+
@Override
31+
public void saveAll(List<Attachment> attachments) {
32+
List<AttachmentEntity> attachmentEntities = attachments.stream()
33+
.map(attachmentPersistenceMapper::toEntity)
34+
.collect(Collectors.toList());
35+
attachmentRepository.saveAll(attachmentEntities);
36+
}
37+
}

0 commit comments

Comments
 (0)