a8407410937818560fc00fec6e70c06c8756e05c.svn-base
1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Copyright © 2015-2018 ODM All rights reserved.
*/
package com.thinkgem.jeesite.modules.cms.service;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.cms.dao.CommentDao;
import com.thinkgem.jeesite.modules.cms.entity.Comment;
/**
* 评论Service
* @author ThinkGem
* @version 2013-01-15
*/
@Service
@Transactional(readOnly = true)
public class CommentService extends CrudService<CommentDao, Comment> {
public Page<Comment> findPage(Page<Comment> page, Comment comment) {
// DetachedCriteria dc = commentDao.createDetachedCriteria();
// if (StringUtils.isNotBlank(comment.getContentId())){
// dc.add(Restrictions.eq("contentId", comment.getContentId()));
// }
// if (StringUtils.isNotEmpty(comment.getTitle())){
// dc.add(Restrictions.like("title", "%"+comment.getTitle()+"%"));
// }
// dc.add(Restrictions.eq(Comment.FIELD_DEL_FLAG, comment.getDelFlag()));
// dc.addOrder(Order.desc("id"));
// return commentDao.find(page, dc);
comment.getSqlMap().put("dsf", dataScopeFilter(comment.getCurrentUser(), "o", "u"));
return super.findPage(page, comment);
}
public void delete(Comment entity, Boolean isRe) {
super.delete(entity);
}
}