/**
*
*/
package com.chen.action;
import java.util.List;
import javax.servlet.http.HttpSession;
import org.apache.struts2.ServletActionContext;
import com.chen.bean.Comments;
import com.chen.bean.Pages;
import com.chen.bean.Topics;
import com.chen.bean.Users;
import com.chen.service.CommentService;
/**
* @author chenguoji
* @email chenguo_ji@163.com
*
*/
public class CommentAction {
private CommentService commentService;
private Comments comment;
private Topics topic;
private Pages pageBean;
private List<Comments> listComment;
private int nowPage = 1;
HttpSession session = ServletActionContext.getRequest().getSession();
public String newComment() throws Exception {
Users user = (Users) session.getAttribute("tu");
boolean flag = this.commentService.newComment(comment, user, topic);
int pageSize = this.pageBean.getPageSize();
int allRecords = this.pageBean.getAllRecords();
this.nowPage = allRecords / pageSize + 1;
if (flag != true) {
return "comment_new_no";
}
return "comment_new_ok";
}
public String Delete() throws Exception{
this.commentService.deleteComment(comment,topic);
return "comment_delete_ok";
}
public CommentService getCommentService() {
return commentService;
}
public void setCommentService(CommentService commentService) {
this.commentService = commentService;
}
public Comments getComment() {
return comment;
}
public void setComment(Comments comment) {
this.comment = comment;
}
public Topics getTopic() {
return topic;
}
public void setTopic(Topics topic) {
this.topic = topic;
}
public Pages getPageBean() {
return pageBean;
}
public void setPageBean(Pages pageBean) {
this.pageBean = pageBean;
}
public int getNowPage() {
return nowPage;
}
public void setNowPage(int nowPage) {
this.nowPage = nowPage;
}
public List<Comments> getListComment() {
return listComment;
}
public void setListComment(List<Comments> listComment) {
this.listComment = listComment;
}
}
最近下载更多
123ggf LV8
2023年6月14日
limin123 LV6
2023年6月11日
0011100 LV12
2023年5月31日
微信网友_6495054193971200 LV2
2023年5月29日
1796527961 LV1
2023年3月23日
wouldbb LV6
2023年3月21日
tyyeng LV18
2023年1月1日
long123_356 LV8
2022年12月10日
akbar2020 LV9
2022年9月4日
yazhiyjs LV4
2022年8月30日
最近浏览更多
微信网友_7488517268295680
4月29日
暂无贡献等级
月牙君 LV1
4月25日
ChanLain LV2
3月3日
taoshen95 LV16
2024年12月19日
微信网友_7300409508155392
2024年12月17日
暂无贡献等级
asdxvfvfs
2024年12月3日
暂无贡献等级
短巷拥猫 LV12
2024年10月22日
cong58cong LV8
2024年6月26日
tjnu123
2024年6月18日
暂无贡献等级
Rinkia
2024年3月28日
暂无贡献等级

