Commit d9ad22de authored by Huang's avatar Huang
Browse files

no commit message

parent c235571d
@echo off
rem /**
rem */
echo.
echo [Ϣ] packageļ
echo.
cd /d %~dp0
cd..
xcopy src\main\webapp\*.* ..\jeespring-web\src\main\webapp /s /e /y
cd bin
pause
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jeespring</groupId>
<artifactId>jeespring-cms</artifactId>
<name>jeespring-cms</name>
<description>jeespring-cms</description>
<version>1.0.0</version>
<packaging>jar</packaging>
<parent>
<groupId>com.jeespring</groupId>
<artifactId>jeespring</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<dependencies>
<dependency>
<groupId>com.jeespring</groupId>
<artifactId>jeespring-framework</artifactId>
<version>1.0.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
</project>
\ No newline at end of file
ģsql
\ No newline at end of file
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.dao;
import java.util.List;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.common.persistence.annotation.MyBatisDao;
import com.jeespring.modules.cms.entity.Article;
import com.jeespring.modules.cms.entity.Category;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章DAO接口
* @author JeeSpring
* @version 2013-8-23
*/
@Mapper
public interface ArticleDao extends InterfaceBaseDao<Article> {
public List<Article> findByIdIn(String[] ids);
// {
// return find("from Article where id in (:p1)", new Parameter(new Object[]{ids}));
// }
public int updateHitsAddOne(String id);
// {
// return update("update Article set hits=hits+1 where id = :p1", new Parameter(id));
// }
public int updateExpiredWeight(Article article);
public List<Category> findStats(Category category);
// {
// return update("update Article set weight=0 where weight > 0 and weightDate < current_timestamp()");
// }
}
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.dao;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.common.persistence.annotation.MyBatisDao;
import com.jeespring.modules.cms.entity.ArticleData;
import org.apache.ibatis.annotations.Mapper;
/**
* 文章DAO接口
* @author JeeSpring
* @version 2013-8-23
*/
@Mapper
public interface ArticleDataDao extends InterfaceBaseDao<ArticleData> {
}
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.dao;
import java.util.List;
import java.util.Map;
import com.jeespring.common.persistence.TreeDao;
import com.jeespring.common.persistence.annotation.MyBatisDao;
import com.jeespring.modules.cms.entity.Category;
import org.apache.ibatis.annotations.Mapper;
/**
* 栏目DAO接口
* @author JeeSpring
* @version 2013-8-23
*/
@Mapper
public interface CategoryDao extends TreeDao<Category> {
public List<Category> findModule(Category category);
// public List<Category> findByParentIdsLike(Category category);
// {
// return find("from Category where parentIds like :p1", new Parameter(parentIds));
// }
public List<Category> findByModule(String module);
// {
// return find("from Category where delFlag=:p1 and (module='' or module=:p2) order by site.id, sort",
// new Parameter(Category.DEL_FLAG_NORMAL, module));
// }
public List<Category> findByParentId(String parentId, String isMenu);
// {
// return find("from Category where delFlag=:p1 and parent.id=:p2 and inMenu=:p3 order by site.id, sort",
// new Parameter(Category.DEL_FLAG_NORMAL, parentId, isMenu));
// }
public List<Category> findByParentIdAndSiteId(Category entity);
public List<Map<String, Object>> findStats(String sql);
// {
// return find("from Category where delFlag=:p1 and parent.id=:p2 and site.id=:p3 order by site.id, sort",
// new Parameter(Category.DEL_FLAG_NORMAL, parentId, siteId));
// }
//public List<Category> findByIdIn(String[] ids);
// {
// return find("from Category where id in (:p1)", new Parameter(new Object[]{ids}));
// }
//public List<Category> find(Category category);
// @Query("select distinct c from Category c, Role r, User u where c in elements (r.categoryList) and r in elements (u.roleList)" +
// " and c.delFlag='" + Category.DEL_FLAG_NORMAL + "' and r.delFlag='" + Role.DEL_FLAG_NORMAL +
// "' and u.delFlag='" + User.DEL_FLAG_NORMAL + "' and u.id=?1 or (c.user.id=?1 and c.delFlag='" + Category.DEL_FLAG_NORMAL +
// "') order by c.site.id, c.sort")
// public List<Category> findByUserId(Long userId);
}
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.dao;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.common.persistence.annotation.MyBatisDao;
import com.jeespring.modules.cms.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
/**
* 评论DAO接口
* @author JeeSpring
* @version 2013-8-23
*/
@Mapper
public interface CommentDao extends InterfaceBaseDao<Comment> {
}
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.dao;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.common.persistence.annotation.MyBatisDao;
import com.jeespring.modules.cms.entity.Guestbook;
import org.apache.ibatis.annotations.Mapper;
/**
* 留言DAO接口
* @author JeeSpring
* @version 2013-8-23
*/
@Mapper
public interface GuestbookDao extends InterfaceBaseDao<Guestbook> {
}
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.dao;
import java.util.List;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.common.persistence.annotation.MyBatisDao;
import com.jeespring.modules.cms.entity.Link;
import org.apache.ibatis.annotations.Mapper;
/**
* 链接DAO接口
* @author JeeSpring
* @version 2013-8-23
*/
@Mapper
public interface LinkDao extends InterfaceBaseDao<Link> {
public List<Link> findByIdIn(String[] ids);
// {
// return find("front Like where id in (:p1)", new Parameter(new Object[]{ids}));
// }
public int updateExpiredWeight(Link link);
// {
// return update("update Link set weight=0 where weight > 0 and weightDate < current_timestamp()");
// }
// public List<Link> fjindListByEntity();
}
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.dao;
import com.jeespring.common.persistence.InterfaceBaseDao;
import com.jeespring.common.persistence.annotation.MyBatisDao;
import com.jeespring.modules.cms.entity.Site;
import org.apache.ibatis.annotations.Mapper;
/**
* 站点DAO接口
* @author JeeSpring
* @version 2013-8-23
*/
@Mapper
public interface SiteDao extends InterfaceBaseDao<Site> {
}
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.entity;
import java.util.Date;
import java.util.List;
import javax.validation.constraints.NotNull;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;
import com.jeespring.modules.sys.entity.User;
import com.google.common.collect.Lists;
import com.jeespring.common.persistence.AbstractBaseEntity;
import com.jeespring.modules.cms.utils.CmsUtils;
/**
* 文章Entity
* @author JeeSpring
* @version 2013-05-15
*/
public class Article extends AbstractBaseEntity<Article> {
public static final String DEFAULT_TEMPLATE = "frontViewArticle";
private static final long serialVersionUID = 1L;
private Category category;// 分类编号
private String title; // 标题
private String link; // 外部链接
private String color; // 标题颜色(red:红色;green:绿色;blue:蓝色;yellow:黄色;orange:橙色)
private String image; // 文章图片
private String keywords;// 关键字
private String description;// 描述、摘要
private Integer weight; // 权重,越大越靠前
private Date weightDate;// 权重期限,超过期限,将weight设置为0
private Integer hits; // 点击数
private String posid; // 推荐位,多选(1:首页焦点图;2:栏目页文章推荐;)
private String customContentView; // 自定义内容视图
private String viewConfig; // 视图参数
private ArticleData articleData; //文章副表
private Date beginDate; // 开始时间
private Date endDate; // 结束时间
private User user;
public Article() {
super();
this.weight = 0;
this.hits = 0;
this.posid = "";
}
public Article(String id){
this();
this.id = id;
}
public Article(Category category){
this();
this.category = category;
}
public void prePersist(){
//TODO 后续处理,暂不知有何用处
//super.prePersist();
articleData.setId(this.id);
}
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Length(min=0, max=255)
public String getLink() {
return link;
}
public void setLink(String link) {
this.link = link;
}
@Length(min=0, max=50)
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@Length(min=0, max=255)
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;//CmsUtils.formatImageSrcToDb(image);
}
@Length(min=0, max=255)
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
@Length(min=0, max=255)
public String getDescription() {
return description;
}
public Date getBeginDate() {
return beginDate;
}
public void setBeginDate(Date beginDate) {
this.beginDate = beginDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public void setDescription(String description) {
this.description = description;
}
@NotNull
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
public Date getWeightDate() {
return weightDate;
}
public void setWeightDate(Date weightDate) {
this.weightDate = weightDate;
}
public Integer getHits() {
return hits;
}
public void setHits(Integer hits) {
this.hits = hits;
}
@Length(min=0, max=10)
public String getPosid() {
return posid;
}
public void setPosid(String posid) {
this.posid = posid;
}
public String getCustomContentView() {
return customContentView;
}
public void setCustomContentView(String customContentView) {
this.customContentView = customContentView;
}
public String getViewConfig() {
return viewConfig;
}
public void setViewConfig(String viewConfig) {
this.viewConfig = viewConfig;
}
public ArticleData getArticleData() {
return articleData;
}
public void setArticleData(ArticleData articleData) {
this.articleData = articleData;
}
public List<String> getPosidList() {
List<String> list = Lists.newArrayList();
if (posid != null){
for (String s : StringUtils.split(posid, ",")) {
list.add(s);
}
}
return list;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public void setPosidList(List<String> list) {
posid = ","+StringUtils.join(list, ",")+",";
}
public String getUrl() {
return CmsUtils.getUrlDynamic(this);
}
public String getImageSrc() {
return CmsUtils.formatImageSrcToWeb(this.image);
}
}
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.entity;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import com.jeespring.common.config.Global;
import com.jeespring.common.persistence.AbstractBaseEntity;
/**
* 文章Entity
* @author JeeSpring
* @version 2013-01-15
*/
public class ArticleData extends AbstractBaseEntity<ArticleData> {
private static final long serialVersionUID = 1L;
private String id; // 编号
private String content; // 内容
private String copyfrom;// 来源
private String relation;// 相关文章
private String allowComment;// 是否允许评论
private Article article;
public ArticleData() {
super();
this.allowComment = Global.YES;
}
public ArticleData(String id){
this();
this.id = id;
}
@Override
public String getId() {
return id;
}
@Override
public void setId(String id) {
this.id = id;
}
@NotBlank
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Length(min=0, max=255)
public String getCopyfrom() {
return copyfrom;
}
public void setCopyfrom(String copyfrom) {
this.copyfrom = copyfrom;
}
@Length(min=0, max=255)
public String getRelation() {
return relation;
}
public void setRelation(String relation) {
this.relation = relation;
}
@Length(min=1, max=1)
public String getAllowComment() {
return allowComment;
}
public void setAllowComment(String allowComment) {
this.allowComment = allowComment;
}
public Article getArticle() {
return article;
}
public void setArticle(Article article) {
this.article = article;
}
}
\ No newline at end of file
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.entity;
import java.util.Date;
import java.util.List;
import org.hibernate.validator.constraints.Length;
import com.google.common.collect.Lists;
import com.jeespring.common.config.Global;
import com.jeespring.common.persistence.TreeEntity;
import com.jeespring.modules.cms.utils.CmsUtils;
import com.jeespring.modules.sys.entity.Office;
/**
* 栏目Entity
* @author JeeSpring
* @version 2013-05-15
*/
public class Category extends TreeEntity<Category> {
public static final String DEFAULT_TEMPLATE = "frontList";
private static final long serialVersionUID = 1L;
private Site site; // 归属站点
private Office office; // 归属部门
// private Category parent;// 父级菜单
// private String parentIds;// 所有父级编号
private String module; // 栏目模型(article:文章;picture:图片;download:下载;link:链接;special:专题)
// private String name; // 栏目名称
private String image; // 栏目图片
private String href; // 链接
private String target; // 目标( _blank、_self、_parent、_top)
private String description; // 描述,填写有助于搜索引擎优化
private String keywords; // 关键字,填写有助于搜索引擎优化
// private Integer sort; // 排序(升序)
private String inMenu; // 是否在导航中显示(1:显示;0:不显示)
private String inList; // 是否在分类页中显示列表(1:显示;0:不显示)
private String showModes; // 展现方式(0:有子栏目显示栏目列表,无子栏目显示内容列表;1:首栏目内容列表;2:栏目第一条内容)
private String allowComment;// 是否允许评论
private String isAudit; // 是否需要审核
private String customListView; // 自定义列表视图
private String customContentView; // 自定义内容视图
private String viewConfig; // 视图参数
private Date beginDate; // 开始时间
private Date endDate; // 结束时间
private String cnt;//信息量
private String hits;//点击量
private List<Category> childList = Lists.newArrayList(); // 拥有子分类列表
public Category(){
super();
this.module = "";
this.sort = 30;
this.inMenu = Global.HIDE;
this.inList = Global.SHOW;
this.showModes = "0";
this.allowComment = Global.NO;
this.delFlag = DEL_FLAG_NORMAL;
this.isAudit = Global.NO;
}
public Category(String id){
this();
this.id = id;
}
public Category(String id, Site site){
this();
this.id = id;
this.setSite(site);
}
public Site getSite() {
return site;
}
public String getHits() {
return hits;
}
public void setHits(String hits) {
this.hits = hits;
}
public void setSite(Site site) {
this.site = site;
}
public Office getOffice() {
return office;
}
public void setOffice(Office office) {
this.office = office;
}
// @JsonBackReference
// @NotNull
@Override
public Category getParent() {
return parent;
}
@Override
public void setParent(Category parent) {
this.parent = parent;
}
// @Length(min=1, max=255)
// public String getParentIds() {
// return parentIds;
// }
//
// public void setParentIds(String parentIds) {
// this.parentIds = parentIds;
// }
@Length(min=0, max=20)
public String getModule() {
return module;
}
public void setModule(String module) {
this.module = module;
}
// @Length(min=0, max=100)
// public String getName() {
// return name;
// }
//
// public void setName(String name) {
// this.name = name;
// }
@Length(min=0, max=255)
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
@Length(min=0, max=255)
public String getHref() {
return href;
}
public void setHref(String href) {
this.href = href;
}
@Length(min=0, max=20)
public String getTarget() {
return target;
}
public Date getBeginDate() {
return beginDate;
}
public void setBeginDate(Date beginDate) {
this.beginDate = beginDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public void setTarget(String target) {
this.target = target;
}
@Length(min=0, max=255)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Length(min=0, max=255)
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
// @NotNull
// public Integer getSort() {
// return sort;
// }
//
// public void setSort(Integer sort) {
// this.sort = sort;
// }
@Length(min=1, max=1)
public String getInMenu() {
return inMenu;
}
public void setInMenu(String inMenu) {
this.inMenu = inMenu;
}
@Length(min=1, max=1)
public String getInList() {
return inList;
}
public void setInList(String inList) {
this.inList = inList;
}
@Length(min=1, max=1)
public String getShowModes() {
return showModes;
}
public void setShowModes(String showModes) {
this.showModes = showModes;
}
@Length(min=1, max=1)
public String getAllowComment() {
return allowComment;
}
public void setAllowComment(String allowComment) {
this.allowComment = allowComment;
}
@Length(min=1, max=1)
public String getIsAudit() {
return isAudit;
}
public void setIsAudit(String isAudit) {
this.isAudit = isAudit;
}
public String getCustomListView() {
return customListView;
}
public void setCustomListView(String customListView) {
this.customListView = customListView;
}
public String getCustomContentView() {
return customContentView;
}
public void setCustomContentView(String customContentView) {
this.customContentView = customContentView;
}
public String getViewConfig() {
return viewConfig;
}
public void setViewConfig(String viewConfig) {
this.viewConfig = viewConfig;
}
public List<Category> getChildList() {
return childList;
}
public void setChildList(List<Category> childList) {
this.childList = childList;
}
public String getCnt() {
return cnt;
}
public void setCnt(String cnt) {
this.cnt = cnt;
}
public static void sortList(List<Category> list, List<Category> sourcelist, String parentId){
for (int i=0; i<sourcelist.size(); i++){
Category e = sourcelist.get(i);
if (e.getParent()!=null && e.getParent().getId()!=null
&& e.getParent().getId().equals(parentId)){
list.add(e);
// 判断是否还有子节点, 有则继续获取子节点
for (int j=0; j<sourcelist.size(); j++){
Category child = sourcelist.get(j);
if (child.getParent()!=null && child.getParent().getId()!=null
&& child.getParent().getId().equals(e.getId())){
sortList(list, sourcelist, e.getId());
break;
}
}
}
}
}
public String getIds() {
return (this.getParentIds() !=null ? this.getParentIds().replaceAll(",", " ") : "")
+ (this.getId() != null ? this.getId() : "");
}
public boolean isRoot(){
return isRoot(this.id);
}
public static boolean isRoot(String id){
return id != null && "1".equals(id);
}
public String getUrl() {
return CmsUtils.getUrlDynamic(this);
}
}
\ No newline at end of file
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.entity;
import java.util.Date;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.jeespring.common.persistence.AbstractBaseEntity;
import com.jeespring.modules.sys.entity.User;
/**
* 评论Entity
* @author JeeSpring
* @version 2013-05-15
*/
public class Comment extends AbstractBaseEntity<Comment> {
private static final long serialVersionUID = 1L;
private Category category;// 分类编号
private String contentId; // 归属分类内容的编号(Article.id、Photo.id、Download.id)
private String title; // 归属分类内容的标题(Article.title、Photo.title、Download.title)
private String content; // 评论内容
private String name; // 评论姓名
private String ip; // 评论IP
private Date createDate;// 评论时间
private User auditUser; // 审核人
private Date auditDate; // 审核时间
private String delFlag; // 删除标记删除标记(0:正常;1:删除;2:审核)
public Comment() {
super();
this.delFlag = DEL_FLAG_AUDIT;
}
public Comment(String id){
this();
this.id = id;
}
public Comment(Category category){
this();
this.category = category;
}
@NotNull
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
@NotNull
public String getContentId() {
return contentId;
}
public void setContentId(String contentId) {
this.contentId = contentId;
}
@Length(min=1, max=255)
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Length(min=1, max=255)
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Length(min=1, max=100)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public User getAuditUser() {
return auditUser;
}
public void setAuditUser(User auditUser) {
this.auditUser = auditUser;
}
public Date getAuditDate() {
return auditDate;
}
public void setAuditDate(Date auditDate) {
this.auditDate = auditDate;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
@Override
@NotNull
public Date getCreateDate() {
return createDate;
}
@Override
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
@Override
@Length(min=1, max=1)
public String getDelFlag() {
return delFlag;
}
@Override
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}
\ No newline at end of file
package com.jeespring.modules.cms.entity;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.io.IOException;
import java.sql.Timestamp;
import java.util.Date;
/**
* User: songlai
* Date: 13-8-22
* Time: 上午9:44
*/
public class FileTpl {
private File file;
// 应用的根目录
private String root;
public FileTpl(File file, String root) {
this.file = file;
this.root = root;
}
public File getFile() {
return file;
}
public void setFile(File file) {
this.file = file;
}
public String getRoot() {
return root;
}
public void setRoot(String root) {
this.root = root;
}
public String getName() {
String ap = file.getAbsolutePath().substring(root.length());
ap = ap.replace(File.separatorChar, '/');
// 在resin里root的结尾是带'/'的,这样会导致getName返回的名称不以'/'开头。
if (!ap.startsWith("/")) {
ap = "/" + ap;
}
return ap;
}
public String getParent(){
String ap = file.getParent().substring(root.length());
ap = ap.replace(File.separatorChar, '/');
// 在resin里root的结尾是带'/'的,这样会导致getName返回的名称不以'/'开头。
if (!ap.startsWith("/")) {
ap = "/" + ap;
}
return ap;
}
public String getPath() {
String name = getName();
return name.substring(0, name.lastIndexOf('/'));
}
public String getFilename() {
return file.getName();
}
public String getSource() {
if (file.isDirectory()) {
return null;
}
try {
return FileUtils.readFileToString(this.file, "UTF-8");
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public long getLastModified() {
return file.lastModified();
}
public Date getLastModifiedDate() {
return new Timestamp(getLastModified());
}
public long getLength() {
return file.length();
}
public int getSize() {
return (int) (getLength() / 1024) + 1;
}
public boolean isDirectory() {
return file.isDirectory();
}
}
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.entity;
import java.util.Date;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import com.jeespring.common.persistence.AbstractBaseEntity;
import com.jeespring.common.utils.IdGen;
import com.jeespring.modules.sys.entity.User;
/**
* 留言Entity
* @author JeeSpring
* @version 2013-05-15
*/
public class Guestbook extends AbstractBaseEntity<Guestbook> {
private static final long serialVersionUID = 1L;
private String type; // 留言分类(咨询、建议、投诉、其它)
private String content; // 留言内容
private String name; // 姓名
private String email; // 邮箱
private String phone; // 电话
private String workunit;// 单位
private String ip; // 留言IP
private Date createDate;// 留言时间
private User reUser; // 回复人
private Date reDate; // 回复时间
private String reContent;// 回复内容
private String delFlag; // 删除标记删除标记(0:正常;1:删除;2:审核)
public Guestbook() {
this.delFlag = DEL_FLAG_AUDIT;
}
public Guestbook(String id){
this();
this.id = id;
}
public void prePersist(){
this.id = IdGen.uuid();
this.createDate = new Date();
}
@Length(min=1, max=100)
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
@Length(min=1, max=2000)
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Length(min=1, max=100)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Email @Length(min=0, max=100)
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Length(min=0, max=100)
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
@Length(min=0, max=100)
public String getWorkunit() {
return workunit;
}
public void setWorkunit(String workunit) {
this.workunit = workunit;
}
@Length(min=1, max=100)
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
@Override
@NotNull
public Date getCreateDate() {
return createDate;
}
@Override
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public User getReUser() {
return reUser;
}
public void setReUser(User reUser) {
this.reUser = reUser;
}
public String getReContent() {
return reContent;
}
public void setReContent(String reContent) {
this.reContent = reContent;
}
public Date getReDate() {
return reDate;
}
public void setReDate(Date reDate) {
this.reDate = reDate;
}
@Override
@Length(min=1, max=1)
public String getDelFlag() {
return delFlag;
}
@Override
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
}
/**
\ * Copyright &copy; 2012-2013 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.entity;
import java.util.Date;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.jeespring.common.persistence.AbstractBaseEntity;
import com.jeespring.modules.sys.entity.User;
/**
* 链接Entity
* @author JeeSpring
* @version 2013-05-15
*/
public class Link extends AbstractBaseEntity<Link> {
private static final long serialVersionUID = 1L;
private Category category;// 分类编号
private String title; // 链接名称
private String color; // 标题颜色(red:红色;green:绿色;blue:蓝色;yellow:黄色;orange:橙色)
private String image; // 链接图片
private String href; // 链接地址
private Integer weight; // 权重,越大越靠前
private Date weightDate;// 权重期限,超过期限,将weight设置为0
private User user; //关联用户
public Link() {
super();
this.weight = 0;
}
public Link(String id){
this();
this.id = id;
}
public Link(Category category){
this();
this.category = category;
}
@NotNull
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
@Length(min=1, max=255)
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
@Length(min=0, max=50)
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
@Length(min=0, max=255)
public String getImage() {
return image;
}
public void setImage(String image) {
this.image = image;
}
@Length(min=0, max=255)
public String getHref() {
return href;
}
public void setHref(String href) {
this.href = href;
}
public Integer getWeight() {
return weight;
}
public void setWeight(Integer weight) {
this.weight = weight;
}
public Date getWeightDate() {
return weightDate;
}
public void setWeightDate(Date weightDate) {
this.weightDate = weightDate;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
}
\ No newline at end of file
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.entity;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;
import com.jeespring.common.persistence.AbstractBaseEntity;
import com.jeespring.modules.sys.utils.UserUtils;
/**
* 站点Entity
* @author JeeSpring
* @version 2013-05-15
*/
public class Site extends AbstractBaseEntity<Site> {
private static final long serialVersionUID = 1L;
private String name; // 站点名称
private String title; // 站点标题
private String logo; // 站点logo
private String description;// 描述,填写有助于搜索引擎优化
private String keywords;// 关键字,填写有助于搜索引擎优化
private String theme; // 主题
private String copyright;// 版权信息
private String customIndexView;// 自定义首页视图文件
private String domain;
public Site() {
super();
}
public Site(String id){
this();
this.id = id;
}
@Length(min=1, max=100)
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Length(min=1, max=100)
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
@Length(min=0, max=255)
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Length(min=0, max=255)
public String getKeywords() {
return keywords;
}
public void setKeywords(String keywords) {
this.keywords = keywords;
}
@Length(min=1, max=255)
public String getTheme() {
return theme;
}
public void setTheme(String theme) {
this.theme = theme;
}
public String getCopyright() {
return copyright;
}
public void setCopyright(String copyright) {
this.copyright = copyright;
}
public String getCustomIndexView() {
return customIndexView;
}
public void setCustomIndexView(String customIndexView) {
this.customIndexView = customIndexView;
}
/**
* 获取默认站点ID
*/
public static String defaultSiteId(){
return "1";
}
/**
* 判断是否为默认(主站)站点
*/
public static boolean isDefault(String id){
return id != null && id.equals(defaultSiteId());
}
/**
* 获取当前编辑的站点编号
*/
public static String getCurrentSiteId(){
String siteId = (String)UserUtils.getCache("siteId");
return StringUtils.isNotBlank(siteId)?siteId:defaultSiteId();
}
/**
* 模板路径
*/
public static final String TPL_BASE = "/WEB-INF/views/modules/cms/front/themes";
/**
* 获得模板方案路径。如:/WEB-INF/views/modules/cms/front/themes/jeesite
*
* @return
*/
public String getSolutionPath() {
return TPL_BASE + "/" + getTheme();
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
}
\ No newline at end of file
/**
* Copyright &copy; 2012-2016 <a href="https://gitee.com/JeeHuangBingGui/jeeSpringCloud">JeeSpring</a>All rights reserved.
*/
package com.jeespring.modules.cms.service;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jeespring.common.service.AbstractBaseService;
import com.jeespring.modules.cms.dao.ArticleDataDao;
import com.jeespring.modules.cms.entity.ArticleData;
/**
* 站点Service
* @author JeeSpring
* @version 2013-01-15
*/
@Service
@Transactional(readOnly = true)
public class ArticleDataService extends AbstractBaseService<ArticleDataDao, ArticleData> {
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment