1 package org.javabb.component; 2 3 import org.javabb.infra.ApplicationContext; 4 import org.javabb.transaction.UserTransaction; 5 import org.javabb.vo.User; 6 import org.javabb.vo.UserRank; 7 8 public class UserFormatter { 9 private UserTransaction userTransaction; 10 11 public void setUserTransaction(UserTransaction userTransaction) { 12 this.userTransaction = userTransaction; 13 } 14 15 public UserRank getUserRank(Long postCount) { 16 return userTransaction.getUserRank(postCount); 17 } 18 19 public int getUserStatus(User user) { 20 try{ 21 return (ApplicationContext.getContext().isOnLine(user)) ? 1 : 0; 22 }catch(Exception e){ 23 return 0; 24 } 25 } 26 27 } 28 | Popular Tags |