Skip to content
Snippets Groups Projects
Commit 66448064 authored by Lukas Maruniak's avatar Lukas Maruniak
Browse files

Fixes

parent 1fce4a7c
No related merge requests found
......@@ -165,7 +165,7 @@
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct</artifactId>
<version>1.6.0.Beta1</version>
<version>1.6.3</version>
</dependency>
</dependencies>
......@@ -187,7 +187,7 @@
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.6.0.Beta1</version>
<version>1.6.3</version>
</path>
</annotationProcessorPaths>
</configuration>
......
......@@ -4,12 +4,15 @@ import com.dre0059.articleprocessor.dto.DocumentDto;
import com.dre0059.articleprocessor.dto.SimpleDocumentDto;
import com.dre0059.articleprocessor.service.DocumentService;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller("api/document")
@Controller()
@RequestMapping("/api/document")
public class DocumentController {
private final DocumentService documentService;
......@@ -20,13 +23,13 @@ public class DocumentController {
}
@GetMapping("/{id}")
public DocumentDto getDocumentById(@PathVariable Long id) {
return documentService.getDocumentById(id);
public ResponseEntity<DocumentDto> getDocumentById(@PathVariable Long id) {
return ResponseEntity.ok(documentService.getDocumentById(id));
}
@GetMapping("/references/{id}")
public List<SimpleDocumentDto> getReferencesFromDocument(@PathVariable Long id) {
return documentService.getDocumentReferences(id);
public ResponseEntity<List<SimpleDocumentDto>> getReferencesFromDocument(@PathVariable Long id) {
return ResponseEntity.ok(documentService.getDocumentReferences(id));
}
@GetMapping("/view/{id}")
......
......@@ -6,7 +6,7 @@ import com.dre0059.articleprocessor.model.Dokument;
import java.util.List;
import org.mapstruct.Mapper;
@Mapper
@Mapper(componentModel = "spring")
public interface DocumentMapper {
DocumentDto toDocumentDto(Dokument entity);
......
......@@ -32,11 +32,11 @@
</tr>
</thead>
<tbody>
<tr th:each="ref: ${references}">
<td th:text="${ref.id}"></td>
<td th:text="${ref.title}"></td>
<td th:text="${ref.link}"></td>
</tr>
<!-- <tr th:each="ref: ${references}">-->
<!-- <td th:text="${ref.id}"></td>-->
<!-- <td th:text="${ref.title}"></td>-->
<!-- <td th:text="${ref.link}"></td>-->
<!-- </tr>-->
</tbody>
</table>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment