api: Add Skill entity and SkillController
parent
3006b45b62
commit
7ae9475386
|
@ -0,0 +1,16 @@
|
|||
package com.maradona.backend;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class Skill {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
private String primary;
|
||||
private String secondary;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.maradona.backend;
|
||||
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api")
|
||||
public class SkillController {
|
||||
|
||||
@PostMapping("skills")
|
||||
public ResponseEntity<Skill> createSkill(@RequestBody Skill skill) {
|
||||
return ResponseEntity.ok(skill);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue