Commits

Anonymous committed 56fbfee

17:56 2010/07/08

Comments (0)

Files changed (1)

src/info/mrchen/gae/blog/service/SysConfService.java

+package info.mrchen.gae.blog.service;
+
+import info.mrchen.gae.blog.dao.SysconfDao;
+import info.mrchen.gae.blog.pojo.Sysconf;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import com.google.appengine.api.users.User;
+
+@Component
+public class SysconfService {
+
+	@Autowired
+	SysconfDao sysconfDao;
+
+	public Sysconf get(Long id) {
+		return sysconfDao.get(id);
+	}
+
+	public Sysconf get(String key) {
+		return sysconfDao.get(key);
+	}
+
+	public Sysconf get(User user, String key) {
+		return sysconfDao.get(user, key);
+	}
+
+	public String getValue(String sysconfKey) {
+		Sysconf conf = this.get(sysconfKey);
+		if (conf != null && conf.getValue() != null) {
+			return conf.getValue();
+		} else {
+			return null;
+		}
+	}
+}