⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 friendlinkserviceimpl.java

📁 EasyJF开源Blog系统是一个由EasyJF开源团队组织开发的基于Java平台的开源博客系统。当前Blog已经实现了基本的基本的博客的书写、流量统计、排名、个人像册、RSS、支持自定义模板、静态h
💻 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 + -