Browse Source

--add queryAgreeList();add queryAgree();update arcicleAgreeDao to
articleAgreeDao;

zzy.zhiyuan.foxmail 8 years ago
parent
commit
e74dff5056

+ 7 - 1
src/main/java/com/ekexiu/portal/dao/ArcicleAgreeDao.java

@ -4,16 +4,18 @@ import java.sql.Connection;
4 4
import java.sql.SQLException;
5 5
import java.util.List;
6 6

7
import org.jfw.apt.annotation.Nullable;
7 8
import org.jfw.apt.orm.annotation.dao.DAO;
8 9
import org.jfw.apt.orm.annotation.dao.method.From;
9 10
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
10 11
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
11 12
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
13
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
12 14

13 15
import com.ekexiu.portal.po.ArticleAgree;
14 16

15 17
@DAO
16
public abstract class ArcicleAgreeDao {
18
public abstract class ArticleAgreeDao {
17 19
	@Insert
18 20
	public abstract int insert(Connection con,ArticleAgree articleAgree)throws SQLException;
19 21
	
@ -28,4 +30,8 @@ public abstract class ArcicleAgreeDao {
28 30
	@SelectList
29 31
	public abstract List<ArticleAgree> query(Connection con,String articleId)throws SQLException;
30 32
	
33
	@SelectOne
34
	@Nullable
35
	public abstract ArticleAgree queryOne(Connection con,String operateId,String articleId)throws SQLException;
36
	
31 37
}

+ 16 - 4
src/main/java/com/ekexiu/portal/service/ArticleService.java

@ -25,7 +25,7 @@ import org.jfw.util.StringUtil;
25 25
import org.jfw.util.exception.JfwBaseException;
26 26
import org.jfw.util.io.IoUtil;
27 27

28
import com.ekexiu.portal.dao.ArcicleAgreeDao;
28
import com.ekexiu.portal.dao.ArticleAgreeDao;
29 29
import com.ekexiu.portal.dao.ArticleDao;
30 30
import com.ekexiu.portal.dao.LeaveWordDao;
31 31
import com.ekexiu.portal.dao.OrgDao;
@ -49,7 +49,7 @@ public class ArticleService {
49 49
	@Autowrie
50 50
	private ArticleDao articleDao;
51 51
	@Autowrie
52
	private ArcicleAgreeDao articleAgreeDao;
52
	private ArticleAgreeDao articleAgreeDao;
53 53
	@Autowrie
54 54
	private ProfessorDao professorDao;
55 55
	@Autowrie
@ -107,11 +107,11 @@ public class ArticleService {
107 107
		this.articleDao = articleDao;
108 108
	}
109 109
	
110
	public ArcicleAgreeDao getArticleAgreeDao() {
110
	public ArticleAgreeDao getArticleAgreeDao() {
111 111
		return articleAgreeDao;
112 112
	}
113 113

114
	public void setArticleAgreeDao(ArcicleAgreeDao articleAgreeDao) {
114
	public void setArticleAgreeDao(ArticleAgreeDao articleAgreeDao) {
115 115
		this.articleAgreeDao = articleAgreeDao;
116 116
	}
117 117

@ -273,6 +273,18 @@ public class ArticleService {
273 273
		}
274 274
	}
275 275
	
276
	@Get
277
	@Path("/isAgree")
278
	public ArticleAgree queryAgree(@JdbcConn Connection con,String operateId,String articleId)throws SQLException{
279
		return this.articleAgreeDao.queryOne(con, operateId, articleId);
280
	}
281
	
282
	@Get
283
	@Path("/agreeList")
284
	public List<ArticleAgree> queryAgreeList(@JdbcConn Connection con,String articleId)throws SQLException{
285
		return this.articleAgreeDao.query(con, articleId);
286
	}
287
	
276 288
	@Get
277 289
	@Path("/qaPro")
278 290
	public List<Article> queryPro(@JdbcConn Connection con, String professorId) throws SQLException{