📄 userinfoserviceimp.java
字号:
package com.opensource.blog.service.imp;
import com.opensource.blog.dao.*;
import com.opensource.blog.exception.*;
import com.opensource.blog.model.*;
import com.opensource.blog.service.*;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
public class UserInfoServiceImp
implements UserInfoService {
private static final Log logger = LogFactory.getLog(UserInfoServiceImp.class);
private UserInfoDAO userInfoDAO;
private BlogDAO blogDAO;
public UserInfoServiceImp() {
}
/**
*
* @param ui UserInfo
* @return UserInfo
* @throws BlogException
* @todo Implement this com.opensource.blog.service.UserInfoService method
*/
public UserInfo saveUserInfo(UserInfo ui) throws BlogException {
try {
return this.getUserInfoDAO().saveUserInfo(ui);
}
catch (Exception ex) {
logger.error(ex);
throw new BlogException(ex);
}
}
/**
*
* @param id long
* @return UserInfo
* @todo Implement this com.opensource.blog.service.UserInfoService method
*/
public UserInfo findUserInfoByID(long id) {
return this.getUserInfoDAO().findUserInfoByID(id);
}
/**
*
* @param userName String
* @return UserInfo
* @todo Implement this com.opensource.blog.service.UserInfoService method
*/
public UserInfo findUserInfoByUserName(String userName) {
return this.getUserInfoDAO().findUserInfoByUserName(userName);
}
/**
*
* @param email String
* @return UserInfo
* @todo Implement this com.opensource.blog.service.UserInfoService method
*/
public UserInfo findUserInfoByEmail(String email) {
return this.getUserInfoDAO().findUserInfoByEmail(email);
}
/**
*
* @param ui UserInfo
* @param blog Blog
* @return Object[]
* @throws BlogException
* @todo Implement this com.opensource.blog.service.UserInfoService method
*/
public Object[] createUserAndBlog(UserInfo ui, Blog blog) throws BlogException {
try {
ui = this.getUserInfoDAO().saveUserInfo(ui);
blog = this.getBlogDAO().saveBlog(blog);
Object[] o = {ui, blog};
return o;
}
catch (Exception ex) {
logger.error(ex);
throw new BlogException(ex);
}
}
public UserInfoDAO getUserInfoDAO() {
return userInfoDAO;
}
public BlogDAO getBlogDAO() {
return blogDAO;
}
public void setUserInfoDAO(UserInfoDAO userInfoDAO) {
this.userInfoDAO = userInfoDAO;
}
public void setBlogDAO(BlogDAO blogDAO) {
this.blogDAO = blogDAO;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -