Ejemplo n.º 1
0
 /*
  * (non-Javadoc)
  *
  * @see q.web.Resource#validate(q.web.ResourceContext)
  */
 @Override
 public void validate(ResourceContext context) throws Exception {
   long loginPeopleId = context.getCookiePeopleId();
   if (IdCreator.isNotValidId(loginPeopleId)) {
     throw new PeopleNotLoginException();
   }
 }
Ejemplo n.º 2
0
 /*
  * (non-Javadoc)
  *
  * @see q.web.Resource#validate(q.web.ResourceContext)
  */
 @Override
 public void validate(ResourceContext context) throws Exception {
   long loginPeopleId = context.getCookiePeopleId();
   if (IdCreator.isNotValidId(loginPeopleId)) {
     throw new PeopleNotLoginException();
   }
   long groupId = context.getResourceIdLong();
   if (IdCreator.isNotValidId(groupId)) {
     throw new RequestParameterInvalidException("group:invalid");
   }
   Group group = groupDao.getGroupById(groupId);
   if (null == group) {
     throw new RequestParameterInvalidException("group:invalid");
   }
   if (loginPeopleId == group.getCreatorId()) {
     throw new RequestParameterInvalidException("join:不需要加入您自己创建的圈子");
   }
 }