mirror of
https://github.com/Qortal/qortal.git
synced 2025-03-26 23:44:34 +00:00
Return full name data in GET /names
.
This commit is contained in:
parent
f8233bd05b
commit
8a1bf8b5ec
@ -64,21 +64,19 @@ public class NamesResource {
|
|||||||
description = "registered name info",
|
description = "registered name info",
|
||||||
content = @Content(
|
content = @Content(
|
||||||
mediaType = MediaType.APPLICATION_JSON,
|
mediaType = MediaType.APPLICATION_JSON,
|
||||||
array = @ArraySchema(schema = @Schema(implementation = NameSummary.class))
|
array = @ArraySchema(schema = @Schema(implementation = NameData.class))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ApiErrors({ApiError.REPOSITORY_ISSUE})
|
@ApiErrors({ApiError.REPOSITORY_ISSUE})
|
||||||
public List<NameSummary> getAllNames(@Parameter(ref = "after") @QueryParam("after") Long after,
|
public List<NameData> getAllNames(@Parameter(description = "Return only names registered or updated after timestamp") @QueryParam("after") Long after,
|
||||||
@Parameter(ref = "limit") @QueryParam("limit") Integer limit,
|
@Parameter(ref = "limit") @QueryParam("limit") Integer limit,
|
||||||
@Parameter(ref = "offset") @QueryParam("offset") Integer offset,
|
@Parameter(ref = "offset") @QueryParam("offset") Integer offset,
|
||||||
@Parameter(ref="reverse") @QueryParam("reverse") Boolean reverse) {
|
@Parameter(ref="reverse") @QueryParam("reverse") Boolean reverse) {
|
||||||
try (final Repository repository = RepositoryManager.getRepository()) {
|
try (final Repository repository = RepositoryManager.getRepository()) {
|
||||||
List<NameData> names = repository.getNameRepository().getAllNames(after, limit, offset, reverse);
|
|
||||||
|
|
||||||
// Convert to summary
|
return repository.getNameRepository().getAllNames(after, limit, offset, reverse);
|
||||||
return names.stream().map(NameSummary::new).collect(Collectors.toList());
|
|
||||||
} catch (DataException e) {
|
} catch (DataException e) {
|
||||||
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE, e);
|
throw ApiExceptionFactory.INSTANCE.createException(request, ApiError.REPOSITORY_ISSUE, e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user