Пример #1
0
 public String update() {
   results = new JsonResults();
   if (!validatePubInfo()) {
     results.fail("信息不完整");
     return JsonResults.JSON_RESULT_NAME;
   }
   if (hasSpecialChars(publisher.getName())
       || hasSpecialChars(publisher.getEmail())
       || hasSpecialChars(publisher.getMobile())
       || hasSpecialChars(publisher.getReceiveAccount())
       || hasSpecialChars(publisher.getReceiveName())
       || hasSpecialChars(publisher.getQq())) {
     results.fail("含有非法字符");
     return JsonResults.JSON_RESULT_NAME;
   }
   try {
     publisherContactService.saveOrUpdatePublisher(publisher);
     results.success();
   } catch (ServiceException e) {
     results.fail(e.getMessage());
   } catch (Exception e) {
     results.fail("系统异常");
   }
   return JsonResults.JSON_RESULT_NAME;
 }
Пример #2
0
 @Override
 public String execute() throws Exception {
   int userId = loginHelper.getUserId();
   publisher = publisherContactService.viewPublisherContactInfo(userId);
   if (publisher.getUserId() == 0) {
     hasContactInfo = false;
     publisher.setUserId(userId);
     addActionMessage("请填写相应的联系人信息");
   }
   return SUCCESS;
 }