Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
智布道
OneBlog
提交
76d9463c
O
OneBlog
项目概览
智布道
/
OneBlog
9 个月 前同步成功
通知
11
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OneBlog
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
76d9463c
编写于
1月 16, 2019
作者:
Y
yadong.zhang0415@gmail.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
✨
sys_config表字段名修改
上级
1b25a379
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
38 addition
and
33 deletion
+38
-33
blog-admin/src/main/java/com/zyd/blog/controller/RestApiController.java
.../main/java/com/zyd/blog/controller/RestApiController.java
+1
-1
blog-admin/src/main/resources/templates/config.ftl
blog-admin/src/main/resources/templates/config.ftl
+6
-6
blog-admin/src/main/resources/templates/layout/footer.ftl
blog-admin/src/main/resources/templates/layout/footer.ftl
+1
-1
blog-core/src/main/java/com/zyd/blog/business/entity/Config.java
...re/src/main/java/com/zyd/blog/business/entity/Config.java
+8
-8
blog-core/src/main/java/com/zyd/blog/business/service/impl/RemoverServiceImpl.java
...om/zyd/blog/business/service/impl/RemoverServiceImpl.java
+1
-1
blog-core/src/main/java/com/zyd/blog/persistence/beans/SysConfig.java
...c/main/java/com/zyd/blog/persistence/beans/SysConfig.java
+2
-2
blog-core/src/main/resources/mybatis/SysConfigMapper.xml
blog-core/src/main/resources/mybatis/SysConfigMapper.xml
+2
-2
blog-web/src/main/resources/static/js/zhyd.js
blog-web/src/main/resources/static/js/zhyd.js
+1
-1
blog-web/src/main/resources/templates/article.ftl
blog-web/src/main/resources/templates/article.ftl
+2
-2
blog-web/src/main/resources/templates/include/macros.ftl
blog-web/src/main/resources/templates/include/macros.ftl
+1
-1
blog-web/src/main/resources/templates/index.ftl
blog-web/src/main/resources/templates/index.ftl
+2
-2
blog-web/src/main/resources/templates/layout/footer.ftl
blog-web/src/main/resources/templates/layout/footer.ftl
+1
-1
docs/db/dblog.sql
docs/db/dblog.sql
+2
-2
docs/db/update.sql
docs/db/update.sql
+8
-3
未找到文件。
blog-admin/src/main/java/com/zyd/blog/controller/RestApiController.java
浏览文件 @
76d9463c
...
...
@@ -63,7 +63,7 @@ public class RestApiController {
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>(
3
);
resultMap
.
put
(
"success"
,
1
);
resultMap
.
put
(
"message"
,
"上传成功"
);
resultMap
.
put
(
"filename"
,
config
.
getQi
u
niuBasePath
()
+
filePath
);
resultMap
.
put
(
"filename"
,
config
.
getQiniuBasePath
()
+
filePath
);
return
resultMap
;
}
...
...
blog-admin/src/main/resources/templates/config.ftl
浏览文件 @
76d9463c
...
...
@@ -188,9 +188,9 @@
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="qi
u
niuBasePath">七牛路径 <span class="required">*</span></label>
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="qiniuBasePath">七牛路径 <span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" class="form-control col-md-7 col-xs-12" name="qi
uniuBasePath" id="qiu
niuBasePath"
<input type="text" class="form-control col-md-7 col-xs-12" name="qi
niuBasePath" id="qi
niuBasePath"
required="required" placeholder="请输入七牛路径"/>
</div>
</div>
...
...
@@ -278,10 +278,10 @@
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="maintenanceDat
a
">维护日期</label>
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="maintenanceDat
e
">维护日期</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<div class='input-group date myDatepicker'>
<input type='text' class="form-control" required="required" readonly="readonly" id="maintenanceDat
a" name="maintenanceData
" placeholder="请输入维护日期"/>
<input type='text' class="form-control" required="required" readonly="readonly" id="maintenanceDat
e" name="maintenanceDate
" placeholder="请输入维护日期"/>
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
...
...
@@ -325,8 +325,8 @@
clearText($(this), this.type, data);
});
data.zfbPraiseCode && $("#zfbPraiseCodeFilePreview").html('<img src="' + data.qi
u
niuBasePath + data.zfbPraiseCode + '" alt="支付宝赞赏码" class="img-responsive img-rounded auto-shake">');
data.wxPraiseCode && $("#wxPraiseCodeFilePreview").html('<img src="' + data.qi
u
niuBasePath + data.wxPraiseCode + '" alt="微信赞赏码" class="img-responsive img-rounded auto-shake">');
data.zfbPraiseCode && $("#zfbPraiseCodeFilePreview").html('<img src="' + data.qiniuBasePath + data.zfbPraiseCode + '" alt="支付宝赞赏码" class="img-responsive img-rounded auto-shake">');
data.wxPraiseCode && $("#wxPraiseCodeFilePreview").html('<img src="' + data.qiniuBasePath + data.wxPraiseCode + '" alt="微信赞赏码" class="img-responsive img-rounded auto-shake">');
}
});
...
...
blog-admin/src/main/resources/templates/layout/footer.ftl
浏览文件 @
76d9463c
...
...
@@ -8,7 +8,7 @@
</div>
<script type="text/javascript">
var appConfig = {
qiniuPath: '${config.qi
u
niuBasePath}',
qiniuPath: '${config.qiniuBasePath}',
qiniuImgStyle: '',// 上传文章图片时,会自动追加该值,主要用来定制化图片样式、水印背景等属性,默认无
wwwPath: '${config.siteUrl}',
staticPath: '${config.staticWebSite}'
...
...
blog-core/src/main/java/com/zyd/blog/business/entity/Config.java
浏览文件 @
76d9463c
...
...
@@ -169,13 +169,13 @@ public class Config {
}
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
DateConst
.
YYYY_MM_DD_HH_MM_SS_EN
)
public
Date
getMaintenanceDat
a
()
{
return
this
.
sysConfig
.
getMaintenanceDat
a
();
public
Date
getMaintenanceDat
e
()
{
return
this
.
sysConfig
.
getMaintenanceDat
e
();
}
@DateTimeFormat
(
pattern
=
DateConst
.
YYYY_MM_DD_HH_MM_SS_EN
)
public
void
setMaintenanceDat
a
(
Date
maintenanceData
)
{
this
.
sysConfig
.
setMaintenanceDat
a
(
maintenanceData
);
public
void
setMaintenanceDat
e
(
Date
maintenanceDate
)
{
this
.
sysConfig
.
setMaintenanceDat
e
(
maintenanceDate
);
}
public
boolean
isComment
()
{
...
...
@@ -203,12 +203,12 @@ public class Config {
this
.
sysConfig
.
setUpdateTime
(
updateTime
);
}
public
String
getQi
u
niuBasePath
()
{
return
this
.
sysConfig
.
getQi
u
niuBasePath
();
public
String
getQiniuBasePath
()
{
return
this
.
sysConfig
.
getQiniuBasePath
();
}
public
void
setQi
uniuBasePath
(
String
qiu
niuBasePath
)
{
this
.
sysConfig
.
setQi
uniuBasePath
(
qiu
niuBasePath
);
public
void
setQi
niuBasePath
(
String
qi
niuBasePath
)
{
this
.
sysConfig
.
setQi
niuBasePath
(
qi
niuBasePath
);
}
public
String
getQiniuAccessKey
()
{
...
...
blog-core/src/main/java/com/zyd/blog/business/service/impl/RemoverServiceImpl.java
浏览文件 @
76d9463c
...
...
@@ -86,7 +86,7 @@ public class RemoverServiceImpl implements RemoverService {
// 处理标签,并获取最终待添加的标签id
List
<
Long
>
tagIds
=
null
;
Tags
newTag
=
null
;
String
qiniuBasePath
=
sysConfigService
.
get
().
getQi
u
niuBasePath
();
String
qiniuBasePath
=
sysConfigService
.
get
().
getQiniuBasePath
();
for
(
Article
spiderArticle
:
list
)
{
writerUtil
.
print
(
"------------------------------------------------------------------------------------"
);
writerUtil
.
print
(
String
.
format
(
"准备持久化 - %s"
,
spiderArticle
.
getTitle
()));
...
...
blog-core/src/main/java/com/zyd/blog/persistence/beans/SysConfig.java
浏览文件 @
76d9463c
...
...
@@ -34,10 +34,10 @@ public class SysConfig extends AbstractDO {
private
String
weibo
;
private
String
github
;
private
Boolean
maintenance
;
private
Date
maintenanceDat
a
;
private
Date
maintenanceDat
e
;
private
Boolean
comment
;
private
String
qi
u
niuBasePath
;
private
String
qiniuBasePath
;
private
String
qiniuAccessKey
;
private
String
qiniuSecretKey
;
private
String
qiniuBucketName
;
...
...
blog-core/src/main/resources/mybatis/SysConfigMapper.xml
浏览文件 @
76d9463c
...
...
@@ -20,9 +20,9 @@
<result
property=
"weibo"
jdbcType=
"VARCHAR"
column=
"weibo"
/>
<result
property=
"github"
jdbcType=
"VARCHAR"
column=
"github"
/>
<result
property=
"maintenance"
jdbcType=
"BIT"
column=
"maintenance"
/>
<result
property=
"maintenanceDat
a"
jdbcType=
"TIMESTAMP"
column=
"maintenance_data
"
/>
<result
property=
"maintenanceDat
e"
jdbcType=
"TIMESTAMP"
column=
"maintenance_date
"
/>
<result
property=
"comment"
jdbcType=
"BIT"
column=
"comment"
/>
<result
property=
"qi
uniuBasePath"
jdbcType=
"VARCHAR"
column=
"qiu
niu_base_path"
/>
<result
property=
"qi
niuBasePath"
jdbcType=
"VARCHAR"
column=
"qi
niu_base_path"
/>
<result
property=
"qiniuAccessKey"
jdbcType=
"VARCHAR"
column=
"qiniu_access_key"
/>
<result
property=
"qiniuSecretKey"
jdbcType=
"VARCHAR"
column=
"qiniu_secret_key"
/>
<result
property=
"qiniuBucketName"
jdbcType=
"VARCHAR"
column=
"qiniu_bucket_name"
/>
...
...
blog-web/src/main/resources/static/js/zhyd.js
浏览文件 @
76d9463c
...
...
@@ -149,7 +149,7 @@ function initScrollMenu() {
}
var
PaymentUtils
=
window
.
payment
||
{
config
:
[{
url
:
appConfig
.
qi
uniuBasePath
+
appConfig
.
zfbPraiseCode
,
desc
:
'
支付宝转账
'
},
{
url
:
appConfig
.
qiu
niuBasePath
+
appConfig
.
wxPraiseCode
,
desc
:
'
微信转账
'
}],
config
:
[{
url
:
appConfig
.
qi
niuBasePath
+
appConfig
.
zfbPraiseCode
,
desc
:
'
支付宝转账
'
},
{
url
:
appConfig
.
qi
niuBasePath
+
appConfig
.
wxPraiseCode
,
desc
:
'
微信转账
'
}],
show
:
function
()
{
$
(
"
#reward
"
).
modal
(
'
show
'
);
this
.
change
(
0
);
...
...
blog-web/src/main/resources/templates/article.ftl
浏览文件 @
76d9463c
...
...
@@ -32,7 +32,7 @@
</@header>
<#if article.coverImage?exists>
<img src="${config.qi
u
niuBasePath}${article.coverImage?if_exists}" onerror="this.src='${config.staticWebSite}/img/default_article_cover.jpg'" style="display: none;" id="cover-img">
<img src="${config.qiniuBasePath}${article.coverImage?if_exists}" onerror="this.src='${config.staticWebSite}/img/default_article_cover.jpg'" style="display: none;" id="cover-img">
</#if>
<div class="container custome-container">
<nav class="breadcrumb">
...
...
@@ -169,7 +169,7 @@
<div class="line-container">
<div class="line-left">
<#if item.coverImage?exists>
<img class="lazy-img" data-original="${config.qi
u
niuBasePath}${item.coverImage}" width="50" height="50" rel="external nofollow"/>
<img class="lazy-img" data-original="${config.qiniuBasePath}${item.coverImage}" width="50" height="50" rel="external nofollow"/>
<#else>
<img class="lazy-img" data-original="${config.staticWebSite}/img/favicon.ico" width="50" height="50" rel="external nofollow"/>
</#if>
...
...
blog-web/src/main/resources/templates/include/macros.ftl
浏览文件 @
76d9463c
...
...
@@ -76,7 +76,7 @@
<
#if
config.maintenance
?
if_exists
&&
config.maintenance
>
<div
class=
"alert alert-warning fade-in"
role=
"alert"
>
<a
href=
"#"
class=
"close"
data-dismiss=
"alert"
>
×
</a>
系统预计将在
<strong>
${config.maintenanceDat
a
?string('yyyy年MM月dd日 HH点mm分')}
</strong>
进行更新,届时网站将无法使用,更新时间大约 5-10分钟,敬请悉知。
系统预计将在
<strong>
${config.maintenanceDat
e
?string('yyyy年MM月dd日 HH点mm分')}
</strong>
进行更新,届时网站将无法使用,更新时间大约 5-10分钟,敬请悉知。
</div>
</
#
if>
</
#
macro>
\ No newline at end of file
blog-web/src/main/resources/templates/index.ftl
浏览文件 @
76d9463c
...
...
@@ -43,7 +43,7 @@
<#list recommendedList as item>
<div class="item ${(item_index == 0)?string('active','')}">
<a href="${config.siteUrl}/article/${item.id?c}">
<img src="${config.qi
u
niuBasePath}${item.coverImage}" alt="${item.title}" title="${item.title}">
<img src="${config.qiniuBasePath}${item.coverImage}" alt="${item.title}" title="${item.title}">
</a>
<div class="zyd-carousel-caption">${item.title}</div>
</div>
...
...
@@ -68,7 +68,7 @@
<figure class="thumbnail">
<a href="${config.siteUrl}/article/${item.id?c}">
<#if item.coverImage?exists && (item.coverImage?length > 7)>
<img width="150" height="150" data-original="${config.qi
u
niuBasePath}${item.coverImage}" class="img-responsive lazy-img" alt="${item.title?if_exists}">
<img width="150" height="150" data-original="${config.qiniuBasePath}${item.coverImage}" class="img-responsive lazy-img" alt="${item.title?if_exists}">
<#else>
<img width="150" height="150" data-original="${config.staticWebSite}/img/user/11.jpg" class="img-responsive lazy-img" alt="${item.title?if_exists}">
</#if>
...
...
blog-web/src/main/resources/templates/layout/footer.ftl
浏览文件 @
76d9463c
...
...
@@ -201,7 +201,7 @@
wwwPath: '${config.siteUrl}',
cmsPath: '${config.cmsUrl}',
staticPath: '${config.staticWebSite}',
qi
uniuBasePath: '${config.qiu
niuBasePath}',
qi
niuBasePath: '${config.qi
niuBasePath}',
wxPraiseCode: '${config.wxPraiseCode}',
zfbPraiseCode: '${config.zfbPraiseCode}'
};
...
...
docs/db/dblog.sql
浏览文件 @
76d9463c
...
...
@@ -170,9 +170,9 @@ CREATE TABLE `sys_config` (
`weibo`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'微博'
,
`github`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'github'
,
`maintenance`
tinyint
(
1
)
UNSIGNED
NULL
DEFAULT
NULL
COMMENT
'是否开启维护通知'
,
`maintenance_dat
a
`
datetime
(
0
)
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'系统维护时间'
,
`maintenance_dat
e
`
datetime
(
0
)
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'系统维护时间'
,
`comment`
tinyint
(
1
)
UNSIGNED
NULL
DEFAULT
1
COMMENT
'是否开启评论'
,
`qi
u
niu_base_path`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'七牛路径'
,
`qiniu_base_path`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'七牛路径'
,
`qiniu_access_key`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'七牛ACCESS_KEY'
,
`qiniu_secret_key`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'七牛SECRET_KEY'
,
`qiniu_bucket_name`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'七牛BUCKET_NAME'
,
...
...
docs/db/update.sql
浏览文件 @
76d9463c
...
...
@@ -12,13 +12,13 @@ ADD COLUMN `name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL
#
2018
-
05
-
18
10
:
28
添加字段
ALTER
TABLE
`sys_config`
ADD
COLUMN
`baidu_push_token`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'百度推送的token'
AFTER
`qi
u
niu_base_path`
,
ADD
COLUMN
`baidu_push_token`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'百度推送的token'
AFTER
`qiniu_base_path`
,
ADD
COLUMN
`wx_praise_code`
varchar
(
200
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'微信赞赏码'
AFTER
`baidu_push_token`
,
ADD
COLUMN
`zfb_praise_code`
varchar
(
200
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'支付宝赞赏码'
AFTER
`wx_praise_code`
;
ALTER
TABLE
`sys_config`
ADD
COLUMN
`baidu_api_ak`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'百度api授权AK(获取地址:http://lbsyun.baidu.com/apiconsole/key)'
AFTER
`zfb_praise_code`
;
ALTER
TABLE
`sys_config`
ADD
COLUMN
`qiniu_access_key`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'七牛ACCESS_KEY'
AFTER
`qi
u
niu_base_path`
,
ADD
COLUMN
`qiniu_access_key`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'七牛ACCESS_KEY'
AFTER
`qiniu_base_path`
,
ADD
COLUMN
`qiniu_secret_key`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'七牛SECRET_KEY'
AFTER
`qiniu_access_key`
,
ADD
COLUMN
`qiniu_bucket_name`
varchar
(
100
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'七牛BUCKET_NAME'
AFTER
`qiniu_secret_key`
;
...
...
@@ -26,7 +26,7 @@ ADD COLUMN `qiniu_bucket_name` varchar(100) CHARACTER SET utf8 COLLATE utf8_gen
ALTER
TABLE
`biz_article`
ADD
COLUMN
`comment`
tinyint
(
1
)
UNSIGNED
NULL
DEFAULT
1
COMMENT
'是否开启评论'
AFTER
`keywords`
;
ALTER
TABLE
`sys_config`
MODIFY
COLUMN
`comment`
tinyint
(
1
)
UNSIGNED
NULL
DEFAULT
1
COMMENT
'是否开启评论'
AFTER
`maintenance_dat
a
`
;
MODIFY
COLUMN
`comment`
tinyint
(
1
)
UNSIGNED
NULL
DEFAULT
1
COMMENT
'是否开启评论'
AFTER
`maintenance_dat
e
`
;
#
2018
-
06
-
10
markdown
版本的编辑器
ALTER
TABLE
`biz_article`
...
...
@@ -145,3 +145,8 @@ CREATE TABLE `sys_log` (
#
2019
-
01
-
04
解决文章或者评论中存在
emoji
表情时造成保存失败的问题
ALTER
TABLE
`biz_article`
CONVERT
TO
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
ALTER
TABLE
`biz_comment`
CONVERT
TO
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
;
#
2019
-
01
-
16
修改表字段名
ALTER
TABLE
`dblog`
.
`sys_config`
CHANGE
COLUMN
`maintenance_data`
`maintenance_date`
datetime
(
0
)
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'系统维护时间'
AFTER
`maintenance`
,
CHANGE
COLUMN
`qiuniu_base_path`
`qiniu_base_path`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'七牛路径'
AFTER
`comment`
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录