Parcourir la Source

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 7 ans auparavant
Parent
commit
7f51ee9a63

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

@ -977,5 +977,5 @@ public abstract class ArticleDao {
977 977

978 978
	@LimitSelect
979 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,8 +231,9 @@ public class WareService {
231 231
	 */
232 232
	@Post
233 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 237
		ware.setState("2");
237 238
		ware.setCategory("1");
238 239
		return insert(con, ware, null, resource);
@ -251,8 +252,9 @@ public class WareService {
251 252
	 */
252 253
	@Post
253 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 258
		ware.setState("2");
257 259
		ware.setCategory("2");
258 260
		return insert(con, ware, professor, resource);
@ -270,8 +272,9 @@ public class WareService {
270 272
	 */
271 273
	@Post
272 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 278
		ware.setState("1");
276 279
		ware.setCategory("1");
277 280
		return insert(con, ware, null, resource);
@ -290,8 +293,9 @@ public class WareService {
290 293
	 */
291 294
	@Post
292 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 299
		ware.setState("1");
296 300
		ware.setCategory("2");
297 301
		return insert(con, ware, professor, resource);
@ -309,8 +313,9 @@ public class WareService {
309 313
	 */
310 314
	@Post
311 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 319
		ware.setState("2");
315 320
		ware.setCategory("1");
316 321
		return update(con, ware, null, resource);
@ -329,8 +334,9 @@ public class WareService {
329 334
	 */
330 335
	@Post
331 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 340
		ware.setState("2");
335 341
		ware.setCategory("2");
336 342
		return update(con, ware, professor, resource);
@ -348,8 +354,9 @@ public class WareService {
348 354
	 */
349 355
	@Post
350 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 360
		ware.setState("1");
354 361
		ware.setCategory("1");
355 362
		return update(con, ware, null, resource);
@ -368,8 +375,9 @@ public class WareService {
368 375
	 */
369 376
	@Post
370 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 381
		ware.setState("1");
374 382
		ware.setCategory("2");
375 383
		return update(con, ware, professor, resource);
@ -614,12 +622,12 @@ public class WareService {
614 622
	@Path("/ralateWare")
615 623
	public List<Map<String, Object>> queryRalateWare(@JdbcConn Connection con, final String id, final int rows) throws SQLException {
616 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 626
				new ResultSetExtractor<Map<String, Object>>() {
619 627
					@Override
620 628
					public Map<String, Object> extractData(ResultSet rs) throws SQLException {
621 629
						Map<String, Object> map = new HashMap<String, Object>();
622
						map.put("id",rs.getString(1));
630
						map.put("id", rs.getString(1));
623 631
						map.put("num", rs.getLong(2));
624 632
						return map;
625 633
					}
@ -633,22 +641,25 @@ public class WareService {
633 641
					}
634 642
				});
635 643
	}
644

636 645
	@Get
637 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 648
		return wareDao.queryByOwnerWithPageViews(con, category, owner, id, rows);
640 649
	}
650

641 651
	@Get
642 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 654
		return wareDao.queryByResource(con, id, rows);
645 655
	}
656

646 657
	@Get
647 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 660
		return wareDao.queryByArticle(con, id, rows);
650 661
	}
651
	
662

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