From a1736d12a7b531531a3f39100cc8230c2a0b879b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E9=87=91=E6=88=90?= <2693239786@qq.com> Date: Sat, 9 Sep 2023 18:29:29 +0800 Subject: [PATCH 1/3] update --- .../42d62ad23989879b1e669e84287f32b9ec3b7df5 | 2 -- .../.idea/sonarlint/issuestore/index.pb | 28 ++++++---------- .../42d62ad23989879b1e669e84287f32b9ec3b7df5 | 0 .../sonarlint/securityhotspotstore/index.pb | 32 +++++++------------ .../Control/LoginAndRegisterController.java | 19 ++++++----- .../springboot/Control/WebHomeController.java | 24 ++++++++++++++ .../com/xht/springboot/Dao/WebHomeMapper.java | 13 ++++++++ .../xht/springboot/Entity/UserComment.java | 6 ++-- .../com/xht/springboot/Entity/UserHome.java | 4 +-- .../com/xht/springboot/Entity/UserReply.java | 4 +-- .../com/xht/springboot/Entity/UserText.java | 8 ++--- .../springboot/Service/WebHomeService.java | 30 +++++++++++++++++ .../resources/mybatis/db1/WebHomeMapper.xml | 24 ++++++++++++-- 13 files changed, 133 insertions(+), 61 deletions(-) delete mode 100644 src/medicine/.idea/sonarlint/issuestore/4/2/42d62ad23989879b1e669e84287f32b9ec3b7df5 delete mode 100644 src/medicine/.idea/sonarlint/securityhotspotstore/4/2/42d62ad23989879b1e669e84287f32b9ec3b7df5 diff --git a/src/medicine/.idea/sonarlint/issuestore/4/2/42d62ad23989879b1e669e84287f32b9ec3b7df5 b/src/medicine/.idea/sonarlint/issuestore/4/2/42d62ad23989879b1e669e84287f32b9ec3b7df5 deleted file mode 100644 index 8b6dc3f9..00000000 --- a/src/medicine/.idea/sonarlint/issuestore/4/2/42d62ad23989879b1e669e84287f32b9ec3b7df5 +++ /dev/null @@ -1,2 +0,0 @@ - -{ java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(8Ҧ1 \ No newline at end of file diff --git a/src/medicine/.idea/sonarlint/issuestore/index.pb b/src/medicine/.idea/sonarlint/issuestore/index.pb index c593fd92..e60cec28 100644 --- a/src/medicine/.idea/sonarlint/issuestore/index.pb +++ b/src/medicine/.idea/sonarlint/issuestore/index.pb @@ -3,35 +3,27 @@ Mspringboot/src/main/java/com/xht/springboot/Control/GetSpiderInformation.java,6\a\6ae8bd6e0b13a9d9272e5cd44460d2d0a72091d9 | Lspringboot/src/main/java/com/xht/springboot/Service/PersonalHomeService.java,7\6\762bc359bc75ba7b3073e784c826f31f6c989305 -q -Aspringboot/src/main/java/com/xht/springboot/Entity/UserReply.java,0\5\051eaf551b928a8ccf651611c070ebb2b8155264 -r -Bspringboot/src/main/java/com/xht/springboot/Tip/RequestResult.java,8\a\8ac776bbbb6e77f29694ccc4476b533f9f4573da - -Sspringboot/src/main/java/com/xht/springboot/Control/LoginAndRegisterController.java,4\2\42d62ad23989879b1e669e84287f32b9ec3b7df5 -{ -Kspringboot/src/main/java/com/xht/springboot/Dao/LoginAndRegisterMapper.java,6\4\6455addaf8475c1ee66ddf019aba9934cde58b33  Ospringboot/src/main/java/com/xht/springboot/Control/PersonalHomeController.java,b\e\be5bf7d32cedc052850e2cc0c99f2cf7357cac12 w Gspringboot/src/main/java/com/xht/springboot/Dao/PersonalHomeMapper.java,8\e\8ea61bcc473345da7a8363076b3ae562bc76fedc +z +Jspringboot/src/main/java/com/xht/springboot/pythonspider/PythonSpider.java,8\2\82d065e13dbb46b69838db763af0105eec47337f p @springboot/src/main/java/com/xht/springboot/Entity/UserHome.java,0\b\0bf6f777ae20a7657065bc4a2b2a9f1f3b4876b1 q -Aspringboot/src/main/java/com/xht/springboot/Entity/UserLogin.java,1\3\139a0da36daad8c438a5607ee212d1f38a505779 -z -Jspringboot/src/main/java/com/xht/springboot/pythonspider/PythonSpider.java,8\2\82d065e13dbb46b69838db763af0105eec47337f +Aspringboot/src/main/java/com/xht/springboot/Entity/UserReply.java,0\5\051eaf551b928a8ccf651611c070ebb2b8155264 p @springboot/src/main/java/com/xht/springboot/Entity/UserText.java,4\0\40a2343a36c9747fa26c52f19f82c0a493b5c2e0 -z -Jspringboot/src/main/java/com/xht/springboot/Control/WebHomeController.java,e\d\edeacc9d294f3b307d4238fb3f381c6838218bb6 -v -Fspringboot/src/main/java/com/xht/springboot/SpringbootApplication.java,4\0\40324953a2003c0d6c6b3ceece38a620d48a0df7 s Cspringboot/src/main/java/com/xht/springboot/Entity/UserComment.java,9\3\932ae6b8f9f42f924c25e69e48dc30fddd63ec28 -w -Gspringboot/src/main/java/com/xht/springboot/Service/WebHomeService.java,5\f\5feb9f75e1bc678660918562fd0ce2745899be29 B springboot/pom.xml,e\4\e46aee6c7c512a7b48980a296fca0acf004a1907 r -Bspringboot/src/main/java/com/xht/springboot/Dao/WebHomeMapper.java,2\a\2ad2a1260dac6c01c8b352bb0e2ca62f513676a9 \ No newline at end of file +Bspringboot/src/main/java/com/xht/springboot/Dao/WebHomeMapper.java,2\a\2ad2a1260dac6c01c8b352bb0e2ca62f513676a9 +{ +Kspringboot/src/main/java/com/xht/springboot/Dao/LoginAndRegisterMapper.java,6\4\6455addaf8475c1ee66ddf019aba9934cde58b33 +q +Aspringboot/src/main/java/com/xht/springboot/Entity/UserLogin.java,1\3\139a0da36daad8c438a5607ee212d1f38a505779 +r +Bspringboot/src/main/java/com/xht/springboot/Tip/RequestResult.java,8\a\8ac776bbbb6e77f29694ccc4476b533f9f4573da \ No newline at end of file diff --git a/src/medicine/.idea/sonarlint/securityhotspotstore/4/2/42d62ad23989879b1e669e84287f32b9ec3b7df5 b/src/medicine/.idea/sonarlint/securityhotspotstore/4/2/42d62ad23989879b1e669e84287f32b9ec3b7df5 deleted file mode 100644 index e69de29b..00000000 diff --git a/src/medicine/.idea/sonarlint/securityhotspotstore/index.pb b/src/medicine/.idea/sonarlint/securityhotspotstore/index.pb index 6f97e7d2..2e70f967 100644 --- a/src/medicine/.idea/sonarlint/securityhotspotstore/index.pb +++ b/src/medicine/.idea/sonarlint/securityhotspotstore/index.pb @@ -3,35 +3,27 @@ Mspringboot/src/main/java/com/xht/springboot/Control/GetSpiderInformation.java,6\a\6ae8bd6e0b13a9d9272e5cd44460d2d0a72091d9 | Lspringboot/src/main/java/com/xht/springboot/Service/PersonalHomeService.java,7\6\762bc359bc75ba7b3073e784c826f31f6c989305 -q -Aspringboot/src/main/java/com/xht/springboot/Entity/UserReply.java,0\5\051eaf551b928a8ccf651611c070ebb2b8155264 -r -Bspringboot/src/main/java/com/xht/springboot/Tip/RequestResult.java,8\a\8ac776bbbb6e77f29694ccc4476b533f9f4573da -{ -Kspringboot/src/main/java/com/xht/springboot/Dao/LoginAndRegisterMapper.java,6\4\6455addaf8475c1ee66ddf019aba9934cde58b33 - -Sspringboot/src/main/java/com/xht/springboot/Control/LoginAndRegisterController.java,4\2\42d62ad23989879b1e669e84287f32b9ec3b7df5  Ospringboot/src/main/java/com/xht/springboot/Control/PersonalHomeController.java,b\e\be5bf7d32cedc052850e2cc0c99f2cf7357cac12 w Gspringboot/src/main/java/com/xht/springboot/Dao/PersonalHomeMapper.java,8\e\8ea61bcc473345da7a8363076b3ae562bc76fedc +z +Jspringboot/src/main/java/com/xht/springboot/pythonspider/PythonSpider.java,8\2\82d065e13dbb46b69838db763af0105eec47337f p @springboot/src/main/java/com/xht/springboot/Entity/UserHome.java,0\b\0bf6f777ae20a7657065bc4a2b2a9f1f3b4876b1 q -Aspringboot/src/main/java/com/xht/springboot/Entity/UserLogin.java,1\3\139a0da36daad8c438a5607ee212d1f38a505779 +Aspringboot/src/main/java/com/xht/springboot/Entity/UserReply.java,0\5\051eaf551b928a8ccf651611c070ebb2b8155264 p @springboot/src/main/java/com/xht/springboot/Entity/UserText.java,4\0\40a2343a36c9747fa26c52f19f82c0a493b5c2e0 -v -Fspringboot/src/main/java/com/xht/springboot/SpringbootApplication.java,4\0\40324953a2003c0d6c6b3ceece38a620d48a0df7 -z -Jspringboot/src/main/java/com/xht/springboot/pythonspider/PythonSpider.java,8\2\82d065e13dbb46b69838db763af0105eec47337f -z -Jspringboot/src/main/java/com/xht/springboot/Control/WebHomeController.java,e\d\edeacc9d294f3b307d4238fb3f381c6838218bb6 -w -Gspringboot/src/main/java/com/xht/springboot/Service/WebHomeService.java,5\f\5feb9f75e1bc678660918562fd0ce2745899be29 -r -Bspringboot/src/main/java/com/xht/springboot/Dao/WebHomeMapper.java,2\a\2ad2a1260dac6c01c8b352bb0e2ca62f513676a9 s Cspringboot/src/main/java/com/xht/springboot/Entity/UserComment.java,9\3\932ae6b8f9f42f924c25e69e48dc30fddd63ec28 +r +Bspringboot/src/main/java/com/xht/springboot/Dao/WebHomeMapper.java,2\a\2ad2a1260dac6c01c8b352bb0e2ca62f513676a9 B -springboot/pom.xml,e\4\e46aee6c7c512a7b48980a296fca0acf004a1907 \ No newline at end of file +springboot/pom.xml,e\4\e46aee6c7c512a7b48980a296fca0acf004a1907 +r +Bspringboot/src/main/java/com/xht/springboot/Tip/RequestResult.java,8\a\8ac776bbbb6e77f29694ccc4476b533f9f4573da +q +Aspringboot/src/main/java/com/xht/springboot/Entity/UserLogin.java,1\3\139a0da36daad8c438a5607ee212d1f38a505779 +{ +Kspringboot/src/main/java/com/xht/springboot/Dao/LoginAndRegisterMapper.java,6\4\6455addaf8475c1ee66ddf019aba9934cde58b33 \ No newline at end of file diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Control/LoginAndRegisterController.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Control/LoginAndRegisterController.java index adb4825a..9e455965 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Control/LoginAndRegisterController.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Control/LoginAndRegisterController.java @@ -6,11 +6,14 @@ import com.xht.springboot.Entity.UserLogin; import com.xht.springboot.Tip.RequestResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; +@RequestMapping("/user") @Controller public class LoginAndRegisterController { @Autowired @@ -19,15 +22,15 @@ public class LoginAndRegisterController { @Autowired RequestResult requestResult; - @RequestMapping("/findisrepeat") + @RequestMapping(value = "/findisrepeat",method = RequestMethod.POST) @ResponseBody - public List findIsRepeat(UserLogin userLogin){ + public List findIsRepeat(@RequestBody UserLogin userLogin){ return loginAndRegisterMapper.findIsRepeat(userLogin); } - @RequestMapping("/register") + @RequestMapping(value = "/register",method = RequestMethod.POST) @ResponseBody - public RequestResult register(UserLogin userLogin){ + public RequestResult register(@RequestBody UserLogin userLogin){ if(loginAndRegisterMapper.register(userLogin) >= 1){ requestResult.status = RequestResult.OK; return requestResult; @@ -37,15 +40,15 @@ public class LoginAndRegisterController { } } - @RequestMapping("/login") + @RequestMapping(value = "/login",method = RequestMethod.POST) @ResponseBody - public UserLogin login(UserLogin userLogin){ + public UserLogin login(@RequestBody UserLogin userLogin){ return loginAndRegisterMapper.find(userLogin); } - @RequestMapping("/forgetpassword") + @RequestMapping(value = "/forgetpassword",method = RequestMethod.POST) @ResponseBody - public UserLogin getPassword(UserLogin userLogin){ + public UserLogin getPassword(@RequestBody UserLogin userLogin){ return loginAndRegisterMapper.find(userLogin); } diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Control/WebHomeController.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Control/WebHomeController.java index 60f650a9..f3fb9e29 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Control/WebHomeController.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Control/WebHomeController.java @@ -87,6 +87,30 @@ public class WebHomeController { } } + @RequestMapping("/delcomment") + @ResponseBody + public RequestResult deleteComment(UserComment userComment){ + if(webHomeService.deleteUserComment(userComment)){ + requestResult.status = RequestResult.OK; + return requestResult; + }else { + requestResult.status = RequestResult.FAIL; + return requestResult; + } + } + + @RequestMapping("/updatecomment") + @ResponseBody + public RequestResult updateComment(UserComment userComment){ + if(webHomeService.updateUserComment(userComment)){ + requestResult.status = RequestResult.OK; + return requestResult; + }else { + requestResult.status = RequestResult.FAIL; + return requestResult; + } + } + @RequestMapping("/postreply") @ResponseBody public RequestResult postReply(UserReply userReply){ diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Dao/WebHomeMapper.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Dao/WebHomeMapper.java index 88f4c241..e2de9cad 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Dao/WebHomeMapper.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Dao/WebHomeMapper.java @@ -31,9 +31,22 @@ public interface WebHomeMapper { //查询文章-标题包含 public Collection findOfTitleContains(String string); + + + + //上传对某文章的评论 public int insertUserComment(UserComment userComment); + public int deleteUserComment(UserComment userComment); + + public int updateUserComment(UserComment userComment); + + + + + + //上传回复 public int insertUserReply(UserReply userReply); diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserComment.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserComment.java index 071eea8d..5f77c796 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserComment.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserComment.java @@ -10,14 +10,14 @@ import java.util.List; @ToString @Component public class UserComment { - private int commentId; + private int commentid; - private int textId; + private int textid; private int uid; private String comment; - private int likeCount; + private int cmlikecount; } diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserHome.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserHome.java index 4dbc31a5..7ba32cdd 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserHome.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserHome.java @@ -15,10 +15,10 @@ public class UserHome { private int uid; //用户累计使用网站时间 - private Date registerTime; + private Date registertime; //累计发表文章 - private int textCounts; + private int textcounts; //用户自己病症的描述 private String diseases; diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserReply.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserReply.java index 9b17e565..4f7e74de 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserReply.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserReply.java @@ -9,9 +9,9 @@ import org.springframework.stereotype.Component; @Data @ToString public class UserReply { - private int replyId; + private int replyid; - private int commentId; + private int commentid; private String text; } diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserText.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserText.java index 15b677c8..487005a8 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserText.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserText.java @@ -13,17 +13,17 @@ import java.util.List; @Component public class UserText { - private int textId; + private int textid; private int uid; private String title; private String text; - private Date updateTime; - private Date createTime; + private Date updatetime; + private Date createtime; - private int likeCount; + private int likecount; private List comments; } diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Service/WebHomeService.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Service/WebHomeService.java index f56e330d..15b4e535 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Service/WebHomeService.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Service/WebHomeService.java @@ -64,6 +64,9 @@ public class WebHomeService { return results; } + + + public boolean postUserComment(UserComment userComment){ int rows=0; rows = webHomeMapper.insertUserComment(userComment); @@ -75,6 +78,33 @@ public class WebHomeService { } } + public boolean deleteUserComment(UserComment userComment){ + int rows=0; + rows = webHomeMapper.deleteUserComment(userComment); + if(rows >= 1){ + System.out.println("delete comment OK "+rows); + return true; + }else{ + return false; + } + } + + public boolean updateUserComment(UserComment userComment){ + int rows=0; + rows = webHomeMapper.updateUserComment(userComment); + if(rows >= 1){ + System.out.println("update comment OK "+rows); + return true; + }else{ + return false; + } + } + + + + + + public boolean postUserReply(UserReply userReply){ int rows=0; rows = webHomeMapper.insertUserReply(userReply); diff --git a/src/medicine/springboot/src/main/resources/mybatis/db1/WebHomeMapper.xml b/src/medicine/springboot/src/main/resources/mybatis/db1/WebHomeMapper.xml index 39bbc0de..67a30eb3 100644 --- a/src/medicine/springboot/src/main/resources/mybatis/db1/WebHomeMapper.xml +++ b/src/medicine/springboot/src/main/resources/mybatis/db1/WebHomeMapper.xml @@ -29,6 +29,10 @@ select * from userreplies where commentid=#{int} + + + + insert into usertexts(uid,title,text,createtime) values(#{uid},#{title},#{text},#{createtime}) @@ -38,21 +42,37 @@ - update usertexts set title=#{title} and text=#{text} and updatetime=#{updatetime} + update usertexts set title=#{title},text=#{text},updatetime=#{updatetime} where textid=#{textid} + + + + insert into usercomments(textid,uid,comment) values(#{textid},#{uid},#{comment}) + + delete from usercomments where commentid=#{commentid} + + + + + + + + + + insert into userreplies(commentid,text) values(#{commentid},#{text}) From fd6b5f953ab9faa0b33e8b039d27a122c69d5abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E9=87=91=E6=88=90?= <2693239786@qq.com> Date: Sat, 9 Sep 2023 19:09:10 +0800 Subject: [PATCH 2/3] update 1 --- .../.idea/sonarlint/issuestore/index.pb | 18 ++++++++---- .../sonarlint/securityhotspotstore/index.pb | 18 ++++++++---- .../springboot/Control/WebHomeController.java | 7 +++-- .../com/xht/springboot/Entity/UserText.java | 2 +- .../resources/mybatis/db1/WebHomeMapper.xml | 28 +++++++++++++++++-- 5 files changed, 57 insertions(+), 16 deletions(-) diff --git a/src/medicine/.idea/sonarlint/issuestore/index.pb b/src/medicine/.idea/sonarlint/issuestore/index.pb index e60cec28..120e5c50 100644 --- a/src/medicine/.idea/sonarlint/issuestore/index.pb +++ b/src/medicine/.idea/sonarlint/issuestore/index.pb @@ -13,10 +13,6 @@ p @springboot/src/main/java/com/xht/springboot/Entity/UserHome.java,0\b\0bf6f777ae20a7657065bc4a2b2a9f1f3b4876b1 q Aspringboot/src/main/java/com/xht/springboot/Entity/UserReply.java,0\5\051eaf551b928a8ccf651611c070ebb2b8155264 -p -@springboot/src/main/java/com/xht/springboot/Entity/UserText.java,4\0\40a2343a36c9747fa26c52f19f82c0a493b5c2e0 -s -Cspringboot/src/main/java/com/xht/springboot/Entity/UserComment.java,9\3\932ae6b8f9f42f924c25e69e48dc30fddd63ec28 B springboot/pom.xml,e\4\e46aee6c7c512a7b48980a296fca0acf004a1907 r @@ -26,4 +22,16 @@ Kspringboot/src/main/java/com/xht/springboot/Dao/LoginAndRegisterMapper.java,6\ q Aspringboot/src/main/java/com/xht/springboot/Entity/UserLogin.java,1\3\139a0da36daad8c438a5607ee212d1f38a505779 r -Bspringboot/src/main/java/com/xht/springboot/Tip/RequestResult.java,8\a\8ac776bbbb6e77f29694ccc4476b533f9f4573da \ No newline at end of file +Bspringboot/src/main/java/com/xht/springboot/Tip/RequestResult.java,8\a\8ac776bbbb6e77f29694ccc4476b533f9f4573da +w +Gspringboot/src/main/java/com/xht/springboot/Service/WebHomeService.java,5\f\5feb9f75e1bc678660918562fd0ce2745899be29 + +Sspringboot/src/main/java/com/xht/springboot/Control/LoginAndRegisterController.java,4\2\42d62ad23989879b1e669e84287f32b9ec3b7df5 +s +Cspringboot/src/main/java/com/xht/springboot/Entity/UserComment.java,9\3\932ae6b8f9f42f924c25e69e48dc30fddd63ec28 +p +@springboot/src/main/java/com/xht/springboot/Entity/UserText.java,4\0\40a2343a36c9747fa26c52f19f82c0a493b5c2e0 +z +Jspringboot/src/main/java/com/xht/springboot/Control/WebHomeController.java,e\d\edeacc9d294f3b307d4238fb3f381c6838218bb6 +v +Fspringboot/src/main/java/com/xht/springboot/SpringbootApplication.java,4\0\40324953a2003c0d6c6b3ceece38a620d48a0df7 \ No newline at end of file diff --git a/src/medicine/.idea/sonarlint/securityhotspotstore/index.pb b/src/medicine/.idea/sonarlint/securityhotspotstore/index.pb index 2e70f967..c8b4304f 100644 --- a/src/medicine/.idea/sonarlint/securityhotspotstore/index.pb +++ b/src/medicine/.idea/sonarlint/securityhotspotstore/index.pb @@ -13,10 +13,6 @@ p @springboot/src/main/java/com/xht/springboot/Entity/UserHome.java,0\b\0bf6f777ae20a7657065bc4a2b2a9f1f3b4876b1 q Aspringboot/src/main/java/com/xht/springboot/Entity/UserReply.java,0\5\051eaf551b928a8ccf651611c070ebb2b8155264 -p -@springboot/src/main/java/com/xht/springboot/Entity/UserText.java,4\0\40a2343a36c9747fa26c52f19f82c0a493b5c2e0 -s -Cspringboot/src/main/java/com/xht/springboot/Entity/UserComment.java,9\3\932ae6b8f9f42f924c25e69e48dc30fddd63ec28 r Bspringboot/src/main/java/com/xht/springboot/Dao/WebHomeMapper.java,2\a\2ad2a1260dac6c01c8b352bb0e2ca62f513676a9 B @@ -26,4 +22,16 @@ Bspringboot/src/main/java/com/xht/springboot/Tip/RequestResult.java,8\a\8ac776b q Aspringboot/src/main/java/com/xht/springboot/Entity/UserLogin.java,1\3\139a0da36daad8c438a5607ee212d1f38a505779 { -Kspringboot/src/main/java/com/xht/springboot/Dao/LoginAndRegisterMapper.java,6\4\6455addaf8475c1ee66ddf019aba9934cde58b33 \ No newline at end of file +Kspringboot/src/main/java/com/xht/springboot/Dao/LoginAndRegisterMapper.java,6\4\6455addaf8475c1ee66ddf019aba9934cde58b33 +v +Fspringboot/src/main/java/com/xht/springboot/SpringbootApplication.java,4\0\40324953a2003c0d6c6b3ceece38a620d48a0df7 +w +Gspringboot/src/main/java/com/xht/springboot/Service/WebHomeService.java,5\f\5feb9f75e1bc678660918562fd0ce2745899be29 + +Sspringboot/src/main/java/com/xht/springboot/Control/LoginAndRegisterController.java,4\2\42d62ad23989879b1e669e84287f32b9ec3b7df5 +s +Cspringboot/src/main/java/com/xht/springboot/Entity/UserComment.java,9\3\932ae6b8f9f42f924c25e69e48dc30fddd63ec28 +p +@springboot/src/main/java/com/xht/springboot/Entity/UserText.java,4\0\40a2343a36c9747fa26c52f19f82c0a493b5c2e0 +z +Jspringboot/src/main/java/com/xht/springboot/Control/WebHomeController.java,e\d\edeacc9d294f3b307d4238fb3f381c6838218bb6 \ No newline at end of file diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Control/WebHomeController.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Control/WebHomeController.java index f3fb9e29..83dc9a72 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Control/WebHomeController.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Control/WebHomeController.java @@ -7,6 +7,7 @@ import com.xht.springboot.Service.WebHomeService; import com.xht.springboot.Tip.RequestResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; @@ -35,7 +36,7 @@ public class WebHomeController { @RequestMapping("/posttext") @ResponseBody - public RequestResult postText(UserText userText){ + public RequestResult postText(@RequestBody UserText userText){ if(webHomeService.postUserText(userText)){ requestResult.status = RequestResult.OK; return requestResult; @@ -77,7 +78,7 @@ public class WebHomeController { @RequestMapping("/postcomment") @ResponseBody - public RequestResult postComment(UserComment userComment){ + public RequestResult postComment(@RequestBody UserComment userComment){ if(webHomeService.postUserComment(userComment)){ requestResult.status = RequestResult.OK; return requestResult; @@ -113,7 +114,7 @@ public class WebHomeController { @RequestMapping("/postreply") @ResponseBody - public RequestResult postReply(UserReply userReply){ + public RequestResult postReply(@RequestBody UserReply userReply){ if(webHomeService.postUserReply(userReply)){ requestResult.status = RequestResult.OK; return requestResult; diff --git a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserText.java b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserText.java index 487005a8..3e839cd0 100644 --- a/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserText.java +++ b/src/medicine/springboot/src/main/java/com/xht/springboot/Entity/UserText.java @@ -23,7 +23,7 @@ public class UserText { private Date updatetime; private Date createtime; - private int likecount; + private int txtlikecount; private List comments; } diff --git a/src/medicine/springboot/src/main/resources/mybatis/db1/WebHomeMapper.xml b/src/medicine/springboot/src/main/resources/mybatis/db1/WebHomeMapper.xml index 67a30eb3..67e80dda 100644 --- a/src/medicine/springboot/src/main/resources/mybatis/db1/WebHomeMapper.xml +++ b/src/medicine/springboot/src/main/resources/mybatis/db1/WebHomeMapper.xml @@ -42,7 +42,22 @@ - update usertexts set title=#{title},text=#{text},updatetime=#{updatetime} where textid=#{textid} + update usertexts + + + title=#{title}, + + + text=#{text}, + + + txtlikecount=#{txtlikecount}, + + + updatetime=#{updatetime}, + + + where textid=#{textid}