jiapeng vor 7 Jahren
Ursprung
Commit
ede242f9de

+ 2 - 2
src/main/java/com/ekexiu/portal/question/QuestionDao.java

@ -53,7 +53,7 @@ public interface QuestionDao {
53 53
	@From(Question.class)
54 54
	@SetSentence("REPLY_COUNT=REPLY_COUNT-1")
55 55
	@Where("REPLY_COUNT >0")
56
	int deccQuestionReply(Connection con,String id)throws SQLException;
56
	int decQuestionReply(Connection con,String id)throws SQLException;
57 57
	
58 58
	@UpdateWith
59 59
	@From(Question.class)
@ -84,7 +84,7 @@ public interface QuestionDao {
84 84
	@From(Answer.class)
85 85
	@SetSentence("STATE='0'")
86 86
	@Where("STATE ='1'")
87
	int logicDeleteAnswer(Connection con,String id)throws SQLException;
87
	int logicDeleteAnswer(Connection con,String id,String qid)throws SQLException;
88 88
	
89 89
	@UpdateWith
90 90
	@From(Answer.class)

+ 3 - 3
src/main/java/com/ekexiu/portal/question/Service.java

@ -584,9 +584,9 @@ public class Service {
584 584

585 585
	@Get
586 586
	@Path("/answer/delete")
587
	public int logicDelete(@JdbcConn(true) Connection con, String id) throws SQLException {
588
		if (questionDao.logicDeleteAnswer(con, id) > 0) {
589
			questionDao.deccQuestionReply(con, id);
587
	public int logicDelete(@JdbcConn(true) Connection con, String id,String qid) throws SQLException {
588
		if (questionDao.logicDeleteAnswer(con, id,qid) > 0) {
589
			questionDao.decQuestionReply(con, qid);
590 590
			return 1;
591 591
		}
592 592
		return 0;