Revize fe499c38
Přidáno uživatelem Petr Urban před více než 1 rok
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/v2/controller/management/CategoryController.java | ||
---|---|---|
1 | 1 |
package cz.zcu.fav.kiv.antipatterndetectionapp.v2.controller.management; |
2 | 2 |
|
3 |
import com.google.gson.Gson; |
|
4 |
import cz.zcu.fav.kiv.antipatterndetectionapp.model.Project; |
|
5 |
import cz.zcu.fav.kiv.antipatterndetectionapp.model.management.Category; |
|
6 |
import cz.zcu.fav.kiv.antipatterndetectionapp.model.management.ProjectInstance; |
|
7 |
import cz.zcu.fav.kiv.antipatterndetectionapp.service.ProjectService; |
|
8 |
import cz.zcu.fav.kiv.antipatterndetectionapp.v2.model.CategoryDto; |
|
9 |
import cz.zcu.fav.kiv.antipatterndetectionapp.v2.model.GeneralResponseDto; |
|
10 |
import cz.zcu.fav.kiv.antipatterndetectionapp.v2.service.management.category.ICategories; |
|
11 |
import cz.zcu.fav.kiv.antipatterndetectionapp.v2.utils.converters.CategoryToDto; |
|
12 |
import lombok.RequiredArgsConstructor; |
|
13 |
import org.springframework.beans.factory.annotation.Autowired; |
|
14 |
import org.springframework.http.HttpStatus; |
|
3 | 15 |
import org.springframework.http.ResponseEntity; |
4 | 16 |
import org.springframework.stereotype.Controller; |
5 | 17 |
import org.springframework.web.bind.annotation.GetMapping; |
... | ... | |
19 | 31 |
private final ICategories categories; |
20 | 32 |
|
21 | 33 |
@GetMapping("/getCategories") |
22 |
public ResponseEntity<String> getCategories() { |
|
23 |
//TODO |
|
24 |
return null; |
|
34 |
public ResponseEntity<GeneralResponseDto<CategoryDto>> getCategories(@RequestBody Map<String, String> requestData) { |
|
35 |
return categories.getResponse(requestData.get("projectId")); |
|
25 | 36 |
} |
26 | 37 |
|
27 | 38 |
@PostMapping("/changeCategory") |
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/v2/model/GeneralResponseDto.java | ||
---|---|---|
9 | 9 |
@Builder |
10 | 10 |
public class GeneralResponseDto<T> { |
11 | 11 |
private String message; |
12 |
private List<T> content;
|
|
12 |
private List<T> responseBody;
|
|
13 | 13 |
|
14 | 14 |
public static <T> GeneralResponseDtoBuilder<T> builder() { |
15 | 15 |
return new GeneralResponseDtoBuilder<T>(); |
src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/v2/service/management/category/impl/CategoriesImpl.java | ||
---|---|---|
79 | 79 |
GeneralResponseDto |
80 | 80 |
.<CategoryDto>builder() |
81 | 81 |
.message(message) |
82 |
.categories(categories)
|
|
82 |
.responseBody(categories)
|
|
83 | 83 |
.build(), status); |
84 | 84 |
} |
85 | 85 |
|
Také k dispozici: Unified diff
https://kivprogrammers.atlassian.net/browse/TSP2-58