pull/1/head
向金成 2 years ago
parent 4287d3f511
commit a1736d12a7

@ -1,2 +0,0 @@
{ java:S120"ZRename this package name to match the regular expression '^[a-z_]+(\.[a-z_][a-z0-9_]*)*$'.(­œ¡ üÿÿÿÿ8€ÈÿÒ¦1

@ -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
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

@ -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
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

@ -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<UserLogin> findIsRepeat(UserLogin userLogin){
public List<UserLogin> 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);
}

@ -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){

@ -31,9 +31,22 @@ public interface WebHomeMapper {
//查询文章-标题包含
public Collection<UserText> findOfTitleContains(String string);
//上传对某文章的评论
public int insertUserComment(UserComment userComment);
public int deleteUserComment(UserComment userComment);
public int updateUserComment(UserComment userComment);
//上传回复
public int insertUserReply(UserReply userReply);

@ -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;
}

@ -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;

@ -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;
}

@ -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<UserComment> comments;
}

@ -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);

@ -29,6 +29,10 @@
select * from userreplies where commentid=#{int}
</select>
<insert id="insertUserText" parameterType="com.xht.springboot.Entity.UserText">
insert into usertexts(uid,title,text,createtime) values(#{uid},#{title},#{text},#{createtime})
</insert>
@ -38,21 +42,37 @@
</delete>
<update id="updateUserText" parameterType="com.xht.springboot.Entity.UserText">
update usertexts set title=#{title} and text=#{text} and updatetime=#{updatetime}
update usertexts set title=#{title},text=#{text},updatetime=#{updatetime} where textid=#{textid}
</update>
<select id="findOfTextContains" parameterType="string" resultType="com.xht.springboot.Entity.UserText">
SELECT * FROM usertexts WHERE LOCATE(#{string},TEXT)>=1;
select * from usertexts where LOCATE(#{string},text)>=1;
</select>
<select id="findOfTitleContains" parameterType="string" resultType="com.xht.springboot.Entity.UserText">
select * from usertexts where LOCATE(#{string},title)>=1;
</select>
<insert id="insertUserComment" parameterType="com.xht.springboot.Entity.UserComment">
insert into usercomments(textid,uid,comment) values(#{textid},#{uid},#{comment})
</insert>
<delete id="deleteUserComment" parameterType="com.xht.springboot.Entity.UserComment">
delete from usercomments where commentid=#{commentid}
</delete>
<update id="updateUserComment" parameterType="com.xht.springboot.Entity.UserComment">
</update>
<insert id="insertUserReply" parameterType="com.xht.springboot.Entity.UserReply">
insert into userreplies(commentid,text) values(#{commentid},#{text})
</insert>

Loading…
Cancel
Save