mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-16 22:36:50 +08:00
我的评分查询的修改
This commit is contained in:
@@ -57,14 +57,17 @@ public class CourseGradeApi extends ApiBaseController {
|
|||||||
* 查询当前用户评分的课程 分数
|
* 查询当前用户评分的课程 分数
|
||||||
* */
|
* */
|
||||||
@PostMapping("/score")
|
@PostMapping("/score")
|
||||||
public JsonResponse<Map<String,Object>> score(String courseId,String aid){
|
public JsonResponse<CourseGrade> score(String courseId,String aid){
|
||||||
if(StringUtils.isBlank(courseId)){
|
if(StringUtils.isBlank(courseId)){
|
||||||
return badRequest("参数异常");
|
return badRequest("参数异常");
|
||||||
}
|
}
|
||||||
if(StringUtils.isBlank(aid)){
|
if(StringUtils.isBlank(aid)){
|
||||||
aid=this.getCurrent().getAccountId();
|
aid=this.getCurrent().getAccountId();
|
||||||
}
|
}
|
||||||
Map<String, Object> score = service.score(courseId, aid);
|
CourseGrade score = service.score(courseId, aid);
|
||||||
|
if(score==null) {
|
||||||
|
return notfound();
|
||||||
|
}
|
||||||
return success(score);
|
return success(score);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,5 +26,5 @@ public interface ICourseGradeService {
|
|||||||
/**
|
/**
|
||||||
* 查询当前用户评分的课程
|
* 查询当前用户评分的课程
|
||||||
* */
|
* */
|
||||||
Map<String,Object> score(String courseId,String aid);
|
CourseGrade score(String courseId,String aid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ public class CourseGradeServiceImpl implements ICourseGradeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> score(String courseId, String aid) {
|
public CourseGrade score(String courseId, String aid) {
|
||||||
HashMap<String, Object> map = new HashMap<>();
|
|
||||||
Object field = courseGradeDao.findField("scores", FieldFilters.eq("courseId", courseId), FieldFilters.eq("sysCreateAid", aid));
|
CourseGrade cg = courseGradeDao.findOne(FieldFilters.eq("courseId", courseId), FieldFilters.eq("sysCreateAid", aid));
|
||||||
map.put(courseId,field);
|
|
||||||
return map;
|
return cg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user