|
|
@@ -218,4 +218,28 @@ public class _CommentController extends JBaseCRUDController<Comment> {
|
|
|
comment.save();
|
|
|
renderAjaxResultForSuccess();
|
|
|
}
|
|
|
+
|
|
|
+ @Before(UCodeInterceptor.class)
|
|
|
+ public void changeCommentTopSataus() {
|
|
|
+ BigInteger id = getParaToBigInteger("id");
|
|
|
+ Comment c = CommentQuery.me().findById(id);
|
|
|
+ String commentTopStatus = getPara("commentTopStatus");
|
|
|
+ if (c != null) {
|
|
|
+
|
|
|
+ if ("top".equals(commentTopStatus)) {
|
|
|
+ c.setOrderNumber(Long.parseLong("1"));
|
|
|
+ } else {
|
|
|
+ c.setOrderNumber(Long.parseLong("0"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (c.saveOrUpdate()) {
|
|
|
+ renderAjaxResultForSuccess("success");
|
|
|
+ } else {
|
|
|
+ renderAjaxResultForError("restore error!");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ renderAjaxResultForError("restore error!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|