Ejemplo n.º 1
0
  @Transactional
  public Chat postImage(int userId, String picture) {
    Chat result = null;
    Chat chat = new Chat();
    User user = (User) userDao.findOne(userId);
    chat.setUser(user);
    chat.setPicture(picture);
    chat.setSendTime(LocalDateTime.now(ZoneId.of("UTC+8")));
    result = chatDao.save(chat);

    return result;
  }
Ejemplo n.º 2
0
  @Transactional
  public Chat postChat(int userId, String messages, String picture, Character showUserInfo) {
    Chat result = null;
    Chat chat = new Chat();
    User user = (User) userDao.findOne(userId);

    chat.setMessages(messages);
    chat.setShowUserInfo(showUserInfo);
    chat.setUser(user);
    chat.setPicture(picture);
    chat.setSendTime(LocalDateTime.now(ZoneId.of("UTC+8")));
    result = chatDao.save(chat);

    return result;
  }