作者 mxy

关键字查询动态

... ... @@ -103,4 +103,14 @@ public class ActivityController {
return activityService.getActivityType();
}
@ApiOperation("模糊查询动态")
@PostMapping("/searchActivities")
public AjaxResult searchActivities(String title){
log.info("<<<接收到的信息<<<::"+title);
return activityService.searchActivities(title);
}
}
... ...
... ... @@ -19,4 +19,6 @@ public interface CActivityMapper extends BaseMapperPlus<CActivity> {
CActivity activity(Long aid);
List<CActivity> searchActivity(String title);
}
... ...
... ... @@ -70,4 +70,10 @@ public interface ActivityService {
*/
AjaxResult getActivityType();
/**
* 模糊查询动态
* @param title
* @return
*/
AjaxResult searchActivities(String title);
}
... ...
... ... @@ -651,6 +651,23 @@ public class ActivityServiceImpl extends ServicePlusImpl<CActivityMapper,CActivi
return AjaxResult.success(vos);
}
/**
* 模糊查询动态
* @param title
* @return
*/
@Override
public AjaxResult searchActivities(String title) {
Long uId = UserContext.currentUserId();
List<CActivity> cActivities = activityMapper.searchActivity(title);
List<CActivityVo> cActivityVos = allActivity(cActivities, uId);
return AjaxResult.success(cActivityVos);
}
@ApiImplicitParams({
@ApiImplicitParam(name = "cActivity",value = "动态信息",dataType = "CActivity",required = true,paramType = "query"),
@ApiImplicitParam(name = "uId",value = "查看人Id",dataType = "Long",required = true,paramType = "query")
... ...
... ... @@ -682,7 +682,7 @@ public class MineServiceImpl implements MineService {
if(cUser.getIdentityType().equals(Identity.TEACHWE)){
CRelationshipStudentSgcBo cRelationshipStudentSgcBo = new CRelationshipStudentSgcBo();
cRelationshipStudentSgcBo.setUserId(uId);
return AjaxResult.success(cRegisterSchoolMapper.getSchoolByTeacher(cRelationshipStudentSgcBo)) ;
return AjaxResult.success(cRegisterSchoolMapper.getSchoolByTeacher(cRelationshipStudentSgcBo));
}
return AjaxResult.error("身份不对") ;
... ...
... ... @@ -37,4 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT * FROM c_activity where activity_id =#{aid};
</select>
<select id="searchActivity" resultMap="CActivityResult">
SELECT * from c_activity where secret=2 AND title LIKE concat('%', #{title},'%');
</select>
</mapper>
... ...