Add score controller
This commit is contained in:
@@ -7,9 +7,6 @@ import org.springframework.stereotype.Component;
|
|||||||
@Component
|
@Component
|
||||||
public class AppConfigurations {
|
public class AppConfigurations {
|
||||||
|
|
||||||
@Value("${storage.location}")
|
|
||||||
public String storageLocation = "";
|
|
||||||
|
|
||||||
@Value("${sec.cors.authorizedHots}")
|
@Value("${sec.cors.authorizedHots}")
|
||||||
public String[] authorizedHosts;
|
public String[] authorizedHosts;
|
||||||
|
|
||||||
@@ -19,5 +16,4 @@ public class AppConfigurations {
|
|||||||
@Value("${sec.cors.authorizedHeader}")
|
@Value("${sec.cors.authorizedHeader}")
|
||||||
public String[] authorizedHeaders;
|
public String[] authorizedHeaders;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package be.naaturel.unluckiest.controllers;
|
||||||
|
|
||||||
|
import be.naaturel.unluckiest.models.Score;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
public class ScoreController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ScoreController(){
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/api/submit")
|
||||||
|
public ResponseEntity<?> register(@RequestBody Score s){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package be.naaturel.unluckiest.entities;
|
||||||
|
|
||||||
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
@Entity(name = "Score")
|
||||||
|
public class ScoreEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.UUID)
|
||||||
|
public String id;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
public String owner;
|
||||||
|
|
||||||
|
@Column
|
||||||
|
public int value;
|
||||||
|
|
||||||
|
}
|
||||||
13
back/src/main/java/be/naaturel/unluckiest/models/Score.java
Normal file
13
back/src/main/java/be/naaturel/unluckiest/models/Score.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package be.naaturel.unluckiest.models;
|
||||||
|
|
||||||
|
public class Score {
|
||||||
|
|
||||||
|
private String owner;
|
||||||
|
private int value;
|
||||||
|
|
||||||
|
public Score(String owner, int value){
|
||||||
|
this.owner = owner;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user