Skip to content
Snippets Groups Projects
Commit 7db256bd authored by jbuechele's avatar jbuechele
Browse files

added basic works api structure

parent 37582b6b
Branches master
No related tags found
No related merge requests found
package eu.fairkom.faircommons.api_service.api;
import eu.fairkom.faircommons.common.model.WorkCreateView;
import eu.fairkom.faircommons.common.model.WorkView;
import eu.fairkom.faircommons.common.rabbitmq.RabbitMqService;
import eu.fairkom.faircommons.common.rabbitmq.message.HashingMessage;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/{userId}/works")
public class WorksApi {
private final RabbitMqService rabbitMqService;
public WorksApi(RabbitMqService rabbitMqService) {
this.rabbitMqService = rabbitMqService;
}
@GetMapping
public ResponseEntity<List<WorkView>> getWorksByUserId(@PathVariable String userId) {
return null;
}
@GetMapping("/{workId}")
public ResponseEntity<WorkView> getWorkById(@PathVariable String userId, @PathVariable String workId) {
return null;
}
@PutMapping("/{workId}")
public ResponseEntity<Void> updateWork(@PathVariable String userId, @PathVariable String workId) {
return null;
}
@PostMapping("/register")
public ResponseEntity<Void> registerWork(@PathVariable String userId, @RequestBody WorkCreateView workCreateView) {
var message = new HashingMessage();
message.setName("Test Hashing Message");
rabbitMqService.sendMessage(message);
return ResponseEntity.ok().build();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment