@Service("userService")
public class UserServiceImpl implements IUserService {
@Autowired
IUserDao userDao;
@Override
public UserInfo findUserInfo(UserInfo user) throws SQLException {
// TODO Auto-generated method stub
UserInfo uInfo = userDao.findUserInfo(user);
if(uInfo==null){ //ID없음
uInfo = user;
}else if(uInfo.getUser_pass() != user.getUser_pass()){ //비밀번호 불일치
uInfo.setResult(UserInfo.NOT_MATCH_PASS);
}else{ //ID존재함 & 비밀번호도 일치
uInfo.setResult(UserInfo.EXIST_USER);
}
return uInfo;
}
@Override
public UserInfo insertUserInfo(UserInfo user) throws SQLException {
// TODO Auto-generated method stub
return userDao.insertUserInfo(user);
}
@Override
public int updateUserInfo(UserInfo user) throws SQLException {
// TODO Auto-generated method stub
return userDao.updateUserInfo(user);
}
@Override
public int deleteUserInfo(UserInfo user) throws SQLException {
// TODO Auto-generated method stub
return userDao.deleteUserInfo(user);
}
}
'강의노트 > Spring' 카테고리의 다른 글
[WEB-INF]servlet-context.xml (0) | 2013.09.04 |
---|---|
[controller]UserController.java (0) | 2013.09.04 |
[service]IUserService.java (0) | 2013.09.04 |
[dao]UserDaoImpl.java (0) | 2013.09.04 |
[dao]IUserDao.java (0) | 2013.09.04 |