|
|
@ -2,6 +2,7 @@ package com.xht.springboot.Service;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.xht.springboot.Dao.WebHomeMapper;
|
|
|
|
import com.xht.springboot.Dao.WebHomeMapper;
|
|
|
|
|
|
|
|
import com.xht.springboot.Entity.UserComment;
|
|
|
|
import com.xht.springboot.Entity.UserReply;
|
|
|
|
import com.xht.springboot.Entity.UserReply;
|
|
|
|
import com.xht.springboot.Entity.UserText;
|
|
|
|
import com.xht.springboot.Entity.UserText;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@ -27,7 +28,7 @@ public class WebHomeService {
|
|
|
|
int rows=0;
|
|
|
|
int rows=0;
|
|
|
|
rows = webHomeMapper.insertUserText(userText);
|
|
|
|
rows = webHomeMapper.insertUserText(userText);
|
|
|
|
if(rows >= 1){
|
|
|
|
if(rows >= 1){
|
|
|
|
System.out.println("insert OK "+rows);
|
|
|
|
System.out.println("insert text OK "+rows);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -38,7 +39,7 @@ public class WebHomeService {
|
|
|
|
int rows=0;
|
|
|
|
int rows=0;
|
|
|
|
rows = webHomeMapper.deleteUserText(userText);
|
|
|
|
rows = webHomeMapper.deleteUserText(userText);
|
|
|
|
if(rows >= 1){
|
|
|
|
if(rows >= 1){
|
|
|
|
System.out.println("delete OK "+rows);
|
|
|
|
System.out.println("delete text OK "+rows);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -49,7 +50,7 @@ public class WebHomeService {
|
|
|
|
int rows=0;
|
|
|
|
int rows=0;
|
|
|
|
rows = webHomeMapper.updateUserText(userText);
|
|
|
|
rows = webHomeMapper.updateUserText(userText);
|
|
|
|
if(rows >= 1){
|
|
|
|
if(rows >= 1){
|
|
|
|
System.out.println("update OK "+rows);
|
|
|
|
System.out.println("update text OK "+rows);
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
@ -62,4 +63,26 @@ public class WebHomeService {
|
|
|
|
results.addAll(webHomeMapper.findOfTitleContains(token));//查询标题中是否包含
|
|
|
|
results.addAll(webHomeMapper.findOfTitleContains(token));//查询标题中是否包含
|
|
|
|
return results;
|
|
|
|
return results;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean postUserComment(UserComment userComment){
|
|
|
|
|
|
|
|
int rows=0;
|
|
|
|
|
|
|
|
rows = webHomeMapper.insertUserComment(userComment);
|
|
|
|
|
|
|
|
if(rows >= 1){
|
|
|
|
|
|
|
|
System.out.println("insert comment OK "+rows);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean postUserReply(UserReply userReply){
|
|
|
|
|
|
|
|
int rows=0;
|
|
|
|
|
|
|
|
rows = webHomeMapper.insertUserReply(userReply);
|
|
|
|
|
|
|
|
if(rows >= 1){
|
|
|
|
|
|
|
|
System.out.println("insert reply OK "+rows);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|