diff --git a/samples/bloggy/sql/bloggy.sql b/samples/bloggy/sql/bloggy.sql index 977f457..62820cc 100644 --- a/samples/bloggy/sql/bloggy.sql +++ b/samples/bloggy/sql/bloggy.sql @@ -50,9 +50,9 @@ INSERT INTO `Post` (`id`, `userId`, `title`, `text`, `deleted`, `updateTime`, `c (5, 2, 'Merchandising revenue dispute', 'Pooh videos, soft toys and other merchandise generate substantial annual revenues for Disney. The size of Pooh stuffed toys ranges from Beanie and miniature to human-sized. In addition to the stylised Disney Pooh, Disney markets Classic Pooh merchandise which more closely resembles E.H. Shepard\'s illustrations.\r\n\r\nIn 1991, Stephen Slesinger, Inc. filed a lawsuit against Disney which alleged that Disney had breached their 1983 agreement by again failing to accurately report revenue from Winnie the Pooh sales. Under this agreement, Disney was to retain approximately 98% of gross worldwide revenues while the remaining 2% was to be paid to Slesinger. In addition, the suit alleged that Disney had failed to pay required royalties on all commercial exploitation of the product name.[24] Though the Disney corporation was sanctioned by a judge for destroying forty boxes of evidential documents,[25] the suit was later terminated by another judge when it was discovered that Slesinger\'s investigator had rummaged through Disney\'s garbage to retrieve the discarded evidence.[26] Slesinger appealed the termination and, on 26 September 2007, a three-judge panel upheld the lawsuit dismissal.[27]\r\n\r\nAfter the Copyright Term Extension Act of 1998, Clare Milne, Christopher Milne\'s daughter, attempted to terminate any future U.S. copyrights for Stephen Slesinger, Inc.[28] After a series of legal hearings, Judge Florence-Marie Cooper of the U.S. District Court in California found in favour of Stephen Slesinger, Inc., as did the United States Court of Appeals for the Ninth Circuit. On 26 June 2006, the U.S. Supreme Court refused to hear the case, sustaining the ruling and ensuring the defeat of the suit.[29]\r\n\r\nOn 19 February 2007 Disney lost a court case in Los Angeles which ruled their \"misguided claims\" to dispute the licensing agreements with Slesinger, Inc. were unjustified,[30] but a federal ruling of 28 September 2009, again from Judge Florence-Marie Cooper, determined that the Slesinger family had granted all trademarks and copyrights to Disney, although Disney must pay royalties for all future use of the characters. Both parties have expressed satisfaction with the outcome.[31][32]', 0, '2019-05-05 18:29:17', '2019-05-06 00:29:17'); CREATE TABLE `User` ( - `id` bigint(20) NOT NULL, + `id` bigint(20) NOT NULL AUTO_INCREMENT, `login` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, - `passwordSha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `passwordSha` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `updateTime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `creationTime` datetime NOT NULL DEFAULT current_timestamp(), diff --git a/samples/bloggy/src/main/java/bloggy/dao/PostDao.java b/samples/bloggy/src/main/java/bloggy/dao/PostDao.java index c803cda..3dbef9e 100644 --- a/samples/bloggy/src/main/java/bloggy/dao/PostDao.java +++ b/samples/bloggy/src/main/java/bloggy/dao/PostDao.java @@ -11,5 +11,4 @@ public interface PostDao { List findByUser(User user); void insert(Post post); void update(Post post); - String findNote(); } diff --git a/samples/bloggy/src/main/java/bloggy/dao/impl/PostDaoImpl.java b/samples/bloggy/src/main/java/bloggy/dao/impl/PostDaoImpl.java index 78751d7..3f64c8a 100644 --- a/samples/bloggy/src/main/java/bloggy/dao/impl/PostDaoImpl.java +++ b/samples/bloggy/src/main/java/bloggy/dao/impl/PostDaoImpl.java @@ -16,16 +16,11 @@ public Post find(long id) { @Override public List findAll() { - return findBy("NOT deleted ORDER BY updateTime DESC"); + return findBy("NOT deleted ORDER BY updateTime DESC, id DESC"); } @Override public List findByUser(User user) { - return findBy("userId=? AND NOT deleted ORDER BY updateTime DESC", user.getId()); - } - - @Override - public String findNote() { - return "note11"; + return findBy("userId=? AND NOT deleted ORDER BY updateTime DESC, id DESC", user.getId()); } } diff --git a/samples/bloggy/src/main/java/bloggy/web/frame/PostsViewFrame.java b/samples/bloggy/src/main/java/bloggy/web/frame/PostsViewFrame.java index d647f6b..4f723ba 100644 --- a/samples/bloggy/src/main/java/bloggy/web/frame/PostsViewFrame.java +++ b/samples/bloggy/src/main/java/bloggy/web/frame/PostsViewFrame.java @@ -35,6 +35,5 @@ private void putPosts(List posts) { private void putPostIds(List posts) { put("postIds", posts.stream().map(Post::getId).collect(Collectors.toList())); - put("note", postDao.findNote()); } } diff --git a/samples/bloggy/src/main/webapp/WEB-INF/templates/EnterPage.ftl b/samples/bloggy/src/main/webapp/WEB-INF/templates/EnterPage.ftl index 4075919..61a3eba 100644 --- a/samples/bloggy/src/main/webapp/WEB-INF/templates/EnterPage.ftl +++ b/samples/bloggy/src/main/webapp/WEB-INF/templates/EnterPage.ftl @@ -41,6 +41,7 @@ +<#--noinspection HtmlDeprecatedAttribute--> diff --git a/samples/bloggy/src/main/webapp/WEB-INF/templates/UserpicFrame.ftl b/samples/bloggy/src/main/webapp/WEB-INF/templates/UserpicFrame.ftl index 3cde01a..77e2c20 100644 --- a/samples/bloggy/src/main/webapp/WEB-INF/templates/UserpicFrame.ftl +++ b/samples/bloggy/src/main/webapp/WEB-INF/templates/UserpicFrame.ftl @@ -11,17 +11,13 @@ +<#--noinspection HtmlDeprecatedAttribute-->