mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
收藏增加评分
This commit is contained in:
@@ -351,4 +351,21 @@ public class Course extends BaseEntity {
|
||||
this.favorites=favorites;
|
||||
}
|
||||
|
||||
public Course(String id,String name,String summary,String coverImg,String sysCreateAid,String sysCreateBy,Integer type,LocalDateTime publishTime,Integer views,Integer comments,Integer praises,Integer shares,Integer favorites,Float score){
|
||||
super.setId(id);
|
||||
this.name=name;
|
||||
this.summary=summary;
|
||||
this.coverImg=coverImg;
|
||||
super.setSysCreateAid(sysCreateAid);
|
||||
super.setSysCreateBy(sysCreateBy);
|
||||
this.type=type;
|
||||
this.publishTime=publishTime;
|
||||
this.views=views;
|
||||
this.comments=comments;
|
||||
this.praises=praises;
|
||||
this.shares=shares;
|
||||
this.favorites=favorites;
|
||||
this.score=score;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -70,5 +70,10 @@ public class FavoriteDto {
|
||||
* */
|
||||
private Float progress;
|
||||
|
||||
/**
|
||||
* 课程评分
|
||||
* */
|
||||
private Float score;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -91,6 +91,11 @@ public class FavoriteTotalDto {
|
||||
* */
|
||||
private String qid;
|
||||
|
||||
/**
|
||||
* score
|
||||
* */
|
||||
private Float score;
|
||||
|
||||
|
||||
public FavoriteTotalDto() {
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public class FavoritesServiceImpl implements IFavoritesService{
|
||||
if(!courseList.isEmpty()) {
|
||||
QueryBuilder from = QueryBuilder.from(Course.class);
|
||||
from.addFilter(FieldFilters.in("id",courseList));
|
||||
from.addFields("new Course(id,name,summary,coverImg,sysCreateAid,sysCreateBy,type,publishTime,views,comments,praises,shares,favorites)");
|
||||
from.addFields("new Course(id,name,summary,coverImg,sysCreateAid,sysCreateBy,type,publishTime,views,comments,praises,shares,favorites,score)");
|
||||
List<Course> courses = courseDao.findList(from.builder());
|
||||
if(!courses.isEmpty()){
|
||||
for (Course c : courses) {
|
||||
@@ -208,6 +208,7 @@ public class FavoritesServiceImpl implements IFavoritesService{
|
||||
favoriteTotalDto.setPraises(c.getPraises());
|
||||
favoriteTotalDto.setShares(c.getShares());
|
||||
favoriteTotalDto.setFavorites(c.getFavorites());
|
||||
favoriteTotalDto.setScore(c.getScore());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -438,7 +439,7 @@ public class FavoritesServiceImpl implements IFavoritesService{
|
||||
String from=Favorites.class.getSimpleName()+" f,"+Course.class.getSimpleName()+" c";
|
||||
QueryBuilder query=QueryBuilder.from(from);
|
||||
query.addFields("f.id","f.sysCreateTime","f.objId","c.name","c.summary","c.type","c.coverImg","c.sysCreateAid","c.sysCreateBy");
|
||||
query.addFields("c.deadTime","c.views","c.comments","c.praises","c.shares","c.favorites","f.objType");
|
||||
query.addFields("c.deadTime","c.views","c.comments","c.praises","c.shares","c.favorites","f.objType","c.score");
|
||||
query.setPageIndex(pageIndex);
|
||||
query.setPageSize(pageSize);
|
||||
query.addOrder(OrderCondition.desc("f.id"));
|
||||
@@ -478,6 +479,7 @@ public class FavoritesServiceImpl implements IFavoritesService{
|
||||
dto.setShares(ConvertUtil.toInt(objs[13]));
|
||||
dto.setFavorites(ConvertUtil.toInt(objs[14]));
|
||||
dto.setObjType((Integer) objs[15]);
|
||||
dto.setScore((Float) objs[16]);
|
||||
result.getList().add(dto);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user