jiapeng преди 7 години
родител
ревизия
ede242f9de
променени са 2 файла, в които са добавени 5 реда и са изтрити 5 реда
  1. 2 2
      src/main/java/com/ekexiu/portal/question/QuestionDao.java
  2. 3 3
      src/main/java/com/ekexiu/portal/question/Service.java

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

53
	@From(Question.class)
53
	@From(Question.class)
54
	@SetSentence("REPLY_COUNT=REPLY_COUNT-1")
54
	@SetSentence("REPLY_COUNT=REPLY_COUNT-1")
55
	@Where("REPLY_COUNT >0")
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
	@UpdateWith
58
	@UpdateWith
59
	@From(Question.class)
59
	@From(Question.class)
84
	@From(Answer.class)
84
	@From(Answer.class)
85
	@SetSentence("STATE='0'")
85
	@SetSentence("STATE='0'")
86
	@Where("STATE ='1'")
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
	@UpdateWith
89
	@UpdateWith
90
	@From(Answer.class)
90
	@From(Answer.class)

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

584

584

585
	@Get
585
	@Get
586
	@Path("/answer/delete")
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
			return 1;
590
			return 1;
591
		}
591
		}
592
		return 0;
592
		return 0;