Browse Source

news upload update

Antiloveg 8 years ago
parent
commit
e9a04b66bd

+ 5 - 2
src/main/java/com/goafanti/admin/controller/AdminNewsApiController.java

@@ -136,19 +136,22 @@ public class AdminNewsApiController extends BaseApiController {
 	}
 	
 	/**
-	 * 新闻图片上传
+	 * 新闻题图图片上传
 	 */
 	@RequestMapping(value = "/upload", method = RequestMethod.POST)
 	public Result upload(HttpServletRequest req, String sign) {
 		Result res = new Result();
 		AttachmentType attachmentType = AttachmentType.getField(sign);
-		if (attachmentType == AttachmentType.NEWS_PIC) {
+		if (attachmentType == AttachmentType.NEWS_TITLE_PICTURE ||
+				attachmentType == AttachmentType.NEWS_CONTENT_PICTURE) {
 			res.setData(handleFiles(res, "/news/", false, req, sign, TokenManager.getAdminId()));
 		} else {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "附件标示"));
 		}
 		return res;
 	}
+	
+	
 
 	private Result disposeInputNews(Result res, InputNews news, String createTimeFormattedDate) {
 		if (StringUtils.isBlank(news.getTitle())) {

+ 2 - 1
src/main/java/com/goafanti/common/enums/AttachmentType.java

@@ -41,7 +41,8 @@ public enum AttachmentType {
 	ACHIEVEMENT_TEMPLATE("achievement_template", "科技成果批量导入模板"),
 	DEMAND_ORDER_FILE("demand_order_file", "科技需求意向单/交易单附件"),
 	BANNERS_PIC("banners", "广告图片"),
-	NEWS_PIC("news", "新闻图片"),
+	NEWS_TITLE_PICTURE("news_title_picture", "新闻题图图片"),
+	NEWS_CONTENT_PICTURE("news_content_picture", "新闻内容图片"),
 	LECTURE_PICTURE("lecture_picture", "科技讲堂展示图片");