@Override public void createUser(User user, String tokenCode) { dao.create(user); Token token = new Token(); token.setUserid(user.getUserid()); token.setTokencode(tokenCode); Calendar cal = Calendar.getInstance(); // ȡ��ǰ���ڡ� Date currentDate = cal.getTime(); cal.add(Calendar.DAY_OF_MONTH, +30); // ȡ��ǰ���ڵĺ�30��. token.setCreatedatetime(currentDate); token.setExpiredatetime(cal.getTime()); tokendao.createTokenCode(token); }
@Override public int createShopUser(User user) { // TODO Auto-generated method stub dao.create(user); Area a = a_dao.GetByName("鼓楼区", "南京"); if (a == null) { a = a_dao.findAll().get(0); } Shop shop = new Shop(); shop.setArea(a); shop.setShopname("shop of " + user.getUsername()); shop.setUser(user); shop_dao.create(shop); return user.getUserid(); }
@Override public User findUserByUserid(int id) { // TODO Auto-generated method stub return dao.findUserByUserid(id); }
@Override public int GetUserIDByName(String username, String password) { // TODO Auto-generated method stub return dao.GetUserIDByName(username, password); }
@Override public User findOneByPass(String username, String pass) { // TODO Auto-generated method stub return dao.findOneByPass(username, pass); }
@Override public boolean checkByName(String username) { // TODO Auto-generated method stub return dao.checkByName(username); }
@Override public List<User> findUserByPage(int page, int pageSize) { // TODO Auto-generated method stub return dao.findUserByPage(page, pageSize); }