topicjsp.java

来自「社区文章采用的是平板、树形自由选择的两种展示方式」· Java 代码 · 共 67 行

JAVA
67
字号
/* 
 * Created on 2007-5-16
 * Last modified on 2007-10-15
 * Powered by YeQiangWei.com
 */
package com.yeqiangwei.club.view.jsp;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.yeqiangwei.club.param.TopicParameter;
import com.yeqiangwei.club.service.ServiceLocator;
import com.yeqiangwei.club.service.ServiceWrapper;
import com.yeqiangwei.club.model.Reply;
import com.yeqiangwei.club.model.Topic;
import com.yeqiangwei.club.service.topic.ReplyService;
import com.yeqiangwei.club.service.topic.TopicService;
import com.yeqiangwei.club.util.BeanLocator;
import com.yeqiangwei.club.util.BeanUtils;
import com.yeqiangwei.club.view.model.ReplyView;
import com.yeqiangwei.club.view.model.TopicView;
import com.yeqiangwei.util.ParamUtils;

public class TopicJsp extends BaseJsp{

	public TopicJsp(HttpServletRequest request, HttpServletResponse response) {
		super(request, response);
	}
	
	public List<?> findTrash(int rows){
		if(com.yeqiangwei.util.ParamUtils.getStringParameter(request,"act").equals("listreply")){
			return this.findTrashReply(rows);
		}else{
			return this.findTrashTopic(rows);
		}
	}
	public List<TopicView> findTrashTopic(int rows){
		TopicParameter param = new TopicParameter();
		param.setIsDeleted(true);
		param.setPage(ParamUtils.getIntParameter(request,"page",1));
		param.setRows(rows);
		List<Topic> mlist = this.getTopicService().findByParameter(param);
		List<TopicView> list = BeanUtils.copyList(mlist,BeanLocator.TOPICVIEW);
		return list;
	}
	
	public List<ReplyView> findTrashReply(int rows){
		TopicParameter param = new TopicParameter();
		param.setIsDeleted(true);
		param.setPage(ParamUtils.getIntParameter(request,"page",1));
		param.setRows(rows);
		List<Reply> mlist = this.getReplyService().findByParameter(param);
		List<ReplyView> list = BeanUtils.copyList(mlist,BeanLocator.REPLYVIEW);
		return list;
	}
	
	private TopicService getTopicService() {
		return ServiceWrapper.<TopicService>getSingletonInstance(ServiceLocator.TOPIC);
	}
	
	private ReplyService getReplyService() {
		return ServiceWrapper.<ReplyService>getSingletonInstance(ServiceLocator.REPLY);
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?