Merge pull request 'fix: Correct spelling of 'prototype' in API and documentation' (#92) from 3002833/Backend:main into restfull
Reviewed-on: Maradona/Backend#92pull/1/head
commit
e05e074ea5
|
@ -26,7 +26,7 @@ import com.maradona.backend.services.details.EmployeeDetails;
|
||||||
* - GET /api/employee/all
|
* - GET /api/employee/all
|
||||||
* - GET /api/employee/from-skill
|
* - GET /api/employee/from-skill
|
||||||
* - GET /api/employee/skill/all
|
* - GET /api/employee/skill/all
|
||||||
* - POST /api/employee/skill/protoype
|
* - POST /api/employee/skill/prototype
|
||||||
* - PUT /api/employee/skill/level
|
* - PUT /api/employee/skill/level
|
||||||
* - DELETE /api/employee/skill
|
* - DELETE /api/employee/skill
|
||||||
*
|
*
|
||||||
|
@ -107,8 +107,8 @@ public class EmployeeController {
|
||||||
* @see com.maradona.backend.entities.Employee
|
* @see com.maradona.backend.entities.Employee
|
||||||
* @see com.maradona.backend.entities.SecondarySkill
|
* @see com.maradona.backend.entities.SecondarySkill
|
||||||
*/
|
*/
|
||||||
@PostMapping("/skill/protoype")
|
@PostMapping("/skill/prototype")
|
||||||
public ResponseEntity<Void> postSkillProtoype(@RequestBody SkillPrototype skillPrototype) {
|
public ResponseEntity<Void> postSkillPrototype(@RequestBody SkillPrototype skillPrototype) {
|
||||||
employeeActions.addSecondarySkillToEmployee(user, skillPrototype);
|
employeeActions.addSecondarySkillToEmployee(user, skillPrototype);
|
||||||
return ResponseEntity.status(HttpStatus.CREATED).build();
|
return ResponseEntity.status(HttpStatus.CREATED).build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,11 +82,11 @@ public class SkillsPage {
|
||||||
*
|
*
|
||||||
* Attributes that can be used by the frontend are a PrimarySkill object
|
* Attributes that can be used by the frontend are a PrimarySkill object
|
||||||
* "primarySkill", a SecondarySkill object "secondarySkill" and a
|
* "primarySkill", a SecondarySkill object "secondarySkill" and a
|
||||||
* SkillProtoype object "skillProtoype".
|
* SkillPrototype object "skillPrototype".
|
||||||
*
|
*
|
||||||
* The skillProtoype object contains the data needed to add a skill to the user
|
* The skillPrototype object contains the data needed to add a skill to the user
|
||||||
* profile.
|
* profile.
|
||||||
* To add it to a user profile, POST to /api/employee/skill/protoype.
|
* To add it to a user profile, POST to /api/employee/skill/prototype.
|
||||||
*
|
*
|
||||||
* @param model The model with the data to be displayed
|
* @param model The model with the data to be displayed
|
||||||
* @return The add skill page template
|
* @return The add skill page template
|
||||||
|
@ -98,7 +98,7 @@ public class SkillsPage {
|
||||||
public String addSkill(Model model) {
|
public String addSkill(Model model) {
|
||||||
// TODO: Make sure it returns the correct initail data for secondary skills
|
// TODO: Make sure it returns the correct initail data for secondary skills
|
||||||
model.addAttribute("primarySkills", primarySkillDetails.getAllPrimarySkills());
|
model.addAttribute("primarySkills", primarySkillDetails.getAllPrimarySkills());
|
||||||
model.addAttribute("skillProtoype", new SkillPrototype());
|
model.addAttribute("skillPrototype", new SkillPrototype());
|
||||||
return "/pages/skills/add";
|
return "/pages/skills/add";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,27 +5,64 @@ import com.maradona.backend.entities.SecondarySkill;
|
||||||
import org.springframework.data.util.Pair;
|
import org.springframework.data.util.Pair;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This classs provides an easier way to send a list of skills with levels to
|
||||||
|
* the frontend.
|
||||||
|
*/
|
||||||
public class SkillList {
|
public class SkillList {
|
||||||
|
/**
|
||||||
|
* The primary skill.
|
||||||
|
*/
|
||||||
private PrimarySkill primarySkill;
|
private PrimarySkill primarySkill;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The list of secondary skills with their levels.
|
||||||
|
*/
|
||||||
private List<Pair<SecondarySkill, Integer>> secondarySkills;
|
private List<Pair<SecondarySkill, Integer>> secondarySkills;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new SkillList object.
|
||||||
|
*
|
||||||
|
* @param primarySkill The primary skill.
|
||||||
|
* @param secondarySkills The list of secondary skills with their levels.
|
||||||
|
*/
|
||||||
public SkillList(PrimarySkill primarySkill, List<Pair<SecondarySkill, Integer>> secondarySkills) {
|
public SkillList(PrimarySkill primarySkill, List<Pair<SecondarySkill, Integer>> secondarySkills) {
|
||||||
this.primarySkill = primarySkill;
|
this.primarySkill = primarySkill;
|
||||||
this.secondarySkills = secondarySkills;
|
this.secondarySkills = secondarySkills;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the primary skill.
|
||||||
|
*
|
||||||
|
* @return The primary skill.
|
||||||
|
*/
|
||||||
public PrimarySkill getPrimarySkill() {
|
public PrimarySkill getPrimarySkill() {
|
||||||
return primarySkill;
|
return primarySkill;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the primary skill.
|
||||||
|
*
|
||||||
|
* @param primarySkill The primary skill.
|
||||||
|
*/
|
||||||
public void setPrimarySkill(PrimarySkill primarySkill) {
|
public void setPrimarySkill(PrimarySkill primarySkill) {
|
||||||
this.primarySkill = primarySkill;
|
this.primarySkill = primarySkill;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the list of secondary skills with their levels.
|
||||||
|
*
|
||||||
|
* @return The list of secondary skills with their levels.
|
||||||
|
*/
|
||||||
public List<Pair<SecondarySkill, Integer>> getSecondarySkills() {
|
public List<Pair<SecondarySkill, Integer>> getSecondarySkills() {
|
||||||
return secondarySkills;
|
return secondarySkills;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the list of secondary skills with their levels.
|
||||||
|
*
|
||||||
|
* @param secondarySkills The list of secondary skills with their levels.
|
||||||
|
*/
|
||||||
public void setSecondarySkills(List<Pair<SecondarySkill, Integer>> secondarySkills) {
|
public void setSecondarySkills(List<Pair<SecondarySkill, Integer>> secondarySkills) {
|
||||||
this.secondarySkills = secondarySkills;
|
this.secondarySkills = secondarySkills;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,30 +1,73 @@
|
||||||
package com.maradona.backend.dto;
|
package com.maradona.backend.dto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class provides an easy way to receive raw data that can be usd to build
|
||||||
|
* a skill from the frontend.
|
||||||
|
*/
|
||||||
public class SkillPrototype {
|
public class SkillPrototype {
|
||||||
|
/**
|
||||||
|
* The primary skill ID.
|
||||||
|
*/
|
||||||
private Long psid;
|
private Long psid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The secondary skill ID.
|
||||||
|
*/
|
||||||
private Long ssid;
|
private Long ssid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The level of the skill.
|
||||||
|
*/
|
||||||
private Integer level;
|
private Integer level;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the primary skill ID.
|
||||||
|
*/
|
||||||
public Long getPsid() {
|
public Long getPsid() {
|
||||||
return psid;
|
return psid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the primary skill ID.
|
||||||
|
*
|
||||||
|
* @param psid The primary skill ID to set.
|
||||||
|
*/
|
||||||
public void setPsid(Long psid) {
|
public void setPsid(Long psid) {
|
||||||
this.psid = psid;
|
this.psid = psid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the secondary skill ID.
|
||||||
|
*
|
||||||
|
* @return The secondary skill ID.
|
||||||
|
*/
|
||||||
public Long getSsid() {
|
public Long getSsid() {
|
||||||
return ssid;
|
return ssid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the secondary skill ID.
|
||||||
|
*
|
||||||
|
* @param ssid The secondary skill ID to set.
|
||||||
|
*/
|
||||||
public void setSsid(Long ssid) {
|
public void setSsid(Long ssid) {
|
||||||
this.ssid = ssid;
|
this.ssid = ssid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the level of the skill.
|
||||||
|
*
|
||||||
|
* @return The level of the skill.
|
||||||
|
*/
|
||||||
public Integer getLevel() {
|
public Integer getLevel() {
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the level of the skill.
|
||||||
|
*
|
||||||
|
* @param level The level of the skill to set.
|
||||||
|
*/
|
||||||
public void setLevel(Integer level) {
|
public void setLevel(Integer level) {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue