use of com.topcom.cms.yuqing.domain.Collection in project topcom-cloud by 545314690.
the class CollectionController method isCollected.
/**
* 根据输入,返回分页结果中的当前页,包括当前页信息和其中的实体对象集合
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/isCollected.json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public boolean isCollected(HttpServletRequest request, HttpServletResponse response, String oId) {
boolean isCollected = false;
Collection collection = this.collectionManager.findByOId(oId);
if (collection != null) {
isCollected = true;
}
return isCollected;
}
use of com.topcom.cms.yuqing.domain.Collection in project topcom-cloud by 545314690.
the class CollectionController method findByType.
/**
* 根据输入,返回分页结果中的当前页,包括当前页信息和其中的实体对象集合
*
* @param request
* @param response
* @param type
* @return
*/
@RequestMapping(value = "/findByType.json", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public Page<Collection> findByType(HttpServletRequest request, HttpServletResponse response, MediaType type) {
String page = request.getParameter("page");
String limit = request.getParameter("limit");
String keywords = request.getParameter("keywords");
Page<Collection> cPage = null;
if (StringUtils.isNotBlank(page)) {
this.pageNumber = Integer.valueOf(page) - 1;
} else {
this.pageNumber = 0;
}
if (StringUtils.isNotBlank(limit)) {
this.pageSize = Integer.valueOf(limit);
}
this.pageable = new PageRequest(this.pageNumber, this.pageSize, new Sort(Direction.DESC, "dateCreated"));
if (StringUtils.isBlank(keywords)) {
keywords = "";
}
cPage = this.manager.findByType(this.pageable, type, keywords);
logger.info(cPage);
return cPage;
}
Aggregations