api: Add Skill entity and SkillController

pull/1/head
Lunix-420 2024-10-28 11:33:54 +01:00
parent 3006b45b62
commit 7ae9475386
2 changed files with 34 additions and 0 deletions

View File

@ -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;
}

View File

@ -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);
}
}