Examples of PostType


Examples of com.freewebsys.blog.pojo.PostType

   */
  @Transactional
  public void deletePostTypeById(Long id) throws Exception {
    log.info("deletePostTypeById:" + id);
    try {
      PostType postType = (PostType) baseDao.findById(PostType.class, id);
      baseDao.delete(postType);
    } catch (Exception e) {
      log.info("PostType删除异常");
      e.printStackTrace();
    }
View Full Code Here

Examples of com.freewebsys.blog.pojo.PostType

        .getBean("postTypeService");
   
    OptionService optionService = (OptionService) applicationContext
        .getBean("optionService");
    try {
      PostType postType = postTypeService.findHomePostType();
      if (postType == null) {
        postType = new PostType();
        postType.setName("首页");
        postType.setIsHome(1);
        // 设置排序号
        postType.setOrderId(new Date().getTime());
        // 保存
        postTypeService.savePostType(postType);
      }
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of com.freewebsys.blog.pojo.PostType

  public String addPostType(HttpServletRequest request,
      HttpServletResponse response,
      @RequestParam(value = "id", required = false) Long id,
      ModelMap model) throws Exception {
    if (id != null) {
      PostType postType = postTypeService.findPostTypeById(id);
      model.addAttribute("postTypeAttribute", postType);
    } else {
      model.addAttribute("postTypeAttribute", new PostType());
    }
    return "/admin/postType/postTypeForm";
  }
View Full Code Here

Examples of sino.entities.PostType

    public ModelAndView viewPosts(@PathVariable("type") String type,
            @RequestParam(value = "page", required = false, defaultValue = "0") int pageNumber,
            HttpServletRequest httpServletRequest) throws PostServiceException {
        ParamUtility.checkNotNegative(null, pageNumber, "pageNumber");

        PostType postType = PostType.fromName(type);

        ModelAndView mov = new ModelAndView(postType == PostType.ACHIEVEMENTS ? this.viewAchievementsView
                : this.viewNewsView);
        mov.addObject("posts", getPostService().getAllPostsSortByDate(postType, pageNumber,
                postType == PostType.ACHIEVEMENTS ? this.achievementsSize : this.newsSize));
View Full Code Here

Examples of sino.entities.PostType

    public ModelAndView viewPosts(@PathVariable("type") String type,
            @RequestParam(value = "page", required = false, defaultValue = "0") int pageNumber)
            throws PostServiceException {
        ParamUtility.checkNotNegative(null, pageNumber, "pageNumber");

        PostType postType = PostType.fromName(type);

        ModelAndView mov = new ModelAndView(postType == PostType.ACHIEVEMENTS ? this.viewAchievementsView
                : this.viewNewsView);
        mov.addObject("posts", getPostService().getAllPostsSortByDate(postType, pageNumber,
                postType == PostType.ACHIEVEMENTS ? this.achievementsSize : this.newsSize));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.