📄 messageservice.java
字号:
package com.accp.service;
import java.util.List;
import com.accp.dao.MessageIDAO;
import com.accp.dto.Message;
import com.accp.exception.MessageException;
public class MessageService implements MessageIService {
private MessageIDAO messageDao;
public void setMessageDao(MessageIDAO messageDao) {
this.messageDao = messageDao;
}
public void addMessage(Message msg)throws MessageException{
try{
messageDao.saveOrUpdate(msg);
}catch(Exception e){
e.printStackTrace();
throw new MessageException("addMessage Method Error.........");
}
}
public List getAllMessage()throws MessageException{
try{
return messageDao.findAll();
}catch(Exception e){
e.printStackTrace();
throw new MessageException("getAllMessage Method Error..............");
}
}
public List getPage(int curpage,int pagesize)throws MessageException{
try{
return messageDao.findPage(curpage,pagesize);
}catch(Exception e){
e.printStackTrace();
throw new MessageException("getPage Method Error ............");
}
}
public int getPageCount(int pagesize)throws MessageException{
try{
return messageDao.findPageCount(pagesize);
}catch(Exception e){
e.printStackTrace();
throw new MessageException("getRows Method Error.............");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -