diff --git a/zheng-cms/zheng-cms-rpc-api/src/main/java/com/zheng/cms/rpc/api/CmsArticleService.java b/zheng-cms/zheng-cms-rpc-api/src/main/java/com/zheng/cms/rpc/api/CmsArticleService.java index c958dc89..64e09bd5 100644 --- a/zheng-cms/zheng-cms-rpc-api/src/main/java/com/zheng/cms/rpc/api/CmsArticleService.java +++ b/zheng-cms/zheng-cms-rpc-api/src/main/java/com/zheng/cms/rpc/api/CmsArticleService.java @@ -4,10 +4,24 @@ import com.zheng.common.base.BaseService; import com.zheng.cms.dao.model.CmsArticle; import com.zheng.cms.dao.model.CmsArticleExample; +import java.util.List; + /** * CmsArticleService接口 * Created by shuzheng on 2017/4/5. */ public interface CmsArticleService extends BaseService { + // 根据类目获取文章列表 + List selectCmsArticlesByCategoryId(Integer categoryId, Integer offset, Integer limit); + + // 根据类目获取文章数量 + long countByCategoryId(Integer categoryId); + + // 根据标签获取文章列表 + List selectCmsArticlesByTagId(Integer tagId, Integer offset, Integer limit); + + // 根据标签获取文章数量 + long countByTagId(Integer tagId); + } \ No newline at end of file diff --git a/zheng-cms/zheng-cms-rpc-api/src/main/java/com/zheng/cms/rpc/api/CmsArticleServiceMock.java b/zheng-cms/zheng-cms-rpc-api/src/main/java/com/zheng/cms/rpc/api/CmsArticleServiceMock.java index 26f79e3b..b0d3b7e9 100644 --- a/zheng-cms/zheng-cms-rpc-api/src/main/java/com/zheng/cms/rpc/api/CmsArticleServiceMock.java +++ b/zheng-cms/zheng-cms-rpc-api/src/main/java/com/zheng/cms/rpc/api/CmsArticleServiceMock.java @@ -4,6 +4,10 @@ import com.zheng.common.base.BaseServiceMock; import com.zheng.cms.dao.mapper.CmsArticleMapper; import com.zheng.cms.dao.model.CmsArticle; import com.zheng.cms.dao.model.CmsArticleExample; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; /** * 降级实现CmsArticleService接口 @@ -11,4 +15,30 @@ import com.zheng.cms.dao.model.CmsArticleExample; */ public class CmsArticleServiceMock extends BaseServiceMock implements CmsArticleService { + private static Logger _log = LoggerFactory.getLogger(CmsArticleServiceMock.class); + + @Override + public List selectCmsArticlesByCategoryId(Integer categoryId, Integer offset, Integer limit) { + _log.info("CmsArticleServiceMock => getCmsArticlesByCategoryId"); + return null; + } + + @Override + public long countByCategoryId(Integer categoryId) { + _log.info("CmsArticleServiceMock => countByCategoryId"); + return 0; + } + + @Override + public List selectCmsArticlesByTagId(Integer tagId, Integer offset, Integer limit) { + _log.info("CmsArticleServiceMock => getCmsArticlesByCategoryId"); + return null; + } + + @Override + public long countByTagId(Integer tagId) { + _log.info("CmsArticleServiceMock => countByTagId"); + return 0; + } + } diff --git a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleExtMapper.java b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleExtMapper.java new file mode 100644 index 00000000..03eb1594 --- /dev/null +++ b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleExtMapper.java @@ -0,0 +1,26 @@ +package com.zheng.cms.rpc.mapper; + +import com.zheng.cms.dao.model.CmsArticle; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 文章VOMapper + * Created by shuzheng on 2017/01/07. + */ +public interface CmsArticleExtMapper { + + int up(Integer articleId); + + int down(Integer articleId); + + List selectCmsArticlesByCategoryId(@Param("categoryId") Integer categoryId, @Param("offset") Integer offset, @Param("limit") Integer limit); + + long countByCategoryId(@Param("categoryId") Integer categoryId); + + List selectCmsArticlesByTagId(@Param("tagId") Integer tagId, @Param("offset") Integer offset, @Param("limit") Integer limit); + + long countByTagId(@Param("tagId") Integer tagId); + +} \ No newline at end of file diff --git a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleExtMapper.xml b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleExtMapper.xml new file mode 100644 index 00000000..2a86a09f --- /dev/null +++ b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleExtMapper.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleVOMapper.java b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleVOMapper.java deleted file mode 100644 index 2f0374c0..00000000 --- a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleVOMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.zheng.cms.rpc.mapper; - -/** - * 文章VOMapper - * Created by shuzheng on 2017/01/07. - */ -public interface CmsArticleVOMapper { - - int up(Integer articleId); - - int down(Integer articleId); - -} \ No newline at end of file diff --git a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleVOMapper.xml b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleVOMapper.xml deleted file mode 100644 index e2b0f0bb..00000000 --- a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsArticleVOMapper.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsCategoryVOMapper.java b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsCategoryExtMapper.java similarity index 80% rename from zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsCategoryVOMapper.java rename to zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsCategoryExtMapper.java index e1de07aa..4539aeb4 100644 --- a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsCategoryVOMapper.java +++ b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsCategoryExtMapper.java @@ -4,7 +4,7 @@ package com.zheng.cms.rpc.mapper; * 类目VOMapper * Created by shuzheng on 2017/01/07. */ -public interface CmsCategoryVOMapper { +public interface CmsCategoryExtMapper { int up(Integer articleId); diff --git a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsTagVOMapper.java b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsTagExtMapper.java similarity index 82% rename from zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsTagVOMapper.java rename to zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsTagExtMapper.java index 7f4b0521..4d39c2cc 100644 --- a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsTagVOMapper.java +++ b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/mapper/CmsTagExtMapper.java @@ -4,7 +4,7 @@ package com.zheng.cms.rpc.mapper; * 标签VOMapper * Created by shuzheng on 2017/01/07. */ -public interface CmsTagVOMapper { +public interface CmsTagExtMapper { int up(Integer articleId); diff --git a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/service/impl/CmsArticleServiceImpl.java b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/service/impl/CmsArticleServiceImpl.java index 88f25889..b4954876 100644 --- a/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/service/impl/CmsArticleServiceImpl.java +++ b/zheng-cms/zheng-cms-rpc-service/src/main/java/com/zheng/cms/rpc/service/impl/CmsArticleServiceImpl.java @@ -1,5 +1,6 @@ package com.zheng.cms.rpc.service.impl; +import com.zheng.cms.rpc.mapper.CmsArticleExtMapper; import com.zheng.common.annotation.BaseService; import com.zheng.common.base.BaseServiceImpl; import com.zheng.cms.dao.mapper.CmsArticleMapper; @@ -12,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; + /** * CmsArticleService实现 * Created by shuzheng on 2017/4/5. @@ -26,4 +29,27 @@ public class CmsArticleServiceImpl extends BaseServiceImpl selectCmsArticlesByCategoryId(Integer categoryId, Integer offset, Integer limit) { + return cmsArticleExtMapper.selectCmsArticlesByCategoryId(categoryId, offset, limit); + } + + @Override + public long countByCategoryId(Integer categoryId) { + return cmsArticleExtMapper.countByCategoryId(categoryId); + } + + @Override + public List selectCmsArticlesByTagId(Integer tagId, Integer offset, Integer limit) { + return cmsArticleExtMapper.selectCmsArticlesByTagId(tagId, offset, limit); + } + + @Override + public long countByTagId(Integer tagId) { + return cmsArticleExtMapper.countByTagId(tagId); + } + } \ No newline at end of file diff --git a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/ArticleController.java b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/ArticleController.java deleted file mode 100644 index b3161a3a..00000000 --- a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/ArticleController.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.zheng.cms.web.controller; - -import com.zheng.cms.dao.model.CmsArticle; -import com.zheng.cms.dao.model.CmsComment; -import com.zheng.cms.dao.model.CmsCommentExample; -import com.zheng.cms.rpc.api.CmsArticleService; -import com.zheng.cms.rpc.api.CmsCommentService; -import com.zheng.common.base.BaseController; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; - -import java.util.List; - -/** - * 文章控制器 - * Created by shuzheng on 2017/3/26. - */ -@Controller -@RequestMapping(value = "/article") -public class ArticleController extends BaseController { - - private static Logger _log = LoggerFactory.getLogger(ArticleController.class); - - @Autowired - private CmsArticleService cmsArticleService; - - @Autowired - private CmsCommentService cmsCommentService; - - @RequestMapping(value = "/{articleId}", method = RequestMethod.GET) - public String index(@PathVariable("articleId") int articleId, Model model) { - CmsArticle article = cmsArticleService.selectByPrimaryKey(articleId); - model.addAttribute("article", article); - // 评论列表 - CmsCommentExample cmsCommentExample = new CmsCommentExample(); - cmsCommentExample.createCriteria() - .andArticleIdEqualTo(articleId) - .andStatusEqualTo((byte) 1); - cmsCommentExample.setOrderByClause("ctime desc"); - List comments = cmsCommentService.selectByExampleWithBLOBs(cmsCommentExample); - model.addAttribute("comments", comments); - return thymeleaf("/article/index"); - } - -} \ No newline at end of file diff --git a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/BlogController.java b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/BlogController.java index 09cb6ec5..c7ce1986 100644 --- a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/BlogController.java +++ b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/BlogController.java @@ -1,12 +1,22 @@ package com.zheng.cms.web.controller; +import com.zheng.cms.dao.model.*; +import com.zheng.cms.rpc.api.*; import com.zheng.common.base.BaseController; +import com.zheng.common.util.Paginator; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; /** * 博客首页控制器 @@ -17,10 +27,150 @@ import org.springframework.web.bind.annotation.RequestMethod; public class BlogController extends BaseController { private static Logger _log = LoggerFactory.getLogger(BlogController.class); + private static String CODE = "blog"; + + @Autowired + private CmsArticleService cmsArticleService; + + @Autowired + private CmsCategoryService cmsCategoryService; + + @Autowired + private CmsTagService cmsTagService; + + @Autowired + private CmsSystemService cmsSystemService; + + @Autowired + private CmsCommentService cmsCommentService; @RequestMapping(value = "", method = RequestMethod.GET) - public String index(Model model) { + public String index(@RequestParam(required = false, defaultValue = "1", value = "page") int page, + @RequestParam(required = false, defaultValue = "orders", value = "sort") String sort, + @RequestParam(required = false, defaultValue = "desc", value = "order") String order, + HttpServletRequest request, + Model model) { + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 该系统类目 + CmsCategoryExample cmsCategoryExample = new CmsCategoryExample(); + cmsCategoryExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()); + cmsCategoryExample.setOrderByClause("orders asc"); + List categories = cmsCategoryService.selectByExample(cmsCategoryExample); + model.addAttribute("categories", categories); + // 该系统标签 + CmsTagExample cmsTagExample = new CmsTagExample(); + cmsTagExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()); + cmsTagExample.setOrderByClause("orders asc"); + List tags = cmsTagService.selectByExample(cmsTagExample); + model.addAttribute("tags", tags); + // 该系统文章列表 + int rows = 10; + CmsArticleExample cmsArticleExample = new CmsArticleExample(); + cmsArticleExample.createCriteria() + .andStatusEqualTo((byte) 1) + .andSystemIdEqualTo(system.getSystemId()); + cmsArticleExample.setOffset((page - 1) * rows); + cmsArticleExample.setLimit(rows); + if (!StringUtils.isBlank(sort) && !StringUtils.isBlank(order)) { + cmsArticleExample.setOrderByClause(sort + " " + order); + } + List articles = cmsArticleService.selectByExample(cmsArticleExample); + model.addAttribute("articles", articles); + // 文章总数 + long total = cmsArticleService.countByExample(cmsArticleExample); + // 分页 + Paginator paginator = new Paginator(total, page, rows, request); + model.addAttribute("paginator", paginator); return thymeleaf("/blog/index"); } + @RequestMapping(value = "/category/{alias}", method = RequestMethod.GET) + public String category(@PathVariable("alias") String alias, + @RequestParam(required = false, defaultValue = "1", value = "page") int page, + HttpServletRequest request, + Model model) { + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 当前类目 + CmsCategoryExample cmsCategoryExample = new CmsCategoryExample(); + cmsCategoryExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()) + .andAliasEqualTo(alias); + CmsCategory category = cmsCategoryService.selectFirstByExample(cmsCategoryExample); + model.addAttribute("category", category); + // 该类目文章列表 + int rows = 10; + List articles = cmsArticleService.selectCmsArticlesByCategoryId(category.getCategoryId(), (page - 1) * rows, rows); + model.addAttribute("articles", articles); + // 文章总数 + long total = cmsArticleService.countByCategoryId(category.getCategoryId()); + // 分页 + Paginator paginator = new Paginator(total, page, rows, request); + model.addAttribute("paginator", paginator); + return thymeleaf("/blog/category/index"); + } + + @RequestMapping(value = "/tag/{alias}", method = RequestMethod.GET) + public String tag(@PathVariable("alias") String alias, + @RequestParam(required = false, defaultValue = "1", value = "page") int page, + HttpServletRequest request, + Model model) { + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 当前标签 + CmsTagExample cmsTagExample = new CmsTagExample(); + cmsTagExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()) + .andAliasEqualTo(alias); + CmsTag tag = cmsTagService.selectFirstByExample(cmsTagExample); + model.addAttribute("tag", tag); + // 该标签文章列表 + int rows = 10; + List articles = cmsArticleService.selectCmsArticlesByTagId(tag.getTagId(), (page - 1) * rows, rows); + model.addAttribute("articles", articles); + // 文章总数 + long total = cmsArticleService.countByTagId(tag.getTagId()); + // 分页 + Paginator paginator = new Paginator(total, page, rows, request); + model.addAttribute("paginator", paginator); + return thymeleaf("/blog/tag/index"); + } + + @RequestMapping(value = "/details/{articleId}", method = RequestMethod.GET) + public String details(@PathVariable("articleId") int articleId, Model model) { + CmsArticle article = cmsArticleService.selectByPrimaryKey(articleId); + model.addAttribute("article", article); + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 评论列表 + CmsCommentExample cmsCommentExample = new CmsCommentExample(); + cmsCommentExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()) + .andArticleIdEqualTo(articleId) + .andStatusEqualTo((byte) 1); + cmsCommentExample.setOrderByClause("ctime desc"); + List comments = cmsCommentService.selectByExampleWithBLOBs(cmsCommentExample); + model.addAttribute("comments", comments); + return thymeleaf("/blog/details/index"); + } + } \ No newline at end of file diff --git a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/CategoryController.java b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/CategoryController.java deleted file mode 100644 index 15642a8f..00000000 --- a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/CategoryController.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.zheng.cms.web.controller; - -import com.zheng.cms.dao.model.*; -import com.zheng.cms.rpc.api.*; -import com.zheng.common.base.BaseController; -import com.zheng.common.util.Paginator; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * 类目控制器 - * Created by shuzheng on 2017/3/26. - */ -@Controller -@RequestMapping(value = "/category") -public class CategoryController extends BaseController { - - private static Logger _log = LoggerFactory.getLogger(CategoryController.class); - - @Autowired - private CmsCategoryService cmsCategoryService; - - @Autowired - private CmsArticleService cmsArticleService; - - @RequestMapping(value = "/{alias}", method = RequestMethod.GET) - public String index(@PathVariable("alias") String alias, - @RequestParam(required = false, defaultValue = "1", value = "page") int page, - @RequestParam(required = false, defaultValue = "orders", value = "sort") String sort, - @RequestParam(required = false, defaultValue = "desc", value = "order") String order, - HttpServletRequest request, - Model model) { - // 当前类目 - CmsCategoryExample cmsCategoryExample = new CmsCategoryExample(); - cmsCategoryExample.createCriteria() - .andAliasEqualTo(alias); - CmsCategory category = cmsCategoryService.selectFirstByExample(cmsCategoryExample); - model.addAttribute("category", category); - // 该类目文章列表 - int rows = 10; - CmsArticleExample cmsArticleExample = new CmsArticleExample(); - cmsArticleExample.createCriteria() - .andStatusEqualTo((byte) 1); - cmsArticleExample.setOffset((page - 1) * rows); - cmsArticleExample.setLimit(rows); - if (!StringUtils.isBlank(sort) && !StringUtils.isBlank(order)) { - cmsArticleExample.setOrderByClause(sort + " " + order); - } - List articles = cmsArticleService.selectByExample(cmsArticleExample); - model.addAttribute("articles", articles); - // 文章总数 - long total = cmsArticleService.countByExample(cmsArticleExample); - // 分页 - Paginator paginator = new Paginator(total, page, rows, request); - model.addAttribute("paginator", paginator); - return thymeleaf("/category/index"); - } - -} \ No newline at end of file diff --git a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/IndexController.java b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/IndexController.java index 2fa03513..efeee0de 100644 --- a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/IndexController.java +++ b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/IndexController.java @@ -32,18 +32,15 @@ public class IndexController extends BaseController { private CmsTagService cmsTagService; @Autowired - private CmsTopicService cmsTopicService; - - @Autowired - private CmsArticleService cmsArticleService; + private CmsSystemService cmsSystemService; @RequestMapping(value = "", method = RequestMethod.GET) public String index(Model model) { - // 菜单 - CmsMenuExample cmsMenuExample = new CmsMenuExample(); - cmsMenuExample.setOrderByClause("orders asc"); - List menus = cmsMenuService.selectByExample(cmsMenuExample); - model.addAttribute("menus", menus); + // 所有系统 + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.setOrderByClause("orders asc"); + List systems = cmsSystemService.selectByExample(cmsSystemExample); + model.addAttribute("systems", systems); // 所有类目 CmsCategoryExample cmsCategoryExample = new CmsCategoryExample(); cmsCategoryExample.setOrderByClause("orders asc"); @@ -54,22 +51,6 @@ public class IndexController extends BaseController { cmsTagExample.setOrderByClause("orders asc"); List tags = cmsTagService.selectByExample(cmsTagExample); model.addAttribute("tags", tags); - // 最新5个专题 - CmsTopicExample cmsTopicExample = new CmsTopicExample(); - cmsTopicExample.setOrderByClause("ctime desc"); - List topics = cmsTopicService.selectByExample(cmsTopicExample); - model.addAttribute("topics", topics); - // 最新5条文章 - CmsArticleExample cmsArticleExample = new CmsArticleExample(); - cmsArticleExample.createCriteria() - .andStatusEqualTo((byte) 1); - cmsArticleExample.setOrderByClause("orders desc"); - List newArticles = cmsArticleService.selectByExample(cmsArticleExample); - model.addAttribute("newArticles", newArticles); - // 最火5条文章 - cmsArticleExample.setOrderByClause("readnumber desc"); - List hotArticles = cmsArticleService.selectByExample(cmsArticleExample); - model.addAttribute("hotArticles", hotArticles); return thymeleaf("/index"); } diff --git a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/NewsController.java b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/NewsController.java index 30b675c6..0a4652c6 100644 --- a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/NewsController.java +++ b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/NewsController.java @@ -1,12 +1,22 @@ package com.zheng.cms.web.controller; +import com.zheng.cms.dao.model.*; +import com.zheng.cms.rpc.api.*; import com.zheng.common.base.BaseController; +import com.zheng.common.util.Paginator; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; /** * 资讯首页控制器 @@ -17,10 +27,150 @@ import org.springframework.web.bind.annotation.RequestMethod; public class NewsController extends BaseController { private static Logger _log = LoggerFactory.getLogger(NewsController.class); + private static String CODE = "news"; + + @Autowired + private CmsArticleService cmsArticleService; + + @Autowired + private CmsCategoryService cmsCategoryService; + + @Autowired + private CmsTagService cmsTagService; + + @Autowired + private CmsSystemService cmsSystemService; + + @Autowired + private CmsCommentService cmsCommentService; @RequestMapping(value = "", method = RequestMethod.GET) - public String index(Model model) { + public String index(@RequestParam(required = false, defaultValue = "1", value = "page") int page, + @RequestParam(required = false, defaultValue = "orders", value = "sort") String sort, + @RequestParam(required = false, defaultValue = "desc", value = "order") String order, + HttpServletRequest request, + Model model) { + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 该系统类目 + CmsCategoryExample cmsCategoryExample = new CmsCategoryExample(); + cmsCategoryExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()); + cmsCategoryExample.setOrderByClause("orders asc"); + List categories = cmsCategoryService.selectByExample(cmsCategoryExample); + model.addAttribute("categories", categories); + // 该系统标签 + CmsTagExample cmsTagExample = new CmsTagExample(); + cmsTagExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()); + cmsTagExample.setOrderByClause("orders asc"); + List tags = cmsTagService.selectByExample(cmsTagExample); + model.addAttribute("tags", tags); + // 该系统文章列表 + int rows = 10; + CmsArticleExample cmsArticleExample = new CmsArticleExample(); + cmsArticleExample.createCriteria() + .andStatusEqualTo((byte) 1) + .andSystemIdEqualTo(system.getSystemId()); + cmsArticleExample.setOffset((page - 1) * rows); + cmsArticleExample.setLimit(rows); + if (!StringUtils.isBlank(sort) && !StringUtils.isBlank(order)) { + cmsArticleExample.setOrderByClause(sort + " " + order); + } + List articles = cmsArticleService.selectByExample(cmsArticleExample); + model.addAttribute("articles", articles); + // 文章总数 + long total = cmsArticleService.countByExample(cmsArticleExample); + // 分页 + Paginator paginator = new Paginator(total, page, rows, request); + model.addAttribute("paginator", paginator); return thymeleaf("/news/index"); } + @RequestMapping(value = "/category/{alias}", method = RequestMethod.GET) + public String category(@PathVariable("alias") String alias, + @RequestParam(required = false, defaultValue = "1", value = "page") int page, + HttpServletRequest request, + Model model) { + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 当前类目 + CmsCategoryExample cmsCategoryExample = new CmsCategoryExample(); + cmsCategoryExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()) + .andAliasEqualTo(alias); + CmsCategory category = cmsCategoryService.selectFirstByExample(cmsCategoryExample); + model.addAttribute("category", category); + // 该类目文章列表 + int rows = 10; + List articles = cmsArticleService.selectCmsArticlesByCategoryId(category.getCategoryId(), (page - 1) * rows, rows); + model.addAttribute("articles", articles); + // 文章总数 + long total = cmsArticleService.countByCategoryId(category.getCategoryId()); + // 分页 + Paginator paginator = new Paginator(total, page, rows, request); + model.addAttribute("paginator", paginator); + return thymeleaf("/news/category/index"); + } + + @RequestMapping(value = "/tag/{alias}", method = RequestMethod.GET) + public String tag(@PathVariable("alias") String alias, + @RequestParam(required = false, defaultValue = "1", value = "page") int page, + HttpServletRequest request, + Model model) { + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 当前标签 + CmsTagExample cmsTagExample = new CmsTagExample(); + cmsTagExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()) + .andAliasEqualTo(alias); + CmsTag tag = cmsTagService.selectFirstByExample(cmsTagExample); + model.addAttribute("tag", tag); + // 该标签文章列表 + int rows = 10; + List articles = cmsArticleService.selectCmsArticlesByTagId(tag.getTagId(), (page - 1) * rows, rows); + model.addAttribute("articles", articles); + // 文章总数 + long total = cmsArticleService.countByTagId(tag.getTagId()); + // 分页 + Paginator paginator = new Paginator(total, page, rows, request); + model.addAttribute("paginator", paginator); + return thymeleaf("/news/tag/index"); + } + + @RequestMapping(value = "/article/{articleId}", method = RequestMethod.GET) + public String article(@PathVariable("articleId") int articleId, Model model) { + CmsArticle article = cmsArticleService.selectByPrimaryKey(articleId); + model.addAttribute("article", article); + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 评论列表 + CmsCommentExample cmsCommentExample = new CmsCommentExample(); + cmsCommentExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()) + .andArticleIdEqualTo(articleId) + .andStatusEqualTo((byte) 1); + cmsCommentExample.setOrderByClause("ctime desc"); + List comments = cmsCommentService.selectByExampleWithBLOBs(cmsCommentExample); + model.addAttribute("comments", comments); + return thymeleaf("/news/article/index"); + } + } \ No newline at end of file diff --git a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/QaController.java b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/QaController.java index 12612deb..bd7e16c3 100644 --- a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/QaController.java +++ b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/QaController.java @@ -1,12 +1,22 @@ package com.zheng.cms.web.controller; +import com.zheng.cms.dao.model.*; +import com.zheng.cms.rpc.api.*; import com.zheng.common.base.BaseController; +import com.zheng.common.util.Paginator; +import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; /** * 问答首页控制器 @@ -17,10 +27,150 @@ import org.springframework.web.bind.annotation.RequestMethod; public class QaController extends BaseController { private static Logger _log = LoggerFactory.getLogger(QaController.class); + private static String CODE = "qa"; + + @Autowired + private CmsArticleService cmsArticleService; + + @Autowired + private CmsCategoryService cmsCategoryService; + + @Autowired + private CmsTagService cmsTagService; + + @Autowired + private CmsSystemService cmsSystemService; + + @Autowired + private CmsCommentService cmsCommentService; @RequestMapping(value = "", method = RequestMethod.GET) - public String index(Model model) { + public String index(@RequestParam(required = false, defaultValue = "1", value = "page") int page, + @RequestParam(required = false, defaultValue = "orders", value = "sort") String sort, + @RequestParam(required = false, defaultValue = "desc", value = "order") String order, + HttpServletRequest request, + Model model) { + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 该系统类目 + CmsCategoryExample cmsCategoryExample = new CmsCategoryExample(); + cmsCategoryExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()); + cmsCategoryExample.setOrderByClause("orders asc"); + List categories = cmsCategoryService.selectByExample(cmsCategoryExample); + model.addAttribute("categories", categories); + // 该系统标签 + CmsTagExample cmsTagExample = new CmsTagExample(); + cmsTagExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()); + cmsTagExample.setOrderByClause("orders asc"); + List tags = cmsTagService.selectByExample(cmsTagExample); + model.addAttribute("tags", tags); + // 该系统文章列表 + int rows = 10; + CmsArticleExample cmsArticleExample = new CmsArticleExample(); + cmsArticleExample.createCriteria() + .andStatusEqualTo((byte) 1) + .andSystemIdEqualTo(system.getSystemId()); + cmsArticleExample.setOffset((page - 1) * rows); + cmsArticleExample.setLimit(rows); + if (!StringUtils.isBlank(sort) && !StringUtils.isBlank(order)) { + cmsArticleExample.setOrderByClause(sort + " " + order); + } + List articles = cmsArticleService.selectByExample(cmsArticleExample); + model.addAttribute("articles", articles); + // 文章总数 + long total = cmsArticleService.countByExample(cmsArticleExample); + // 分页 + Paginator paginator = new Paginator(total, page, rows, request); + model.addAttribute("paginator", paginator); return thymeleaf("/qa/index"); } + @RequestMapping(value = "/category/{alias}", method = RequestMethod.GET) + public String category(@PathVariable("alias") String alias, + @RequestParam(required = false, defaultValue = "1", value = "page") int page, + HttpServletRequest request, + Model model) { + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 当前类目 + CmsCategoryExample cmsCategoryExample = new CmsCategoryExample(); + cmsCategoryExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()) + .andAliasEqualTo(alias); + CmsCategory category = cmsCategoryService.selectFirstByExample(cmsCategoryExample); + model.addAttribute("category", category); + // 该类目文章列表 + int rows = 10; + List articles = cmsArticleService.selectCmsArticlesByCategoryId(category.getCategoryId(), (page - 1) * rows, rows); + model.addAttribute("articles", articles); + // 文章总数 + long total = cmsArticleService.countByCategoryId(category.getCategoryId()); + // 分页 + Paginator paginator = new Paginator(total, page, rows, request); + model.addAttribute("paginator", paginator); + return thymeleaf("/qa/category/index"); + } + + @RequestMapping(value = "/tag/{alias}", method = RequestMethod.GET) + public String tag(@PathVariable("alias") String alias, + @RequestParam(required = false, defaultValue = "1", value = "page") int page, + HttpServletRequest request, + Model model) { + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 当前标签 + CmsTagExample cmsTagExample = new CmsTagExample(); + cmsTagExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()) + .andAliasEqualTo(alias); + CmsTag tag = cmsTagService.selectFirstByExample(cmsTagExample); + model.addAttribute("tag", tag); + // 该标签文章列表 + int rows = 10; + List articles = cmsArticleService.selectCmsArticlesByTagId(tag.getTagId(), (page - 1) * rows, rows); + model.addAttribute("articles", articles); + // 文章总数 + long total = cmsArticleService.countByTagId(tag.getTagId()); + // 分页 + Paginator paginator = new Paginator(total, page, rows, request); + model.addAttribute("paginator", paginator); + return thymeleaf("/qa/tag/index"); + } + + @RequestMapping(value = "/question/{articleId}", method = RequestMethod.GET) + public String question(@PathVariable("articleId") int articleId, Model model) { + CmsArticle article = cmsArticleService.selectByPrimaryKey(articleId); + model.addAttribute("article", article); + // 系统id + CmsSystemExample cmsSystemExample = new CmsSystemExample(); + cmsSystemExample.createCriteria() + .andCodeEqualTo(CODE); + CmsSystem system = cmsSystemService.selectFirstByExample(cmsSystemExample); + model.addAttribute("system", system); + // 评论列表 + CmsCommentExample cmsCommentExample = new CmsCommentExample(); + cmsCommentExample.createCriteria() + .andSystemIdEqualTo(system.getSystemId()) + .andArticleIdEqualTo(articleId) + .andStatusEqualTo((byte) 1); + cmsCommentExample.setOrderByClause("ctime desc"); + List comments = cmsCommentService.selectByExampleWithBLOBs(cmsCommentExample); + model.addAttribute("comments", comments); + return thymeleaf("/qa/question/index"); + } + } \ No newline at end of file diff --git a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/TagController.java b/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/TagController.java deleted file mode 100644 index ed048e5a..00000000 --- a/zheng-cms/zheng-cms-web/src/main/java/com/zheng/cms/web/controller/TagController.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.zheng.cms.web.controller; - -import com.zheng.cms.dao.model.*; -import com.zheng.cms.rpc.api.CmsArticleService; -import com.zheng.cms.rpc.api.CmsCategoryService; -import com.zheng.cms.rpc.api.CmsTagService; -import com.zheng.cms.rpc.api.CmsTopicService; -import com.zheng.common.base.BaseController; -import com.zheng.common.util.Paginator; -import org.apache.commons.lang.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.ui.Model; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; - -import javax.servlet.http.HttpServletRequest; -import java.util.List; - -/** - * 标签控制器 - * Created by shuzheng on 2017/3/26. - */ -@Controller -@RequestMapping(value = "/tag") -public class TagController extends BaseController { - - private static Logger _log = LoggerFactory.getLogger(TagController.class); - - @Autowired - private CmsTagService cmsTagService; - - @Autowired - private CmsArticleService cmsArticleService; - - @RequestMapping(value = "/{alias}", method = RequestMethod.GET) - public String index(@PathVariable("alias") String alias, - @RequestParam(required = false, defaultValue = "1", value = "page") int page, - @RequestParam(required = false, defaultValue = "orders", value = "sort") String sort, - @RequestParam(required = false, defaultValue = "desc", value = "order") String order, - HttpServletRequest request, - Model model) { - // 当前标签 - CmsTagExample cmsTagExample = new CmsTagExample(); - cmsTagExample.createCriteria() - .andAliasEqualTo(alias); - CmsTag tag = cmsTagService.selectFirstByExample(cmsTagExample); - model.addAttribute("tag", tag); - // 该标签文章列表 - int rows = 10; - CmsArticleExample cmsArticleExample = new CmsArticleExample(); - cmsArticleExample.createCriteria() - .andStatusEqualTo((byte) 1); - cmsArticleExample.setOffset((page - 1) * rows); - cmsArticleExample.setLimit(rows); - if (!StringUtils.isBlank(sort) && !StringUtils.isBlank(order)) { - cmsArticleExample.setOrderByClause(sort + " " + order); - } - List articles = cmsArticleService.selectByExample(cmsArticleExample); - model.addAttribute("articles", articles); - // 文章总数 - long total = cmsArticleService.countByExample(cmsArticleExample); - // 分页 - Paginator paginator = new Paginator(total, page, rows, request); - model.addAttribute("paginator", paginator); - return thymeleaf("/tag/index"); - } - -} \ No newline at end of file diff --git a/zheng-ui/zheng-cms-web/blog/category/index.html b/zheng-ui/zheng-cms-web/blog/category/index.html new file mode 100644 index 00000000..e7068ec0 --- /dev/null +++ b/zheng-ui/zheng-cms-web/blog/category/index.html @@ -0,0 +1,109 @@ + + + + + 类目 - ZhengCms + + + + + + + + + + + + + + + + +
+
+
类目博文列表
+
博文标题
+
+
+
+ + +
+ Copyright © 2017 ZhangShuzheng All Rights Reserved +
+ + + + + + \ No newline at end of file diff --git a/zheng-ui/zheng-cms-web/article/index.html b/zheng-ui/zheng-cms-web/blog/details/index.html similarity index 84% rename from zheng-ui/zheng-cms-web/article/index.html rename to zheng-ui/zheng-cms-web/blog/details/index.html index 16a9e593..0055d4b5 100644 --- a/zheng-ui/zheng-cms-web/article/index.html +++ b/zheng-ui/zheng-cms-web/blog/details/index.html @@ -8,16 +8,16 @@ - - + + - + @@ -31,7 +31,7 @@ - zhengCMS + zhengCMS @@ -107,9 +107,9 @@ Copyright © 2017 ZhangShuzheng All Rights Reserved - - - + + + + + + + + + + +
+
+
标签博文列表
+
博文标题
+
+
+
+ + +
+ Copyright © 2017 ZhangShuzheng All Rights Reserved +
+ + + + + + \ No newline at end of file diff --git a/zheng-ui/zheng-cms-web/index.html b/zheng-ui/zheng-cms-web/index.html index cfe932f7..d6a53d09 100644 --- a/zheng-ui/zheng-cms-web/index.html +++ b/zheng-ui/zheng-cms-web/index.html @@ -90,25 +90,17 @@
+
+
所有系统
+
系统名称
+
所有类目
-
类目
+
类目
所有标签
-
标签
-
-
-
最新5个专题
-
专题
-
-
-
最新5条文章
-
文章标题
-
-
-
最热5个文章
-
文章标题
+
标签
diff --git a/zheng-ui/zheng-cms-web/news/article/index.html b/zheng-ui/zheng-cms-web/news/article/index.html new file mode 100644 index 00000000..0055d4b5 --- /dev/null +++ b/zheng-ui/zheng-cms-web/news/article/index.html @@ -0,0 +1,125 @@ + + + + + 标题 - ZhengCms + + + + + + + + + + + + + + + + +
+

标题

+
内容
+
+ + +
+
+
评论列表
+
评论内容
+
+
+ + +
+ Copyright © 2017 ZhangShuzheng All Rights Reserved +
+ + + + + + + \ No newline at end of file diff --git a/zheng-ui/zheng-cms-web/category/index.html b/zheng-ui/zheng-cms-web/news/category/index.html similarity index 80% rename from zheng-ui/zheng-cms-web/category/index.html rename to zheng-ui/zheng-cms-web/news/category/index.html index 33b35e13..8fabe343 100644 --- a/zheng-ui/zheng-cms-web/category/index.html +++ b/zheng-ui/zheng-cms-web/news/category/index.html @@ -8,16 +8,16 @@ - - + + - + @@ -31,7 +31,7 @@ - zhengCMS + zhengCMS @@ -92,7 +92,7 @@
类目文章列表
-
文章标题
+
文章标题
@@ -102,8 +102,8 @@ Copyright © 2017 ZhangShuzheng All Rights Reserved - - - + + + \ No newline at end of file diff --git a/zheng-ui/zheng-cms-web/news/index.html b/zheng-ui/zheng-cms-web/news/index.html index 67daf78f..e020f01a 100644 --- a/zheng-ui/zheng-cms-web/news/index.html +++ b/zheng-ui/zheng-cms-web/news/index.html @@ -90,7 +90,19 @@
- 资讯首页 +
+
资讯类目
+
类目
+
+
+
资讯标签
+
标签
+
+
+
资讯文章列表
+
文章标题
+
+
diff --git a/zheng-ui/zheng-cms-web/tag/index.html b/zheng-ui/zheng-cms-web/news/tag/index.html similarity index 80% rename from zheng-ui/zheng-cms-web/tag/index.html rename to zheng-ui/zheng-cms-web/news/tag/index.html index d578711a..e148a928 100644 --- a/zheng-ui/zheng-cms-web/tag/index.html +++ b/zheng-ui/zheng-cms-web/news/tag/index.html @@ -8,16 +8,16 @@ - - + + - + @@ -31,7 +31,7 @@ - zhengCMS + zhengCMS @@ -92,7 +92,7 @@
标签文章列表
-
文章标题
+
文章标题
@@ -102,8 +102,8 @@ Copyright © 2017 ZhangShuzheng All Rights Reserved - - - + + + \ No newline at end of file diff --git a/zheng-ui/zheng-cms-web/qa/category/index.html b/zheng-ui/zheng-cms-web/qa/category/index.html new file mode 100644 index 00000000..0268253f --- /dev/null +++ b/zheng-ui/zheng-cms-web/qa/category/index.html @@ -0,0 +1,109 @@ + + + + + 类目 - ZhengCms + + + + + + + + + + + + + + + + +
+
+
类目问题列表
+
问题标题
+
+
+
+ + +
+ Copyright © 2017 ZhangShuzheng All Rights Reserved +
+ + + + + + \ No newline at end of file diff --git a/zheng-ui/zheng-cms-web/qa/index.html b/zheng-ui/zheng-cms-web/qa/index.html index 4898892a..f5db82f8 100644 --- a/zheng-ui/zheng-cms-web/qa/index.html +++ b/zheng-ui/zheng-cms-web/qa/index.html @@ -90,7 +90,19 @@
- 问答首页 +
+
问答类目
+
类目
+
+
+
问答标签
+
标签
+
+
+
问答问题列表
+
问题标题
+
+
diff --git a/zheng-ui/zheng-cms-web/qa/question/index.html b/zheng-ui/zheng-cms-web/qa/question/index.html new file mode 100644 index 00000000..acd35708 --- /dev/null +++ b/zheng-ui/zheng-cms-web/qa/question/index.html @@ -0,0 +1,125 @@ + + + + + 标题 - ZhengCms + + + + + + + + + + + + + + + + +
+

标题

+
内容
+
+ + +
+
+
回答列表
+
回答内容
+
+
+ + +
+ Copyright © 2017 ZhangShuzheng All Rights Reserved +
+ + + + + + + \ No newline at end of file diff --git a/zheng-ui/zheng-cms-web/qa/tag/index.html b/zheng-ui/zheng-cms-web/qa/tag/index.html new file mode 100644 index 00000000..3a313ff1 --- /dev/null +++ b/zheng-ui/zheng-cms-web/qa/tag/index.html @@ -0,0 +1,109 @@ + + + + + 标签 - ZhengCms + + + + + + + + + + + + + + + + +
+
+
标签问题列表
+
问题标题
+
+
+
+ + +
+ Copyright © 2017 ZhangShuzheng All Rights Reserved +
+ + + + + + \ No newline at end of file diff --git a/zheng-ui/zheng-cms-web/search/index.html b/zheng-ui/zheng-cms-web/search/index.html index 9cb19979..dec6a623 100644 --- a/zheng-ui/zheng-cms-web/search/index.html +++ b/zheng-ui/zheng-cms-web/search/index.html @@ -92,7 +92,7 @@
搜索结果
-
文章标题
+
文章标题
diff --git a/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsUserService.java b/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsUserService.java index d14abadf..929e2c5f 100644 --- a/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsUserService.java +++ b/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsUserService.java @@ -10,4 +10,5 @@ import com.zheng.upms.dao.model.UpmsUserExample; */ public interface UpmsUserService extends BaseService { + UpmsUser insert2(UpmsUser upmsUser); } \ No newline at end of file diff --git a/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsUserServiceMock.java b/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsUserServiceMock.java index 5717df50..65982260 100644 --- a/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsUserServiceMock.java +++ b/zheng-upms/zheng-upms-rpc-api/src/main/java/com/zheng/upms/rpc/api/UpmsUserServiceMock.java @@ -11,4 +11,8 @@ import com.zheng.upms.dao.model.UpmsUserExample; */ public class UpmsUserServiceMock extends BaseServiceMock implements UpmsUserService { + @Override + public UpmsUser insert2(UpmsUser upmsUser) { + return null; + } } diff --git a/zheng-upms/zheng-upms-rpc-service/src/main/java/com/zheng/upms/rpc/service/impl/UpmsUserServiceImpl.java b/zheng-upms/zheng-upms-rpc-service/src/main/java/com/zheng/upms/rpc/service/impl/UpmsUserServiceImpl.java index 62d7c9fe..ab05c74d 100644 --- a/zheng-upms/zheng-upms-rpc-service/src/main/java/com/zheng/upms/rpc/service/impl/UpmsUserServiceImpl.java +++ b/zheng-upms/zheng-upms-rpc-service/src/main/java/com/zheng/upms/rpc/service/impl/UpmsUserServiceImpl.java @@ -26,4 +26,9 @@ public class UpmsUserServiceImpl extends BaseServiceImpl