📄 friendlinkserviceimpl.java
字号:
package com.easyjf.blog.logic.impl;
import java.util.List;
import com.easyjf.blog.domain.FriendLink;
import com.easyjf.blog.logic.CurrentUser;
import com.easyjf.web.tools.DbPageList;
import com.easyjf.web.tools.IPageList;
public class FriendLinkServiceImpl extends DAOSupportService implements
com.easyjf.blog.logic.FriendLinkService {
private static FriendLinkServiceImpl singleton=new FriendLinkServiceImpl();
public static FriendLinkServiceImpl getInstance()
{
return singleton;
}
public boolean addFriendLink(FriendLink link) {
boolean ret = false;
link.setInputTime(new java.util.Date());
link.setInputUser(CurrentUser.getActiveUser().getUserName());
link.setStatus(new Integer(0));
ret = this.dao.save(link);
return ret;
}
public int batchDelFriendLink(String[] cids) {
int ret = 0;
for (int i = 0; i < cids.length; i++) {
if (delFriendLink(cids[i]))
ret++;
}
return ret;
}
public boolean delFriendLink(String cid) {
boolean ret = false;
this.dao.del(getFriendLink(cid));
return ret;
}
public FriendLink getFriendLink(String cid) {
return (FriendLink) this.dao.get(FriendLink.class, cid);
}
public List getTopFriendLink(String userName, int topNum) {
String scope = "inputUser=? ";
java.util.Collection paras = new java.util.ArrayList();
paras.add(userName);
DbPageList pList = new DbPageList(FriendLink.class, scope, paras);
pList.doList(1, topNum);
return pList.getResult();
}
public IPageList queryFriendLink(String userName, int currentPage,
int pageSize) {
String scope = "inputUser=? ";
java.util.Collection paras = new java.util.ArrayList();
paras.add(userName);
DbPageList pList = new DbPageList(FriendLink.class, scope, paras);
pList.doList(currentPage, pageSize);
return pList;
}
public boolean updateFriendLink(FriendLink link) {
boolean ret=false;
ret=this.dao.update(link);
return ret;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -