use of io.dropwizard.jersey.sessions.Session in project textdb by TextDB.
the class KeywordDictionaryResource method listUserDictionaries.
@GET
@Path("/list")
public List<KeywordDictionary> listUserDictionaries(@Session HttpSession session) {
UInteger userID = UserResource.getUser(session).getUserID();
Result<Record4<UInteger, String, byte[], String>> result = getUserDictionaryRecord(userID);
if (result == null)
return new ArrayList<>();
List<KeywordDictionary> dictionaryList = result.stream().map(record -> new KeywordDictionary(record.get(KEYWORD_DICTIONARY.KID), record.get(KEYWORD_DICTIONARY.NAME), convertContentToList(record.get(KEYWORD_DICTIONARY.CONTENT)), record.get(KEYWORD_DICTIONARY.DESCRIPTION))).collect(Collectors.toList());
return dictionaryList;
}
use of io.dropwizard.jersey.sessions.Session in project textdb by TextDB.
the class UserFileResource method listUserFiles.
@GET
@Path("/list")
public List<UserFile> listUserFiles(@Session HttpSession session) {
UInteger userID = UserResource.getUser(session).getUserID();
Result<Record5<UInteger, String, String, String, UInteger>> result = getUserFileRecord(userID);
if (result == null)
return new ArrayList<>();
List<UserFile> fileList = result.stream().map(record -> new UserFile(record.get(FILE.FID), record.get(FILE.NAME), record.get(FILE.PATH), record.get(FILE.DESCRIPTION), record.get(FILE.SIZE))).collect(Collectors.toList());
return fileList;
}
Aggregations