- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.service;
-
-import com.jfinal.plugin.activerecord.Page;
-import io.jboot.db.model.Columns;
-import io.jboot.service.JbootServiceJoiner;
-import io.jpress.module.article.model.Article;
-
-import java.util.List;
-
-public interface ArticleService extends JbootServiceJoiner {
-
- /**
- * find model by primary key
- *
- * @param id
- * @return
- */
- public Article findById(Object id);
-
- public Article findByTitle(String title);
-
-
- /**
- * find all model
- *
- * @return all findAll();
-
-
- /**
- * delete model by primary key
- *
- * @param id
- * @return success
- */
- public boolean deleteById(Object id);
-
-
- public void removeCacheById(Object id);
-
-
- /**
- * 删除多个id
- *
- * @param ids
- * @return
- */
- public boolean deleteByIds(Object... ids);
-
-
- /**
- * delete model
- *
- * @param model
- * @return
- */
- public boolean delete(Article model);
-
-
- /**
- * save model to database
- *
- * @param model
- * @return
- */
- public Object save(Article model);
-
-
- /**
- * save or update model
- *
- * @param model
- * @return if save or update success
- */
- public Object saveOrUpdate(Article model);
-
-
- /**
- * update data model
- *
- * @param model
- * @return
- */
- public boolean update(Article model);
-
-
- public void doUpdateCategorys(long articleId, Long[] categoryIds);
-
- public void doUpdateCommentCount(long articleId);
-
- public boolean doChangeStatus(long id, String status);
-
- public Long findCountByStatus(String status);
-
- public Article findFirstBySlug(String slug);
-
- public Article findNextById(long id);
-
- public Article findPreviousById(long id);
-
- public List findListByColumns(Columns columns, String orderBy, Integer count);
-
- public List findListByCategoryId(long categoryId, Boolean hasThumbnail, String orderBy, Integer count);
-
- public List findRelevantListByArticleId(long ArticleId, String status, Integer count);
-
- public Page _paginateByStatus(int page, int pagesize, String title, Long categoryId, String status);
-
- public Page _paginateWithoutTrash(int page, int pagesize, String title, Long categoryId);
-
- public Page _paginateByUserId(int page, int pagesize, Long userId);
-
- public Page paginateInNormal(int page, int pagesize);
-
- public Page paginateInNormal(int page, int pagesize, String orderBy);
-
- public Page paginateByCategoryIdInNormal(int page, int pagesize, long categoryId, String orderBy);
-
- public void doIncArticleViewCount(long articleId);
-
- public void doIncArticleCommentCount(long articleId);
-
- public Page search(String queryString, int pageNum, int pageSize);
-
- public Page searchIndb(String queryString, int pageNum, int pageSize);
-
-
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.service;
+
+import com.jfinal.plugin.activerecord.Page;
+import io.jboot.db.model.Columns;
+import io.jboot.service.JbootServiceJoiner;
+import io.jpress.module.article.model.Article;
+
+import java.util.List;
+
+public interface ArticleService extends JbootServiceJoiner {
+
+ /**
+ * find model by primary key
+ *
+ * @param id
+ * @return
+ */
+ public Article findById(Object id);
+
+ public Article findByTitle(String title);
+
+
+ /**
+ * find all model
+ *
+ * @return all findAll();
+
+
+ /**
+ * delete model by primary key
+ *
+ * @param id
+ * @return success
+ */
+ public boolean deleteById(Object id);
+
+
+ public void removeCacheById(Object id);
+
+
+ /**
+ * 删除多个id
+ *
+ * @param ids
+ * @return
+ */
+ public boolean deleteByIds(Object... ids);
+
+
+ /**
+ * delete model
+ *
+ * @param model
+ * @return
+ */
+ public boolean delete(Article model);
+
+
+ /**
+ * save model to database
+ *
+ * @param model
+ * @return
+ */
+ public Object save(Article model);
+
+
+ /**
+ * save or update model
+ *
+ * @param model
+ * @return if save or update success
+ */
+ public Object saveOrUpdate(Article model);
+
+
+ /**
+ * update data model
+ *
+ * @param model
+ * @return
+ */
+ public boolean update(Article model);
+
+
+ public void doUpdateCategorys(long articleId, Long[] categoryIds);
+
+ public void doUpdateCommentCount(long articleId);
+
+ public boolean doChangeStatus(long id, String status);
+
+ public Long findCountByStatus(String status);
+
+ public Article findFirstBySlug(String slug);
+
+ public Article findNextById(long id);
+
+ public Article findNextByIdNotHidden(long id);
+
+ public Article findPreviousById(long id);
+
+ public Article findPreviousByIdNotHidden(long id);
+
+ public List findListByColumns(Columns columns, String orderBy, Integer count);
+
+ public List findListByCategoryId(long categoryId, Boolean hasThumbnail, String orderBy, Integer count);
+
+ public List findListByCategoryIdNotHidden(long categoryId, Boolean hasThumbnail, String orderBy, Integer count);
+
+ public List findRelevantListByArticleId(long ArticleId, String status, Integer count);
+
+ public List findRelevantListByArticleIdNotHidden(long ArticleId, String status, Integer count);
+
+ public Page _paginateByStatus(int page, int pagesize, String title, Long categoryId, String status);
+
+ public Page _paginateWithoutTrash(int page, int pagesize, String title, Long categoryId);
+
+ public Page _paginateByUserId(int page, int pagesize, Long userId);
+
+ public Page paginateInNormal(int page, int pagesize);
+
+ public Page paginateInNormal(int page, int pagesize, String orderBy);
+
+ public Page paginateInNormalNotHidden(int page, int pagesize, String orderBy);
+
+ public Page paginateByCategoryIdInNormalNotHidden(int page, int pagesize, long categoryId, String orderBy);
+
+ public Page paginateByCategoryIdInNormal(int page, int pagesize, long categoryId, String orderBy);
+
+ public void doIncArticleViewCount(long articleId);
+
+ public void doIncArticleCommentCount(long articleId);
+
+ public Page search(String queryString, int pageNum, int pageSize);
+
+ public Page searchIndb(String queryString, int pageNum, int pageSize);
+
+
}
\ No newline at end of file
diff --git a/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java b/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java
index 5a4c3c936..e9af9b269 100755
--- a/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java
+++ b/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java
@@ -1,408 +1,507 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.utils.StrUtil;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.service.ArticleService;
-
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- */
-@JFinalDirective("article")
-public class ArticleDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService service;
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
- String idOrSlug = getPara(0, scope);
- Article article = getArticle(idOrSlug);
-
- if (article == null) {
- return;
- }
-
- scope.setLocal("article", article);
- renderBody(env, scope, writer);
- }
-
- private Article getArticle(String idOrSlug) {
- return StrUtil.isNumeric(idOrSlug)
- ? service.findById(idOrSlug)
- : service.findFirstBySlug(idOrSlug);
- }
-
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.directive;
+
+import com.jfinal.aop.Inject;
+import com.jfinal.template.Env;
+import com.jfinal.template.io.Writer;
+import com.jfinal.template.stat.Scope;
+import io.jboot.utils.StrUtil;
+import io.jboot.web.directive.annotation.JFinalDirective;
+import io.jboot.web.directive.base.JbootDirectiveBase;
+import io.jpress.module.article.model.Article;
+import io.jpress.module.article.service.ArticleService;
+
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ */
+@JFinalDirective("article")
+public class ArticleDirective extends JbootDirectiveBase {
+
+ @Inject
+ private ArticleService service;
+
+ @Override
+ public void onRender(Env env, Scope scope, Writer writer) {
+ String idOrSlug = getPara(0, scope);
+ Boolean hiddenFlag = getParaToBool("hiddenFlag", scope, false);
+ Article article = getArticle(idOrSlug);
+
+ // 当设置了hidden的flag时,文章不可见
+ if (article == null || (hiddenFlag && "hidden".equals(article.getFlag()))) {
+ return;
+ }
+
+ scope.setLocal("article", article);
+ renderBody(env, scope, writer);
+ }
+
+ private Article getArticle(String idOrSlug) {
+ return StrUtil.isNumeric(idOrSlug)
+ ? service.findById(idOrSlug)
+ : service.findFirstBySlug(idOrSlug);
+ }
+
+
+ @Override
+ public boolean hasEnd() {
+ return true;
+ }
+}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlePageDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlePageDirective.java
index 354ee9249..e74c63999 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlePageDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlePageDirective.java
@@ -1,108 +1,110 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.core.Controller;
-import com.jfinal.core.JFinal;
-import com.jfinal.plugin.activerecord.Page;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.web.controller.JbootControllerContext;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jboot.web.directive.base.PaginateDirectiveBase;
-import io.jpress.JPressOptions;
-import io.jpress.commons.directive.DirectveKit;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.model.ArticleCategory;
-import io.jpress.module.article.service.ArticleService;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- */
-@JFinalDirective("articlePage")
-public class ArticlePageDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService service;
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
-
- Controller controller = JbootControllerContext.get();
-
- int page = controller.getParaToInt(1, 1);
- int pageSize = getParaToInt("pageSize", scope, 10);
- String orderBy = getPara("orderBy", scope, "id desc");
-
- // 可以指定当前的分类ID
- Long categoryId = getParaToLong("categoryId", scope, 0L);
- ArticleCategory category = controller.getAttr("category");
-
- if (categoryId == 0 && category != null) {
- categoryId = category.getId();
- }
-
- Page articlePage = categoryId == 0
- ? service.paginateInNormal(page, pageSize, orderBy)
- : service.paginateByCategoryIdInNormal(page, pageSize, categoryId, orderBy);
-
- scope.setGlobal("articlePage", articlePage);
- renderBody(env, scope, writer);
- }
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-
-
- @JFinalDirective("articlePaginate")
- public static class TemplatePaginateDirective extends PaginateDirectiveBase {
-
- @Override
- protected String getUrl(int pageNumber, Env env, Scope scope, Writer writer) {
- HttpServletRequest request = JbootControllerContext.get().getRequest();
- String url = request.getRequestURI();
- String contextPath = JFinal.me().getContextPath();
-
- boolean firstGotoIndex = getPara("firstGotoIndex", scope, false);
-
- if (pageNumber == 1 && firstGotoIndex) {
- return contextPath + "/";
- }
-
- // 如果当前页面是首页的话
- // 需要改变url的值,因为 上一页或下一页是通过当前的url解析出来的
- if (url.equals(contextPath + "/")) {
- url = contextPath + "/article/category/index"
- + JPressOptions.getAppUrlSuffix();
- }
- return DirectveKit.replacePageNumber(url, pageNumber);
- }
-
- @Override
- protected Page> getPage(Env env, Scope scope, Writer writer) {
- return (Page>) scope.get("articlePage");
- }
-
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.core.Controller;
-import com.jfinal.plugin.activerecord.Page;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.utils.StrUtil;
-import io.jboot.web.controller.JbootControllerContext;
-import io.jboot.web.directive.JbootPaginateDirective;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.service.ArticleService;
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- */
-@JFinalDirective("articleSearchPage")
-public class ArticleSearchPageDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService articleService;
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
-
- Controller controller = JbootControllerContext.get();
-
- String keyword = controller.getAttr("keyword");
- int page = controller.getAttr("page");
- int pageSize = getParaToInt("pageSize", scope, 10);
-
- Page dataPage = StrUtil.isNotBlank(keyword)
- ? articleService.search(keyword, page, pageSize)
- : null;
-
- if (dataPage != null) {
- scope.setGlobal("articlePage", dataPage);
- }
-
- //需要页面自行判断 articlePage 是否为空
- renderBody(env, scope, writer);
- }
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-
-
- @JFinalDirective("articleSearchPaginate")
- public static class SearchPaginateDirective extends JbootPaginateDirective {
- @Override
- protected Page> getPage(Env env, Scope scope, Writer writer) {
- return (Page>) scope.get("articlePage");
- }
-
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.directive;
+
+import java.util.List;
+
+import com.jfinal.aop.Inject;
+import com.jfinal.core.Controller;
+import com.jfinal.plugin.activerecord.Page;
+import com.jfinal.template.Env;
+import com.jfinal.template.io.Writer;
+import com.jfinal.template.stat.Scope;
+import io.jboot.utils.StrUtil;
+import io.jboot.web.controller.JbootControllerContext;
+import io.jboot.web.directive.JbootPaginateDirective;
+import io.jboot.web.directive.annotation.JFinalDirective;
+import io.jboot.web.directive.base.JbootDirectiveBase;
+import io.jpress.module.article.model.Article;
+import io.jpress.module.article.service.ArticleService;
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ */
+@JFinalDirective("articleSearchPage")
+public class ArticleSearchPageDirective extends JbootDirectiveBase {
+
+ @Inject
+ private ArticleService articleService;
+
+ @Override
+ public void onRender(Env env, Scope scope, Writer writer) {
+
+ Controller controller = JbootControllerContext.get();
+
+ String keyword = controller.getAttr("keyword");
+ Boolean hiddenFlag = getParaToBool("hiddenFlag", scope, false);
+ int page = controller.getAttr("page");
+ int pageSize = getParaToInt("pageSize", scope, 10);
+
+ Page dataPage = StrUtil.isNotBlank(keyword)
+ ? articleService.search(keyword, page, pageSize)
+ : null;
+
+ if(hiddenFlag && null != dataPage) {
+ List articles = dataPage.getList();
+ if(null != articles) {
+ for(Article article: articles ) {
+ if("hidden".equals(article.getFlag())) {
+ // 通过linkTo实现无法查看
+ article.setLinkTo("##");
+ article.setContent("作者已经隐藏了此文章,你无权查看!");
+ }
+ }
+ }
+ }
+
+ if (dataPage != null) {
+ scope.setGlobal("articlePage", dataPage);
+ }
+
+ //需要页面自行判断 articlePage 是否为空
+ renderBody(env, scope, writer);
+ }
+
+ @Override
+ public boolean hasEnd() {
+ return true;
+ }
+
+
+ @JFinalDirective("articleSearchPaginate")
+ public static class SearchPaginateDirective extends JbootPaginateDirective {
+ @Override
+ protected Page> getPage(Env env, Scope scope, Writer writer) {
+ return (Page>) scope.get("articlePage");
+ }
+
+ }
+}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java
index 75459dbb9..23d625f1f 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java
@@ -1,80 +1,87 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.db.model.Columns;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.service.ArticleService;
-
-import java.util.List;
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- */
-@JFinalDirective("articles")
-public class ArticlesDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService service;
-
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
-
- String flag = getPara("flag", scope);
- String style = getPara("style", scope);
- Boolean hasThumbnail = getParaToBool("hasThumbnail", scope);
- String orderBy = getPara("orderBy", scope, "id desc");
- int count = getParaToInt("count", scope, 10);
-
-
- Columns columns = Columns.create();
-
- columns.add("flag", flag);
- columns.add("style", style);
- columns.add("status", Article.STATUS_NORMAL);
-
- if (hasThumbnail != null) {
- if (hasThumbnail) {
- columns.isNotNull("thumbnail");
- } else {
- columns.isNull("thumbnail");
- }
- }
-
- List articles = service.findListByColumns(columns, orderBy, count);
-
- if (articles == null || articles.isEmpty()) {
- return;
- }
-
- scope.setLocal("articles", articles);
- renderBody(env, scope, writer);
- }
-
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.directive;
+
+import com.jfinal.aop.Inject;
+import com.jfinal.template.Env;
+import com.jfinal.template.io.Writer;
+import com.jfinal.template.stat.Scope;
+import io.jboot.db.model.Columns;
+import io.jboot.web.directive.annotation.JFinalDirective;
+import io.jboot.web.directive.base.JbootDirectiveBase;
+import io.jpress.module.article.model.Article;
+import io.jpress.module.article.service.ArticleService;
+
+import java.util.List;
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ */
+@JFinalDirective("articles")
+public class ArticlesDirective extends JbootDirectiveBase {
+
+ @Inject
+ private ArticleService service;
+
+
+ @Override
+ public void onRender(Env env, Scope scope, Writer writer) {
+
+ String flag = getPara("flag", scope);
+ String style = getPara("style", scope);
+ Boolean hasThumbnail = getParaToBool("hasThumbnail", scope);
+ String orderBy = getPara("orderBy", scope, "id desc");
+ // 隐藏部分不想展示的文章
+ Boolean hiddenFlag = getParaToBool("hiddenFlag", scope, false);
+ int count = getParaToInt("count", scope, 10);
+
+
+ Columns columns = Columns.create();
+
+ columns.add("flag", flag);
+ columns.add("style", style);
+ columns.add("status", Article.STATUS_NORMAL);
+
+ // 当flag设置为articleSoftHidden时,文章列表页不可见,当flag设置为articleHardHidden时,文章列表页,文章内容页不可见
+ if(hiddenFlag) {
+ columns.ne("flag", "hidden");
+ }
+
+ if (hasThumbnail != null) {
+ if (hasThumbnail) {
+ columns.isNotNull("thumbnail");
+ } else {
+ columns.isNull("thumbnail");
+ }
+ }
+
+ List articles = service.findListByColumns(columns, orderBy, count);
+
+ if (articles == null || articles.isEmpty()) {
+ return;
+ }
+
+ scope.setLocal("articles", articles);
+ renderBody(env, scope, writer);
+ }
+
+
+ @Override
+ public boolean hasEnd() {
+ return true;
+ }
+}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/CategoryArticlesDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/CategoryArticlesDirective.java
index 27bf4d801..06a8f1a68 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/CategoryArticlesDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/CategoryArticlesDirective.java
@@ -1,84 +1,85 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.utils.StrUtil;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.model.ArticleCategory;
-import io.jpress.module.article.service.ArticleCategoryService;
-import io.jpress.module.article.service.ArticleService;
-
-import java.util.List;
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- */
-@JFinalDirective("categoryArticles")
-public class CategoryArticlesDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService service;
-
- @Inject
- private ArticleCategoryService categoryService;
-
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
-
- Long categoryId = getParaToLong("categoryId", scope);
- String flag = getPara("categoryFlag", scope);
-
- if (StrUtil.isBlank(flag) && categoryId == null) {
- throw new IllegalArgumentException("#categoryArticles(categoryFlag=xxx,categoryId=xxx) is error, " +
- "categoryFlag or categoryId must not be empty. " + getLocation());
- }
-
- Boolean hasThumbnail = getParaToBool("hasThumbnail", scope);
- String orderBy = getPara("orderBy", scope, "order_number desc,id desc");
- int count = getParaToInt("count", scope, 10);
-
- ArticleCategory category = categoryId != null
- ? categoryService.findById(categoryId)
- : categoryService.findFirstByFlag(flag);
- if (category == null) {
- return;
- }
-
- scope.setLocal("category", category);
-
- List articles = service.findListByCategoryId(category.getId(), hasThumbnail, orderBy, count);
- if (articles == null || articles.isEmpty()) {
- return;
- }
-
- scope.setLocal("articles", articles);
- renderBody(env, scope, writer);
- }
-
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.directive;
+
+import com.jfinal.aop.Inject;
+import com.jfinal.template.Env;
+import com.jfinal.template.io.Writer;
+import com.jfinal.template.stat.Scope;
+import io.jboot.utils.StrUtil;
+import io.jboot.web.directive.annotation.JFinalDirective;
+import io.jboot.web.directive.base.JbootDirectiveBase;
+import io.jpress.module.article.model.Article;
+import io.jpress.module.article.model.ArticleCategory;
+import io.jpress.module.article.service.ArticleCategoryService;
+import io.jpress.module.article.service.ArticleService;
+
+import java.util.List;
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ */
+@JFinalDirective("categoryArticles")
+public class CategoryArticlesDirective extends JbootDirectiveBase {
+
+ @Inject
+ private ArticleService service;
+
+ @Inject
+ private ArticleCategoryService categoryService;
+
+
+ @Override
+ public void onRender(Env env, Scope scope, Writer writer) {
+
+ Long categoryId = getParaToLong("categoryId", scope);
+ String flag = getPara("categoryFlag", scope);
+ Boolean hiddenFlag = getParaToBool("hiddenFlag", scope, false);
+
+ if (StrUtil.isBlank(flag) && categoryId == null) {
+ throw new IllegalArgumentException("#categoryArticles(categoryFlag=xxx,categoryId=xxx) is error, " +
+ "categoryFlag or categoryId must not be empty. " + getLocation());
+ }
+
+ Boolean hasThumbnail = getParaToBool("hasThumbnail", scope);
+ String orderBy = getPara("orderBy", scope, "order_number desc,id desc");
+ int count = getParaToInt("count", scope, 10);
+
+ ArticleCategory category = categoryId != null
+ ? categoryService.findById(categoryId)
+ : categoryService.findFirstByFlag(flag);
+ if (category == null) {
+ return;
+ }
+
+ scope.setLocal("category", category);
+
+ List articles = hiddenFlag ? service.findListByCategoryIdNotHidden(categoryId, hasThumbnail, orderBy, count) : service.findListByCategoryId(category.getId(), hasThumbnail, orderBy, count);
+ if (articles == null || articles.isEmpty()) {
+ return;
+ }
+
+ scope.setLocal("articles", articles);
+ renderBody(env, scope, writer);
+ }
+
+
+ @Override
+ public boolean hasEnd() {
+ return true;
+ }
+}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/NextArticleDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/NextArticleDirective.java
index 70cb33335..263a91458 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/NextArticleDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/NextArticleDirective.java
@@ -1,56 +1,57 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.web.controller.JbootControllerContext;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.service.ArticleService;
-
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- */
-@JFinalDirective("nextArticle")
-public class NextArticleDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService service;
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
- Article article = JbootControllerContext.get().getAttr("article");
-
- Article nextArticle = service.findNextById(article.getId());
- if (nextArticle == null) {
- return;
- }
-
- scope.setLocal("next", nextArticle);
- renderBody(env, scope, writer);
- }
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.directive;
+
+import com.jfinal.aop.Inject;
+import com.jfinal.template.Env;
+import com.jfinal.template.io.Writer;
+import com.jfinal.template.stat.Scope;
+import io.jboot.web.controller.JbootControllerContext;
+import io.jboot.web.directive.annotation.JFinalDirective;
+import io.jboot.web.directive.base.JbootDirectiveBase;
+import io.jpress.module.article.model.Article;
+import io.jpress.module.article.service.ArticleService;
+
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ */
+@JFinalDirective("nextArticle")
+public class NextArticleDirective extends JbootDirectiveBase {
+
+ @Inject
+ private ArticleService service;
+
+ @Override
+ public void onRender(Env env, Scope scope, Writer writer) {
+ Article article = JbootControllerContext.get().getAttr("article");
+ Boolean hiddenFlag = getParaToBool("hiddenFlag", scope, false);
+
+ Article nextArticle = hiddenFlag ? service.findNextByIdNotHidden(article.getId()) : service.findNextById(article.getId());
+ if (nextArticle == null) {
+ return;
+ }
+
+ scope.setLocal("next", nextArticle);
+ renderBody(env, scope, writer);
+ }
+
+ @Override
+ public boolean hasEnd() {
+ return true;
+ }
+}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/PreviousArticleDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/PreviousArticleDirective.java
index c83df0d45..3c0ed31be 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/PreviousArticleDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/PreviousArticleDirective.java
@@ -1,56 +1,57 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.web.controller.JbootControllerContext;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.service.ArticleService;
-
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- */
-@JFinalDirective("previousArticle")
-public class PreviousArticleDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService service;
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
- Article article = JbootControllerContext.get().getAttr("article");
-
- Article previousArticle = service.findPreviousById(article.getId());
- if (previousArticle == null) {
- return;
- }
-
- scope.setLocal("previous", previousArticle);
- renderBody(env, scope, writer);
- }
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.directive;
+
+import com.jfinal.aop.Inject;
+import com.jfinal.template.Env;
+import com.jfinal.template.io.Writer;
+import com.jfinal.template.stat.Scope;
+import io.jboot.web.controller.JbootControllerContext;
+import io.jboot.web.directive.annotation.JFinalDirective;
+import io.jboot.web.directive.base.JbootDirectiveBase;
+import io.jpress.module.article.model.Article;
+import io.jpress.module.article.service.ArticleService;
+
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ */
+@JFinalDirective("previousArticle")
+public class PreviousArticleDirective extends JbootDirectiveBase {
+
+ @Inject
+ private ArticleService service;
+
+ @Override
+ public void onRender(Env env, Scope scope, Writer writer) {
+ Article article = JbootControllerContext.get().getAttr("article");
+ Boolean hiddenFlag = getParaToBool("hiddenFlag", scope, false);
+
+ Article previousArticle = hiddenFlag ? service.findPreviousByIdNotHidden(article.getId()) : service.findPreviousById(article.getId());
+ if (previousArticle == null) {
+ return;
+ }
+
+ scope.setLocal("previous", previousArticle);
+ renderBody(env, scope, writer);
+ }
+
+ @Override
+ public boolean hasEnd() {
+ return true;
+ }
+}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/RelevantArticlesDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/RelevantArticlesDirective.java
index 4f19dff89..8623f3b0c 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/RelevantArticlesDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/RelevantArticlesDirective.java
@@ -1,68 +1,70 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.service.ArticleCategoryService;
-import io.jpress.module.article.service.ArticleService;
-
-import java.util.List;
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- * @Title: 相关文章
- */
-@JFinalDirective("relevantArticles")
-public class RelevantArticlesDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService service;
-
- @Inject
- private ArticleCategoryService categoryService;
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
- Article article = getPara(0, scope);
- if (article == null) {
- throw new IllegalArgumentException("#relevantArticles(...) argument must not be null or empty." + getLocation());
- }
-
- //默认值 3
- int count = getParaToInt(1, scope, 3);
-
- List relevantArticles = service.findRelevantListByArticleId(article.getId(), Article.STATUS_NORMAL, count);
-
- if (relevantArticles == null || relevantArticles.isEmpty()) {
- return;
- }
-
- scope.setLocal("relevantArticles", relevantArticles);
- renderBody(env, scope, writer);
- }
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.directive;
+
+import com.jfinal.aop.Inject;
+import com.jfinal.template.Env;
+import com.jfinal.template.io.Writer;
+import com.jfinal.template.stat.Scope;
+import io.jboot.web.directive.annotation.JFinalDirective;
+import io.jboot.web.directive.base.JbootDirectiveBase;
+import io.jpress.module.article.model.Article;
+import io.jpress.module.article.service.ArticleCategoryService;
+import io.jpress.module.article.service.ArticleService;
+
+import java.util.List;
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ * @Title: 相关文章
+ */
+@JFinalDirective("relevantArticles")
+public class RelevantArticlesDirective extends JbootDirectiveBase {
+
+ @Inject
+ private ArticleService service;
+
+ @Inject
+ private ArticleCategoryService categoryService;
+
+ @Override
+ public void onRender(Env env, Scope scope, Writer writer) {
+ Article article = getPara(0, scope);
+ Boolean hiddenFlag = getParaToBool("hiddenFlag", scope, false);
+
+ if (article == null) {
+ throw new IllegalArgumentException("#relevantArticles(...) argument must not be null or empty." + getLocation());
+ }
+
+ //默认值 3
+ int count = getParaToInt(1, scope, 3);
+
+ List relevantArticles = hiddenFlag ? service.findRelevantListByArticleIdNotHidden(article.getId(), Article.STATUS_NORMAL, count) : service.findRelevantListByArticleId(article.getId(), Article.STATUS_NORMAL, count);
+
+ if (relevantArticles == null || relevantArticles.isEmpty()) {
+ return;
+ }
+
+ scope.setLocal("relevantArticles", relevantArticles);
+ renderBody(env, scope, writer);
+ }
+
+ @Override
+ public boolean hasEnd() {
+ return true;
+ }
+}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/TagArticlesDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/TagArticlesDirective.java
index 399574998..32a2dfc24 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/TagArticlesDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/TagArticlesDirective.java
@@ -1,82 +1,83 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.utils.StrUtil;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.model.ArticleCategory;
-import io.jpress.module.article.service.ArticleCategoryService;
-import io.jpress.module.article.service.ArticleService;
-
-import java.util.List;
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- */
-@JFinalDirective("tagArticles")
-public class TagArticlesDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService service;
-
- @Inject
- private ArticleCategoryService categoryService;
-
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
-
- String tag = getPara("tag", scope);
-
- if (StrUtil.isBlank(tag)) {
- throw new IllegalArgumentException("#tagArticles() args is error, tag must not be empty." + getLocation());
- }
-
-
- Boolean hasThumbnail = getParaToBool("hasThumbnail", scope);
- String orderBy = getPara("orderBy", scope, "order_number desc,id desc");
- int count = getParaToInt("count", scope, 10);
-
- ArticleCategory category = categoryService.findFirstByTypeAndSlug(ArticleCategory.TYPE_TAG, tag);
- if (category == null) {
- return;
- }
-
- scope.setLocal("tag", category);
-
- List articles = service.findListByCategoryId(category.getId(), hasThumbnail, orderBy, count);
-
- if (articles == null || articles.isEmpty()) {
- return;
- }
-
- scope.setLocal("articles", articles);
- renderBody(env, scope, writer);
- }
-
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.directive;
+
+import com.jfinal.aop.Inject;
+import com.jfinal.template.Env;
+import com.jfinal.template.io.Writer;
+import com.jfinal.template.stat.Scope;
+import io.jboot.utils.StrUtil;
+import io.jboot.web.directive.annotation.JFinalDirective;
+import io.jboot.web.directive.base.JbootDirectiveBase;
+import io.jpress.module.article.model.Article;
+import io.jpress.module.article.model.ArticleCategory;
+import io.jpress.module.article.service.ArticleCategoryService;
+import io.jpress.module.article.service.ArticleService;
+
+import java.util.List;
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ */
+@JFinalDirective("tagArticles")
+public class TagArticlesDirective extends JbootDirectiveBase {
+
+ @Inject
+ private ArticleService service;
+
+ @Inject
+ private ArticleCategoryService categoryService;
+
+
+ @Override
+ public void onRender(Env env, Scope scope, Writer writer) {
+
+ String tag = getPara("tag", scope);
+ Boolean hiddenFlag = getParaToBool("hiddenFlag", scope, false);
+
+ if (StrUtil.isBlank(tag)) {
+ throw new IllegalArgumentException("#tagArticles() args is error, tag must not be empty." + getLocation());
+ }
+
+
+ Boolean hasThumbnail = getParaToBool("hasThumbnail", scope);
+ String orderBy = getPara("orderBy", scope, "order_number desc,id desc");
+ int count = getParaToInt("count", scope, 10);
+
+ ArticleCategory category = categoryService.findFirstByTypeAndSlug(ArticleCategory.TYPE_TAG, tag);
+ if (category == null) {
+ return;
+ }
+
+ scope.setLocal("tag", category);
+
+ List articles = hiddenFlag ? service.findListByCategoryIdNotHidden(category.getId(), hasThumbnail, orderBy, count) : service.findListByCategoryId(category.getId(), hasThumbnail, orderBy, count);
+
+ if (articles == null || articles.isEmpty()) {
+ return;
+ }
+
+ scope.setLocal("articles", articles);
+ renderBody(env, scope, writer);
+ }
+
+
+ @Override
+ public boolean hasEnd() {
+ return true;
+ }
+}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/UserArticlesDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/UserArticlesDirective.java
index 7b7ee5081..930b25376 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/UserArticlesDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/UserArticlesDirective.java
@@ -1,80 +1,84 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.article.directive;
-
-import com.jfinal.aop.Inject;
-import com.jfinal.template.Env;
-import com.jfinal.template.io.Writer;
-import com.jfinal.template.stat.Scope;
-import io.jboot.db.model.Columns;
-import io.jboot.web.controller.JbootControllerContext;
-import io.jboot.web.directive.annotation.JFinalDirective;
-import io.jboot.web.directive.base.JbootDirectiveBase;
-import io.jpress.model.User;
-import io.jpress.module.article.model.Article;
-import io.jpress.module.article.service.ArticleService;
-
-import java.util.List;
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- */
-@JFinalDirective("userArticles")
-public class UserArticlesDirective extends JbootDirectiveBase {
-
- @Inject
- private ArticleService service;
-
-
- @Override
- public void onRender(Env env, Scope scope, Writer writer) {
-
- Long userId = getParaToLong("userId", scope);
- User user = JbootControllerContext.get().getAttr("user");
-
- if (userId == null && user == null) {
- throw new RuntimeException("#userArticles() args is error,userId must not be null." + getLocation());
- }
-
- if (userId == null) {
- userId = user.getId();
- }
-
- String orderBy = getPara("orderBy", scope, "id desc");
- String status = getPara("status", scope, Article.STATUS_NORMAL);
- int count = getParaToInt("count", scope, 10);
-
-
- Columns columns = Columns.create("user_id", userId);
- columns.add("status", status);
-
- List articles = service.findListByColumns(columns, orderBy, count);
-
- if (articles == null || articles.isEmpty()) {
- return;
- }
-
- scope.setLocal("articles", articles);
- renderBody(env, scope, writer);
- }
-
-
- @Override
- public boolean hasEnd() {
- return true;
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.module.article.directive;
+
+import com.jfinal.aop.Inject;
+import com.jfinal.template.Env;
+import com.jfinal.template.io.Writer;
+import com.jfinal.template.stat.Scope;
+import io.jboot.db.model.Columns;
+import io.jboot.web.controller.JbootControllerContext;
+import io.jboot.web.directive.annotation.JFinalDirective;
+import io.jboot.web.directive.base.JbootDirectiveBase;
+import io.jpress.model.User;
+import io.jpress.module.article.model.Article;
+import io.jpress.module.article.service.ArticleService;
+
+import java.util.List;
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ */
+@JFinalDirective("userArticles")
+public class UserArticlesDirective extends JbootDirectiveBase {
+
+ @Inject
+ private ArticleService service;
+
+
+ @Override
+ public void onRender(Env env, Scope scope, Writer writer) {
+
+ Long userId = getParaToLong("userId", scope);
+ Boolean hiddenFlag = getParaToBool("hiddenFlag", scope, false);
+ User user = JbootControllerContext.get().getAttr("user");
+
+ if (userId == null && user == null) {
+ throw new RuntimeException("#userArticles() args is error,userId must not be null." + getLocation());
+ }
+
+ if (userId == null) {
+ userId = user.getId();
+ }
+
+ String orderBy = getPara("orderBy", scope, "id desc");
+ String status = getPara("status", scope, Article.STATUS_NORMAL);
+ int count = getParaToInt("count", scope, 10);
+
+
+ Columns columns = Columns.create("user_id", userId);
+ columns.add("status", status);
+ if(hiddenFlag) {
+ columns.ne("flag", "hidden");
+ }
+
+ List articles = service.findListByColumns(columns, orderBy, count);
+
+ if (articles == null || articles.isEmpty()) {
+ return;
+ }
+
+ scope.setLocal("articles", articles);
+ renderBody(env, scope, writer);
+ }
+
+
+ @Override
+ public boolean hasEnd() {
+ return true;
+ }
+}
--
Gitee
From 34d5c679839a08bd594046df2a5ade1bd2530453 Mon Sep 17 00:00:00 2001
From: onewomanonecity <2589071709@qq.com>
Date: Sat, 28 Mar 2020 21:14:25 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9A=90=E8=97=8F?=
=?UTF-8?q?=E6=96=87=E7=AB=A0=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../provider/ArticleServiceProvider.java | 26 +++++--------------
.../directive/ArticleSearchPageDirective.java | 2 +-
.../article/directive/ArticlesDirective.java | 2 +-
3 files changed, 9 insertions(+), 21 deletions(-)
diff --git a/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java b/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java
index e9af9b269..21557d9a0 100755
--- a/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java
+++ b/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java
@@ -144,9 +144,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
orderBy = StrUtil.obtainDefaultIfBlank(orderBy, DEFAULT_ORDER_BY);
Columns columns = new Columns();
columns.add("status", Article.STATUS_NORMAL);
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(flag = 'hidden' or flag is null)");
Page dataPage = DAO.paginateByColumns(page, pagesize, columns, orderBy);
return joinUserInfo(dataPage);
}
@@ -158,9 +156,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
Columns columns = new Columns();
columns.add("m.category_id", categoryId);
columns.add("article.status", Article.STATUS_NORMAL);
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(flag = 'hidden' or flag is null)");
Page dataPage = DAO.leftJoin("article_category_mapping")
.as("m").on("article.id=m.`article_id`")
@@ -284,9 +280,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
Columns columns = Columns.create();
columns.add(Column.create("id", id, Column.LOGIC_GT));
columns.add(Column.create("status", Article.STATUS_NORMAL));
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(flag = 'hidden' or flag is null)");
return joinUserInfo(DAO.findFirstByColumns(columns));
}
@@ -295,9 +289,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
Columns columns = Columns.create();
columns.add(Column.create("id", id, Column.LOGIC_LT));
columns.add(Column.create("status", Article.STATUS_NORMAL));
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(flag = 'hidden' or flag is null)");
return joinUserInfo(DAO.findFirstByColumns(columns, "id desc"));
}
@@ -332,10 +324,8 @@ public class ArticleServiceProvider extends JbootServiceBase implements
.create("m.category_id", categoryId)
.eq("article.status", Article.STATUS_NORMAL)
.isNotNullIf("article.thumbnail", hasThumbnail != null && hasThumbnail)
- .isNullIf("article.thumbnail", hasThumbnail != null && !hasThumbnail)
- .ne("flag", "hidden")
- .or()
- .isNull("flag");
+ .isNullIf("article.thumbnail", hasThumbnail != null && !hasThumbnail);
+ columns.sqlPart("(flag = 'hidden' or flag is null)");
List articles = DAO.leftJoin("article_category_mapping").as("m")
.on("article.id = m.`article_id`")
@@ -358,9 +348,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
columns.in("m.category_id", tagIds.toArray());
columns.ne("article.id", articleId);
columns.eq("article.status", status);
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(flag = 'hidden' or flag is null)");
List articles = DAO.leftJoin("article_category_mapping").as("m")
.on("article.id = m.`article_id`")
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticleSearchPageDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticleSearchPageDirective.java
index 3c8a695f0..53eb7d06e 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticleSearchPageDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticleSearchPageDirective.java
@@ -62,7 +62,7 @@ public class ArticleSearchPageDirective extends JbootDirectiveBase {
if("hidden".equals(article.getFlag())) {
// 通过linkTo实现无法查看
article.setLinkTo("##");
- article.setContent("作者已经隐藏了此文章,你无权查看!");
+ article.setContent("该文章已隐藏,你无权查看!");
}
}
}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java
index 23d625f1f..690a7b326 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java
@@ -58,7 +58,7 @@ public class ArticlesDirective extends JbootDirectiveBase {
// 当flag设置为articleSoftHidden时,文章列表页不可见,当flag设置为articleHardHidden时,文章列表页,文章内容页不可见
if(hiddenFlag) {
- columns.ne("flag", "hidden");
+ columns.sqlPart("(flag = 'hidden' or flag is null)");
}
if (hasThumbnail != null) {
--
Gitee
From eeee5f475e70af09d3c8df0e6e4e3fba3df5c400 Mon Sep 17 00:00:00 2001
From: onewomanonecity <2589071709@qq.com>
Date: Sat, 28 Mar 2020 21:14:25 +0800
Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=9A=90=E8=97=8F?=
=?UTF-8?q?=E6=96=87=E7=AB=A0=E7=9A=84bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../provider/ArticleServiceProvider.java | 26 +++++--------------
.../directive/ArticleSearchPageDirective.java | 2 +-
.../article/directive/ArticlesDirective.java | 2 +-
.../directive/RelevantArticlesDirective.java | 2 +-
4 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java b/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java
index e9af9b269..ac2a91a9b 100755
--- a/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java
+++ b/module-article/module-article-service-provider/src/main/java/io/jpress/module/article/service/provider/ArticleServiceProvider.java
@@ -144,9 +144,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
orderBy = StrUtil.obtainDefaultIfBlank(orderBy, DEFAULT_ORDER_BY);
Columns columns = new Columns();
columns.add("status", Article.STATUS_NORMAL);
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(flag != 'hidden' or flag is null)");
Page dataPage = DAO.paginateByColumns(page, pagesize, columns, orderBy);
return joinUserInfo(dataPage);
}
@@ -158,9 +156,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
Columns columns = new Columns();
columns.add("m.category_id", categoryId);
columns.add("article.status", Article.STATUS_NORMAL);
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(article.flag != 'hidden' or article.flag is null)");
Page dataPage = DAO.leftJoin("article_category_mapping")
.as("m").on("article.id=m.`article_id`")
@@ -284,9 +280,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
Columns columns = Columns.create();
columns.add(Column.create("id", id, Column.LOGIC_GT));
columns.add(Column.create("status", Article.STATUS_NORMAL));
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(flag != 'hidden' or flag is null)");
return joinUserInfo(DAO.findFirstByColumns(columns));
}
@@ -295,9 +289,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
Columns columns = Columns.create();
columns.add(Column.create("id", id, Column.LOGIC_LT));
columns.add(Column.create("status", Article.STATUS_NORMAL));
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(flag != 'hidden' or flag is null)");
return joinUserInfo(DAO.findFirstByColumns(columns, "id desc"));
}
@@ -332,10 +324,8 @@ public class ArticleServiceProvider extends JbootServiceBase implements
.create("m.category_id", categoryId)
.eq("article.status", Article.STATUS_NORMAL)
.isNotNullIf("article.thumbnail", hasThumbnail != null && hasThumbnail)
- .isNullIf("article.thumbnail", hasThumbnail != null && !hasThumbnail)
- .ne("flag", "hidden")
- .or()
- .isNull("flag");
+ .isNullIf("article.thumbnail", hasThumbnail != null && !hasThumbnail);
+ columns.sqlPart("(flag != 'hidden' or flag is null)");
List articles = DAO.leftJoin("article_category_mapping").as("m")
.on("article.id = m.`article_id`")
@@ -358,9 +348,7 @@ public class ArticleServiceProvider extends JbootServiceBase implements
columns.in("m.category_id", tagIds.toArray());
columns.ne("article.id", articleId);
columns.eq("article.status", status);
- columns.ne("flag", "hidden");
- columns.or();
- columns.isNull("flag");
+ columns.sqlPart("(flag != 'hidden' or flag is null)");
List articles = DAO.leftJoin("article_category_mapping").as("m")
.on("article.id = m.`article_id`")
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticleSearchPageDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticleSearchPageDirective.java
index 3c8a695f0..53eb7d06e 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticleSearchPageDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticleSearchPageDirective.java
@@ -62,7 +62,7 @@ public class ArticleSearchPageDirective extends JbootDirectiveBase {
if("hidden".equals(article.getFlag())) {
// 通过linkTo实现无法查看
article.setLinkTo("##");
- article.setContent("作者已经隐藏了此文章,你无权查看!");
+ article.setContent("该文章已隐藏,你无权查看!");
}
}
}
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java
index 23d625f1f..cf3a82e98 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/ArticlesDirective.java
@@ -58,7 +58,7 @@ public class ArticlesDirective extends JbootDirectiveBase {
// 当flag设置为articleSoftHidden时,文章列表页不可见,当flag设置为articleHardHidden时,文章列表页,文章内容页不可见
if(hiddenFlag) {
- columns.ne("flag", "hidden");
+ columns.sqlPart("(flag != 'hidden' or flag is null)");
}
if (hasThumbnail != null) {
diff --git a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/RelevantArticlesDirective.java b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/RelevantArticlesDirective.java
index 8623f3b0c..676c33bcc 100644
--- a/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/RelevantArticlesDirective.java
+++ b/module-article/module-article-web/src/main/java/io/jpress/module/article/directive/RelevantArticlesDirective.java
@@ -51,7 +51,7 @@ public class RelevantArticlesDirective extends JbootDirectiveBase {
}
//默认值 3
- int count = getParaToInt(1, scope, 3);
+ int count = getParaToInt("count", scope, 3);
List relevantArticles = hiddenFlag ? service.findRelevantListByArticleIdNotHidden(article.getId(), Article.STATUS_NORMAL, count) : service.findRelevantListByArticleId(article.getId(), Article.STATUS_NORMAL, count);
--
Gitee
From cfb3cb6865a8ea7e1a1c11619f3c6eee3e23a6a5 Mon Sep 17 00:00:00 2001
From: onewomanonecity <2589071709@qq.com>
Date: Sun, 12 Apr 2020 01:21:56 +0800
Subject: [PATCH 4/7] pom.xml conflict
---
pom.xml | 828 ++++++++++++++++++++++++++++----------------------------
1 file changed, 414 insertions(+), 414 deletions(-)
diff --git a/pom.xml b/pom.xml
index 04c8048a5..0f459e542 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,415 +1,415 @@
-
-
- 4.0.0
-
- io.jpress
- parent
- pom
- 3.0
-
-
- codegen
-
- jpress-addons
- jpress-commons
- jpress-core
- jpress-web
- jpress-service-api
- jpress-service-provider
- jpress-model
- jpress-template
-
- module-article
- module-page
- module-product
-
- starter
- starter-tomcat
-
-
-
-
-
- 1.8
- 3.1.5
- 2.5
- 0.9.1
- 1.2.3
- 1.6.2
- 2.6
- 0.14.0
- 3.8.1
- 4.5.11
- 2.10.3
- 2.13.1
- 28.2-jre
- 2.6
- 1.2
- 1.14
- 1.7.29
- 1.2.68
- 8.4.1
- 2.6.2
- 7.6.0
-
- 1.8
- 1.8
-
- UTF-8
-
-
-
-
-
-
-
- com.atlassian.commonmark
- commonmark
- ${commonmark.version}
-
-
-
- com.atlassian.commonmark
- commonmark-ext-gfm-tables
- ${commonmark.version}
-
-
-
- com.atlassian.commonmark
- commonmark-ext-yaml-front-matter
- ${commonmark.version}
-
-
-
- com.google.guava
- guava
- ${guava.version}
-
-
-
- commons-lang
- commons-lang
- ${commons-lang.version}
-
-
-
- commons-logging
- commons-logging
- ${commons-logging.version}
-
-
-
-
- org.apache.httpcomponents
- httpcore
- 4.4.13
-
-
-
- org.lionsoul
- jcseg-core
- ${jcseg.version}
-
-
-
- org.lionsoul
- jcseg-analyzer
- ${jcseg.version}
-
-
-
- org.apache.lucene
- lucene-core
- ${lucene.version}
-
-
-
- org.apache.lucene
- lucene-queryparser
- ${lucene.version}
-
-
-
- org.apache.lucene
- lucene-highlighter
- ${lucene.version}
-
-
-
- org.apache.lucene
- lucene-analyzers-common
- ${lucene.version}
-
-
-
- org.elasticsearch.client
- elasticsearch-rest-high-level-client
- ${elasticsearch.version}
-
-
- org.apache.logging.log4j
- log4j-api
-
-
-
-
-
-
- io.jboot
- jboot
- ${jboot.version}
-
-
-
- com.jfinal
- jfinal-weixin
- ${jfinal-weixin.version}
-
-
-
- io.jsonwebtoken
- jjwt
- ${jjwt.version}
-
-
-
- ch.qos.logback
- logback-core
- ${logback.version}
-
-
-
- ch.qos.logback
- logback-classic
- ${logback.version}
-
-
-
- io.jpress
- jpress-commons
- 3.0
-
-
-
- io.jpress
- jpress-core
- 3.0
-
-
-
- io.jpress
- jpress-model
- 3.0
-
-
-
- io.jpress
- jpress-web
- 3.0
-
-
-
- io.jpress
- jpress-service-api
- 3.0
-
-
-
- io.jpress
- jpress-service-provider
- 3.0
-
-
-
- javax.mail
- javax.mail-api
- ${javax.mail.version}
-
-
-
- com.sun.mail
- javax.mail
- ${javax.mail.version}
-
-
-
- commons-io
- commons-io
- ${commons-io.version}
-
-
-
- com.aliyun.oss
- aliyun-sdk-oss
- ${aliyunoss.version}
-
-
- org.apache.httpcomponents
- httpclient
-
-
-
-
-
- org.apache.httpcomponents
- httpclient
- ${httpclient.version}
-
-
- commons-codec
- commons-codec
-
-
-
-
-
- commons-codec
- commons-codec
- ${commons-codec.version}
-
-
-
- com.fasterxml.jackson.core
- jackson-core
- ${jackson.version}
-
-
-
- com.fasterxml.jackson.core
- jackson-databind
- ${jackson.version}
-
-
-
- com.fasterxml.jackson.core
- jackson-annotations
- ${jackson.version}
-
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-yaml
- ${jackson.version}
-
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-cbor
- ${jackson.version}
-
-
-
- com.fasterxml.jackson.dataformat
- jackson-dataformat-smile
- ${jackson.version}
-
-
-
- com.egzosn
- pay-java-ali
- ${pay-java.version}
-
-
-
- com.egzosn
- pay-java-wx
- ${pay-java.version}
-
-
-
- com.egzosn
- pay-java-paypal
- ${pay-java.version}
-
-
-
- org.slf4j
- slf4j-api
- ${slf4j.version}
-
-
-
- org.slf4j
- slf4j-log4j12
- ${slf4j.version}
-
-
-
- org.slf4j
- slf4j-simple
- ${slf4j.version}
-
-
-
- org.slf4j
- jcl-over-slf4j
- ${slf4j.version}
-
-
-
- com.alibaba
- fastjson
- ${fastjson.version}
-
-
-
-
-
-
-
-
- central
- https://maven.aliyun.com/nexus/content/groups/public
-
- true
-
-
- true
- always
- fail
-
-
-
-
-
-
-
- central
- https://maven.aliyun.com/nexus/content/groups/public
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
-
- 1.8
- 1.8
- UTF-8
- -parameters
-
-
-
-
-
-
-
-
- org.codehaus.mojo
- versions-maven-plugin
- 2.7
-
- false
-
-
-
-
-
-
-
-
+
+
+ 4.0.0
+
+ io.jpress
+ parent
+ pom
+ 3.0
+
+
+ codegen
+
+ jpress-addons
+ jpress-commons
+ jpress-core
+ jpress-web
+ jpress-service-api
+ jpress-service-provider
+ jpress-model
+ jpress-template
+
+ module-article
+ module-page
+ module-product
+
+ starter
+ starter-tomcat
+
+
+
+
+
+ 1.8
+ 2.5
+ 3.1.0
+ 0.9.1
+ 1.2.3
+ 1.6.2
+ 2.6
+ 0.14.0
+ 3.8.1
+ 4.5.11
+ 2.10.3
+ 2.13.1
+ 28.2-jre
+ 2.6
+ 1.2
+ 1.14
+ 1.7.29
+ 1.2.68
+ 8.4.1
+ 2.6.2
+ 7.6.0
+
+ 1.8
+ 1.8
+
+ UTF-8
+
+
+
+
+
+
+
+ com.atlassian.commonmark
+ commonmark
+ ${commonmark.version}
+
+
+
+ com.atlassian.commonmark
+ commonmark-ext-gfm-tables
+ ${commonmark.version}
+
+
+
+ com.atlassian.commonmark
+ commonmark-ext-yaml-front-matter
+ ${commonmark.version}
+
+
+
+ com.google.guava
+ guava
+ ${guava.version}
+
+
+
+ commons-lang
+ commons-lang
+ ${commons-lang.version}
+
+
+
+ commons-logging
+ commons-logging
+ ${commons-logging.version}
+
+
+
+
+ org.apache.httpcomponents
+ httpcore
+ 4.4.13
+
+
+
+ org.lionsoul
+ jcseg-core
+ ${jcseg.version}
+
+
+
+ org.lionsoul
+ jcseg-analyzer
+ ${jcseg.version}
+
+
+
+ org.apache.lucene
+ lucene-core
+ ${lucene.version}
+
+
+
+ org.apache.lucene
+ lucene-queryparser
+ ${lucene.version}
+
+
+
+ org.apache.lucene
+ lucene-highlighter
+ ${lucene.version}
+
+
+
+ org.apache.lucene
+ lucene-analyzers-common
+ ${lucene.version}
+
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-high-level-client
+ ${elasticsearch.version}
+
+
+ org.apache.logging.log4j
+ log4j-api
+
+
+
+
+
+
+ io.jboot
+ jboot
+ ${jboot.version}
+
+
+
+ com.jfinal
+ jfinal-weixin
+ ${jfinal-weixin.version}
+
+
+
+ io.jsonwebtoken
+ jjwt
+ ${jjwt.version}
+
+
+
+ ch.qos.logback
+ logback-core
+ ${logback.version}
+
+
+
+ ch.qos.logback
+ logback-classic
+ ${logback.version}
+
+
+
+ io.jpress
+ jpress-commons
+ 3.0
+
+
+
+ io.jpress
+ jpress-core
+ 3.0
+
+
+
+ io.jpress
+ jpress-model
+ 3.0
+
+
+
+ io.jpress
+ jpress-web
+ 3.0
+
+
+
+ io.jpress
+ jpress-service-api
+ 3.0
+
+
+
+ io.jpress
+ jpress-service-provider
+ 3.0
+
+
+
+ javax.mail
+ javax.mail-api
+ ${javax.mail.version}
+
+
+
+ com.sun.mail
+ javax.mail
+ ${javax.mail.version}
+
+
+
+ commons-io
+ commons-io
+ ${commons-io.version}
+
+
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ ${aliyunoss.version}
+
+
+ org.apache.httpcomponents
+ httpclient
+
+
+
+
+
+ org.apache.httpcomponents
+ httpclient
+ ${httpclient.version}
+
+
+ commons-codec
+ commons-codec
+
+
+
+
+
+ commons-codec
+ commons-codec
+ ${commons-codec.version}
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ ${jackson.version}
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+ ${jackson.version}
+
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+ ${jackson.version}
+
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-cbor
+ ${jackson.version}
+
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-smile
+ ${jackson.version}
+
+
+
+ com.egzosn
+ pay-java-ali
+ ${pay-java.version}
+
+
+
+ com.egzosn
+ pay-java-wx
+ ${pay-java.version}
+
+
+
+ com.egzosn
+ pay-java-paypal
+ ${pay-java.version}
+
+
+
+ org.slf4j
+ slf4j-api
+ ${slf4j.version}
+
+
+
+ org.slf4j
+ slf4j-log4j12
+ ${slf4j.version}
+
+
+
+ org.slf4j
+ slf4j-simple
+ ${slf4j.version}
+
+
+
+ org.slf4j
+ jcl-over-slf4j
+ ${slf4j.version}
+
+
+
+ com.alibaba
+ fastjson
+ ${fastjson.version}
+
+
+
+
+
+
+
+
+ central
+ https://maven.aliyun.com/nexus/content/groups/public
+
+ true
+
+
+ true
+ always
+ fail
+
+
+
+
+
+
+
+ central
+ https://maven.aliyun.com/nexus/content/groups/public
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+
+ 1.8
+ 1.8
+ UTF-8
+ -parameters
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ versions-maven-plugin
+ 2.7
+
+ false
+
+
+
+
+
+
+
+
\ No newline at end of file
--
Gitee
From cc899186a47b8927bf680231c0ecc6978e7bf4f6 Mon Sep 17 00:00:00 2001
From: onewomanonecity <2589071709@qq.com>
Date: Sun, 12 Apr 2020 01:50:58 +0800
Subject: [PATCH 5/7] =?UTF-8?q?fork=E5=90=8C=E6=AD=A5jpress?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.dockerignore | 4 +-
.gitignore | 56 +-
Dockerfile | 34 +-
LICENSE | 330 +-
README.md | 418 +-
changes.txt | 712 +-
codegen/pom.xml | 110 +-
.../io/jpress/codegen/AddonGenerator.java | 272 +-
.../io/jpress/codegen/ModuleGenerator.java | 440 +-
.../io/jpress/codegen/SystemGenerator.java | 180 +-
.../main/java/io/jpress/codegen/Tester.java | 84 +-
.../codegen/generator/AddonUIGenerator.java | 318 +-
.../codegen/generator/BaseModelGenerator.java | 60 +-
.../generator/BaseOptionsModelGenerator.java | 62 +-
.../codegen/generator/ModelGenerator.java | 62 +-
.../codegen/generator/ModuleUIGenerator.java | 346 +-
.../generator/ServiceApiGenerator.java | 234 +-
.../generator/ServiceProviderGenerator.java | 200 +-
.../codegen/templates/base_model_template.jf | 96 +-
.../templates/base_options_model_template.jf | 96 +-
.../codegen/templates/model_template.jf | 40 +-
.../templates/module_listener_template.jf | 124 +-
.../codegen/templates/pom_model_template.jf | 44 +-
.../codegen/templates/pom_module_template.jf | 84 +-
.../templates/pom_service_api_template.jf | 60 +-
.../pom_service_provider_template.jf | 82 +-
.../codegen/templates/pom_web_template.jf | 92 +-
.../templates/service_provider_template.jf | 20 +-
.../codegen/templates/service_template.jf | 354 +-
.../templates/ui_controller_template.jf | 144 +-
.../ui_controller_template_for_addon.jf | 134 +-
.../codegen/templates/ui_edit_template.jf | 194 +-
.../codegen/templates/ui_list_template.jf | 212 +-
.../codegen/templates/ui_listener_template.jf | 124 +-
dbuild.sh | 72 +-
doc/about_jpress.md | 32 +-
doc/addon_dev.md | 120 +-
doc/install.md | 338 +-
doc/quick_start.md | 110 +-
doc/readme.md | 2392 +-
doc/template_dev.md | 582 +-
doc/upgrade.md | 96 +-
doc/videos.md | 72 +-
doc/vip.md | 288 +-
doc/wechat_dev.md | 188 +-
docker-compose.yml | 74 +-
docker/Dockerfile.base | 18 +-
docker/docker-compose-dev.yml | 78 +-
docker/docker-compose-nginx.yml | 106 +-
docker/files/jboot.properties | 6 +-
docker/files/jpress.sh | 92 +-
docker/files/settings.xml | 52 +-
docker/nginx/nginx.conf | 152 +-
docker/push-base.sh | 2 +-
install.sh | 142 +-
.../jpress-addon-categoryTag/pom.xml | 43 +
.../jpress/addon/menutag/MenuTagAddon.java | 63 +
.../addon/menutag/MenuTagAddonHandler.java | 16 +
.../menutag/MenuTagAddonInterceptor.java | 17 +
.../addon/menutag/MenuTagController.java | 146 +
.../jpress/addon/menutag/MenuTagUpgrader.java | 18 +
.../src/main/resources/addon.txt | 7 +
.../src/main/resources/changelog.txt | 20 +
.../src/main/resources/readme.txt | 10 +
.../src/main/webapp/menuTag.gif | Bin 0 -> 8517724 bytes
.../main/webapp/resource/page_menuTag.html | 79 +
.../plugin-menuTag/plugin-menuTag.css | 74 +
.../src/main/webapp/setting.html | 98 +
jpress-addons/jpress-addon-helloworld/pom.xml | 90 +-
.../addon/helloworld/HelloWorldAddon.java | 126 +-
.../helloworld/HelloWorldAddonController.java | 56 +-
.../helloworld/HelloWorldAddonHandler.java | 32 +-
.../HelloWorldAddonInterceptor.java | 34 +-
.../addon/helloworld/HelloWorldUpgrader.java | 36 +-
.../src/main/resources/addon.txt | 12 +-
.../src/main/resources/config.txt | 48 +-
.../src/main/webapp/helloworld/index.html | 22 +-
jpress-addons/jpress-addon-message/LICENSE | 330 +-
jpress-addons/jpress-addon-message/README.md | 52 +-
jpress-addons/jpress-addon-message/pom.xml | 102 +-
.../src/main/java/Codegen.java | 46 +-
.../src/main/java/MessageAddon.java | 128 +-
.../message/controller/MessageController.java | 112 +-
.../controller/_MessageController.java | 150 +-
.../directive/MessageListDirective.java | 72 +-
.../message/model/JpressAddonMessage.java | 30 +-
.../model/base/BaseJpressAddonMessage.java | 212 +-
.../service/JpressAddonMessageService.java | 354 +-
.../JpressAddonMessageServiceProvider.java | 20 +-
.../src/main/resources/addon.txt | 14 +-
.../src/main/resources/changelog.txt | 2 +-
.../src/main/resources/readme.txt | 52 +-
.../src/main/resources/sql/install.sql | 20 +-
.../src/main/resources/sql/uninstall.sql | 2 +-
.../views/jpress_addon_message_edit.html | 246 +-
.../views/jpress_addon_message_list.html | 220 +-
jpress-addons/pom.xml | 96 +-
jpress-commons/pom.xml | 190 +-
.../main/java/io/jpress/JPressActiveKit.java | 96 +-
.../src/main/java/io/jpress/JPressConfig.java | 318 +-
.../src/main/java/io/jpress/JPressConsts.java | 256 +-
.../main/java/io/jpress/JPressOptions.java | 468 +-
.../java/io/jpress/base/BaseOptionsModel.java | 208 +-
.../java/io/jpress/commons/CacheObject.java | 82 +-
.../main/java/io/jpress/commons/Copyer.java | 78 +-
.../src/main/java/io/jpress/commons/Msg.java | 250 +-
.../java/io/jpress/commons/SnowFlake.java | 198 +-
.../io/jpress/commons/authcode/AuthCode.java | 150 +-
.../jpress/commons/authcode/AuthCodeKit.java | 74 +-
.../io/jpress/commons/bean/RenderList.java | 70 +-
.../java/io/jpress/commons/dfa/DFAUtil.java | 300 +-
.../commons/dfa/algorithm/BCConvert.java | 126 +-
.../commons/dfa/algorithm/DFAConfig.java | 376 +-
.../commons/dfa/algorithm/DFAFilter.java | 530 +-
.../commons/dfa/algorithm/DFAMatch.java | 94 +-
.../jpress/commons/dfa/algorithm/DFANode.java | 150 +-
.../jpress/commons/directive/DirectveKit.java | 112 +-
.../io/jpress/commons/directive/StrSplit.java | 64 +-
.../commons/email/AliyunEmailSender.java | 74 +-
.../java/io/jpress/commons/email/Email.java | 210 +-
.../io/jpress/commons/email/EmailSender.java | 44 +-
.../commons/email/SimpleEmailSender.java | 304 +-
.../java/io/jpress/commons/layer/SortKit.java | 206 +-
.../io/jpress/commons/layer/SortModel.java | 100 +-
.../commons/oauth2/Oauth2Controller.java | 182 +-
.../jpress/commons/oauth2/OauthConnector.java | 216 +-
.../io/jpress/commons/oauth2/OauthUser.java | 148 +-
.../oauth2/connector/DingdingConnector.java | 214 +-
.../oauth2/connector/GithubConnector.java | 146 +-
.../oauth2/connector/OSChinaConnector.java | 208 +-
.../commons/oauth2/connector/QQConnector.java | 254 +-
.../oauth2/connector/WechatConnector.java | 240 +-
.../oauth2/connector/WeiboConnector.java | 176 +-
.../jpress/commons/pay/AlipayPayConfig.java | 218 +-
.../jpress/commons/pay/AlipayxPayConfig.java | 124 +-
.../io/jpress/commons/pay/PayConfigBase.java | 94 +-
.../io/jpress/commons/pay/PayConfigUtil.java | 142 +-
.../java/io/jpress/commons/pay/PayStatus.java | 308 +-
.../java/io/jpress/commons/pay/PayType.java | 130 +-
.../jpress/commons/pay/PaypalPayConfig.java | 146 +-
.../jpress/commons/pay/WechatPayConfig.java | 236 +-
.../jpress/commons/pay/WechatxPayConfig.java | 126 +-
.../jpress/commons/sms/AliyunSmsSender.java | 284 +-
.../io/jpress/commons/sms/NonSmsSender.java | 62 +-
.../jpress/commons/sms/QCloudSmsSender.java | 200 +-
.../java/io/jpress/commons/sms/SmsKit.java | 184 +-
.../io/jpress/commons/sms/SmsMessage.java | 148 +-
.../java/io/jpress/commons/sms/SmsSender.java | 44 +-
.../jpress/commons/sms/SmsSenderFactory.java | 106 +-
.../jpress/commons/utils/AliyunOssUtils.java | 338 +-
.../jpress/commons/utils/AttachmentUtils.java | 284 +-
.../io/jpress/commons/utils/CommonsUtils.java | 268 +-
.../io/jpress/commons/utils/ImageUtils.java | 704 +-
.../io/jpress/commons/utils/JPressJson.java | 298 +-
.../io/jpress/commons/utils/JsoupUtils.java | 352 +-
.../jpress/commons/utils/MarkdownUtils.java | 216 +-
.../io/jpress/commons/utils/SignUtils.java | 90 +-
.../io/jpress/commons/utils/SqlUtils.java | 148 +-
jpress-core/pom.xml | 162 +-
.../java/io/jpress/JPressCoreInitializer.java | 240 +-
.../main/java/io/jpress/core/addon/Addon.java | 62 +-
.../jpress/core/addon/AddonClassLoader.java | 386 +-
.../java/io/jpress/core/addon/AddonInfo.java | 700 +-
.../io/jpress/core/addon/AddonManager.java | 2048 +-
.../io/jpress/core/addon/AddonNotifier.java | 40 +-
.../io/jpress/core/addon/AddonUpgrader.java | 74 +-
.../java/io/jpress/core/addon/AddonUtil.java | 1004 +-
.../addon/annotation/GlobalInterceptor.java | 54 +-
.../controller/AddonControllerManager.java | 472 +-
.../controller/AddonControllerProcesser.java | 82 +-
.../addon/handler/AddonHandlerManager.java | 138 +-
.../addon/handler/AddonHandlerProcesser.java | 72 +-
.../interceptor/AddonInterceptorManager.java | 108 +-
.../AddonInterceptorProcesser.java | 280 +-
.../core/addon/template/AddonTemplateEnv.java | 74 +-
.../core/annotation/AdminPermission.java | 58 +-
.../core/annotation/NeedUserLogined.java | 54 +-
.../core/attachment/AttachmentDownloader.java | 160 +-
.../core/finance/BaseProductInfoQuerier.java | 96 +-
.../OrderItemStatusChangeListener.java | 50 +-
.../io/jpress/core/finance/OrderManager.java | 224 +-
.../finance/OrderStatusChangeListener.java | 50 +-
.../jpress/core/finance/PaymentManager.java | 140 +-
.../core/finance/PaymentSuccessListener.java | 50 +-
.../core/finance/ProductInfoQuerier.java | 138 +-
.../jpress/core/finance/ProductManager.java | 362 +-
.../core/finance/ProductOptionsRender.java | 34 +-
.../java/io/jpress/core/install/Consts.java | 78 +-
.../io/jpress/core/install/DbExecuter.java | 336 +-
.../jpress/core/install/InstallHandler.java | 96 +-
.../jpress/core/install/InstallManager.java | 254 +-
.../io/jpress/core/install/Installer.java | 128 +-
.../io/jpress/core/menu/MenuArrayList.java | 52 +-
.../java/io/jpress/core/menu/MenuGroup.java | 278 +-
.../java/io/jpress/core/menu/MenuItem.java | 278 +-
.../java/io/jpress/core/menu/MenuManager.java | 610 +-
.../core/menu/annotation/AdminMenu.java | 78 +-
.../core/menu/annotation/UCenterMenu.java | 78 +-
.../io/jpress/core/module/ModuleBase.java | 106 +-
.../io/jpress/core/module/ModuleListener.java | 136 +-
.../core/module/ModuleListenerBase.java | 104 +-
.../io/jpress/core/module/ModuleManager.java | 150 +-
.../core/support/ehcache/EhcacheManager.java | 192 +-
.../core/support/smartfield/SmartField.java | 432 +-
.../support/smartfield/SmartFieldRender.java | 52 +-
.../smartfield/SmartFieldRenderFactory.java | 116 +-
.../smartfield/renders/CheckboxRender.java | 184 +-
.../smartfield/renders/DateRender.java | 92 +-
.../smartfield/renders/DatetimeRender.java | 92 +-
.../smartfield/renders/FileRender.java | 66 +-
.../smartfield/renders/ImageRender.java | 68 +-
.../smartfield/renders/InputRender.java | 90 +-
.../smartfield/renders/RadioRender.java | 166 +-
.../support/smartfield/renders/RenderKit.java | 86 +-
.../smartfield/renders/SelectRender.java | 166 +-
.../smartfield/renders/SwitchRender.java | 96 +-
.../smartfield/renders/TextareaRender.java | 88 +-
.../io/jpress/core/template/Template.java | 650 +-
.../jpress/core/template/TemplateManager.java | 390 +-
.../core/template/TemplateNotifier.java | 52 +-
.../io/jpress/core/wechat/WechatAddon.java | 92 +-
.../jpress/core/wechat/WechatAddonConfig.java | 88 +-
.../jpress/core/wechat/WechatAddonInfo.java | 278 +-
.../core/wechat/WechatAddonManager.java | 300 +-
.../jpress/web/base/AdminControllerBase.java | 168 +-
.../io/jpress/web/base/ApiControllerBase.java | 94 +-
.../io/jpress/web/base/ControllerBase.java | 310 +-
.../web/base/TemplateControllerBase.java | 420 +-
.../web/base/UcenterControllerBase.java | 96 +-
.../jpress/web/base/UserControllerBase.java | 60 +-
.../web/captcha/JPressCaptchaCache.java | 118 +-
.../web/directive/CheckedIfDirective.java | 90 +-
.../web/directive/HasAddonDirective.java | 110 +-
.../web/directive/MaxLengthDirective.java | 114 +-
.../jpress/web/directive/ParaDirective.java | 124 +-
.../web/directive/SelectedIfDirective.java | 92 +-
.../web/functions/JPressCoreFunctions.java | 256 +-
.../web/handler/AttachmentHandlerKit.java | 152 +-
.../io/jpress/web/handler/JPressHandler.java | 212 +-
.../web/interceptor/AdminInterceptor.java | 196 +-
.../web/interceptor/ApiInterceptor.java | 388 +-
.../web/interceptor/CSRFInterceptor.java | 208 +-
.../web/interceptor/JPressInterceptor.java | 128 +-
.../interceptor/PermissionInterceptor.java | 128 +-
.../web/interceptor/TemplateInterceptor.java | 276 +-
.../web/interceptor/UTMInterceptor.java | 200 +-
.../interceptor/UserCenterInterceptor.java | 86 +-
.../web/interceptor/UserInterceptor.java | 192 +-
.../UserMustLoginedInterceptor.java | 80 +-
.../web/interceptor/WechatInterceptor.java | 208 +-
.../web/render/JPressRenderFactory.java | 134 +-
.../io/jpress/web/render/TemplateRender.java | 528 +-
.../io/jpress/web/seoping/BaiduPinger.java | 112 +-
.../jpress/web/seoping/BaiduSeoProcesser.java | 146 +-
.../io/jpress/web/seoping/GooglePinger.java | 98 +-
.../java/io/jpress/web/seoping/PingData.java | 110 +-
.../java/io/jpress/web/seoping/Pinger.java | 44 +-
.../io/jpress/web/seoping/SeoManager.java | 228 +-
.../main/java/io/jpress/web/seoping/Util.java | 56 +-
.../web/sitemap/MainSitemapCreater.java | 126 +-
.../web/sitemap/MainSitemapProvider.java | 48 +-
.../java/io/jpress/web/sitemap/Sitemap.java | 268 +-
.../jpress/web/sitemap/SitemapController.java | 206 +-
.../io/jpress/web/sitemap/SitemapHandler.java | 96 +-
.../io/jpress/web/sitemap/SitemapManager.java | 178 +-
.../jpress/web/sitemap/SitemapProvider.java | 58 +-
.../io/jpress/web/sitemap/SitemapUtil.java | 98 +-
jpress-model/pom.xml | 68 +-
.../main/java/io/jpress/model/Attachment.java | 236 +-
.../src/main/java/io/jpress/model/Coupon.java | 136 +-
.../main/java/io/jpress/model/CouponCode.java | 100 +-
.../io/jpress/model/CouponUsedRecord.java | 30 +-
.../src/main/java/io/jpress/model/Member.java | 82 +-
.../io/jpress/model/MemberDistAmount.java | 30 +-
.../java/io/jpress/model/MemberGroup.java | 52 +-
.../io/jpress/model/MemberJoinedRecord.java | 108 +-
.../java/io/jpress/model/MemberPrice.java | 30 +-
.../src/main/java/io/jpress/model/Menu.java | 322 +-
.../src/main/java/io/jpress/model/Option.java | 66 +-
.../java/io/jpress/model/PaymentRecord.java | 302 +-
.../main/java/io/jpress/model/Permission.java | 154 +-
.../src/main/java/io/jpress/model/Role.java | 76 +-
.../src/main/java/io/jpress/model/User.java | 298 +-
.../java/io/jpress/model/UserAddress.java | 64 +-
.../io/jpress/model/UserAmountPayout.java | 184 +-
.../io/jpress/model/UserAmountStatement.java | 44 +-
.../main/java/io/jpress/model/UserCart.java | 158 +-
.../java/io/jpress/model/UserFavorite.java | 36 +-
.../main/java/io/jpress/model/UserOpenid.java | 108 +-
.../main/java/io/jpress/model/UserOrder.java | 422 +-
.../io/jpress/model/UserOrderDelivery.java | 60 +-
.../io/jpress/model/UserOrderInvoice.java | 70 +-
.../java/io/jpress/model/UserOrderItem.java | 172 +-
.../main/java/io/jpress/model/UserTag.java | 30 +-
.../src/main/java/io/jpress/model/Utm.java | 72 +-
.../main/java/io/jpress/model/WechatMenu.java | 302 +-
.../java/io/jpress/model/WechatReply.java | 352 +-
.../jpress/model/base/BaseApiApplication.java | 152 +-
.../io/jpress/model/base/BaseAttachment.java | 392 +-
.../java/io/jpress/model/base/BaseCoupon.java | 668 +-
.../io/jpress/model/base/BaseCouponCode.java | 240 +-
.../model/base/BaseCouponUsedRecord.java | 312 +-
.../java/io/jpress/model/base/BaseMember.java | 224 +-
.../model/base/BaseMemberDistAmount.java | 212 +-
.../io/jpress/model/base/BaseMemberGroup.java | 568 +-
.../model/base/BaseMemberJoinedRecord.java | 324 +-
.../io/jpress/model/base/BaseMemberPrice.java | 136 +-
.../java/io/jpress/model/base/BaseMenu.java | 392 +-
.../java/io/jpress/model/base/BaseOption.java | 112 +-
.../jpress/model/base/BasePaymentRecord.java | 1048 +-
.../io/jpress/model/base/BasePermission.java | 188 +-
.../java/io/jpress/model/base/BaseRole.java | 160 +-
.../java/io/jpress/model/base/BaseUser.java | 896 +-
.../io/jpress/model/base/BaseUserAddress.java | 332 +-
.../model/base/BaseUserAmountPayout.java | 428 +-
.../model/base/BaseUserAmountStatement.java | 396 +-
.../io/jpress/model/base/BaseUserCart.java | 604 +-
.../jpress/model/base/BaseUserFavorite.java | 300 +-
.../io/jpress/model/base/BaseUserOpenid.java | 288 +-
.../io/jpress/model/base/BaseUserOrder.java | 1044 +-
.../model/base/BaseUserOrderDelivery.java | 464 +-
.../model/base/BaseUserOrderInvoice.java | 352 +-
.../jpress/model/base/BaseUserOrderItem.java | 1044 +-
.../io/jpress/model/base/BaseUserTag.java | 296 +-
.../java/io/jpress/model/base/BaseUtm.java | 648 +-
.../io/jpress/model/base/BaseWechatMenu.java | 240 +-
.../io/jpress/model/base/BaseWechatReply.java | 156 +-
jpress-service-api/pom.xml | 70 +-
.../io/jpress/service/AttachmentService.java | 174 +-
.../io/jpress/service/CouponCodeService.java | 200 +-
.../java/io/jpress/service/CouponService.java | 184 +-
.../service/CouponUsedRecordService.java | 166 +-
.../service/MemberDistAmountService.java | 354 +-
.../io/jpress/service/MemberGroupService.java | 174 +-
.../service/MemberJoinedRecordService.java | 358 +-
.../io/jpress/service/MemberPriceService.java | 370 +-
.../java/io/jpress/service/MemberService.java | 176 +-
.../java/io/jpress/service/MenuService.java | 186 +-
.../java/io/jpress/service/OptionService.java | 212 +-
.../jpress/service/PaymentRecordService.java | 200 +-
.../io/jpress/service/PermissionService.java | 208 +-
.../java/io/jpress/service/RoleService.java | 236 +-
.../io/jpress/service/UserAddressService.java | 192 +-
.../service/UserAmountPayoutService.java | 360 +-
.../service/UserAmountStatementService.java | 184 +-
.../io/jpress/service/UserCartService.java | 162 +-
.../jpress/service/UserFavoriteService.java | 386 +-
.../io/jpress/service/UserOpenidService.java | 378 +-
.../service/UserOrderDeliveryService.java | 354 +-
.../service/UserOrderInvoiceService.java | 354 +-
.../jpress/service/UserOrderItemService.java | 76 +-
.../io/jpress/service/UserOrderService.java | 192 +-
.../java/io/jpress/service/UserService.java | 254 +-
.../io/jpress/service/UserTagService.java | 380 +-
.../java/io/jpress/service/UtmService.java | 182 +-
.../io/jpress/service/WechatMenuService.java | 168 +-
.../io/jpress/service/WechatReplyService.java | 208 +-
jpress-service-provider/pom.xml | 88 +-
.../provider/AttachmentServiceProvider.java | 198 +-
.../provider/CouponCodeServiceProvider.java | 410 +-
.../provider/CouponServiceProvider.java | 70 +-
.../CouponUsedRecordServiceProvider.java | 80 +-
.../MemberDistAmountServiceProvider.java | 20 +-
.../provider/MemberGroupServiceProvider.java | 52 +-
.../MemberJoinedRecordServiceProvider.java | 62 +-
.../provider/MemberPriceServiceProvider.java | 220 +-
.../provider/MemberServiceProvider.java | 128 +-
.../service/provider/MenuServiceProvider.java | 170 +-
.../provider/OptionServiceProvider.java | 198 +-
.../PaymentRecordServiceProvider.java | 128 +-
.../provider/PermissionServiceProvider.java | 384 +-
.../service/provider/RoleServiceProvider.java | 622 +-
.../provider/UserAddressServiceProvider.java | 128 +-
.../UserAmountPayoutServiceProvider.java | 42 +-
.../UserAmountStatementServiceProvider.java | 106 +-
.../provider/UserCartServiceProvider.java | 254 +-
.../provider/UserFavoriteServiceProvider.java | 152 +-
.../provider/UserOpenidServiceProvider.java | 192 +-
.../UserOrderDeliveryServiceProvider.java | 20 +-
.../UserOrderInvoiceServiceProvider.java | 20 +-
.../UserOrderItemServiceProvider.java | 82 +-
.../provider/UserOrderServiceProvider.java | 172 +-
.../service/provider/UserServiceProvider.java | 488 +-
.../provider/UserTagServiceProvider.java | 206 +-
.../service/provider/UtmServiceProvider.java | 74 +-
.../provider/WechatMenuServiceProvider.java | 50 +-
.../provider/WechatReplyServiceProvider.java | 94 +-
.../jpress/service/task/UtmBatchSaveTask.java | 98 +-
jpress-template/pom.xml | 30 +-
.../webapp/templates/BonHumeur/article.html | 136 +-
.../webapp/templates/BonHumeur/artlist.html | 90 +-
.../bootstrap/css/bootstrap-grid.min.css | 12 +-
.../bootstrap/css/bootstrap-reboot.min.css | 14 +-
.../BonHumeur/bootstrap/css/bootstrap.min.css | 12 +-
.../bootstrap/js/bootstrap.bundle.min.js | 12 +-
.../BonHumeur/bootstrap/js/bootstrap.min.js | 12 +-
.../webapp/templates/BonHumeur/css/bh-css.css | 678 +-
.../webapp/templates/BonHumeur/error.html | 58 +-
.../font-awesome/css/font-awesome.min.css | 8 +-
.../fonts/fontawesome-webfont.svg | 5342 +--
.../webapp/templates/BonHumeur/header.html | 14 +-
.../BonHumeur/highlight/highlight.pack.js | 2 +-
.../BonHumeur/highlight/styles/railscasts.css | 212 +-
.../webapp/templates/BonHumeur/index.html | 88 +-
.../webapp/templates/BonHumeur/layout.html | 96 +-
.../main/webapp/templates/BonHumeur/page.html | 34 +-
.../webapp/templates/BonHumeur/product.html | 78 +-
.../webapp/templates/BonHumeur/prolist.html | 90 +-
.../webapp/templates/BonHumeur/setting.html | 138 +-
.../templates/BonHumeur/template.properties | 16 +-
.../templates/JPressPortal/article.html | 180 +-
.../templates/JPressPortal/artlist.html | 106 +-
.../bootstrap/css/bootstrap-grid.min.css | 12 +-
.../bootstrap/css/bootstrap-reboot.min.css | 14 +-
.../bootstrap/css/bootstrap.min.css | 12 +-
.../bootstrap/js/bootstrap.bundle.min.js | 12 +-
.../bootstrap/js/bootstrap.min.js | 12 +-
.../templates/JPressPortal/css/bl-css.css | 1340 +-
.../font-awesome/css/font-awesome.min.css | 8 +-
.../fonts/fontawesome-webfont.svg | 5342 +--
.../JPressPortal/highlight/highlight.pack.js | 2 +-
.../highlight/styles/railscasts.css | 212 +-
.../webapp/templates/JPressPortal/index.html | 296 +-
.../webapp/templates/JPressPortal/layout.html | 130 +-
.../webapp/templates/JPressPortal/page.html | 20 +-
.../templates/JPressPortal/page_leftbar.html | 56 +-
.../templates/JPressPortal/product.html | 114 +-
.../templates/JPressPortal/prolist.html | 106 +-
.../templates/JPressPortal/setting.html | 144 +-
.../JPressPortal/template.properties | 16 +-
.../webapp/templates/calmlog/_rightbar.html | 130 +-
.../webapp/templates/calmlog/article.html | 114 +-
.../webapp/templates/calmlog/artlist.html | 98 +-
.../webapp/templates/calmlog/artsearch.html | 114 +-
.../bootstrap/css/bootstrap-grid.min.css | 12 +-
.../bootstrap/css/bootstrap-reboot.min.css | 14 +-
.../calmlog/bootstrap/css/bootstrap.min.css | 12 +-
.../bootstrap/js/bootstrap.bundle.min.js | 12 +-
.../calmlog/bootstrap/js/bootstrap.min.js | 12 +-
.../webapp/templates/calmlog/css/cl-css.css | 1052 +-
.../font-awesome/css/font-awesome.min.css | 8 +-
.../fonts/fontawesome-webfont.svg | 5342 +--
.../calmlog/highlight/highlight.pack.js | 2 +-
.../calmlog/highlight/styles/railscasts.css | 212 +-
.../main/webapp/templates/calmlog/index.html | 192 +-
.../main/webapp/templates/calmlog/layout.html | 124 +-
.../main/webapp/templates/calmlog/page.html | 60 +-
.../templates/calmlog/page_rightbar.html | 44 +-
.../webapp/templates/calmlog/product.html | 152 +-
.../webapp/templates/calmlog/prolist.html | 136 +-
.../webapp/templates/calmlog/setting.html | 248 +-
.../templates/calmlog/template.properties | 16 +-
.../webapp/templates/lightlog/article.html | 110 +-
.../webapp/templates/lightlog/artlist.html | 104 +-
.../bootstrap/css/bootstrap-grid.min.css | 12 +-
.../bootstrap/css/bootstrap-reboot.min.css | 14 +-
.../lightlog/bootstrap/css/bootstrap.min.css | 12 +-
.../bootstrap/js/bootstrap.bundle.min.js | 12 +-
.../lightlog/bootstrap/js/bootstrap.min.js | 12 +-
.../webapp/templates/lightlog/css/ll-css.css | 748 +-
.../font-awesome/css/font-awesome.min.css | 8 +-
.../fonts/fontawesome-webfont.svg | 5342 +--
.../lightlog/highlight/highlight.pack.js | 2 +-
.../lightlog/highlight/styles/railscasts.css | 212 +-
.../main/webapp/templates/lightlog/index.html | 116 +-
.../webapp/templates/lightlog/layout.html | 108 +-
.../webapp/templates/lightlog/product.html | 62 +-
.../webapp/templates/lightlog/prolist.html | 104 +-
.../webapp/templates/lightlog/setting.html | 106 +-
.../templates/lightlog/template.properties | 16 +-
jpress-web/pom.xml | 114 +-
.../java/io/jpress/web/OptionInitializer.java | 332 +-
.../java/io/jpress/web/WebInitializer.java | 136 +-
.../io/jpress/web/admin/_AddonController.java | 572 +-
.../io/jpress/web/admin/_AdminController.java | 270 +-
.../web/admin/_AttachmentController.java | 618 +-
.../jpress/web/admin/_CouponController.java | 366 +-
.../jpress/web/admin/_FinanceController.java | 532 +-
.../jpress/web/admin/_OptionController.java | 206 +-
.../io/jpress/web/admin/_OrderController.java | 636 +-
.../web/admin/_PermissionController.java | 364 +-
.../jpress/web/admin/_SettingController.java | 282 +-
.../jpress/web/admin/_TemplateController.java | 994 +-
.../io/jpress/web/admin/_UserController.java | 1478 +-
.../jpress/web/admin/_UserInfoController.java | 448 +-
.../jpress/web/admin/_WechatController.java | 508 +-
.../admin/directive/_PaginateDirective.java | 54 +-
.../jpress/web/admin/kits/PermissionKits.java | 98 +-
.../jpress/web/api/OptionApiController.java | 150 +-
.../io/jpress/web/api/UserApiController.java | 156 +-
.../jpress/web/api/WechatApiController.java | 74 +-
.../api/WechatMiniProgramApiController.java | 496 +-
.../api/WechatMiniProgramApiInterceptor.java | 74 +-
.../controller/AttachmentController.java | 204 +-
.../controller/CKEditorController.java | 244 +-
.../commons/controller/CaptchaController.java | 70 +-
.../controller/ChangeEditorController.java | 88 +-
.../controller/EmailActivateController.java | 142 +-
.../controller/Html2WxmlController.java | 148 +-
.../controller/SendSmsCodeController.java | 134 +-
.../controller/html2wxml/HtmlToJson.java | 1076 +-
.../commons/controller/html2wxml/Params.java | 90 +-
.../controller/html2wxml/RendererFactory.java | 20 +-
.../web/commons/email/AdminMessageSender.java | 350 +-
.../jpress/web/commons/email/EmailSender.java | 224 +-
.../web/commons/express/ExpressCompany.java | 158 +-
.../web/commons/express/ExpressInfo.java | 102 +-
.../web/commons/express/ExpressQuerier.java | 54 +-
.../express/ExpressQuerierFactory.java | 126 +-
.../web/commons/express/ExpressUtil.java | 108 +-
.../express/impl/JuheExpressQuerier.java | 216 +-
.../express/impl/KdniaoExpressQuerier.java | 186 +-
.../express/impl/Kuaidi100ExpressQuerier.java | 172 +-
.../express/impl/ShowapiExpressQuerier.java | 210 +-
.../commons/finance/CouponAwardProcesser.java | 332 +-
.../commons/finance/CouponInfoProcesser.java | 208 +-
.../finance/MemberPaymentSuccessListener.java | 224 +-
.../commons/finance/OrderDistProcesser.java | 204 +-
.../finance/OrderFinishedFlagProcesser.java | 144 +-
.../finance/OrderPaymentSuccessListener.java | 166 +-
.../web/commons/finance/PayNotifytKit.java | 200 +-
.../web/commons/finance/PrePayNotifytKit.java | 266 +-
.../RechargePaymentSuccessListener.java | 160 +-
.../modelfilter/JPressModelFilter.java | 98 +-
.../web/commons/textfilter/TextFilter.java | 22 +-
.../commons/textfilter/TextFilterManager.java | 74 +-
.../textfilter/impl/AliyunTextFilter.java | 64 +-
.../textfilter/impl/TmsTextFilter.java | 64 +-
.../textfilter/impl/UltrapowerTextFilter.java | 64 +-
.../impl/XiaohuaerAITextFilter.java | 64 +-
.../web/directive/AnyRoleDirective.java | 122 +-
.../web/directive/EditorContentDirective.java | 118 +-
.../web/directive/HasAnyMemberDirective.java | 176 +-
.../web/directive/HasMemberDirective.java | 184 +-
.../web/directive/HasPermissionDirective.java | 126 +-
.../jpress/web/directive/OptionDirective.java | 120 +-
.../jpress/web/directive/RoleDirective.java | 124 +-
.../web/directive/UseTagsDirective.java | 118 +-
.../web/directive/UserMembersDirective.java | 118 +-
.../jpress/web/front/AddressController.java | 194 +-
.../io/jpress/web/front/CartController.java | 440 +-
.../jpress/web/front/CheckoutController.java | 824 +-
.../io/jpress/web/front/CouponController.java | 94 +-
.../jpress/web/front/FinanceController.java | 380 +-
.../io/jpress/web/front/IndexController.java | 106 +-
.../io/jpress/web/front/MemberController.java | 286 +-
.../io/jpress/web/front/OauthController.java | 476 +-
.../io/jpress/web/front/OrderController.java | 364 +-
.../io/jpress/web/front/PayController.java | 1442 +-
.../main/java/io/jpress/web/front/PayKit.java | 126 +-
.../web/front/UserCenterController.java | 454 +-
.../io/jpress/web/front/UserController.java | 630 +-
.../web/functions/PermissionFunctions.java | 294 +-
.../jpress/web/install/InstallController.java | 966 +-
.../web/install/InstallInterceptor.java | 66 +-
.../io/jpress/web/install/InstallUtil.java | 212 +-
.../io/jpress/web/wechat/GetOpenIdAddon.java | 110 +-
.../jpress/web/wechat/HelloWechatAddon.java | 106 +-
.../wechat/WechatAuthorizationController.java | 546 +-
.../web/wechat/WechatMsgNotifyController.java | 602 +-
.../io/jpress/web/wechat/WechatMsgUtil.java | 282 +-
.../webapp/WEB-INF/install/sqls/install.sql | 2224 +-
.../WEB-INF/install/sqls/v2_upgrade.sql | 1492 +-
.../webapp/WEB-INF/install/views/error.html | 68 +-
.../webapp/WEB-INF/install/views/layout.html | 120 +-
.../webapp/WEB-INF/install/views/step1.html | 66 +-
.../webapp/WEB-INF/install/views/step2.html | 212 +-
.../webapp/WEB-INF/install/views/step3.html | 206 +-
.../WEB-INF/install/views/step3_notinit.html | 154 +-
.../WEB-INF/install/views/step3_upgrade.html | 154 +-
.../WEB-INF/other/sys_sensitive_words.txt | 1658 +-
.../WEB-INF/views/admin/_layout/_errpage.html | 122 +-
.../WEB-INF/views/admin/_layout/_footer.html | 14 +-
.../WEB-INF/views/admin/_layout/_header.html | 84 +-
.../WEB-INF/views/admin/_layout/_layer.html | 132 +-
.../WEB-INF/views/admin/_layout/_layout.html | 144 +-
.../views/admin/_layout/_left_menu.html | 96 +-
.../views/admin/_layout/_paginate.html | 26 +-
.../WEB-INF/views/admin/addon/changelog.html | 38 +-
.../WEB-INF/views/admin/addon/install.html | 170 +-
.../WEB-INF/views/admin/addon/list.html | 320 +-
.../WEB-INF/views/admin/addon/readme.html | 38 +-
.../WEB-INF/views/admin/addon/upgrade.html | 170 +-
.../views/admin/attachment/browse.html | 408 +-
.../views/admin/attachment/detail.html | 276 +-
.../WEB-INF/views/admin/attachment/list.html | 360 +-
.../WEB-INF/views/admin/attachment/root.html | 316 +-
.../views/admin/attachment/setting.html | 360 +-
.../views/admin/attachment/upload.html | 166 +-
.../webapp/WEB-INF/views/admin/error/404.html | 28 +-
.../webapp/WEB-INF/views/admin/error/500.html | 30 +-
.../views/admin/error/nopermission.html | 20 +-
.../WEB-INF/views/admin/finance/coupon.html | 228 +-
.../views/admin/finance/coupon_edit.html | 434 +-
.../views/admin/finance/coupon_take_edit.html | 200 +-
.../views/admin/finance/coupon_takes.html | 226 +-
.../views/admin/finance/coupon_useds.html | 146 +-
.../views/admin/finance/layer_coupon.html | 146 +-
.../views/admin/finance/layer_paydetail.html | 280 +-
.../admin/finance/layer_payout_process.html | 224 +-
.../admin/finance/layer_payout_refuse.html | 102 +-
.../views/admin/finance/layer_payupdate.html | 272 +-
.../WEB-INF/views/admin/finance/paylist.html | 298 +-
.../WEB-INF/views/admin/finance/payout.html | 232 +-
.../views/admin/finance/payoutdetail.html | 330 +-
.../views/admin/finance/setting_base.html | 222 +-
.../views/admin/finance/setting_notify.html | 456 +-
.../views/admin/finance/setting_pay.html | 548 +-
.../webapp/WEB-INF/views/admin/index.html | 134 +-
.../webapp/WEB-INF/views/admin/login.html | 142 +-
.../views/admin/order/order_detail.html | 630 +-
.../admin/order/order_layer_deliver.html | 202 +-
.../admin/order/order_layer_invoice.html | 220 +-
.../views/admin/order/order_layer_remark.html | 84 +-
.../order/order_layer_update_paystatus.html | 258 +-
.../admin/order/order_layer_update_price.html | 96 +-
.../WEB-INF/views/admin/order/order_list.html | 486 +-
.../WEB-INF/views/admin/setting/api.html | 202 +-
.../WEB-INF/views/admin/setting/app.html | 300 +-
.../WEB-INF/views/admin/setting/base.html | 260 +-
.../WEB-INF/views/admin/setting/cdn.html | 140 +-
.../views/admin/setting/connection.html | 344 +-
.../WEB-INF/views/admin/setting/filter.html | 248 +-
.../WEB-INF/views/admin/setting/icons.html | 6118 ++--
.../WEB-INF/views/admin/setting/reg.html | 654 +-
.../WEB-INF/views/admin/setting/seo.html | 308 +-
.../WEB-INF/views/admin/setting/tools.html | 108 +-
.../WEB-INF/views/admin/template/edit.html | 462 +-
.../WEB-INF/views/admin/template/install.html | 170 +-
.../WEB-INF/views/admin/template/list.html | 268 +-
.../WEB-INF/views/admin/template/menu.html | 396 +-
.../WEB-INF/views/admin/template/setting.html | 82 +-
.../views/admin/user/_user_detail_layout.html | 256 +-
.../views/admin/user/_user_msg_layout.html | 186 +-
.../WEB-INF/views/admin/user/detail.html | 214 +-
.../views/admin/user/detail_avatar.html | 184 +-
.../admin/user/detail_communication.html | 164 +-
.../views/admin/user/detail_coupon.html | 212 +-
.../views/admin/user/detail_finance.html | 248 +-
.../views/admin/user/detail_member.html | 170 +-
.../views/admin/user/detail_order.html | 194 +-
.../views/admin/user/detail_other.html | 166 +-
.../WEB-INF/views/admin/user/detail_pwd.html | 88 +-
.../WEB-INF/views/admin/user/detail_role.html | 112 +-
.../views/admin/user/detail_signature.html | 68 +-
.../WEB-INF/views/admin/user/detail_tag.html | 164 +-
.../WEB-INF/views/admin/user/detail_utm.html | 92 +-
.../webapp/WEB-INF/views/admin/user/edit.html | 274 +-
.../webapp/WEB-INF/views/admin/user/list.html | 512 +-
.../webapp/WEB-INF/views/admin/user/me.html | 146 +-
.../WEB-INF/views/admin/user/member.html | 204 +-
.../WEB-INF/views/admin/user/member_edit.html | 192 +-
.../views/admin/user/member_renewal.html | 170 +-
.../WEB-INF/views/admin/user/mgroup.html | 198 +-
.../WEB-INF/views/admin/user/mgroup_edit.html | 430 +-
.../views/admin/user/mgroupjoined.html | 152 +-
.../WEB-INF/views/admin/user/msg_email.html | 208 +-
.../WEB-INF/views/admin/user/msg_sms.html | 212 +-
.../WEB-INF/views/admin/user/msg_wechat.html | 294 +-
.../WEB-INF/views/admin/user/permission.html | 236 +-
.../webapp/WEB-INF/views/admin/user/role.html | 204 +-
.../WEB-INF/views/admin/user/role_edit.html | 146 +-
.../views/admin/user/role_permissions.html | 474 +-
.../WEB-INF/views/admin/user/tag_list.html | 286 +-
.../views/admin/user/user_permissions.html | 184 +-
.../WEB-INF/views/admin/wechat/addons.html | 212 +-
.../WEB-INF/views/admin/wechat/menu.html | 388 +-
.../views/admin/wechat/miniprogram.html | 178 +-
.../views/admin/wechat/reply_base.html | 142 +-
.../views/admin/wechat/reply_list.html | 280 +-
.../views/admin/wechat/reply_write.html | 344 +-
.../views/admin/wechat/setting_base.html | 228 +-
.../WEB-INF/views/front/pay/layout.html | 212 +-
.../WEB-INF/views/front/pay/pay_alipay.html | 114 +-
.../WEB-INF/views/front/pay/pay_alipayx.html | 86 +-
.../WEB-INF/views/front/pay/pay_complete.html | 88 +-
.../WEB-INF/views/front/pay/pay_error.html | 70 +-
.../WEB-INF/views/front/pay/pay_fail.html | 88 +-
.../WEB-INF/views/front/pay/pay_success.html | 90 +-
.../WEB-INF/views/front/pay/pay_wechat.html | 88 +-
.../WEB-INF/views/front/pay/pay_wechatjs.html | 200 +-
.../WEB-INF/views/front/pay/pay_wechatx.html | 88 +-
.../views/ucenter/_layout/_footer.html | 14 +-
.../views/ucenter/_layout/_header.html | 156 +-
.../views/ucenter/_layout/_layout.html | 142 +-
.../views/ucenter/_layout/_layout_noleft.html | 152 +-
.../views/ucenter/_layout/_left_menu.html | 130 +-
.../views/ucenter/_layout/_paginate.html | 26 +-
.../views/ucenter/address/address_edit.html | 248 +-
.../views/ucenter/address/address_layer.html | 148 +-
.../views/ucenter/address/address_list.html | 332 +-
.../webapp/WEB-INF/views/ucenter/avatar.html | 240 +-
.../webapp/WEB-INF/views/ucenter/bind.html | 258 +-
.../webapp/WEB-INF/views/ucenter/cart.html | 894 +-
.../views/ucenter/checkout/checkout.html | 1028 +-
.../WEB-INF/views/ucenter/checkout/order.html | 662 +-
.../ucenter/coupon/coupon_code_layer.html | 132 +-
.../ucenter/coupon/coupon_code_list.html | 246 +-
.../WEB-INF/views/ucenter/finance/amount.html | 242 +-
.../WEB-INF/views/ucenter/finance/payout.html | 210 +-
.../views/ucenter/finance/payoutdetail.html | 246 +-
.../views/ucenter/finance/payoutsubmit.html | 246 +-
.../views/ucenter/finance/recharge.html | 288 +-
.../webapp/WEB-INF/views/ucenter/index.html | 186 +-
.../webapp/WEB-INF/views/ucenter/info.html | 378 +-
.../views/ucenter/member/member_detail.html | 192 +-
.../views/ucenter/member/member_join.html | 310 +-
.../views/ucenter/member/member_list.html | 174 +-
.../views/ucenter/order/order_detail.html | 572 +-
.../ucenter/order/order_layer_addmessage.html | 84 +-
.../ucenter/order/order_layer_invoice.html | 180 +-
.../views/ucenter/order/order_list.html | 336 +-
.../webapp/WEB-INF/views/ucenter/pwd.html | 142 +-
.../WEB-INF/views/ucenter/signature.html | 120 +-
.../WEB-INF/views/ucenter/user_activate.html | 134 +-
.../views/ucenter/user_emailactivate.html | 134 +-
.../WEB-INF/views/ucenter/user_login.html | 184 +-
.../WEB-INF/views/ucenter/user_register.html | 256 +-
.../webapp/static/admin/css/jpressadmin.css | 380 +-
.../webapp/static/admin/js/jpressadmin.js | 740 +-
.../static/adminlte/css/AdminLTE.min.css | 14 +-
.../css/alt/AdminLTE-without-plugins.min.css | 16 +-
.../webapp/static/adminlte/js/adminlte.min.js | 24 +-
.../webapp/static/commons/jpresscommons.js | 604 +-
.../main/webapp/static/commons/jpresscsrf.js | 82 +-
.../main/webapp/static/components/ace/ace.js | 34 +-
.../static/components/ace/keybinding-emacs.js | 16 +-
.../static/components/ace/keybinding-vim.js | 16 +-
.../webapp/static/components/ace/mode-css.js | 16 +-
.../webapp/static/components/ace/mode-html.js | 16 +-
.../static/components/ace/mode-javascript.js | 16 +-
.../webapp/static/components/ace/mode-json.js | 16 +-
.../webapp/static/components/ace/mode-jsp.js | 16 +-
.../static/components/ace/mode-mysql.js | 16 +-
.../webapp/static/components/ace/mode-xml.js | 16 +-
.../webapp/static/components/ace/mode-yaml.js | 16 +-
.../static/components/ace/theme-eclipse.js | 16 +-
.../bootstrap/css/bootstrap-theme.min.css | 10 +-
.../bootstrap/css/bootstrap.min.css | 10 +-
.../fonts/glyphicons-halflings-regular.svg | 574 +-
.../components/bootstrap/js/bootstrap.js | 4754 +--
.../components/bootstrap/js/bootstrap.min.js | 12 +-
.../static/components/bootstrap/js/npm.js | 24 +-
.../static/components/ckeditor/CHANGES.md | 3758 +-
.../static/components/ckeditor/LICENSE.md | 2842 +-
.../static/components/ckeditor/README.md | 78 +-
.../components/ckeditor/adapters/jquery.js | 18 +-
.../components/ckeditor/build-config.js | 382 +-
.../static/components/ckeditor/ckeditor.js | 2752 +-
.../static/components/ckeditor/config.js | 20 +-
.../static/components/ckeditor/contents.css | 416 +-
.../static/components/ckeditor/lang/en.js | 8 +-
.../static/components/ckeditor/lang/zh-cn.js | 8 +-
.../static/components/ckeditor/lang/zh.js | 8 +-
.../plugins/a11yhelp/dialogs/a11yhelp.js | 18 +-
.../plugins/a11yhelp/dialogs/lang/en.js | 20 +-
.../plugins/a11yhelp/dialogs/lang/zh-cn.js | 16 +-
.../plugins/a11yhelp/dialogs/lang/zh.js | 16 +-
.../ckeditor/plugins/about/dialogs/about.js | 14 +-
.../plugins/clipboard/dialogs/paste.js | 20 +-
.../codesnippet/dialogs/codesnippet.js | 166 +-
.../ckeditor/plugins/codesnippet/lang/en.js | 26 +-
.../plugins/codesnippet/lang/zh-cn.js | 26 +-
.../ckeditor/plugins/codesnippet/lang/zh.js | 26 +-
.../codesnippet/lib/highlight/CHANGES.md | 1654 +-
.../plugins/codesnippet/lib/highlight/LICENSE | 48 +-
.../codesnippet/lib/highlight/README.md | 334 +-
.../codesnippet/lib/highlight/README.ru.md | 342 +-
.../lib/highlight/highlight.pack.js | 2 +-
.../codesnippet/lib/highlight/styles/arta.css | 320 +-
.../lib/highlight/styles/ascetic.css | 100 +-
.../highlight/styles/atelier-dune.dark.css | 186 +-
.../highlight/styles/atelier-dune.light.css | 186 +-
.../highlight/styles/atelier-forest.dark.css | 186 +-
.../highlight/styles/atelier-forest.light.css | 186 +-
.../highlight/styles/atelier-heath.dark.css | 186 +-
.../highlight/styles/atelier-heath.light.css | 186 +-
.../styles/atelier-lakeside.dark.css | 186 +-
.../styles/atelier-lakeside.light.css | 186 +-
.../highlight/styles/atelier-seaside.dark.css | 186 +-
.../styles/atelier-seaside.light.css | 186 +-
.../lib/highlight/styles/brown_paper.css | 210 +-
.../codesnippet/lib/highlight/styles/dark.css | 210 +-
.../lib/highlight/styles/default.css | 306 +-
.../lib/highlight/styles/docco.css | 264 +-
.../codesnippet/lib/highlight/styles/far.css | 226 +-
.../lib/highlight/styles/foundation.css | 266 +-
.../lib/highlight/styles/github.css | 250 +-
.../lib/highlight/styles/googlecode.css | 294 +-
.../codesnippet/lib/highlight/styles/idea.css | 244 +-
.../lib/highlight/styles/ir_black.css | 210 +-
.../lib/highlight/styles/magula.css | 246 +-
.../lib/highlight/styles/mono-blue.css | 124 +-
.../lib/highlight/styles/monokai.css | 254 +-
.../lib/highlight/styles/monokai_sublime.css | 298 +-
.../lib/highlight/styles/obsidian.css | 308 +-
.../lib/highlight/styles/paraiso.dark.css | 186 +-
.../lib/highlight/styles/paraiso.light.css | 186 +-
.../lib/highlight/styles/pojoaque.css | 212 +-
.../lib/highlight/styles/railscasts.css | 364 +-
.../lib/highlight/styles/rainbow.css | 224 +-
.../lib/highlight/styles/school_book.css | 226 +-
.../lib/highlight/styles/solarized_dark.css | 214 +-
.../lib/highlight/styles/solarized_light.css | 214 +-
.../lib/highlight/styles/sunburst.css | 320 +-
.../highlight/styles/tomorrow-night-blue.css | 186 +-
.../styles/tomorrow-night-bright.css | 184 +-
.../styles/tomorrow-night-eighties.css | 184 +-
.../lib/highlight/styles/tomorrow-night.css | 186 +-
.../lib/highlight/styles/tomorrow.css | 180 +-
.../codesnippet/lib/highlight/styles/vs.css | 178 +-
.../lib/highlight/styles/xcode.css | 316 +-
.../lib/highlight/styles/zenburn.css | 234 +-
.../ckeditor/plugins/codesnippet/plugin.js | 972 +-
.../colordialog/dialogs/colordialog.css | 40 +-
.../colordialog/dialogs/colordialog.js | 26 +-
.../cursors/cursor-disabled.svg | 48 +-
.../plugins/copyformatting/cursors/cursor.svg | 28 +-
.../copyformatting/styles/copyformatting.css | 90 +-
.../plugins/dialog/dialogDefinition.js | 8 +-
.../ckeditor/plugins/dialog/styles/dialog.css | 36 +-
.../ckeditor/plugins/div/dialogs/div.js | 18 +-
.../ckeditor/plugins/find/dialogs/find.js | 48 +-
.../ckeditor/plugins/flash/dialogs/flash.js | 46 +-
.../ckeditor/plugins/forms/dialogs/button.js | 14 +-
.../plugins/forms/dialogs/checkbox.js | 16 +-
.../ckeditor/plugins/forms/dialogs/form.js | 14 +-
.../plugins/forms/dialogs/hiddenfield.js | 12 +-
.../ckeditor/plugins/forms/dialogs/radio.js | 16 +-
.../ckeditor/plugins/forms/dialogs/select.js | 40 +-
.../plugins/forms/dialogs/textarea.js | 16 +-
.../plugins/forms/dialogs/textfield.js | 20 +-
.../plugins/html5audio/dialogs/html5audio.js | 270 +-
.../ckeditor/plugins/html5audio/lang/en.js | 28 +-
.../ckeditor/plugins/html5audio/lang/zh-cn.js | 28 +-
.../ckeditor/plugins/html5audio/plugin.js | 244 +-
.../plugins/html5video/dialogs/html5video.js | 322 +-
.../ckeditor/plugins/html5video/lang/en.js | 30 +-
.../ckeditor/plugins/html5video/lang/zh-cn.js | 30 +-
.../ckeditor/plugins/html5video/plugin.js | 278 +-
.../ckeditor/plugins/iframe/dialogs/iframe.js | 20 +-
.../ckeditor/plugins/image/dialogs/image.js | 86 +-
.../ckeditor/plugins/link/dialogs/anchor.js | 14 +-
.../ckeditor/plugins/link/dialogs/link.js | 58 +-
.../plugins/liststyle/dialogs/liststyle.js | 18 +-
.../plugins/pastefromgdocs/filter/default.js | 14 +-
.../plugins/pastefromword/filter/default.js | 84 +-
.../plugins/pastetools/filter/common.js | 42 +-
.../plugins/pastetools/filter/image.js | 10 +-
.../ckeditor/plugins/preview/preview.html | 26 +-
.../plugins/preview/styles/screen.css | 20 +-
.../ckeditor/plugins/scayt/CHANGELOG.md | 40 +-
.../ckeditor/plugins/scayt/LICENSE.md | 56 +-
.../ckeditor/plugins/scayt/README.md | 162 +-
.../ckeditor/plugins/scayt/dialogs/dialog.css | 46 +-
.../ckeditor/plugins/scayt/dialogs/options.js | 62 +-
.../plugins/scayt/dialogs/toolbar.css | 142 +-
.../plugins/scayt/skins/moono-lisa/scayt.css | 50 +-
.../ckeditor/plugins/smiley/dialogs/smiley.js | 20 +-
.../plugins/specialchar/dialogs/lang/en.js | 24 +-
.../plugins/specialchar/dialogs/lang/zh-cn.js | 16 +-
.../plugins/specialchar/dialogs/lang/zh.js | 16 +-
.../specialchar/dialogs/specialchar.js | 26 +-
.../ckeditor/plugins/table/dialogs/table.js | 42 +-
.../tableselection/styles/tableselection.css | 72 +-
.../plugins/tabletools/dialogs/tableCell.js | 34 +-
.../plugins/templates/dialogs/templates.css | 168 +-
.../plugins/templates/dialogs/templates.js | 18 +-
.../plugins/templates/templates/default.js | 12 +-
.../plugins/wordcount/css/wordcount.css | 4 +-
.../ckeditor/plugins/wordcount/lang/en.js | 34 +-
.../ckeditor/plugins/wordcount/lang/zh-cn.js | 28 +-
.../ckeditor/plugins/wordcount/lang/zh.js | 26 +-
.../ckeditor/plugins/wordcount/plugin.js | 1192 +-
.../ckeditor/plugins/wsc/LICENSE.md | 56 +-
.../components/ckeditor/plugins/wsc/README.md | 160 +-
.../ckeditor/plugins/wsc/dialogs/ciframe.html | 132 +-
.../plugins/wsc/dialogs/tmpFrameset.html | 104 +-
.../ckeditor/plugins/wsc/dialogs/wsc.css | 164 +-
.../ckeditor/plugins/wsc/dialogs/wsc.js | 180 +-
.../ckeditor/plugins/wsc/dialogs/wsc_ie.js | 20 +-
.../plugins/wsc/skins/moono-lisa/wsc.css | 86 +-
.../ckeditor/skins/moono-lisa/dialog.css | 8 +-
.../ckeditor/skins/moono-lisa/dialog_ie.css | 8 +-
.../ckeditor/skins/moono-lisa/dialog_ie8.css | 8 +-
.../skins/moono-lisa/dialog_iequirks.css | 8 +-
.../ckeditor/skins/moono-lisa/editor.css | 8 +-
.../skins/moono-lisa/editor_gecko.css | 8 +-
.../ckeditor/skins/moono-lisa/editor_ie.css | 8 +-
.../ckeditor/skins/moono-lisa/editor_ie8.css | 8 +-
.../skins/moono-lisa/editor_iequirks.css | 8 +-
.../ckeditor/skins/moono-lisa/readme.md | 92 +-
.../static/components/ckeditor/styles.js | 274 +-
.../components/ckeditor/vendor/promise.js | 24 +-
.../components/clipboard/clipboard.min.js | 12 +-
.../css/bootstrap-datepicker.min.css | 12 +-
.../bootstrap-datepicker.standalone.min.css | 12 +-
.../css/bootstrap-datepicker3.min.css | 12 +-
.../bootstrap-datepicker3.standalone.min.css | 12 +-
.../datepicker/js/bootstrap-datepicker.min.js | 14 +-
.../bootstrap-datetimepicker-standalone.css | 196 +-
.../css/bootstrap-datetimepicker.css | 748 +-
.../css/bootstrap-datetimepicker.min.css | 8 +-
.../js/bootstrap-datetimepicker.min.js | 2 +-
.../distpicker/distpicker.common.js | 8846 ++---
.../components/distpicker/distpicker.esm.js | 8838 ++---
.../components/distpicker/distpicker.min.js | 18 +-
.../editable/css/bootstrap-editable.css | 498 +-
.../editable/js/bootstrap-editable.min.js | 12 +-
.../static/components/fastclick/fastclick.js | 1682 +-
.../font-awesome/css/font-awesome.min.css | 8 +-
.../fonts/fontawesome-webfont.svg | 5342 +--
.../static/components/highlight/CHANGES.md | 3292 +-
.../static/components/highlight/LICENSE | 48 +-
.../static/components/highlight/README.md | 300 +-
.../static/components/highlight/README.ru.md | 284 +-
.../components/highlight/highlight.pack.js | 2 +-
.../components/highlight/styles/agate.css | 216 +-
.../highlight/styles/androidstudio.css | 132 +-
.../highlight/styles/arduino-light.css | 176 +-
.../components/highlight/styles/arta.css | 146 +-
.../components/highlight/styles/ascetic.css | 90 +-
.../highlight/styles/atelier-cave-dark.css | 166 +-
.../highlight/styles/atelier-cave-light.css | 170 +-
.../highlight/styles/atelier-dune-dark.css | 138 +-
.../highlight/styles/atelier-dune-light.css | 138 +-
.../highlight/styles/atelier-estuary-dark.css | 168 +-
.../styles/atelier-estuary-light.css | 168 +-
.../highlight/styles/atelier-forest-dark.css | 138 +-
.../highlight/styles/atelier-forest-light.css | 138 +-
.../highlight/styles/atelier-heath-dark.css | 138 +-
.../highlight/styles/atelier-heath-light.css | 138 +-
.../styles/atelier-lakeside-dark.css | 138 +-
.../styles/atelier-lakeside-light.css | 138 +-
.../highlight/styles/atelier-plateau-dark.css | 168 +-
.../styles/atelier-plateau-light.css | 168 +-
.../highlight/styles/atelier-savanna-dark.css | 168 +-
.../styles/atelier-savanna-light.css | 168 +-
.../highlight/styles/atelier-seaside-dark.css | 138 +-
.../styles/atelier-seaside-light.css | 138 +-
.../styles/atelier-sulphurpool-dark.css | 138 +-
.../styles/atelier-sulphurpool-light.css | 138 +-
.../highlight/styles/atom-one-dark.css | 192 +-
.../highlight/styles/atom-one-light.css | 192 +-
.../highlight/styles/brown-paper.css | 128 +-
.../highlight/styles/codepen-embed.css | 120 +-
.../highlight/styles/color-brewer.css | 142 +-
.../components/highlight/styles/darcula.css | 154 +-
.../components/highlight/styles/dark.css | 126 +-
.../components/highlight/styles/darkula.css | 12 +-
.../components/highlight/styles/default.css | 198 +-
.../components/highlight/styles/docco.css | 194 +-
.../components/highlight/styles/dracula.css | 152 +-
.../components/highlight/styles/far.css | 142 +-
.../highlight/styles/foundation.css | 176 +-
.../highlight/styles/github-gist.css | 142 +-
.../components/highlight/styles/github.css | 198 +-
.../highlight/styles/googlecode.css | 178 +-
.../components/highlight/styles/grayscale.css | 202 +-
.../highlight/styles/gruvbox-dark.css | 216 +-
.../highlight/styles/gruvbox-light.css | 216 +-
.../components/highlight/styles/hopscotch.css | 166 +-
.../components/highlight/styles/hybrid.css | 204 +-
.../components/highlight/styles/idea.css | 194 +-
.../components/highlight/styles/ir-black.css | 146 +-
.../highlight/styles/kimbie.dark.css | 148 +-
.../highlight/styles/kimbie.light.css | 148 +-
.../components/highlight/styles/magula.css | 140 +-
.../components/highlight/styles/mono-blue.css | 118 +-
.../highlight/styles/monokai-sublime.css | 166 +-
.../components/highlight/styles/monokai.css | 140 +-
.../components/highlight/styles/obsidian.css | 176 +-
.../components/highlight/styles/ocean.css | 148 +-
.../highlight/styles/paraiso-dark.css | 144 +-
.../highlight/styles/paraiso-light.css | 144 +-
.../components/highlight/styles/pojoaque.css | 166 +-
.../components/highlight/styles/purebasic.css | 192 +-
.../highlight/styles/qtcreator_dark.css | 166 +-
.../highlight/styles/qtcreator_light.css | 166 +-
.../highlight/styles/railscasts.css | 212 +-
.../components/highlight/styles/rainbow.css | 170 +-
.../components/highlight/styles/routeros.css | 216 +-
.../highlight/styles/school-book.css | 144 +-
.../highlight/styles/solarized-dark.css | 168 +-
.../highlight/styles/solarized-light.css | 168 +-
.../components/highlight/styles/sunburst.css | 204 +-
.../highlight/styles/tomorrow-night-blue.css | 150 +-
.../styles/tomorrow-night-bright.css | 148 +-
.../styles/tomorrow-night-eighties.css | 148 +-
.../highlight/styles/tomorrow-night.css | 150 +-
.../components/highlight/styles/tomorrow.css | 144 +-
.../static/components/highlight/styles/vs.css | 136 +-
.../components/highlight/styles/vs2015.css | 230 +-
.../components/highlight/styles/xcode.css | 186 +-
.../components/highlight/styles/xt256.css | 184 +-
.../components/highlight/styles/zenburn.css | 160 +-
.../html5shiv/html5shiv-printshiv.min.js | 6 +-
.../components/ionicons/css/ionicons.min.css | 22 +-
.../components/ionicons/fonts/ionicons.svg | 4460 +--
.../components/jcrop/css/jquery.jcrop.min.css | 58 +-
.../components/jcrop/js/jquery.jcrop.min.js | 42 +-
.../components/jquery-file-upload/LICENSE.txt | 42 +-
.../jquery-file-upload/cors/postmessage.html | 150 +-
.../jquery-file-upload/cors/result.html | 48 +-
.../css/jquery-ui-demo-ie8.css | 42 +-
.../jquery-file-upload/css/jquery-ui-demo.css | 134 +-
.../css/jquery.fileupload-noscript.css | 44 +-
.../css/jquery.fileupload-ui-noscript.css | 34 +-
.../css/jquery.fileupload-ui.css | 114 +-
.../css/jquery.fileupload.css | 74 +-
.../jquery-file-upload/css/style.css | 30 +-
.../components/jquery-file-upload/js/app.js | 202 +-
.../js/cors/jquery.postmessage-transport.js | 252 +-
.../js/cors/jquery.xdr-transport.js | 178 +-
.../js/jquery.fileupload-angular.js | 874 +-
.../js/jquery.fileupload-audio.js | 226 +-
.../js/jquery.fileupload-image.js | 652 +-
.../js/jquery.fileupload-jquery-ui.js | 322 +-
.../js/jquery.fileupload-process.js | 356 +-
.../js/jquery.fileupload-ui.js | 1428 +-
.../js/jquery.fileupload-validate.js | 250 +-
.../js/jquery.fileupload-video.js | 226 +-
.../js/jquery.fileupload.js | 2972 +-
.../js/jquery.iframe-transport.js | 448 +-
.../components/jquery-file-upload/js/main.js | 150 +-
.../js/vendor/jquery.ui.widget.js | 1504 +-
.../static/components/jquery/jquery.min.js | 4 +-
.../webapp/static/components/layer/layer.js | 2 +-
.../static/components/layer/mobile/layer.js | 2 +-
.../components/layer/theme/jpress/style.css | 56 +-
.../static/components/moment/locale/zh-cn.js | 218 +-
.../static/components/moment/locales.js | 20356 +++++------
.../components/moment/moment-with-locales.js | 29530 ++++++++--------
.../static/components/respond/respond.min.js | 8 +-
.../selectize/css/selectize.bootstrap2.css | 1006 +-
.../selectize/css/selectize.bootstrap3.css | 834 +-
.../components/selectize/css/selectize.css | 666 +-
.../selectize/css/selectize.default.css | 806 +-
.../selectize/css/selectize.jpress.css | 940 +-
.../selectize/css/selectize.legacy.css | 760 +-
.../components/selectize/selectize.min.js | 6 +-
.../components/simplemde/simplemde.jpress.css | 78 +-
.../components/simplemde/simplemde.min.css | 12 +-
.../components/simplemde/simplemde.min.js | 28 +-
.../static/components/swiper/swiper.min.css | 24 +-
.../static/components/swiper/swiper.min.js | 26 +-
.../static/components/toastr/toastr.min.js | 4 +-
.../webapp/static/ucenter/jpressucenter.css | 216 +-
.../webapp/static/ucenter/jpressucenter.js | 228 +-
jpress-web/src/test/java/UserPwdGenerate.java | 44 +-
jpress.sql | 2246 +-
module-article/module-article-model/pom.xml | 68 +-
.../jpress/module/article/model/Article.java | 418 +-
.../module/article/model/ArticleCategory.java | 364 +-
.../module/article/model/ArticleComment.java | 174 +-
.../article/model/base/BaseArticle.java | 392 +-
.../model/base/BaseArticleCategory.java | 296 +-
.../model/base/BaseArticleComment.java | 264 +-
.../module-article-search-api/pom.xml | 48 +-
.../service/search/ArticleSearcher.java | 36 +-
.../module-article-search-db/pom.xml | 72 +-
.../module/article/searcher/DbSearcher.java | 100 +-
.../module-article-search-es/pom.xml | 96 +-
.../article/search/ElasticSearcher.java | 422 +-
.../module-article-search-lucene/pom.xml | 156 +-
.../article/searcher/LuceneSearcher.java | 470 +-
.../module-article-search-opensearch/pom.xml | 72 +-
.../jpress/module/article/search/Action.java | 152 +-
.../article/search/AliyunOpenSearcher.java | 362 +-
.../module-article-service-api/pom.xml | 60 +-
.../service/ArticleCategoryService.java | 232 +-
.../service/ArticleCommentService.java | 268 +-
.../module-article-service-provider/pom.xml | 142 +-
.../ArticleCategoryServiceProvider.java | 506 +-
.../ArticleCommentServiceProvider.java | 420 +-
.../search/ArticleSearcherFactory.java | 138 +-
.../article/service/search/NoneSearcher.java | 84 +-
.../ArticleCategorySitemapProvider.java | 112 +-
.../sitemap/ArticleSitemapManager.java | 110 +-
.../sitemap/ArticleSitemapProvider.java | 154 +-
.../sitemap/ArticleTagSitemapProvider.java | 112 +-
.../module/article/service/sitemap/Util.java | 84 +-
.../ArticleCommentReplyCountUpdateTask.java | 130 +-
.../task/ArticleCommentsCountUpdateTask.java | 130 +-
.../task/ArticleViewsCountUpdateTask.java | 130 +-
module-article/module-article-web/pom.xml | 92 +-
.../jpress/module/article/ArticleFields.java | 302 +-
.../article/ArticleModuleInitializer.java | 186 +-
.../article/api/ArticleApiController.java | 706 +-
.../article/api/CommentApiController.java | 82 +-
.../controller/ArticleCategoryController.java | 242 +-
.../article/controller/ArticleController.java | 542 +-
.../controller/ArticleSearchController.java | 100 +-
.../controller/ArticleTagController.java | 176 +-
.../controller/ArticleUCenterController.java | 558 +-
.../controller/_ArticleController.java | 1030 +-
.../article/controller/_MarkdownImport.java | 204 +-
.../controller/_WechatArticleImport.java | 466 +-
.../article/controller/_WordpressImport.java | 222 +-
.../directive/ArticleCategoriesDirective.java | 128 +-
.../directive/CategoriesDirective.java | 306 +-
.../directive/CommentPageDirective.java | 172 +-
.../article/directive/CommentsDirective.java | 126 +-
.../article/directive/TagsDirective.java | 124 +-
.../module/article/kit/ArticleNotifyKit.java | 204 +-
.../article/kit/markdown/MarkdownParser.java | 232 +-
.../kit/wordpress/WordPressXmlParser.java | 314 +-
.../wechat/ArticleDetailWechatAddon.java | 196 +-
.../views/admin/article/_dashboard_box.html | 190 +-
.../views/admin/article/_tools_box.html | 86 +-
.../views/admin/article/article_list.html | 414 +-
.../views/admin/article/article_write.html | 610 +-
.../views/admin/article/category_list.html | 524 +-
.../views/admin/article/comment_edit.html | 236 +-
.../views/admin/article/comment_list.html | 360 +-
.../views/admin/article/comment_reply.html | 266 +-
.../WEB-INF/views/admin/article/markdown.html | 150 +-
.../WEB-INF/views/admin/article/paylist.html | 458 +-
.../WEB-INF/views/admin/article/setting.html | 532 +-
.../WEB-INF/views/admin/article/tag_list.html | 390 +-
.../WEB-INF/views/admin/article/wechat.html | 142 +-
.../views/admin/article/wordpress.html | 150 +-
.../article/defaultArticleCommentItem.html | 78 +-
.../article/defaultArticleCommentPage.html | 106 +-
.../ucenter/article/article_favorite.html | 176 +-
.../views/ucenter/article/article_list.html | 212 +-
.../views/ucenter/article/article_write.html | 536 +-
.../views/ucenter/article/comment_list.html | 182 +-
.../main/webapp/static/commons/article.css | 360 +-
.../src/main/webapp/static/commons/article.js | 136 +-
module-article/pom.xml | 96 +-
module-page/module-page-model/pom.xml | 66 +-
.../jpress/module/page/model/SinglePage.java | 206 +-
.../module/page/model/SinglePageComment.java | 158 +-
.../page/model/base/BaseSinglePage.java | 504 +-
.../model/base/BaseSinglePageComment.java | 448 +-
module-page/module-page-service-api/pom.xml | 60 +-
.../service/SinglePageCommentService.java | 380 +-
.../page/service/SinglePageService.java | 228 +-
.../module-page-service-provider/pom.xml | 82 +-
.../provider/PageViewsCountUpdateTask.java | 130 +-
.../SinglePageCommentServiceProvider.java | 246 +-
.../provider/SinglePageServiceProvider.java | 232 +-
module-page/module-page-web/pom.xml | 92 +-
.../module/page/PageModuleInitializer.java | 144 +-
.../io/jpress/module/page/PageNotifyKit.java | 204 +-
.../page/controller/PageApiController.java | 126 +-
.../page/controller/PageController.java | 490 +-
.../page/controller/_PageController.java | 562 +-
.../directive/PageCommentPageDirective.java | 174 +-
.../module/page/directive/PageDirective.java | 122 +-
.../module/page/directive/PagesDirective.java | 168 +-
.../sitemap/NewstPageSitemapProvider.java | 98 +-
.../page/sitemap/PageSitemapProvider.java | 114 +-
.../io/jpress/module/page/sitemap/Util.java | 64 +-
.../views/admin/page/comment_edit.html | 236 +-
.../views/admin/page/comment_list.html | 360 +-
.../views/admin/page/comment_reply.html | 266 +-
.../WEB-INF/views/admin/page/page_list.html | 338 +-
.../WEB-INF/views/admin/page/page_write.html | 502 +-
.../WEB-INF/views/admin/page/setting.html | 306 +-
.../commons/page/defaultPageCommentItem.html | 78 +-
.../commons/page/defaultPageCommentPage.html | 106 +-
.../src/main/webapp/static/commons/page.css | 360 +-
.../src/main/webapp/static/commons/page.js | 136 +-
module-page/pom.xml | 86 +-
module-product/module-product-model/pom.xml | 60 +-
.../jpress/module/product/model/Product.java | 372 +-
.../module/product/model/ProductCategory.java | 310 +-
.../module/product/model/ProductComment.java | 126 +-
.../module/product/model/ProductImage.java | 30 +-
.../product/model/base/BaseProduct.java | 1040 +-
.../model/base/BaseProductCategory.java | 520 +-
.../model/base/BaseProductComment.java | 364 +-
.../product/model/base/BaseProductImage.java | 108 +-
.../module-product-search-api/pom.xml | 50 +-
.../service/search/ProductSearcher.java | 36 +-
.../module-product-search-db/pom.xml | 74 +-
.../module/product/searcher/DbSearcher.java | 100 +-
.../module-product-search-es/pom.xml | 96 +-
.../product/search/ElasticSearcher.java | 422 +-
.../module-product-search-lucene/pom.xml | 160 +-
.../product/searcher/LuceneSearcher.java | 472 +-
.../module-product-search-opensearch/pom.xml | 74 +-
.../jpress/module/product/search/Action.java | 154 +-
.../product/search/AliyunOpenSearcher.java | 362 +-
.../module-product-service-api/pom.xml | 60 +-
.../service/ProductCategoryService.java | 410 +-
.../service/ProductCommentService.java | 420 +-
.../product/service/ProductImageService.java | 362 +-
.../product/service/ProductService.java | 430 +-
.../module-product-service-provider/pom.xml | 142 +-
.../ProductCategoryServiceProvider.java | 344 +-
.../ProductCommentServiceProvider.java | 288 +-
.../provider/ProductImageServiceProvider.java | 158 +-
.../provider/ProductServiceProvider.java | 718 +-
.../service/provider/search/NoneSearcher.java | 86 +-
.../search/ProductSearcherFactory.java | 140 +-
.../ProductCommentReplyCountUpdateTask.java | 124 +-
.../task/ProductCommentsCountUpdateTask.java | 130 +-
.../task/ProductViewsCountUpdateTask.java | 136 +-
module-product/module-product-web/pom.xml | 92 +-
.../product/JPressProductInfoQuerier.java | 130 +-
.../jpress/module/product/ProductFields.java | 378 +-
.../product/ProductModuleInitializer.java | 150 +-
.../module/product/ProductNotifyKit.java | 216 +-
.../product/api/ProductApiController.java | 230 +-
.../product/api/UserAddressApiController.java | 166 +-
.../product/api/UserCarApiController.java | 118 +-
.../product/api/UserCouponApiController.java | 118 +-
.../product/api/UserOrderApiController.java | 132 +-
.../controller/ProductCategoryController.java | 242 +-
.../product/controller/ProductController.java | 682 +-
.../controller/ProductSearchController.java | 60 +-
.../controller/ProductTagController.java | 174 +-
.../controller/ProductUCenterController.java | 192 +-
.../_ProductCategoryController.java | 252 +-
.../controller/_ProductCommentController.java | 250 +-
.../controller/_ProductController.java | 584 +-
.../controller/_ProductTagController.java | 274 +-
.../directive/CategoryProductsDirective.java | 168 +-
.../directive/NextProductDirective.java | 112 +-
.../directive/PreviousProductDirective.java | 112 +-
.../directive/ProductCategoriesDirective.java | 130 +-
.../ProductCategoryListDirective.java | 304 +-
.../ProductCommentPageDirective.java | 172 +-
.../product/directive/ProductDirective.java | 126 +-
.../directive/ProductPageDirective.java | 216 +-
.../directive/ProductSearchPageDirective.java | 154 +-
.../directive/ProductTagListDirective.java | 122 +-
.../directive/ProductTagsDirective.java | 130 +-
.../product/directive/ProductsDirective.java | 158 +-
.../directive/RelevantProductsDirective.java | 136 +-
.../product/interceptor/ProductValidate.java | 158 +-
.../views/admin/product/comment_edit.html | 286 +-
.../views/admin/product/comment_list.html | 320 +-
.../views/admin/product/comment_reply.html | 268 +-
.../admin/product/product_category_list.html | 524 +-
.../views/admin/product/product_edit.html | 1096 +-
.../views/admin/product/product_list.html | 428 +-
.../views/admin/product/product_tag_list.html | 392 +-
.../WEB-INF/views/admin/product/setting.html | 532 +-
.../product/defaultProductCommentItem.html | 82 +-
.../product/defaultProductCommentPage.html | 108 +-
.../commons/product/defaultProductHeader.html | 196 +-
.../views/ucenter/product/comment_list.html | 182 +-
.../ucenter/product/product_favorite.html | 182 +-
.../main/webapp/static/commons/product.css | 726 +-
.../src/main/webapp/static/commons/product.js | 422 +-
module-product/pom.xml | 98 +-
starter-tomcat/pom.xml | 528 +-
.../main/resources/jboot-simple.properties | 36 +-
starter-tomcat/src/main/resources/logback.xml | 296 +-
.../src/main/webapp/WEB-INF/web.xml | 38 +-
starter-tomcat/src/main/webapp/robots.txt | 12 +-
starter/jpress.bat | 92 +-
starter/jpress.sh | 122 +-
starter/package.xml | 126 +-
starter/pom.xml | 554 +-
starter/src/main/java/io/jpress/Starter.java | 72 +-
.../modulegen/ArticleModuleGenerator.java | 88 +-
.../jpress/modulegen/PageModuleGenerator.java | 88 +-
.../modulegen/ProductModuleGenerator.java | 90 +-
.../main/resources/jboot-simple.properties | 36 +-
starter/src/main/resources/logback.xml | 296 +-
starter/src/main/resources/undertow.txt | 86 +-
starter/src/main/webapp/robots.txt | 12 +-
starter/src/test/java/JavaTester.java | 14 +-
upgrade.sh | 130 +-
1269 files changed, 191898 insertions(+), 191307 deletions(-)
create mode 100644 jpress-addons/jpress-addon-categoryTag/pom.xml
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/java/org/jpress/addon/menutag/MenuTagAddon.java
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/java/org/jpress/addon/menutag/MenuTagAddonHandler.java
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/java/org/jpress/addon/menutag/MenuTagAddonInterceptor.java
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/java/org/jpress/addon/menutag/MenuTagController.java
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/java/org/jpress/addon/menutag/MenuTagUpgrader.java
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/resources/addon.txt
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/resources/changelog.txt
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/resources/readme.txt
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/webapp/menuTag.gif
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/webapp/resource/page_menuTag.html
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/webapp/resource/plugin-menuTag/plugin-menuTag.css
create mode 100644 jpress-addons/jpress-addon-categoryTag/src/main/webapp/setting.html
diff --git a/.dockerignore b/.dockerignore
index 82dfbbdd0..986d4b561 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,3 +1,3 @@
-*
-!starter/target/starter-3.0
+*
+!starter/target/starter-3.0
!docker
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index edeb15a2b..333643aae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,28 +1,28 @@
-**/target/
-*/jpress-addon-club/
-*/jpress-addon-articlemeta/
-*/jpress-addon-wechatlogin/
-*/jpress-addon-wtask/
-*/jpress-addon-dcode/
-*/jpress-addon-smartprogram/
-*/jpress-addon-keygen/
-*/jpress-addon-newprod/
-starter-dev/
-starter-ent/
-.idea
-*.iml
-.project
-.settings
-starter/**/jboot.properties
-install.lock
-*.jar
-*.log
-.logs
-logs
-*.iws
-*.classpath
-.DS_Store
-*.patch
-~$*
-*/*.jar
-docker_volumes/
+**/target/
+*/jpress-addon-club/
+*/jpress-addon-articlemeta/
+*/jpress-addon-wechatlogin/
+*/jpress-addon-wtask/
+*/jpress-addon-dcode/
+*/jpress-addon-smartprogram/
+*/jpress-addon-keygen/
+*/jpress-addon-newprod/
+starter-dev/
+starter-ent/
+.idea
+*.iml
+.project
+.settings
+starter/**/jboot.properties
+install.lock
+*.jar
+*.log
+.logs
+logs
+*.iws
+*.classpath
+.DS_Store
+*.patch
+~$*
+*/*.jar
+docker_volumes/
diff --git a/Dockerfile b/Dockerfile
index fe56f405a..351f0f845 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,18 +1,18 @@
-FROM fuhai/jpress-base:v1.4
-LABEL maintainer="Michael Yang"
-
-WORKDIR /opt/jpress
-
-COPY ./starter/target/starter-3.0/ /opt/jpress/
-COPY ./docker/files/jpress.sh /opt/jpress/jpress.sh
-COPY ./docker/files/jboot.properties /opt/jpress/config/jboot.properties
-
-
-RUN chmod +x /opt/jpress/jpress.sh && \
- rm -rf /opt/jpress/jpress.bat && \
- rm -rf /opt/jpress/config/undertow.txt && \
- rm -rf /opt/jpress/config/install.lock
-
-EXPOSE 8080
-
+FROM fuhai/jpress-base:v1.4
+LABEL maintainer="Michael Yang"
+
+WORKDIR /opt/jpress
+
+COPY ./starter/target/starter-3.0/ /opt/jpress/
+COPY ./docker/files/jpress.sh /opt/jpress/jpress.sh
+COPY ./docker/files/jboot.properties /opt/jpress/config/jboot.properties
+
+
+RUN chmod +x /opt/jpress/jpress.sh && \
+ rm -rf /opt/jpress/jpress.bat && \
+ rm -rf /opt/jpress/config/undertow.txt && \
+ rm -rf /opt/jpress/config/install.lock
+
+EXPOSE 8080
+
CMD ["/opt/jpress/jpress.sh", "start"]
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index e8a5509b2..3e0caaf5c 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,165 +1,165 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/README.md b/README.md
index 0c7468997..02ffe438b 100644
--- a/README.md
+++ b/README.md
@@ -1,209 +1,209 @@
-
-
-
-
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.codegen;
-
-import com.jfinal.kit.PathKit;
-import com.jfinal.plugin.activerecord.generator.MetaBuilder;
-import com.jfinal.plugin.activerecord.generator.TableMeta;
-import io.jboot.app.JbootApplication;
-import io.jboot.codegen.CodeGenHelpler;
-import io.jboot.utils.StrUtil;
-import io.jpress.codegen.generator.*;
-
-import java.util.List;
-import java.util.Set;
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- * @Title: 根据数据库信息,生成 JPress 系统代码
- * @Package io.jpress.core.code
- */
-public class SystemGenerator {
-
- public static void main(String[] args) {
-
- String dbTables = "user,attachment,menu,option,payment_record,permission,role,utm," +
- "wechat_menu,wechat_reply," +
- "member,member_group,member_dist_amount,member_joined_record,member_price," +
- "user_address,user_amount,user_amount_statement,user_amount_payout," +
- "coupon,coupon_code,coupon_used_record," +
- "user_cart,user_order,user_order_item,user_order_delivery,user_order_invoice," +
- "user_openid,user_favorite,user_tag," +
- "payment_record";
-
- String optionsTables = "coupon,member,member_group,product,product_category,user_address," +
- "user_amount_statement,user_amount_payout,user_cart,user_order,user_order_item,user_order_delivery,user_order_invoice," +
- "payment_record,user_openid,member_joined_record,user_favorite,user_tag";
-
- JbootApplication.setBootArg("jboot.datasource.url", "jdbc:mysql://127.0.0.1:3306/jpress3");
- JbootApplication.setBootArg("jboot.datasource.user", "root");
- JbootApplication.setBootArg("jboot.datasource.password", "123456");
-
- String modelPackage = "io.jpress.model";
-
- String baseModelPackage = modelPackage + ".base";
-
- String modelDir = PathKit.getWebRootPath() + "/../jpress-model/src/main/java/" + modelPackage.replace(".", "/");
- String baseModelDir = PathKit.getWebRootPath() + "/../jpress-model/src/main/java/" + baseModelPackage.replace(".", "/");
-
- System.out.println("start generate...dir:" + modelDir);
-
- Set genTableNames = StrUtil.splitToSet(dbTables, ",");
- MetaBuilder metaBuilder = CodeGenHelpler.createMetaBuilder();
- metaBuilder.setGenerateRemarks(true);
- List tableMetas = metaBuilder.build();
- tableMetas.removeIf(tableMeta -> genTableNames != null && !genTableNames.contains(tableMeta.name.toLowerCase()));
-
-
- new BaseModelGenerator(baseModelPackage, baseModelDir).generate(tableMetas);
- new ModelGenerator(modelPackage, baseModelPackage, modelDir).generate(tableMetas);
-
- String servicePackage = "io.jpress.service";
- String apiPath = PathKit.getWebRootPath() + "/../jpress-service-api/src/main/java/" + servicePackage.replace(".", "/");
- String providerPath = PathKit.getWebRootPath() + "/../jpress-service-provider/src/main/java/" + servicePackage.replace(".", "/") + "/provider";
-
-
- new ServiceApiGenerator(servicePackage, modelPackage, apiPath).generate(tableMetas);
- new ServiceProviderGenerator(servicePackage, modelPackage, providerPath).generate(tableMetas);
-
- Set optionsTableNames = StrUtil.splitToSet(optionsTables, ",");
- if (optionsTableNames != null && optionsTableNames.size() > 0) {
- tableMetas.removeIf(tableMeta -> !optionsTableNames.contains(tableMeta.name.toLowerCase()));
- new BaseOptionsModelGenerator(baseModelPackage, baseModelDir).generate(tableMetas);
- }
- }
-
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.codegen;
+
+import com.jfinal.kit.PathKit;
+import com.jfinal.plugin.activerecord.generator.MetaBuilder;
+import com.jfinal.plugin.activerecord.generator.TableMeta;
+import io.jboot.app.JbootApplication;
+import io.jboot.codegen.CodeGenHelpler;
+import io.jboot.utils.StrUtil;
+import io.jpress.codegen.generator.*;
+
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ * @Title: 根据数据库信息,生成 JPress 系统代码
+ * @Package io.jpress.core.code
+ */
+public class SystemGenerator {
+
+ public static void main(String[] args) {
+
+ String dbTables = "user,attachment,menu,option,payment_record,permission,role,utm," +
+ "wechat_menu,wechat_reply," +
+ "member,member_group,member_dist_amount,member_joined_record,member_price," +
+ "user_address,user_amount,user_amount_statement,user_amount_payout," +
+ "coupon,coupon_code,coupon_used_record," +
+ "user_cart,user_order,user_order_item,user_order_delivery,user_order_invoice," +
+ "user_openid,user_favorite,user_tag," +
+ "payment_record";
+
+ String optionsTables = "coupon,member,member_group,product,product_category,user_address," +
+ "user_amount_statement,user_amount_payout,user_cart,user_order,user_order_item,user_order_delivery,user_order_invoice," +
+ "payment_record,user_openid,member_joined_record,user_favorite,user_tag";
+
+ JbootApplication.setBootArg("jboot.datasource.url", "jdbc:mysql://127.0.0.1:3306/jpress3");
+ JbootApplication.setBootArg("jboot.datasource.user", "root");
+ JbootApplication.setBootArg("jboot.datasource.password", "123456");
+
+ String modelPackage = "io.jpress.model";
+
+ String baseModelPackage = modelPackage + ".base";
+
+ String modelDir = PathKit.getWebRootPath() + "/../jpress-model/src/main/java/" + modelPackage.replace(".", "/");
+ String baseModelDir = PathKit.getWebRootPath() + "/../jpress-model/src/main/java/" + baseModelPackage.replace(".", "/");
+
+ System.out.println("start generate...dir:" + modelDir);
+
+ Set genTableNames = StrUtil.splitToSet(dbTables, ",");
+ MetaBuilder metaBuilder = CodeGenHelpler.createMetaBuilder();
+ metaBuilder.setGenerateRemarks(true);
+ List tableMetas = metaBuilder.build();
+ tableMetas.removeIf(tableMeta -> genTableNames != null && !genTableNames.contains(tableMeta.name.toLowerCase()));
+
+
+ new BaseModelGenerator(baseModelPackage, baseModelDir).generate(tableMetas);
+ new ModelGenerator(modelPackage, baseModelPackage, modelDir).generate(tableMetas);
+
+ String servicePackage = "io.jpress.service";
+ String apiPath = PathKit.getWebRootPath() + "/../jpress-service-api/src/main/java/" + servicePackage.replace(".", "/");
+ String providerPath = PathKit.getWebRootPath() + "/../jpress-service-provider/src/main/java/" + servicePackage.replace(".", "/") + "/provider";
+
+
+ new ServiceApiGenerator(servicePackage, modelPackage, apiPath).generate(tableMetas);
+ new ServiceProviderGenerator(servicePackage, modelPackage, providerPath).generate(tableMetas);
+
+ Set optionsTableNames = StrUtil.splitToSet(optionsTables, ",");
+ if (optionsTableNames != null && optionsTableNames.size() > 0) {
+ tableMetas.removeIf(tableMeta -> !optionsTableNames.contains(tableMeta.name.toLowerCase()));
+ new BaseOptionsModelGenerator(baseModelPackage, baseModelDir).generate(tableMetas);
+ }
+ }
+
+}
diff --git a/codegen/src/main/java/io/jpress/codegen/Tester.java b/codegen/src/main/java/io/jpress/codegen/Tester.java
index 61aa91274..94ce9daed 100644
--- a/codegen/src/main/java/io/jpress/codegen/Tester.java
+++ b/codegen/src/main/java/io/jpress/codegen/Tester.java
@@ -1,42 +1,42 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.codegen;
-
-/**
- * @author Michael Yang 杨福海 (fuhai999@gmail.com)
- * @version V1.0
- * @Package io.jboot.codegen
- */
-public class Tester {
-
-
- private static String dbUrl = "jdbc:mysql://127.0.0.1:3306/jpress3";
- private static String dbUser = "root";
- private static String dbPassword = "";
-
-
- private static String moduleName = "page";
- private static String dbTables = "single_page";
- private static String modelPackage = "io.jpress.module.page.model";
- private static String servicePackage = "io.jpress.module.page.service";
-
- public static void main(String[] args) {
-
- ModuleGenerator moduleGenerator = new ModuleGenerator(moduleName, dbUrl, dbUser, dbPassword, dbTables, modelPackage, servicePackage);
- moduleGenerator.gen();
-
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.codegen;
+
+/**
+ * @author Michael Yang 杨福海 (fuhai999@gmail.com)
+ * @version V1.0
+ * @Package io.jboot.codegen
+ */
+public class Tester {
+
+
+ private static String dbUrl = "jdbc:mysql://127.0.0.1:3306/jpress3";
+ private static String dbUser = "root";
+ private static String dbPassword = "";
+
+
+ private static String moduleName = "page";
+ private static String dbTables = "single_page";
+ private static String modelPackage = "io.jpress.module.page.model";
+ private static String servicePackage = "io.jpress.module.page.service";
+
+ public static void main(String[] args) {
+
+ ModuleGenerator moduleGenerator = new ModuleGenerator(moduleName, dbUrl, dbUser, dbPassword, dbTables, modelPackage, servicePackage);
+ moduleGenerator.gen();
+
+ }
+}
diff --git a/codegen/src/main/java/io/jpress/codegen/generator/AddonUIGenerator.java b/codegen/src/main/java/io/jpress/codegen/generator/AddonUIGenerator.java
index 8ec1ff5df..eba3486a2 100644
--- a/codegen/src/main/java/io/jpress/codegen/generator/AddonUIGenerator.java
+++ b/codegen/src/main/java/io/jpress/codegen/generator/AddonUIGenerator.java
@@ -1,159 +1,159 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.codegen.generator;
-
-import com.jfinal.kit.Kv;
-import com.jfinal.kit.StrKit;
-import com.jfinal.plugin.activerecord.generator.TableMeta;
-import com.jfinal.template.Engine;
-import com.jfinal.template.source.ClassPathSourceFactory;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.List;
-
-public class AddonUIGenerator {
-
- private String moduleName;//product
- private String modulePackage;//io.jpress.module.product
-
- private String modelPackage;//io.jpress.module.product.model
-
-
- private String templatesDir = "io/jpress/codegen/templates/";
-
- private Kv data;
- private String[] templates = { "ui_controller_template_for_addon.jf", "ui_edit_template.jf", "ui_list_template.jf"};
- public static final int UI_CONTROLLER = 1;
- public static final int UI_EDIT = 2;
- public static final int UI_LIST = 3;
-
-
- private String controllerOutputDir;
- private String htmlOutputDir;
-
- private String targetTemplate;
- private String targetOutputDirFile;
-
- private List tableMetaList;
-
- private String basePath;
-
- private Engine engine = Engine.create("forUI");
-
- public static void main(String[] args) {
-
- }
-
- public AddonUIGenerator(String basePath, String moduleName, String modelPackage, List tableMetaList) {
-
- this.basePath = basePath;
-
- this.tableMetaList = tableMetaList;
- this.moduleName = moduleName;
- this.modelPackage = modelPackage;
- this.modulePackage = modelPackage.substring(0, modelPackage.lastIndexOf("."));
-
- modulePackage = modelPackage.substring(0, modelPackage.lastIndexOf("."));
-
- String moduleListenerPakcage = modelPackage.substring(0, modelPackage.lastIndexOf("."));
- String controllerPackage = modelPackage.substring(0, modelPackage.lastIndexOf(".")) + ".controller";
-
-
- controllerOutputDir = basePath + "/src/main/java/" + controllerPackage.replace(".", "/");
- htmlOutputDir = basePath + "/src/main/webapp/views/";
-
- data = Kv.by("moduleName", moduleName);//product
- data.set("upcasedModuleName", StrKit.firstCharToUpperCase(moduleName));//Product
- data.set("modulePackage", modulePackage);//io.jpress.module.product
- data.set("modelPackage", modelPackage);//io.jpress.module.product.model
- data.set("moduleListenerPakcage", moduleListenerPakcage);//io.jpress.module.product
- data.set("controllerPackage", controllerPackage);//io.jpress.module.product.controller
-
- engine.setSourceFactory(new ClassPathSourceFactory());
- engine.addSharedMethod(new StrKit());
-
- }
-
-
- public AddonUIGenerator genControllers() {
- generate(AddonUIGenerator.UI_CONTROLLER);
- return this;
- }
-
- public AddonUIGenerator genEdit() {
- generate(AddonUIGenerator.UI_EDIT);
- return this;
- }
-
- public AddonUIGenerator genList() {
- generate(AddonUIGenerator.UI_LIST);
- return this;
- }
-
- public void generate(int genType) {
-
- String targetOutputDir = "";
-
- for (TableMeta tableMeta : tableMetaList) {
- data.set("tableMeta", tableMeta);
- String lowerCaseModelName = StrKit.firstCharToLowerCase(tableMeta.modelName);
- data.set("lowerCaseModelName", lowerCaseModelName);
-
- if (AddonUIGenerator.UI_CONTROLLER == genType) {
- targetTemplate = templatesDir + templates[0];
- targetOutputDir = controllerOutputDir;
- targetOutputDirFile = targetOutputDir + File.separator + "_" + tableMeta.modelName + "Controller" + ".java";
- }
-
- if (AddonUIGenerator.UI_EDIT == genType) {
- targetTemplate = templatesDir + templates[1];
- targetOutputDir = htmlOutputDir;
- targetOutputDirFile = targetOutputDir + File.separator + tableMeta.name + "_edit.html";
- }
- if (AddonUIGenerator.UI_LIST == genType) {
- targetTemplate = templatesDir + templates[2];
- targetOutputDir = htmlOutputDir;
- targetOutputDirFile = targetOutputDir + File.separator + tableMeta.name + "_list.html";
- }
- // tableMeta.columnMetas.get(0).remarks
- String content = engine.getTemplate(targetTemplate).renderToString(data);
-
- //
- File dir = new File(targetOutputDir);
- if (!dir.exists()) {
- dir.mkdirs();
- }
- File targetFile = new File(targetOutputDirFile);
- if (targetFile.exists()) {
- return;
- }
- try {
- FileWriter fw = new FileWriter(targetOutputDirFile);
- try {
- fw.write(content);
- } finally {
- fw.close();
- }
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
-
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.codegen.generator;
+
+import com.jfinal.kit.Kv;
+import com.jfinal.kit.StrKit;
+import com.jfinal.plugin.activerecord.generator.TableMeta;
+import com.jfinal.template.Engine;
+import com.jfinal.template.source.ClassPathSourceFactory;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.List;
+
+public class AddonUIGenerator {
+
+ private String moduleName;//product
+ private String modulePackage;//io.jpress.module.product
+
+ private String modelPackage;//io.jpress.module.product.model
+
+
+ private String templatesDir = "io/jpress/codegen/templates/";
+
+ private Kv data;
+ private String[] templates = { "ui_controller_template_for_addon.jf", "ui_edit_template.jf", "ui_list_template.jf"};
+ public static final int UI_CONTROLLER = 1;
+ public static final int UI_EDIT = 2;
+ public static final int UI_LIST = 3;
+
+
+ private String controllerOutputDir;
+ private String htmlOutputDir;
+
+ private String targetTemplate;
+ private String targetOutputDirFile;
+
+ private List tableMetaList;
+
+ private String basePath;
+
+ private Engine engine = Engine.create("forUI");
+
+ public static void main(String[] args) {
+
+ }
+
+ public AddonUIGenerator(String basePath, String moduleName, String modelPackage, List tableMetaList) {
+
+ this.basePath = basePath;
+
+ this.tableMetaList = tableMetaList;
+ this.moduleName = moduleName;
+ this.modelPackage = modelPackage;
+ this.modulePackage = modelPackage.substring(0, modelPackage.lastIndexOf("."));
+
+ modulePackage = modelPackage.substring(0, modelPackage.lastIndexOf("."));
+
+ String moduleListenerPakcage = modelPackage.substring(0, modelPackage.lastIndexOf("."));
+ String controllerPackage = modelPackage.substring(0, modelPackage.lastIndexOf(".")) + ".controller";
+
+
+ controllerOutputDir = basePath + "/src/main/java/" + controllerPackage.replace(".", "/");
+ htmlOutputDir = basePath + "/src/main/webapp/views/";
+
+ data = Kv.by("moduleName", moduleName);//product
+ data.set("upcasedModuleName", StrKit.firstCharToUpperCase(moduleName));//Product
+ data.set("modulePackage", modulePackage);//io.jpress.module.product
+ data.set("modelPackage", modelPackage);//io.jpress.module.product.model
+ data.set("moduleListenerPakcage", moduleListenerPakcage);//io.jpress.module.product
+ data.set("controllerPackage", controllerPackage);//io.jpress.module.product.controller
+
+ engine.setSourceFactory(new ClassPathSourceFactory());
+ engine.addSharedMethod(new StrKit());
+
+ }
+
+
+ public AddonUIGenerator genControllers() {
+ generate(AddonUIGenerator.UI_CONTROLLER);
+ return this;
+ }
+
+ public AddonUIGenerator genEdit() {
+ generate(AddonUIGenerator.UI_EDIT);
+ return this;
+ }
+
+ public AddonUIGenerator genList() {
+ generate(AddonUIGenerator.UI_LIST);
+ return this;
+ }
+
+ public void generate(int genType) {
+
+ String targetOutputDir = "";
+
+ for (TableMeta tableMeta : tableMetaList) {
+ data.set("tableMeta", tableMeta);
+ String lowerCaseModelName = StrKit.firstCharToLowerCase(tableMeta.modelName);
+ data.set("lowerCaseModelName", lowerCaseModelName);
+
+ if (AddonUIGenerator.UI_CONTROLLER == genType) {
+ targetTemplate = templatesDir + templates[0];
+ targetOutputDir = controllerOutputDir;
+ targetOutputDirFile = targetOutputDir + File.separator + "_" + tableMeta.modelName + "Controller" + ".java";
+ }
+
+ if (AddonUIGenerator.UI_EDIT == genType) {
+ targetTemplate = templatesDir + templates[1];
+ targetOutputDir = htmlOutputDir;
+ targetOutputDirFile = targetOutputDir + File.separator + tableMeta.name + "_edit.html";
+ }
+ if (AddonUIGenerator.UI_LIST == genType) {
+ targetTemplate = templatesDir + templates[2];
+ targetOutputDir = htmlOutputDir;
+ targetOutputDirFile = targetOutputDir + File.separator + tableMeta.name + "_list.html";
+ }
+ // tableMeta.columnMetas.get(0).remarks
+ String content = engine.getTemplate(targetTemplate).renderToString(data);
+
+ //
+ File dir = new File(targetOutputDir);
+ if (!dir.exists()) {
+ dir.mkdirs();
+ }
+ File targetFile = new File(targetOutputDirFile);
+ if (targetFile.exists()) {
+ return;
+ }
+ try {
+ FileWriter fw = new FileWriter(targetOutputDirFile);
+ try {
+ fw.write(content);
+ } finally {
+ fw.close();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+
+}
diff --git a/codegen/src/main/java/io/jpress/codegen/generator/BaseModelGenerator.java b/codegen/src/main/java/io/jpress/codegen/generator/BaseModelGenerator.java
index 12e5066e1..522122985 100644
--- a/codegen/src/main/java/io/jpress/codegen/generator/BaseModelGenerator.java
+++ b/codegen/src/main/java/io/jpress/codegen/generator/BaseModelGenerator.java
@@ -1,30 +1,30 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.codegen.generator;
-
-
-public class BaseModelGenerator extends com.jfinal.plugin.activerecord.generator.BaseModelGenerator {
-
- public BaseModelGenerator(String baseModelPackageName,
- String baseModelOutputDir) {
- super(baseModelPackageName, baseModelOutputDir);
-
- this.template = "/io/jpress/codegen/templates/base_model_template.jf";
-
- }
-
-
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.codegen.generator;
+
+
+public class BaseModelGenerator extends com.jfinal.plugin.activerecord.generator.BaseModelGenerator {
+
+ public BaseModelGenerator(String baseModelPackageName,
+ String baseModelOutputDir) {
+ super(baseModelPackageName, baseModelOutputDir);
+
+ this.template = "/io/jpress/codegen/templates/base_model_template.jf";
+
+ }
+
+
+}
diff --git a/codegen/src/main/java/io/jpress/codegen/generator/BaseOptionsModelGenerator.java b/codegen/src/main/java/io/jpress/codegen/generator/BaseOptionsModelGenerator.java
index 4e153b064..5c62c9b3e 100644
--- a/codegen/src/main/java/io/jpress/codegen/generator/BaseOptionsModelGenerator.java
+++ b/codegen/src/main/java/io/jpress/codegen/generator/BaseOptionsModelGenerator.java
@@ -1,31 +1,31 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.codegen.generator;
-
-
-public class BaseOptionsModelGenerator extends com.jfinal.plugin.activerecord.generator.BaseModelGenerator {
-
- public BaseOptionsModelGenerator(String baseModelPackageName,
- String baseModelOutputDir) {
- super(baseModelPackageName, baseModelOutputDir);
-
- this.template = "/io/jpress/codegen/templates/base_options_model_template.jf";
-
-
- }
-
-
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.codegen.generator;
+
+
+public class BaseOptionsModelGenerator extends com.jfinal.plugin.activerecord.generator.BaseModelGenerator {
+
+ public BaseOptionsModelGenerator(String baseModelPackageName,
+ String baseModelOutputDir) {
+ super(baseModelPackageName, baseModelOutputDir);
+
+ this.template = "/io/jpress/codegen/templates/base_options_model_template.jf";
+
+
+ }
+
+
+}
diff --git a/codegen/src/main/java/io/jpress/codegen/generator/ModelGenerator.java b/codegen/src/main/java/io/jpress/codegen/generator/ModelGenerator.java
index 77e8b48d8..dada4d160 100644
--- a/codegen/src/main/java/io/jpress/codegen/generator/ModelGenerator.java
+++ b/codegen/src/main/java/io/jpress/codegen/generator/ModelGenerator.java
@@ -1,31 +1,31 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.codegen.generator;
-
-
-
-public class ModelGenerator extends com.jfinal.plugin.activerecord.generator.ModelGenerator {
-
- public ModelGenerator(String modelPackageName,
- String baseModelPackageName, String modelOutputDir) {
- super(modelPackageName, baseModelPackageName, modelOutputDir);
-
- this.template = "/io/jpress/codegen/templates/model_template.jf";
-
- }
-
-
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.codegen.generator;
+
+
+
+public class ModelGenerator extends com.jfinal.plugin.activerecord.generator.ModelGenerator {
+
+ public ModelGenerator(String modelPackageName,
+ String baseModelPackageName, String modelOutputDir) {
+ super(modelPackageName, baseModelPackageName, modelOutputDir);
+
+ this.template = "/io/jpress/codegen/templates/model_template.jf";
+
+ }
+
+
+}
diff --git a/codegen/src/main/java/io/jpress/codegen/generator/ModuleUIGenerator.java b/codegen/src/main/java/io/jpress/codegen/generator/ModuleUIGenerator.java
index 750f6b6f1..48e18099f 100644
--- a/codegen/src/main/java/io/jpress/codegen/generator/ModuleUIGenerator.java
+++ b/codegen/src/main/java/io/jpress/codegen/generator/ModuleUIGenerator.java
@@ -1,173 +1,173 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.codegen.generator;
-
-import com.jfinal.kit.Kv;
-import com.jfinal.kit.StrKit;
-import com.jfinal.plugin.activerecord.generator.BaseModelGenerator;
-import com.jfinal.plugin.activerecord.generator.TableMeta;
-import com.jfinal.template.Engine;
-import com.jfinal.template.source.ClassPathSourceFactory;
-import io.jboot.app.JbootApplication;
-import io.jboot.codegen.CodeGenHelpler;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.List;
-
-public class ServiceApiGenerator extends BaseModelGenerator {
-
- private String modelPacket;
- private String basePackage;
-
- public static void main(String[] args) {
-
- JbootApplication.setBootArg("jboot.datasource.url", "jdbc:mysql://127.0.0.1:3306/jbootdemo");
- JbootApplication.setBootArg("jboot.datasource.user", "root");
-
- String basePackage = "io.jboot.codegen.service.test";
- String modelPackage = "io.jboot.codegen.model.test";
-
- List tableMetaList = CodeGenHelpler.createMetaBuilder().build();
- CodeGenHelpler.excludeTables(tableMetaList, null);
-
- new ServiceApiGenerator(basePackage, modelPackage,"core-service").generate(tableMetaList);
- }
-
- public ServiceApiGenerator(String basePackage, String modelPacket, String baseModelOutputDir) {
- super(basePackage, baseModelOutputDir);
-
-
- this.modelPacket = modelPacket;
- this.basePackage = basePackage;
- this.template = "io/jpress/codegen/templates/service_template.jf";
-
- }
-
- @Override
- public void generate(List tableMetas) {
- System.out.println("Generate base model ...");
- System.out.println("Base Model Output Dir: " + baseModelOutputDir);
-
- Engine engine = Engine.create("forService");
- engine.setSourceFactory(new ClassPathSourceFactory());
- engine.addSharedMethod(new StrKit());
- engine.addSharedObject("getterTypeMap", getterTypeMap);
- engine.addSharedObject("javaKeyword", javaKeyword);
-
- for (TableMeta tableMeta : tableMetas) {
- genBaseModelContent(tableMeta);
- }
- writeToFile(tableMetas);
- }
-
- @Override
- protected void genBaseModelContent(TableMeta tableMeta) {
- Kv data = Kv.by("baseModelPackageName", baseModelPackageName);
- data.set("generateChainSetter", generateChainSetter);
- data.set("tableMeta", tableMeta);
- data.set("modelPacket", modelPacket);
- data.set("basePackage", basePackage);
-
- Engine engine = Engine.use("forService");
- tableMeta.baseModelContent = engine.getTemplate(template).renderToString(data);
- }
-
-
- /**
- * base model 覆盖写入
- */
- @Override
- protected void writeToFile(TableMeta tableMeta) throws IOException {
- File dir = new File(baseModelOutputDir);
- if (!dir.exists()) {
- dir.mkdirs();
- }
-
- String target = baseModelOutputDir + File.separator + tableMeta.modelName + "Service" + ".java";
-
- File targetFile = new File(target);
- if (targetFile.exists()) {
- return;
- }
-
- FileWriter fw = new FileWriter(target);
- try {
- fw.write(tableMeta.baseModelContent);
- } finally {
- fw.close();
- }
- }
-
-
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.jpress.codegen.generator;
+
+import com.jfinal.kit.Kv;
+import com.jfinal.kit.StrKit;
+import com.jfinal.plugin.activerecord.generator.BaseModelGenerator;
+import com.jfinal.plugin.activerecord.generator.TableMeta;
+import com.jfinal.template.Engine;
+import com.jfinal.template.source.ClassPathSourceFactory;
+import io.jboot.app.JbootApplication;
+import io.jboot.codegen.CodeGenHelpler;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.List;
+
+public class ServiceApiGenerator extends BaseModelGenerator {
+
+ private String modelPacket;
+ private String basePackage;
+
+ public static void main(String[] args) {
+
+ JbootApplication.setBootArg("jboot.datasource.url", "jdbc:mysql://127.0.0.1:3306/jbootdemo");
+ JbootApplication.setBootArg("jboot.datasource.user", "root");
+
+ String basePackage = "io.jboot.codegen.service.test";
+ String modelPackage = "io.jboot.codegen.model.test";
+
+ List tableMetaList = CodeGenHelpler.createMetaBuilder().build();
+ CodeGenHelpler.excludeTables(tableMetaList, null);
+
+ new ServiceApiGenerator(basePackage, modelPackage,"core-service").generate(tableMetaList);
+ }
+
+ public ServiceApiGenerator(String basePackage, String modelPacket, String baseModelOutputDir) {
+ super(basePackage, baseModelOutputDir);
+
+
+ this.modelPacket = modelPacket;
+ this.basePackage = basePackage;
+ this.template = "io/jpress/codegen/templates/service_template.jf";
+
+ }
+
+ @Override
+ public void generate(List tableMetas) {
+ System.out.println("Generate base model ...");
+ System.out.println("Base Model Output Dir: " + baseModelOutputDir);
+
+ Engine engine = Engine.create("forService");
+ engine.setSourceFactory(new ClassPathSourceFactory());
+ engine.addSharedMethod(new StrKit());
+ engine.addSharedObject("getterTypeMap", getterTypeMap);
+ engine.addSharedObject("javaKeyword", javaKeyword);
+
+ for (TableMeta tableMeta : tableMetas) {
+ genBaseModelContent(tableMeta);
+ }
+ writeToFile(tableMetas);
+ }
+
+ @Override
+ protected void genBaseModelContent(TableMeta tableMeta) {
+ Kv data = Kv.by("baseModelPackageName", baseModelPackageName);
+ data.set("generateChainSetter", generateChainSetter);
+ data.set("tableMeta", tableMeta);
+ data.set("modelPacket", modelPacket);
+ data.set("basePackage", basePackage);
+
+ Engine engine = Engine.use("forService");
+ tableMeta.baseModelContent = engine.getTemplate(template).renderToString(data);
+ }
+
+
+ /**
+ * base model 覆盖写入
+ */
+ @Override
+ protected void writeToFile(TableMeta tableMeta) throws IOException {
+ File dir = new File(baseModelOutputDir);
+ if (!dir.exists()) {
+ dir.mkdirs();
+ }
+
+ String target = baseModelOutputDir + File.separator + tableMeta.modelName + "Service" + ".java";
+
+ File targetFile = new File(target);
+ if (targetFile.exists()) {
+ return;
+ }
+
+ FileWriter fw = new FileWriter(target);
+ try {
+ fw.write(tableMeta.baseModelContent);
+ } finally {
+ fw.close();
+ }
+ }
+
+
+}
diff --git a/codegen/src/main/java/io/jpress/codegen/generator/ServiceProviderGenerator.java b/codegen/src/main/java/io/jpress/codegen/generator/ServiceProviderGenerator.java
index be54d4bce..5c614bfd9 100644
--- a/codegen/src/main/java/io/jpress/codegen/generator/ServiceProviderGenerator.java
+++ b/codegen/src/main/java/io/jpress/codegen/generator/ServiceProviderGenerator.java
@@ -1,100 +1,100 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.codegen.generator;
-
-import com.jfinal.kit.Kv;
-import com.jfinal.kit.StrKit;
-import com.jfinal.plugin.activerecord.generator.BaseModelGenerator;
-import com.jfinal.plugin.activerecord.generator.TableMeta;
-import com.jfinal.template.Engine;
-import com.jfinal.template.source.ClassPathSourceFactory;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.List;
-
-public class ServiceProviderGenerator extends BaseModelGenerator {
-
- String basePackage;
- String modelPackage;
-
- public ServiceProviderGenerator(String basePackage, String modelPackage, String baseModelOutputDir) {
- super(basePackage + ".provider", baseModelOutputDir);
-
- this.basePackage = basePackage;
- this.modelPackage = modelPackage;
- this.template = "io/jpress/codegen/templates/service_provider_template.jf";
-
-
- }
-
- @Override
- public void generate(List tableMetas) {
- System.out.println("Generate base model ...");
- System.out.println("Base Model Output Dir: " + baseModelOutputDir);
-
- Engine engine = Engine.create("forServiceImpl");
- engine.setSourceFactory(new ClassPathSourceFactory());
- engine.addSharedMethod(new StrKit());
- engine.addSharedObject("getterTypeMap", getterTypeMap);
- engine.addSharedObject("javaKeyword", javaKeyword);
-
- for (TableMeta tableMeta : tableMetas) {
- genBaseModelContent(tableMeta);
- }
- writeToFile(tableMetas);
- }
-
-
- @Override
- protected void genBaseModelContent(TableMeta tableMeta) {
- Kv data = Kv.by("serviceImplPackageName", baseModelPackageName);
- data.set("generateChainSetter", generateChainSetter);
- data.set("tableMeta", tableMeta);
- data.set("basePackage", basePackage);
- data.set("modelPackage", modelPackage);
-
- Engine engine = Engine.use("forServiceImpl");
- tableMeta.baseModelContent = engine.getTemplate(template).renderToString(data);
- }
-
- /**
- * base model 覆盖写入
- */
- @Override
- protected void writeToFile(TableMeta tableMeta) throws IOException {
- File dir = new File(baseModelOutputDir);
- if (!dir.exists()) {
- dir.mkdirs();
- }
-
- String target = baseModelOutputDir + File.separator + tableMeta.modelName + "ServiceProvider" + ".java";
-
- File targetFile = new File(target);
- if (targetFile.exists()) {
- return;
- }
-
-
- FileWriter fw = new FileWriter(target);
- try {
- fw.write(tableMeta.baseModelContent);
- } finally {
- fw.close();
- }
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.jpress.module.#(moduleName);
-
-import com.jfinal.core.Controller;
-import io.jboot.Jboot;
-import io.jboot.core.listener.JbootAppListenerBase;
-import io.jboot.db.model.Columns;
-import io.jpress.core.menu.MenuGroup;
-import io.jpress.core.module.ModuleListener;
-import java.util.List;
-
-/**
- * @version V1.0
- * @Title: Module 监听器
- * @Description: 每个 module 都应该有这样的一个监听器,用来配置自身Module的信息,比如后台菜单等
- * @Package io.jpress.module.#(moduleName)
- */
-public class #(upcasedModuleName)ModuleInitializer extends JbootAppListenerBase implements ModuleListener {
-
-
- @Override
- public String onRenderDashboardBox(Controller controller) {
- return null;
- }
-
- @Override
- public String onRenderToolsBox(Controller controller) {
- return null;
- }
-
- @Override
- public void onConfigAdminMenu(List adminMenus) {
- MenuGroup menuGroup = new MenuGroup();
- menuGroup.setId("#(moduleName)");
- menuGroup.setText("#(moduleName)");
- menuGroup.setIcon("");
- menuGroup.setOrder(1);
- adminMenus.add(menuGroup);
- }
-
- @Override
- public void onConfigUcenterMenu(List ucenterMenus) {
-
-
- }
-
-
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package #(controllerPackage);
-
-import com.jfinal.aop.Inject;
-import com.jfinal.kit.Ret;
-import com.jfinal.plugin.activerecord.Page;
-import io.jboot.web.controller.annotation.RequestMapping;
-import io.jboot.web.validate.EmptyValidate;
-import io.jpress.JPressConsts;
-import io.jpress.core.menu.annotation.AdminMenu;
-import #(modelPackage).#(tableMeta.modelName);
-import #(modulePackage).service.#(tableMeta.modelName)Service;
-import io.jpress.web.base.AdminControllerBase;
-import java.util.Date;
-
-
-@RequestMapping(value = "/admin/#(moduleName)/#(tableMeta.name)", viewPath = JPressConsts.DEFAULT_ADMIN_VIEW)
-public class _#(tableMeta.modelName)Controller extends AdminControllerBase {
-
- @Inject
- private #(tableMeta.modelName)Service service;
-
- @AdminMenu(text = "#(tableMeta.remarks)管理", groupId = "#(moduleName)")
- public void index() {
- Page<#(tableMeta.modelName)> entries=service.paginate(getPagePara(), 10);
- setAttr("page", entries);
- render("#(moduleName)/#(tableMeta.name)_list.html");
- }
-
-
- public void edit() {
- int entryId = getParaToInt(0, 0);
-
- #(tableMeta.modelName) entry = entryId > 0 ? service.findById(entryId) : null;
- setAttr("#(lowerCaseModelName)", entry);
- set("now",new Date());
- render("#(moduleName)/#(tableMeta.name)_edit.html");
- }
-
- public void doSave() {
- #(tableMeta.modelName) entry = getModel(#(tableMeta.modelName).class,"#(firstCharToLowerCase(tableMeta.modelName))");
- service.saveOrUpdate(entry);
- renderJson(Ret.ok().set("id", entry.getId()));
- }
-
-
- public void doDel() {
- Long id = getIdPara();
- render(service.deleteById(id) ? Ret.ok() : Ret.fail());
- }
-
- @EmptyValidate(@Form(name = "ids"))
- public void doDelByIds() {
- service.batchDeleteByIds(getParaSet("ids").toArray());
- renderOkJson();
- }
-
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package #(controllerPackage);
+
+import com.jfinal.aop.Inject;
+import com.jfinal.kit.Ret;
+import com.jfinal.plugin.activerecord.Page;
+import io.jboot.web.controller.annotation.RequestMapping;
+import io.jboot.web.validate.EmptyValidate;
+import io.jpress.JPressConsts;
+import io.jpress.core.menu.annotation.AdminMenu;
+import #(modelPackage).#(tableMeta.modelName);
+import #(modulePackage).service.#(tableMeta.modelName)Service;
+import io.jpress.web.base.AdminControllerBase;
+import java.util.Date;
+
+
+@RequestMapping(value = "/admin/#(moduleName)/#(tableMeta.name)", viewPath = JPressConsts.DEFAULT_ADMIN_VIEW)
+public class _#(tableMeta.modelName)Controller extends AdminControllerBase {
+
+ @Inject
+ private #(tableMeta.modelName)Service service;
+
+ @AdminMenu(text = "#(tableMeta.remarks)管理", groupId = "#(moduleName)")
+ public void index() {
+ Page<#(tableMeta.modelName)> entries=service.paginate(getPagePara(), 10);
+ setAttr("page", entries);
+ render("#(moduleName)/#(tableMeta.name)_list.html");
+ }
+
+
+ public void edit() {
+ int entryId = getParaToInt(0, 0);
+
+ #(tableMeta.modelName) entry = entryId > 0 ? service.findById(entryId) : null;
+ setAttr("#(lowerCaseModelName)", entry);
+ set("now",new Date());
+ render("#(moduleName)/#(tableMeta.name)_edit.html");
+ }
+
+ public void doSave() {
+ #(tableMeta.modelName) entry = getModel(#(tableMeta.modelName).class,"#(firstCharToLowerCase(tableMeta.modelName))");
+ service.saveOrUpdate(entry);
+ renderJson(Ret.ok().set("id", entry.getId()));
+ }
+
+
+ public void doDel() {
+ Long id = getIdPara();
+ render(service.deleteById(id) ? Ret.ok() : Ret.fail());
+ }
+
+ @EmptyValidate(@Form(name = "ids"))
+ public void doDelByIds() {
+ service.batchDeleteByIds(getParaSet("ids").toArray());
+ renderOkJson();
+ }
+
+}
diff --git a/codegen/src/main/java/io/jpress/codegen/templates/ui_controller_template_for_addon.jf b/codegen/src/main/java/io/jpress/codegen/templates/ui_controller_template_for_addon.jf
index 2c8eb3aee..2bbb56414 100644
--- a/codegen/src/main/java/io/jpress/codegen/templates/ui_controller_template_for_addon.jf
+++ b/codegen/src/main/java/io/jpress/codegen/templates/ui_controller_template_for_addon.jf
@@ -1,67 +1,67 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package #(controllerPackage);
-
-import com.jfinal.aop.Inject;
-import com.jfinal.kit.Ret;
-import com.jfinal.plugin.activerecord.Page;
-
-import io.jboot.web.controller.annotation.RequestMapping;
-import io.jboot.web.validate.EmptyValidate;
-import #(modelPackage).#(tableMeta.modelName);
-import #(modulePackage).service.#(tableMeta.modelName)Service;
-import io.jpress.core.menu.annotation.AdminMenu;
-import io.jpress.web.base.AdminControllerBase;
-
-
-@RequestMapping(value = "/admin/#(moduleName)/#(tableMeta.name)", viewPath = "/")
-public class _#(tableMeta.modelName)Controller extends AdminControllerBase {
-
- @Inject
- private #(tableMeta.modelName)Service service;
-
- @AdminMenu(text = "#(tableMeta.remarks)管理", groupId = "#(moduleName)")
- public void index() {
- Page<#(tableMeta.modelName)> entries=service.paginate(getPagePara(), 10);
- setAttr("page", entries);
- render("views/#(tableMeta.name)_list.html");
- }
-
-
- public void edit() {
- int entryId = getParaToInt(0, 0);
- #(tableMeta.modelName) entry = entryId > 0 ? service.findById(entryId) : null;
- setAttr("#(lowerCaseModelName)", entry);
- render("views/#(tableMeta.name)_edit.html");
- }
-
- public void doSave() {
- #(tableMeta.modelName) entry = getModel(#(tableMeta.modelName).class,"#(firstCharToLowerCase(tableMeta.modelName))");
- service.saveOrUpdate(entry);
- renderJson(Ret.ok().set("id", entry.getId()));
- }
-
- public void doDel() {
- Long id = getIdPara();
- render(service.deleteById(id) ? Ret.ok() : Ret.fail());
- }
-
- @EmptyValidate(@Form(name = "ids"))
- public void doDelByIds() {
- service.batchDeleteByIds(getParaSet("ids").toArray());
- renderOkJson();
- }
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl-3.0.txt
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package #(controllerPackage);
+
+import com.jfinal.aop.Inject;
+import com.jfinal.kit.Ret;
+import com.jfinal.plugin.activerecord.Page;
+
+import io.jboot.web.controller.annotation.RequestMapping;
+import io.jboot.web.validate.EmptyValidate;
+import #(modelPackage).#(tableMeta.modelName);
+import #(modulePackage).service.#(tableMeta.modelName)Service;
+import io.jpress.core.menu.annotation.AdminMenu;
+import io.jpress.web.base.AdminControllerBase;
+
+
+@RequestMapping(value = "/admin/#(moduleName)/#(tableMeta.name)", viewPath = "/")
+public class _#(tableMeta.modelName)Controller extends AdminControllerBase {
+
+ @Inject
+ private #(tableMeta.modelName)Service service;
+
+ @AdminMenu(text = "#(tableMeta.remarks)管理", groupId = "#(moduleName)")
+ public void index() {
+ Page<#(tableMeta.modelName)> entries=service.paginate(getPagePara(), 10);
+ setAttr("page", entries);
+ render("views/#(tableMeta.name)_list.html");
+ }
+
+
+ public void edit() {
+ int entryId = getParaToInt(0, 0);
+ #(tableMeta.modelName) entry = entryId > 0 ? service.findById(entryId) : null;
+ setAttr("#(lowerCaseModelName)", entry);
+ render("views/#(tableMeta.name)_edit.html");
+ }
+
+ public void doSave() {
+ #(tableMeta.modelName) entry = getModel(#(tableMeta.modelName).class,"#(firstCharToLowerCase(tableMeta.modelName))");
+ service.saveOrUpdate(entry);
+ renderJson(Ret.ok().set("id", entry.getId()));
+ }
+
+ public void doDel() {
+ Long id = getIdPara();
+ render(service.deleteById(id) ? Ret.ok() : Ret.fail());
+ }
+
+ @EmptyValidate(@Form(name = "ids"))
+ public void doDelByIds() {
+ service.batchDeleteByIds(getParaSet("ids").toArray());
+ renderOkJson();
+ }
+}
diff --git a/codegen/src/main/java/io/jpress/codegen/templates/ui_edit_template.jf b/codegen/src/main/java/io/jpress/codegen/templates/ui_edit_template.jf
index 8cc316baa..3e1025adf 100644
--- a/codegen/src/main/java/io/jpress/codegen/templates/ui_edit_template.jf
+++ b/codegen/src/main/java/io/jpress/codegen/templates/ui_edit_template.jf
@@ -1,97 +1,97 @@
-#[[
-#@layout()
-#define css()
-#@layout_css?()
-
-#end
-#define script()
-#@layout_script?()
-
-
-
-#end
-]]#
-
-#('#')define content()
-
+#('#')end
diff --git a/codegen/src/main/java/io/jpress/codegen/templates/ui_listener_template.jf b/codegen/src/main/java/io/jpress/codegen/templates/ui_listener_template.jf
index 92a4a80bc..3f1fc6d1e 100644
--- a/codegen/src/main/java/io/jpress/codegen/templates/ui_listener_template.jf
+++ b/codegen/src/main/java/io/jpress/codegen/templates/ui_listener_template.jf
@@ -1,62 +1,62 @@
-/**
- * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
- *
- * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl-3.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package #(moduleListenerPakcage);
-
-import com.jfinal.core.Controller;
-import io.jboot.Jboot;
-import io.jboot.core.listener.JbootAppListenerBase;
-import io.jboot.db.model.Columns;
-import io.jpress.core.menu.MenuGroup;
-import io.jpress.core.module.ModuleListener;
-import java.util.List;
-
-/**
- * @version V1.0
- * @Title: Module 监听器
- * @Description: 每个 module 都应该有这样的一个监听器,用来配置自身Module的信息,比如后台菜单等
- * @Package io.jpress.module.#(moduleName)
- */
-public class #(upcasedModuleName)ModuleListener extends JbootAppListenerBase implements ModuleListener {
-
-
- @Override
- public String onRenderDashboardBox(Controller controller) {
- return null;
- }
-
- @Override
- public String onRenderToolsBox(Controller controller) {
- return null;
- }
-
- @Override
- public void onConfigAdminMenu(List adminMenus) {
- MenuGroup menuGroup = new MenuGroup();
- menuGroup.setId("#(moduleName)");
- menuGroup.setText("#(moduleName)");
- menuGroup.setIcon("");
- menuGroup.setOrder(1);
- adminMenus.add(menuGroup);
- }
-
- @Override
- public void onConfigUcenterMenu(List ucenterMenus) {
-
-
- }
-
-
-}
+/**
+ * Copyright (c) 2016-2020, Michael Yang 杨福海 (fuhai999@gmail.com).
+ *
+ * Licensed under the GNU Lesser General Public License (LGPL) ,Version 3.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *