@return 大于0修改成功,否则为失败
*/
public Integer deleteLogicById(Serializable id);
-
+
+ public boolean create(ContentArticles conArti);
}
diff --git a/parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentArticlesServiceImpl.java b/parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentArticlesServiceImpl.java
index 53e8ecd..33423fd 100644
--- a/parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentArticlesServiceImpl.java
+++ b/parent/base.common/src/main/java/com/lyms/base/common/service/content/impl/ContentArticlesServiceImpl.java
@@ -5,8 +5,10 @@ import com.lyms.base.common.dao.content.ContentArticlesMapper;
import com.lyms.base.common.entity.content.ContentArticles;
import com.lyms.base.common.service.content.ContentArticlesService;
import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
+import java.util.Date;
/**
*
@@ -22,4 +24,14 @@ public class ContentArticlesServiceImpl extends ServiceImpl 0;
+ }
}
diff --git a/parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentArticlesController.java b/parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentArticlesController.java
index 31774e7..7742bea 100644
--- a/parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentArticlesController.java
+++ b/parent/center.manager/src/main/java/com/lyms/cm/controller/content/ContentArticlesController.java
@@ -1,9 +1,17 @@
package com.lyms.cm.controller.content;
+import com.lyms.base.common.entity.content.ContentArticles;
+import com.lyms.base.common.service.content.ContentArticlesService;
+import com.lyms.base.common.vo.content.ContentArticlesVO;
+import com.lyms.constants.OperationName;
+import com.lyms.util.StrUtils;
+import com.lyms.web.bean.AjaxResult;
import com.lyms.web.controller.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
/**
*
@@ -16,7 +24,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("/contentArticles")
public class ContentArticlesController extends BaseController {
-
+ @Autowired
+ private ContentArticlesService contentArticlesService;
+
/**
* 跳转到新增页面
*
@@ -36,5 +46,29 @@ public class ContentArticlesController extends BaseController {
public String toList() {
return "/articles/articles_list";
}
+
+ @ResponseBody
+ @RequestMapping(value = "/create", method = { RequestMethod.POST })
+ public AjaxResult create(ContentArticlesVO cav, AjaxResult ajaxResult) {
+ ContentArticles conArti = new ContentArticles();
+
+ conArti.setId(StrUtils.uuid());
+ conArti.setCategoryId(cav.getCategoryId());
+ conArti.setType(cav.getType());
+ conArti.setWeight(cav.getWeight());
+ conArti.setImage(cav.getImage());
+ conArti.setTitle(cav.getTitle());
+ conArti.setIntroduction(cav.getIntroduction());
+ conArti.setContentType(cav.getContentType());
+ conArti.setContent(cav.getContent());
+ conArti.setLink(cav.getLink());
+
+ for (String tags:cav.getTags()){
+
+
+ }
+ boolean tag = contentArticlesService.create(conArti);
+ return handleAjaxResult(ajaxResult, true, OperationName.CREATE);
+ }
}
diff --git a/parent/center.manager/src/main/webapp/WEB-INF/views/articles/articles_edit.html b/parent/center.manager/src/main/webapp/WEB-INF/views/articles/articles_edit.html
index f96b308..b65b4e6 100644
--- a/parent/center.manager/src/main/webapp/WEB-INF/views/articles/articles_edit.html
+++ b/parent/center.manager/src/main/webapp/WEB-INF/views/articles/articles_edit.html
@@ -3,12 +3,17 @@
#select6 {
width: 100%;
height: 36px;
+
}
-
-
-
+/*
+.tagsClass{
+ width: 100%;
+ height: 36px;
+ min-height:36px;
+}*/
+