/** * An Api to add new chat in the chatroom * * @param dto * @return */ @POST @Produces(MediaType.APPLICATION_JSON) public String addChat(ChatDto dto) { /* ChatDao dao=new ChatDao(); return dao.addChat(dto);*/ ChatsDao dao = new ChatsDao(); return dao.addChat(dto); }
/** * An Api to fetch all the chats in the chatroom * * @return */ @GET @Produces(MediaType.APPLICATION_JSON) public List<Chats> getChats() { /*List list=new ArrayList(); ChatDao dao=new ChatDao(); list=dao.getChats(); return list; */ List<Chats> list = new ArrayList(); ChatsDao chatsDao = new ChatsDao(); list = chatsDao.getChats(); return list; }