Commit 06c69cea by jhrabal

radegast

parent c28b2eda
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<parent> <parent>
<groupId>com.jh</groupId> <groupId>com.jh</groupId>
<artifactId>boot-react</artifactId> <artifactId>boot-react</artifactId>
<version>0.0.4</version> <version>0.0.5</version>
<relativePath>../boot-react</relativePath> <relativePath>../boot-react</relativePath>
</parent> </parent>
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<frontend-maven-plugin-version>1.0</frontend-maven-plugin-version> <frontend-maven-plugin-version>1.0</frontend-maven-plugin-version>
<node-version>v8.1.3</node-version> <node-version>v8.1.3</node-version>
<npm-version>5.0.3</npm-version> <npm-version>5.0.3</npm-version>
<boot-common.version>0.0.4</boot-common.version> <boot-common.version>0.0.5</boot-common.version>
</properties> </properties>
<dependencies> <dependencies>
......
package com.jh.radegast.api; package com.jh.radegast.api;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.ResponseStatus;
import com.jh.common.web.list.DefaultSorting;
import com.jh.common.web.list.ListHelper;
import com.jh.common.web.list.Page;
import com.jh.common.web.list.PagingInfo;
import com.jh.common.web.list.SortTrend;
import com.jh.radegast.model.Rating; import com.jh.radegast.model.Rating;
import com.jh.radegast.rating.RatingService; import com.jh.radegast.rating.RatingService;
...@@ -21,6 +28,12 @@ public class RatingApiController { ...@@ -21,6 +28,12 @@ public class RatingApiController {
private RatingService service; private RatingService service;
//paged endpoint //paged endpoint
// @RequestMapping(path = "ratings", method = RequestMethod.GET)
// @DefaultSorting(field = "name", trend = SortTrend.ASCENDING)
// public ResponseEntity<List<Rating>> filterCustomers(PagingInfo pagingInfo) {
// Page<Rating> page = service.filter(pagingInfo);
// return ListHelper.pagedResponse(page);
// }
@RequestMapping(path = "ratings", method = RequestMethod.POST) @RequestMapping(path = "ratings", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED) @ResponseStatus(HttpStatus.CREATED)
......
package com.jh.radegast.api;
public class RatingsStats {
public RatingsStats() {
}
}
...@@ -2,6 +2,7 @@ package com.jh.radegast.rating; ...@@ -2,6 +2,7 @@ package com.jh.radegast.rating;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -21,6 +22,7 @@ public class RatingRepository extends AbstractHibernateRepository { ...@@ -21,6 +22,7 @@ public class RatingRepository extends AbstractHibernateRepository {
} }
for (Rating r : ratings) { for (Rating r : ratings) {
r.setCreated(new Date(Long.parseLong(r.getKey())));
save(r); save(r);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment