添加注释
This commit is contained in:
@@ -14,7 +14,8 @@ import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户个人资料控制类
|
||||
* 用户个人资料接口
|
||||
* 提供主表及5张子表(教育/工作/实习/项目/竞赛)的查询与保存功能
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@@ -28,6 +29,9 @@ public class UserProfileController {
|
||||
|
||||
// ==================== 主表 ====================
|
||||
|
||||
/**
|
||||
* 查询当前用户的个人资料主表
|
||||
*/
|
||||
@GetMapping
|
||||
public UserProfileDto getProfile() {
|
||||
UserProfile po = userProfileService.getProfile();
|
||||
@@ -39,6 +43,9 @@ public class UserProfileController {
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存/更新当前用户的个人资料主表
|
||||
*/
|
||||
@PostMapping
|
||||
public void saveProfile(@Validated @RequestBody UserProfileParam param) {
|
||||
UserProfile po = new UserProfile();
|
||||
@@ -48,6 +55,9 @@ public class UserProfileController {
|
||||
|
||||
// ==================== 教育经历 ====================
|
||||
|
||||
/**
|
||||
* 查询当前用户的教育经历列表
|
||||
*/
|
||||
@GetMapping("/education")
|
||||
public List<UserProfileEducationDto> listEducation() {
|
||||
return userProfileService.listEducation().stream().map(po -> {
|
||||
@@ -57,6 +67,9 @@ public class UserProfileController {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存当前用户的教育经历列表(全量替换)
|
||||
*/
|
||||
@PostMapping("/education")
|
||||
public void saveEducation(@Validated @RequestBody List<@Valid UserProfileEducationParam> params) {
|
||||
List<UserProfileEducation> list = params.stream().map(p -> {
|
||||
@@ -69,6 +82,9 @@ public class UserProfileController {
|
||||
|
||||
// ==================== 工作经历 ====================
|
||||
|
||||
/**
|
||||
* 查询当前用户的工作经历列表
|
||||
*/
|
||||
@GetMapping("/work")
|
||||
public List<UserProfileWorkDto> listWork() {
|
||||
return userProfileService.listWork().stream().map(po -> {
|
||||
@@ -78,6 +94,9 @@ public class UserProfileController {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存当前用户的工作经历列表(全量替换)
|
||||
*/
|
||||
@PostMapping("/work")
|
||||
public void saveWork(@Validated @RequestBody List<@Valid UserProfileWorkParam> params) {
|
||||
List<UserProfileWork> list = params.stream().map(p -> {
|
||||
@@ -90,6 +109,9 @@ public class UserProfileController {
|
||||
|
||||
// ==================== 实习经历 ====================
|
||||
|
||||
/**
|
||||
* 查询当前用户的实习经历列表
|
||||
*/
|
||||
@GetMapping("/internship")
|
||||
public List<UserProfileInternshipDto> listInternship() {
|
||||
return userProfileService.listInternship().stream().map(po -> {
|
||||
@@ -99,6 +121,9 @@ public class UserProfileController {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存当前用户的实习经历列表(全量替换)
|
||||
*/
|
||||
@PostMapping("/internship")
|
||||
public void saveInternship(@Validated @RequestBody List<@Valid UserProfileInternshipParam> params) {
|
||||
List<UserProfileInternship> list = params.stream().map(p -> {
|
||||
@@ -111,6 +136,9 @@ public class UserProfileController {
|
||||
|
||||
// ==================== 项目经历 ====================
|
||||
|
||||
/**
|
||||
* 查询当前用户的项目经历列表
|
||||
*/
|
||||
@GetMapping("/project")
|
||||
public List<UserProfileProjectDto> listProject() {
|
||||
return userProfileService.listProject().stream().map(po -> {
|
||||
@@ -120,6 +148,9 @@ public class UserProfileController {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存当前用户的项目经历列表(全量替换)
|
||||
*/
|
||||
@PostMapping("/project")
|
||||
public void saveProject(@Validated @RequestBody List<@Valid UserProfileProjectParam> params) {
|
||||
List<UserProfileProject> list = params.stream().map(p -> {
|
||||
@@ -132,6 +163,9 @@ public class UserProfileController {
|
||||
|
||||
// ==================== 竞赛经历 ====================
|
||||
|
||||
/**
|
||||
* 查询当前用户的竞赛经历列表
|
||||
*/
|
||||
@GetMapping("/competition")
|
||||
public List<UserProfileCompetitionDto> listCompetition() {
|
||||
return userProfileService.listCompetition().stream().map(po -> {
|
||||
@@ -141,6 +175,9 @@ public class UserProfileController {
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存当前用户的竞赛经历列表(全量替换)
|
||||
*/
|
||||
@PostMapping("/competition")
|
||||
public void saveCompetition(@Validated @RequestBody List<@Valid UserProfileCompetitionParam> params) {
|
||||
List<UserProfileCompetition> list = params.stream().map(p -> {
|
||||
|
||||
Reference in New Issue
Block a user