diff options
Diffstat (limited to 'src/main/java/io')
-rwxr-xr-x | src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java | 1 | ||||
-rwxr-xr-x | src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java b/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java index 7a682dc..ec460ec 100755 --- a/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java +++ b/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java @@ -194,6 +194,7 @@ public class PersonDao { sql += " AND level=?"; } + sql += " ORDER BY created_date"; sql += " LIMIT ? OFFSET ?"; try (PreparedStatement s = c.prepareStatement(sql)) { diff --git a/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java b/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java index a129cf3..c58bc13 100755 --- a/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java +++ b/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java @@ -124,14 +124,14 @@ public class CoreResource extends AbstractResource { @GET @Path("/badge") - public List<BadgeJson> getBadges(@MagicParam final PageRequest page, @MagicParam(query = "person") final Uuid person) throws Exception { - return da.inTransaction(new CoreDaosCallback<List<BadgeJson>>() { - protected List<BadgeJson> run() throws SQLException { + public List<BadgeDetailJson> getBadges(@MagicParam final PageRequest page, @MagicParam(query = "person") final Uuid person) throws Exception { + return da.inTransaction(new CoreDaosCallback<List<BadgeDetailJson>>() { + protected List<BadgeDetailJson> run() throws SQLException { List<PersonalBadgeDto> badgeDtos = daos.personDao.selectBadges(fromNull(person), Option.<PersonalBadgeDto.BadgeType>none(), Option.<Integer>none(), page); - List<BadgeJson> list = new ArrayList<>(); + List<BadgeDetailJson> list = new ArrayList<>(); for (PersonalBadgeDto badge : badgeDtos) { - list.add(getBadgeJson.apply(badge)); + list.add(getBadgeDetailJson.apply(badge)); } return list; } |