Browse Source

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@753 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d

administrator 11 years ago
parent
commit
b4b7fe8b7d

+ 5 - 2
src/main/java/com/uas/platform/b2b/controller/NoticeController.java

@@ -2,6 +2,7 @@ package com.uas.platform.b2b.controller;
 
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.domain.Page;
 import org.springframework.data.domain.Page;
+import org.springframework.data.domain.Sort.Direction;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -21,7 +22,7 @@ import com.uas.platform.core.model.PageParams;
  * 
  * 
  */
  */
 @Controller
 @Controller
-@RequestMapping("/info/notice")
+@RequestMapping("/public/notice")
 public class NoticeController {
 public class NoticeController {
 
 
 	@Autowired
 	@Autowired
@@ -35,9 +36,11 @@ public class NoticeController {
 	@RequestMapping(method = RequestMethod.GET)
 	@RequestMapping(method = RequestMethod.GET)
 	@ResponseBody
 	@ResponseBody
 	public Page<Notice> getNotices(PageParams params) {
 	public Page<Notice> getNotices(PageParams params) {
+		PageInfo info = new PageInfo(params);
+		info.sorting("date", Direction.DESC);
 		return noticeService.findAllByPageInfo(new PageInfo(params));
 		return noticeService.findAllByPageInfo(new PageInfo(params));
 	}
 	}
-
+	
 	/**
 	/**
 	 * 系统公告正文详细
 	 * 系统公告正文详细
 	 * 
 	 * 

+ 0 - 25
src/main/java/com/uas/platform/b2b/controller/SnapshotController.java

@@ -1,25 +1,18 @@
 package com.uas.platform.b2b.controller;
 package com.uas.platform.b2b.controller;
 
 
-import java.util.List;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Sort.Direction;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.HttpStatus;
 import org.springframework.ui.ModelMap;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.bind.annotation.RestController;
 
 
-import com.uas.platform.b2b.model.Notice;
-import com.uas.platform.b2b.service.NoticeService;
 import com.uas.platform.b2b.service.PurchaseInquiryService;
 import com.uas.platform.b2b.service.PurchaseInquiryService;
 import com.uas.platform.b2b.service.PurchaseNoticeService;
 import com.uas.platform.b2b.service.PurchaseNoticeService;
 import com.uas.platform.b2b.service.PurchaseOrderChangeService;
 import com.uas.platform.b2b.service.PurchaseOrderChangeService;
 import com.uas.platform.b2b.service.PurchaseOrderService;
 import com.uas.platform.b2b.service.PurchaseOrderService;
-import com.uas.platform.core.model.PageInfo;
 
 
 /**
 /**
  * 平台消息、任务快照
  * 平台消息、任务快照
@@ -43,9 +36,6 @@ public class SnapshotController {
 	@Autowired
 	@Autowired
 	private PurchaseNoticeService purchaseNoticeService;
 	private PurchaseNoticeService purchaseNoticeService;
 
 
-	@Autowired
-	private NoticeService noticeService;
-
 	/**
 	/**
 	 * 统计待处理事项
 	 * 统计待处理事项
 	 * 
 	 * 
@@ -63,19 +53,4 @@ public class SnapshotController {
 		return modelMap;
 		return modelMap;
 	}
 	}
 
 
-	/**
-	 * 系统公告(取前count条)
-	 * 
-	 * @param count
-	 * @return
-	 */
-	@RequestMapping(value = "/notice", method = RequestMethod.GET, headers = "Accept=application/json")
-	@ResponseBody
-	@ResponseStatus(value = HttpStatus.OK)
-	public List<Notice> getNoticesSnapshot(@RequestParam("count") int count) {
-		PageInfo info = new PageInfo(1, count, 0);
-		info.sorting("date", Direction.DESC);
-		return noticeService.findAllByPageInfo(info).getContent();
-	}
-
 }
 }

+ 5 - 3
src/main/resources/spring/security.xml

@@ -8,13 +8,15 @@
           http://www.springframework.org/schema/security
           http://www.springframework.org/schema/security
           http://www.springframework.org/schema/security/spring-security-3.2.xsd">
           http://www.springframework.org/schema/security/spring-security-3.2.xsd">
 
 
-	<!-- 首页和静态资源不用过滤 -->
+	<!-- 静态资源不用过滤 -->
 	<http pattern="/**/static/**" security="none" />
 	<http pattern="/**/static/**" security="none" />
-	<!-- 登录页面不过滤 -->
+	<!-- 登录、注册页面不过滤 -->
 	<http pattern="/signin/**" security="none" />
 	<http pattern="/signin/**" security="none" />
 	<http pattern="/signup/**" security="none" />
 	<http pattern="/signup/**" security="none" />
+	<!-- 文件下载 -->
 	<http pattern="/file/**" security="none" />
 	<http pattern="/file/**" security="none" />
-	<http pattern="/snapshot/notice/**" security="none" />
+	<!-- 公开的信息 -->
+	<http pattern="/public/**" security="none" />
 
 
 	<http auto-config="true" use-expressions="true">
 	<http auto-config="true" use-expressions="true">
 		<!-- 登录配置 -->
 		<!-- 登录配置 -->

+ 1 - 1
src/main/webapp/resources/js/common/services.js

@@ -142,7 +142,7 @@ define([ 'angular', 'toaster' ], function(angular) {
 				});
 				});
 			},
 			},
 			getNotice : function(count, success) {
 			getNotice : function(count, success) {
-				var request = $http.get(rootPath + '/snapshot/notice?count='+count);
+				var request = $http.get(rootPath + '/public/notice?page=1&count='+count);
 				request.success(function(data){
 				request.success(function(data){
 					success.call(null, data);
 					success.call(null, data);
 				});
 				});