Quellcode durchsuchen

Merge branch 'dev' of http://www.ekexiu.com:3000/jiapeng/portal-web.git
into dev

Conflicts:
src/main/java/com/ekexiu/portal/ware/WareService.java

jiapeng vor 7 Jahren
Ursprung
Commit
7f51ee9a63

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

977

977

978
	@LimitSelect
978
	@LimitSelect
979
	@OrderBy( " ORDER BY PAGE_VIEWS DESC")
979
	@OrderBy( " ORDER BY PAGE_VIEWS DESC")
980
	public abstract List<Article> queryByWareId(Connection con,@SqlColumn(handlerClass = StringHandler.class, value = { "ARTICLE_ID IN (SELECT ID FROM ARTICLE_WARE WHERE WARE =?))" }) String ware,int rows) throws SQLException;
980
	public abstract List<Article> queryByWareId(Connection con,@SqlColumn(handlerClass = StringHandler.class, value = { "ARTICLE_ID IN (SELECT ID FROM ARTICLE_WARE WHERE WARE =?)" }) String ware,int rows) throws SQLException;
981
}
981
}

+ 33 - 22
src/main/java/com/ekexiu/portal/ware/WareService.java

231
	 */
231
	 */
232
	@Post
232
	@Post
233
	@Path("/draft")
233
	@Path("/draft")
234
	public String draft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", 
235
			"shareId", "pageViews", "sortFirst" }) Ware ware, @Nullable String[] resource) throws SQLException, IOException {
234
	public String draft(@JdbcConn(true) Connection con,
235
			@RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
236
			@Nullable String[] resource) throws SQLException, IOException {
236
		ware.setState("2");
237
		ware.setState("2");
237
		ware.setCategory("1");
238
		ware.setCategory("1");
238
		return insert(con, ware, null, resource);
239
		return insert(con, ware, null, resource);
251
	 */
252
	 */
252
	@Post
253
	@Post
253
	@Path("/draft/org")
254
	@Path("/draft/org")
254
	public String draft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", 
255
			"shareId", "pageViews", "sortFirst" }) Ware ware,@Nullable String[] resource,@Nullable String[] professor) throws SQLException, IOException {
255
	public String draft(@JdbcConn(true) Connection con,
256
			@RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
257
			@Nullable String[] resource, @Nullable String[] professor) throws SQLException, IOException {
256
		ware.setState("2");
258
		ware.setState("2");
257
		ware.setCategory("2");
259
		ware.setCategory("2");
258
		return insert(con, ware, professor, resource);
260
		return insert(con, ware, professor, resource);
270
	 */
272
	 */
271
	@Post
273
	@Post
272
	@Path("/publish")
274
	@Path("/publish")
273
	public String publish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", 
274
			"shareId", "pageViews", "sortFirst" }) Ware ware,@Nullable String[] resource) throws SQLException, IOException {
275
	public String publish(@JdbcConn(true) Connection con,
276
			@RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
277
			@Nullable String[] resource) throws SQLException, IOException {
275
		ware.setState("1");
278
		ware.setState("1");
276
		ware.setCategory("1");
279
		ware.setCategory("1");
277
		return insert(con, ware, null, resource);
280
		return insert(con, ware, null, resource);
290
	 */
293
	 */
291
	@Post
294
	@Post
292
	@Path("/publish/org")
295
	@Path("/publish/org")
293
	public String publish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", 
294
			"shareId", "pageViews", "sortFirst" }) Ware ware,@Nullable String[] resource,@Nullable String[] professor) throws SQLException, IOException {
296
	public String publish(@JdbcConn(true) Connection con,
297
			@RequestParam(excludeFields = { "category", "id", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
298
			@Nullable String[] resource, @Nullable String[] professor) throws SQLException, IOException {
295
		ware.setState("1");
299
		ware.setState("1");
296
		ware.setCategory("2");
300
		ware.setCategory("2");
297
		return insert(con, ware, professor, resource);
301
		return insert(con, ware, professor, resource);
309
	 */
313
	 */
310
	@Post
314
	@Post
311
	@Path("/draft/update")
315
	@Path("/draft/update")
312
	public boolean updateDraft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime",
313
			"shareId", "pageViews", "sortFirst" }) Ware ware, @Nullable String[] resource) throws SQLException, IOException {
316
	public boolean updateDraft(@JdbcConn(true) Connection con,
317
			@RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
318
			@Nullable String[] resource) throws SQLException, IOException {
314
		ware.setState("2");
319
		ware.setState("2");
315
		ware.setCategory("1");
320
		ware.setCategory("1");
316
		return update(con, ware, null, resource);
321
		return update(con, ware, null, resource);
329
	 */
334
	 */
330
	@Post
335
	@Post
331
	@Path("/draft/org/update")
336
	@Path("/draft/org/update")
332
	public boolean updateDraft(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime",
333
			"shareId", "pageViews", "sortFirst" }) Ware ware,@Nullable String[] resource,@Nullable String[] professor) throws SQLException, IOException {
337
	public boolean updateDraft(@JdbcConn(true) Connection con,
338
			@RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
339
			@Nullable String[] resource, @Nullable String[] professor) throws SQLException, IOException {
334
		ware.setState("2");
340
		ware.setState("2");
335
		ware.setCategory("2");
341
		ware.setCategory("2");
336
		return update(con, ware, professor, resource);
342
		return update(con, ware, professor, resource);
348
	 */
354
	 */
349
	@Post
355
	@Post
350
	@Path("/publish/update")
356
	@Path("/publish/update")
351
	public boolean updatePublish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime",
352
		 "shareId", "pageViews", "sortFirst" }) Ware ware,@Nullable String[] resource) throws SQLException, IOException {
357
	public boolean updatePublish(@JdbcConn(true) Connection con,
358
			@RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
359
			@Nullable String[] resource) throws SQLException, IOException {
353
		ware.setState("1");
360
		ware.setState("1");
354
		ware.setCategory("1");
361
		ware.setCategory("1");
355
		return update(con, ware, null, resource);
362
		return update(con, ware, null, resource);
368
	 */
375
	 */
369
	@Post
376
	@Post
370
	@Path("/publish/org/update")
377
	@Path("/publish/org/update")
371
	public boolean updatePublish(@JdbcConn(true) Connection con, @RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime",
372
		"shareId", "pageViews", "sortFirst" }) Ware ware,@Nullable String[] resource,@Nullable String[] professor) throws SQLException, IOException {
378
	public boolean updatePublish(@JdbcConn(true) Connection con,
379
			@RequestParam(excludeFields = { "category", "state", "createTime", "modifyTime", "shareId", "pageViews", "sortFirst" }) Ware ware,
380
			@Nullable String[] resource, @Nullable String[] professor) throws SQLException, IOException {
373
		ware.setState("1");
381
		ware.setState("1");
374
		ware.setCategory("2");
382
		ware.setCategory("2");
375
		return update(con, ware, professor, resource);
383
		return update(con, ware, professor, resource);
614
	@Path("/ralateWare")
622
	@Path("/ralateWare")
615
	public List<Map<String, Object>> queryRalateWare(@JdbcConn Connection con, final String id, final int rows) throws SQLException {
623
	public List<Map<String, Object>> queryRalateWare(@JdbcConn Connection con, final String id, final int rows) throws SQLException {
616
		return JdbcUtil.queryList(con,
624
		return JdbcUtil.queryList(con,
617
				"SELECT ID,NUM FROM (SELECT ID,COUNT(1) NUM FROM WRE_KEY_WORD WHERE ID <> ? AND KW IN (SELECT KW FROM WRE_KEY_WORD WHERE ID=?) GROUP BY ID ) T ORDER BY NUM DESC LIMIT ?",
625
				"SELECT ID,NUM FROM (SELECT ID,COUNT(1) NUM FROM WRE_KEY_WORD WHERE ID <> ? AND KW IN (SELECT KW FROM WRE_KEY_WORD WHERE ID = ?) GROUP BY ID ) T ORDER BY NUM DESC LIMIT ?",
618
				new ResultSetExtractor<Map<String, Object>>() {
626
				new ResultSetExtractor<Map<String, Object>>() {
619
					@Override
627
					@Override
620
					public Map<String, Object> extractData(ResultSet rs) throws SQLException {
628
					public Map<String, Object> extractData(ResultSet rs) throws SQLException {
621
						Map<String, Object> map = new HashMap<String, Object>();
629
						Map<String, Object> map = new HashMap<String, Object>();
622
						map.put("id",rs.getString(1));
630
						map.put("id", rs.getString(1));
623
						map.put("num", rs.getLong(2));
631
						map.put("num", rs.getLong(2));
624
						return map;
632
						return map;
625
					}
633
					}
633
					}
641
					}
634
				});
642
				});
635
	}
643
	}
644

636
	@Get
645
	@Get
637
	@Path("/byOwnerWithPageViews")
646
	@Path("/byOwnerWithPageViews")
638
	public List<Ware> queryBySameKwWithPageViews(@JdbcConn Connection con,String category,String owner,@Nullable String id,int rows) throws SQLException{
647
	public List<Ware> queryBySameKwWithPageViews(@JdbcConn Connection con, String category, String owner, @Nullable String id, int rows) throws SQLException {
639
		return wareDao.queryByOwnerWithPageViews(con, category, owner, id, rows);
648
		return wareDao.queryByOwnerWithPageViews(con, category, owner, id, rows);
640
	}
649
	}
650

641
	@Get
651
	@Get
642
	@Path("/byResourceWithModifyTime")
652
	@Path("/byResourceWithModifyTime")
643
	public List<Ware> queryByResourceWithModifyTime(@JdbcConn Connection con,String id,int rows) throws SQLException{
653
	public List<Ware> queryByResourceWithModifyTime(@JdbcConn Connection con, String id, int rows) throws SQLException {
644
		return wareDao.queryByResource(con, id, rows);
654
		return wareDao.queryByResource(con, id, rows);
645
	}
655
	}
656

646
	@Get
657
	@Get
647
	@Path("/byArticle")
658
	@Path("/byArticle")
648
	public List<Ware> queryByArticle(@JdbcConn Connection con,String id,@DefaultValue("Integer.MAX_VALUE" ) int rows) throws SQLException{
659
	public List<Ware> queryByArticle(@JdbcConn Connection con, String id, @DefaultValue("Integer.MAX_VALUE") int rows) throws SQLException {
649
		return wareDao.queryByArticle(con, id, rows);
660
		return wareDao.queryByArticle(con, id, rows);
650
	}
661
	}
651
	
662

652
	//
663
	//
653
	// @Post
664
	// @Post
654
	// @Path("/update")
665
	// @Path("/update")