Exemplo n.º 1
0
  @RequestMapping("admin-batch-list")
  public String input(@RequestParam(value = "text", required = false) String text, Model model) {
    if (text != null) {
      List<UserDTO> userDtos = new ArrayList<UserDTO>();

      for (String str : text.split("\n")) {
        str = str.trim();

        if (str.length() == 0) {
          continue;
        }

        UserDTO userDto = userConnector.findByUsername(str, ScopeHolder.getUserRepoRef());

        if (userDto.getStatus() != 1) {
          continue;
        }

        userDtos.add(userDto);
      }

      model.addAttribute("userDtos", userDtos);
    }

    return "party/admin-batch-input";
  }
Exemplo n.º 2
0
  public void handleMessage(String message) {
    try {
      UserDTO userDto = jsonMapper.fromJson(message, UserDTO.class);

      Long typeId = 1L;
      Long entityId = this.getPartyEntityId(userDto.getId(), typeId);

      if (entityId == null) {
        return;
      }

      Long structTypeId = 1L;
      jdbcTemplate.update(removePartyStructSql, structTypeId, entityId, entityId);

      jdbcTemplate.update(removePartyEntitySql, entityId);

      logger.info("update user : {}", message);
    } catch (IOException ex) {
      logger.error(ex.getMessage(), ex);
    }
  }
Exemplo n.º 3
0
 public void removeUser(UserDTO userDto) {
   cache.remove("userId:" + userDto.getId());
   cache.remove("userUsername:"******":" + userDto.getUserRepoRef());
   cache.remove("userRef:" + userDto.getRef() + ":" + userDto.getUserRepoRef());
   cache.remove("nickName:" + userDto.getDisplayName());
 }
Exemplo n.º 4
0
 public void updateUser(UserDTO userDto) {
   cache.set("userId:" + userDto.getId(), userDto);
   cache.set("userUsername:"******":" + userDto.getUserRepoRef(), userDto);
   cache.set("userRef:" + userDto.getRef() + ":" + userDto.getUserRepoRef(), userDto);
   cache.set("nickName:" + userDto.getDisplayName(), userDto);
 }