replyservice.java
来自「java带进度条上传尽量不要让站长把时间都花费在为您修正说明上」· Java 代码 · 共 152 行
JAVA
152 行
package com.jmwl.biz;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.jmwl.common.BlogException;
import com.jmwl.dao.*;
import com.jmwl.dto.UserReplyDTO;
import com.jmwl.vo.Re_UserVO;
import com.jmwl.vo.ReplyVO;
public class ReplyService extends BasicService
{
/**
* 添加一条文章的回复
* @param info
* @return
* @throws BlogException
*/
public boolean addreply(UserReplyDTO info) throws BlogException
{
ReplyDAO re=new ReplyDAO();
this.getConn();
re.setConn(conn);
boolean b=re.add_reply(info);
return b;
}
/**
* 作者添加一条日志回复的回复
* @param id
* @param content
* @param time
* @return
* @throws BlogException
*/
public boolean add_hostreply(int id,String content,String time) throws BlogException
{
ReplyDAO re=new ReplyDAO();
this.getConn();
re.setConn(conn);
boolean b=re.add_hostreply(id, content, time);
this.closeConn();
return b;
}
/**
* 得到一篇日志的所有回复(回复人只有ID)
* @param id
* @return
* @throws BlogException
*/
public List<ReplyVO> get_replyinfo(int id,int currpage) throws BlogException
{
System.out.println("id-----"+id);
System.out.println("currpage-----"+currpage);
List<ReplyVO> list=new ArrayList();
ReplyDAO re=new ReplyDAO();
this.getConn();
re.setConn(conn);
list=re.get_replyinfo(id,currpage);
this.closeConn();
return list;
}
/**
* 得到一篇日志回复的数量
* @param id
* @return
* @throws BlogException
*/
public int get_reply_cs(int id) throws BlogException
{
ReplyDAO re=new ReplyDAO();
this.getConn();
re.setConn(conn);
int i=re.get_reply_cs(id);
this.closeConn();
return i;
}
/**
* 得到某一日志回复的页数
* @param id
* @return
* @throws BlogException
*/
public int gethfpage(int id) throws BlogException
{
int page=0;
ReplyDAO re=new ReplyDAO();
this.getConn();
re.setConn(conn);
page=re.gethfpage(id);
return page;
}
/**
* 得到回复人的简单信息
* @param id
* @return
* @throws BlogException
*/
public Re_UserVO get_user(int id) throws BlogException
{
Re_UserVO info=new Re_UserVO();
this.getConn();
ReplyDAO re=new ReplyDAO();
re.setConn(conn);
info=re.get_user(id);
this.closeConn();
return info;
}
/**
* 屏蔽一个用户的回复
* @param id
* @return
* @throws BlogException
*/
public boolean ReErrors(int id) throws BlogException
{
ReplyDAO re=new ReplyDAO();
this.getConn();
re.setConn(conn);
boolean b=re.ReErrors(id);
this.closeConn();
return b;
}
/**
* 删除一篇日志的所有回复
* @param id
* @return
* @throws BlogException
*/
public boolean delete_reply(int id) throws BlogException
{
ReplyDAO re=new ReplyDAO();
this.getConn();
re.setConn(conn);
boolean b=re.delete_reply(id);
return b;
}
public static void main(String []agr) throws BlogException
{
ReplyService re=new ReplyService();
List<ReplyVO> list=re.get_replyinfo(8, 2);
for(ReplyVO info:list)
{
System.out.print(info.getId()+"-----");
System.out.println(info.getPub_time());
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?