1、swagger接口文档

beetlsql3-dev
陈沅 1 year ago
parent d4e69d5af1
commit 1b58653476

@ -36,7 +36,7 @@ import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
/**
* <p>
* -API
* -API
* </p>
*
* @author mlx
@ -47,20 +47,32 @@ import static com.ibeetl.admin.core.util.user.CacheUserUtil.getUser;
@Validated
public class ApiStudentService {
@Autowired private ApiIndexBaseService apiIndexBaseService;
@Autowired private TeacherOpenCourseNoticeService teacherOpenCourseNoticeService;
@Autowired private StudentService studentService;
@Autowired private StudentDao studentDao;
@Autowired private ResourcesApplicationService resourcesApplicationService;
@Autowired private TeacherOpenCourseMergeStudentDao teacherOpenCourseMergeStudentDao;
@Autowired private UniversitiesCollegesService universitiesCollegesService;
@Autowired private PasswordConfig.PasswordEncryptService passwordEncryptService;
@Autowired private CoreUserService coreUserService;
@Autowired
private ApiIndexBaseService apiIndexBaseService;
@Autowired
private TeacherOpenCourseNoticeService teacherOpenCourseNoticeService;
@Autowired
private StudentService studentService;
@Autowired
private StudentDao studentDao;
@Autowired
private StudentAccountAssetAllocationService studentAccountAssetAllocationService;
@Autowired
private ResourcesApplicationService resourcesApplicationService;
@Autowired
private TeacherOpenCourseMergeStudentDao teacherOpenCourseMergeStudentDao;
@Autowired
private UniversitiesCollegesService universitiesCollegesService;
@Autowired
private PasswordConfig.PasswordEncryptService passwordEncryptService;
@Autowired
private CoreUserService coreUserService;
@Autowired
private SysLogService sysLogService;
/**
* -
* -
*
* @return
*/
public StudentIndexData index() {
@ -97,36 +109,52 @@ public class ApiStudentService {
//饼状图数据
//todo 查询数据库
//
List<StudentAccountAssetAllocation> studentAccountAssetAllocations = studentAccountAssetAllocationService.getInfoByStudentId(studentId);
List<Map<String, Object>> pieMaps = new ArrayList<>();
Map<String, Object> map1 = new HashMap<>();
map1.put("name", "现金账户");
map1.put("value", 835000);
Map<String, Object> map2 = new HashMap<>();
map2.put("name", "银行账户");
map2.put("value", 572924);
Map<String, Object> map3 = new HashMap<>();
map3.put("name", "P2P账户");
map3.put("value", 150370);
Map<String, Object> map4 = new HashMap<>();
map4.put("name", "众筹账户");
map4.put("value", 558499);
Map<String, Object> map5 = new HashMap<>();
map5.put("name", "股票基金投资账户");
map5.put("value", 1118689);
Map<String, Object> map6 = new HashMap<>();
map6.put("name", "期货投资账户");
map6.put("value", 247149);
Map<String, Object> map7 = new HashMap<>();
map7.put("name", "期权投资账户");
map7.put("value", 5038001);
pieMaps.add(map1);
pieMaps.add(map2);
pieMaps.add(map3);
pieMaps.add(map4);
pieMaps.add(map5);
pieMaps.add(map6);
pieMaps.add(map7);
for (StudentAccountAssetAllocation allocation : studentAccountAssetAllocations) {
if (allocation.getName().getText().equals("现金账户")) {
continue;
}
Map<String, Object> map = new HashMap<>();
if (allocation.getName().getText().equals("银行账户")) {
map.put("name", allocation.getName().getText());
map.put("value", allocation.getAvailableFunds());
} else {
if (allocation.getName().getText().equals("P2P账户")) {
map.put("name", "网络融资账户");
map.put("value", allocation.getTotalAssetsOfSubAccounts());
} else {
map.put("name", allocation.getName().getText());
map.put("value", allocation.getTotalAssetsOfSubAccounts());
}
}
pieMaps.add(map);
}
// Map<String, Object> map2 = new HashMap<>();
// map2.put("name", "银行账户");
// map2.put("value", 572924);
// Map<String, Object> map3 = new HashMap<>();
// map3.put("name", "P2P账户");
// map3.put("value", 150370);
// Map<String, Object> map4 = new HashMap<>();
// map4.put("name", "众筹账户");
// map4.put("value", 558499);
// Map<String, Object> map5 = new HashMap<>();
// map5.put("name", "股票基金投资账户");
// map5.put("value", 1118689);
// Map<String, Object> map6 = new HashMap<>();
// map6.put("name", "期货投资账户");
// map6.put("value", 247149);
// Map<String, Object> map7 = new HashMap<>();
// map7.put("name", "期权投资账户");
// map7.put("value", 5038001);
// pieMaps.add(map2);
// pieMaps.add(map3);
// pieMaps.add(map4);
// pieMaps.add(map5);
// pieMaps.add(map6);
// pieMaps.add(map7);
//我的收益率
Map<String, Object> lineMap = new HashMap<>();
List<String> xList = new ArrayList<>();
@ -156,8 +184,8 @@ public class ApiStudentService {
yList2.add("135");
yLists.add(yList1);
yLists.add(yList2);
lineMap.put("xList" , xList);
lineMap.put("yList" , yLists);
lineMap.put("xList", xList);
lineMap.put("yList", yLists);
return StudentIndexData.builder()
.noticeList(noticeList)
@ -170,10 +198,11 @@ public class ApiStudentService {
/**
* -
*
* @param dto
* @return
*/
public void register(@NotNull(message="学生注册信息不能为空!") StudentRegisterDTO dto) {
public void register(@NotNull(message = "学生注册信息不能为空!") StudentRegisterDTO dto) {
// 传入的院校ID
final Long universitiesCollegesId = dto.getUniversitiesCollegesId();
@ -187,6 +216,7 @@ public class ApiStudentService {
/**
* -
*
* @param dto
*/
public void editPwd(@NotNull(message = "修改密码信息不能为空!") StudentEditPasswordDTO dto) {
@ -220,12 +250,13 @@ public class ApiStudentService {
// 根据旧密码修改新密码
// Boolean updateSuccess = coreUserService.editPwdByOld(dto.getOldPwd(), dto.getNewPwd(), studentInfo.getUserId());
Boolean updateSuccess = coreUserService.editPwdByOldNotVerify( dto.getNewPwd(), studentInfo.getUserId());
Boolean updateSuccess = coreUserService.editPwdByOldNotVerify(dto.getNewPwd(), studentInfo.getUserId());
Assert.isTrue(updateSuccess, "密码修改失败!");
}
/**
*
*
* @return
*/
public StudentActiveInfo studentActiveInfo() {

Loading…
Cancel
Save