Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
64cca8ad
Commit
64cca8ad
authored
Jan 19, 2019
by
ms group dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配置更新
parent
96850042
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
170 deletions
+43
-170
ArticleAction.java
src/main/java/net/mingsoft/cms/action/web/ArticleAction.java
+43
-37
application.yml
src/main/resources/application.yml
+0
-2
web.xml
src/main/webapp/WEB-INF/web.xml
+0
-131
No files found.
src/main/java/net/mingsoft/cms/action/web/ArticleAction.java
View file @
64cca8ad
...
@@ -29,29 +29,35 @@ import java.util.Map;
...
@@ -29,29 +29,35 @@ import java.util.Map;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.ApiOperation
;
import
net.mingsoft.base.filter.DateValueFilter
;
import
io.swagger.annotations.ApiOperation
;
import
net.mingsoft.base.filter.DateValueFilter
;
import
net.mingsoft.basic.action.BaseAction
;
import
net.mingsoft.basic.action.BaseAction
;
import
net.mingsoft.basic.bean.ListBean
;
import
net.mingsoft.basic.biz.IColumnBiz
;
import
net.mingsoft.basic.biz.IColumnBiz
;
import
net.mingsoft.basic.entity.ColumnEntity
;
import
net.mingsoft.basic.entity.ColumnEntity
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.cms.biz.IArticleBiz
;
import
net.mingsoft.cms.biz.IArticleBiz
;
import
net.mingsoft.cms.entity.ArticleEntity
;
import
net.mingsoft.cms.entity.ArticleEntity
;
import
net.mingsoft.mdiy.biz.IContentModelBiz
;
import
net.mingsoft.mdiy.biz.IContentModelBiz
;
import
net.mingsoft.mdiy.biz.IContentModelFieldBiz
;
import
net.mingsoft.mdiy.biz.IContentModelFieldBiz
;
import
net.mingsoft.mdiy.entity.ContentModelEntity
;
import
net.mingsoft.mdiy.entity.ContentModelEntity
;
import
org.apache.commons.lang3.StringUtils
;
import
springfox.documentation.annotations.ApiIgnore
;
import
cn.hutool.core.util.ObjectUtil
;
import
net.mingsoft.base.filter.DateValueFilter
;
import
net.mingsoft.basic.bean.ListBean
;
import
net.mingsoft.basic.util.BasicUtil
;
/**
/**
*
*
...
@@ -101,37 +107,36 @@ public class ArticleAction extends BaseAction {
...
@@ -101,37 +107,36 @@ public class ArticleAction extends BaseAction {
* basicDateTime:"发布时间",basicUpdateTime:"更新时间","basicHit":点击数,
* basicDateTime:"发布时间",basicUpdateTime:"更新时间","basicHit":点击数,
* "basicId":编号 articleContent:"文章内容","basicSort":排序,[自定义模型字段]}
* "basicId":编号 articleContent:"文章内容","basicSort":排序,[自定义模型字段]}
*/
*/
@
Reques
tMapping
(
"/{basicId}/detail"
)
@
Ge
tMapping
(
"/{basicId}/detail"
)
@ResponseBody
@ResponseBody
public
void
detail
(
@PathVariable
int
basicId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
void
detail
(
@PathVariable
int
basicId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
System
.
out
.
println
(
BasicUtil
.
getSession
(
"xxx"
));
ArticleEntity
article
=
articleBiz
.
getById
(
basicId
);
//ArticleEntity article = articleBiz.getById(basicId);
if
(
article
==
null
)
{
// if (article == null) {
this
.
outJson
(
response
,
""
);
// this.outJson(response, "");
return
;
// return;
}
// }
// 获取文章栏目id获取栏目实体
// // 获取文章栏目id获取栏目实体
ColumnEntity
column
=
(
ColumnEntity
)
columnBiz
.
getEntity
(
article
.
getBasicCategoryId
());
// ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId());
ContentModelEntity
contentModel
=
(
ContentModelEntity
)
contentModelBiz
// ContentModelEntity contentModel = (ContentModelEntity) contentModelBiz
.
getEntity
(
column
.
getColumnContentModelId
());
// .getEntity(column.getColumnContentModelId());
//
// 判断内容模型的值
// // 判断内容模型的值
if
(
contentModel
!=
null
)
{
// if (contentModel != null) {
Map
where
=
new
HashMap
();
// Map where = new HashMap();
// 压入basicId字段的值
// // 压入basicId字段的值
where
.
put
(
"basicId"
,
basicId
);
// where.put("basicId", basicId);
// 遍历所有的字段实体,得到字段名列表信息
// // 遍历所有的字段实体,得到字段名列表信息
List
<
String
>
listFieldName
=
new
ArrayList
<
String
>();
// List<String> listFieldName = new ArrayList<String>();
listFieldName
.
add
(
"basicId"
);
// listFieldName.add("basicId");
// 查询新增字段的信息
// // 查询新增字段的信息
List
fieldLists
=
fieldBiz
.
queryBySQL
(
contentModel
.
getCmTableName
(),
listFieldName
,
where
);
// List fieldLists = fieldBiz.queryBySQL(contentModel.getCmTableName(), listFieldName, where);
if
(
fieldLists
.
size
()
>
0
)
{
// if (fieldLists.size() > 0) {
Map
map
=
(
Map
)
fieldLists
.
get
(
0
);
// Map map = (Map) fieldLists.get(0);
article
.
setExtendsFields
(
map
);
// article.setExtendsFields(map);
}
// }
}
// }
//
this
.
outJson
(
response
,
JSONObject
.
toJSONStringWithDateFormat
(
article
,
"yyyy-MM-dd hh:mm:ss"
));
// this.outJson(response, JSONObject.toJSONStringWithDateFormat(article, "yyyy-MM-dd hh:mm:ss"));
}
}
...
@@ -183,9 +188,10 @@ public class ArticleAction extends BaseAction {
...
@@ -183,9 +188,10 @@ public class ArticleAction extends BaseAction {
* "total":总记录数量
* "total":总记录数量
* }
* }
*/
*/
@RequestMapping
(
value
=
"/list"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
value
=
"文章列表信息"
)
@ResponseBody
@ResponseBody
public
void
list
(
@ModelAttribute
ArticleEntity
article
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
void
list
(
@ModelAttribute
@ApiIgnore
ArticleEntity
article
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
int
appId
=
BasicUtil
.
getAppId
();
int
appId
=
BasicUtil
.
getAppId
();
int
[]
ids
=
null
;
int
[]
ids
=
null
;
if
(
article
.
getBasicCategoryId
()>
0
)
{
if
(
article
.
getBasicCategoryId
()>
0
)
{
...
...
src/main/resources/application.yml
View file @
64cca8ad
application
:
version
:
mcms-4.7.0
server
:
server
:
port
:
8080
port
:
8080
servlet.context-path
:
/ms-mcms
servlet.context-path
:
/ms-mcms
...
...
src/main/webapp/WEB-INF/web.xml
deleted
100644 → 0
View file @
96850042
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://java.sun.com/xml/ns/javaee"
xmlns:web=
"http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id=
"WebApp_ID"
version=
"3.0"
>
<display-name>
mybatis
</display-name>
<context-param>
<param-name>
contextConfigLocation
</param-name>
<param-value>
classpath:spring-core.xml
</param-value>
</context-param>
<filter>
<description>
字符集过滤器
</description>
<filter-name>
encodingFilter
</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<description>
字符集编码
</description>
<param-name>
encoding
</param-name>
<param-value>
UTF-8
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>
encodingFilter
</filter-name>
<url-pattern>
/*
</url-pattern>
</filter-mapping>
<!-- Apache Shiro -->
<filter>
<filter-name>
shiroFilter
</filter-name>
<filter-class>
org.springframework.web.filter.DelegatingFilterProxy
</filter-class>
<init-param>
<param-name>
targetFilterLifecycle
</param-name>
<param-value>
true
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>
shiroFilter
</filter-name>
<url-pattern>
/*
</url-pattern>
</filter-mapping>
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
<!-- 防止spring内存溢出监听器 -->
<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>
<listener>
<description>
spring监听器
</description>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- spring mvc servlet -->
<servlet>
<description>
spring mvc servlet
</description>
<servlet-name>
springMvc
</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<description>
spring mvc 配置文件
</description>
<param-name>
contextConfigLocation
</param-name>
<param-value>
classpath:spring-mvc.xml
</param-value>
</init-param>
<load-on-startup>
1
</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>
springMvc
</servlet-name>
<url-pattern>
*.do
</url-pattern>
</servlet-mapping>
<!-- Druid,监控数据库,以及WEB访问连接信息 -->
<!-- 参考: https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_%E9%85%8D%E7%BD%AEWebStatFilter -->
<filter>
<filter-name>
DruidWebStatFilter
</filter-name>
<filter-class>
com.alibaba.druid.support.http.WebStatFilter
</filter-class>
<init-param>
<param-name>
exclusions
</param-name>
<param-value>
*.js,*.gif,*.jpg,*.png,*.css,*.ico,*.jsp,/druid/*,/download/*
</param-value>
</init-param>
<init-param>
<param-name>
sessionStatMaxCount
</param-name>
<param-value>
2000
</param-value>
</init-param>
<init-param>
<param-name>
sessionStatEnable
</param-name>
<param-value>
true
</param-value>
</init-param>
<init-param>
<param-name>
principalSessionName
</param-name>
<param-value>
session_user_key
</param-value>
</init-param>
<init-param>
<param-name>
profileEnable
</param-name>
<param-value>
true
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>
DruidWebStatFilter
</filter-name>
<url-pattern>
/*
</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>
index
</welcome-file>
<welcome-file>
default.html
</welcome-file>
<welcome-file>
default.htm
</welcome-file>
<welcome-file>
index.htm
</welcome-file>
<welcome-file>
index.html
</welcome-file>
<welcome-file>
login.do
</welcome-file>
</welcome-file-list>
<!-- 配置session超时时间,单位分钟 -->
<error-page>
<error-code>
404
</error-code>
<location>
/error/404.do
</location>
</error-page>
<error-page>
<error-code>
400
</error-code>
<location>
/error/400.do
</location>
</error-page>
<error-page>
<error-code>
403
</error-code>
<location>
/error/403.do
</location>
</error-page>
<error-page>
<error-code>
405
</error-code>
<location>
/error/405.do
</location>
</error-page>
<error-page>
<error-code>
500
</error-code>
<location>
/error/500.do
</location>
</error-page>
<session-config>
<session-timeout>
15
</session-timeout>
</session-config>
</web-app>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment