|
|
@ -86,15 +86,15 @@ public class ActivityService{ |
|
|
|
* @return 返回活动信息 |
|
|
|
* @return 返回活动信息 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public JSONResponse<FindActivityRes.Res,FindActivityRes> find(FindActivityForm findActivityForm){ |
|
|
|
public JSONResponse<FindActivityRes.Res,FindActivityRes> find(FindActivityForm findActivityForm){ |
|
|
|
FindActivityRes findActivityRes=activityMapper.count(pageSize); |
|
|
|
FindActivityRes findActivityRes=activityMapper.count(pageSize,findActivityForm.getUserId()); |
|
|
|
findActivityRes.setPageSize(pageSize); |
|
|
|
findActivityRes.setPageSize(pageSize); |
|
|
|
findActivityRes.setCurrentPage(findActivityForm.getCurrentPage()); |
|
|
|
findActivityRes.setCurrentPage(findActivityForm.getCurrentPage()); |
|
|
|
List<ActivitySimple> activitySimpleList=activityMapper.getPage((findActivityForm.getCurrentPage()-1)*pageSize,pageSize); |
|
|
|
List<ActivitySimple> activitySimpleList=activityMapper.getPage((findActivityForm.getCurrentPage()-1)*pageSize,pageSize,findActivityForm.getUserId()); |
|
|
|
if(!activitySimpleList.isEmpty()){ |
|
|
|
if(!activitySimpleList.isEmpty()){ |
|
|
|
findActivityRes.setBody(Util.splitList(ActivitySimple.class,activitySimpleList,rowSize)); |
|
|
|
findActivityRes.setBody(Util.splitList(ActivitySimple.class,activitySimpleList,rowSize)); |
|
|
|
return new JSONResponse<FindActivityRes.Res,FindActivityRes>(FindActivityRes.Res.ok,Result.OK).setBody(findActivityRes); |
|
|
|
return new JSONResponse<FindActivityRes.Res,FindActivityRes>(FindActivityRes.Res.ok,Result.OK).setBody(findActivityRes); |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
return new JSONResponse<>(FindActivityRes.Res.empty, Result.FAIL); |
|
|
|
return new JSONResponse<>(FindActivityRes.Res.empty, Result.OK); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -142,8 +142,9 @@ public class ActivityService{ |
|
|
|
leaveWordEntity.setTargetUserId(activity.getUserId()); |
|
|
|
leaveWordEntity.setTargetUserId(activity.getUserId()); |
|
|
|
leaveWordEntity.setActivityId(activityForm.getActivityId()); |
|
|
|
leaveWordEntity.setActivityId(activityForm.getActivityId()); |
|
|
|
leaveWordEntity.setCreateTime(new Timestamp(System.currentTimeMillis())); |
|
|
|
leaveWordEntity.setCreateTime(new Timestamp(System.currentTimeMillis())); |
|
|
|
if(leaveWordMapper.insert(leaveWordEntity)){ |
|
|
|
if(!leaveWordMapper.insert(leaveWordEntity)){ |
|
|
|
logger.error("保存留言信息失败"); |
|
|
|
logger.error("保存留言信息失败"); |
|
|
|
|
|
|
|
return new JSONResponse<>(ApplyActivityRes.fail,Result.FAIL); |
|
|
|
} |
|
|
|
} |
|
|
|
return new JSONResponse<>(ApplyActivityRes.ok,Result.OK); |
|
|
|
return new JSONResponse<>(ApplyActivityRes.ok,Result.OK); |
|
|
|
} |
|
|
|
} |
|
|
|