Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
智布道
OneBlog
提交
2f210ff2
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 搜索 >>
提交
2f210ff2
编写于
1月 29, 2019
作者:
Y
yadong.zhang0415@gmail.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🐛
Fixed issue: #IO5HQ
上级
82f9cd71
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
184 addition
and
273 deletion
+184
-273
blog-admin/src/main/resources/static/assets/js/zhyd.core.js
blog-admin/src/main/resources/static/assets/js/zhyd.core.js
+15
-8
blog-admin/src/main/resources/static/assets/js/zhyd.publish-article.js
...c/main/resources/static/assets/js/zhyd.publish-article.js
+1
-1
blog-admin/src/main/resources/templates/article/list.ftl
blog-admin/src/main/resources/templates/article/list.ftl
+1
-1
blog-admin/src/main/resources/templates/article/publish-md.ftl
...admin/src/main/resources/templates/article/publish-md.ftl
+2
-129
blog-admin/src/main/resources/templates/article/publish.ftl
blog-admin/src/main/resources/templates/article/publish.ftl
+3
-127
blog-admin/src/main/resources/templates/include/macros.ftl
blog-admin/src/main/resources/templates/include/macros.ftl
+133
-0
blog-core/src/main/java/com/zyd/blog/business/service/BizTagsService.java
...in/java/com/zyd/blog/business/service/BizTagsService.java
+2
-0
blog-core/src/main/java/com/zyd/blog/business/service/impl/BizTagsServiceImpl.java
...om/zyd/blog/business/service/impl/BizTagsServiceImpl.java
+26
-7
update.md
update.md
+1
-0
未找到文件。
blog-admin/src/main/resources/static/assets/js/zhyd.core.js
浏览文件 @
2f210ff2
...
...
@@ -67,7 +67,7 @@ var zhyd = window.zhyd || {
itemValue
:
'
id
'
,
itemText
:
'
name
'
,
maxTags
:
3
,
maxChars
:
1
0
,
maxChars
:
2
0
,
trimValue
:
true
,
focusClass
:
'
focus
'
});
...
...
@@ -81,20 +81,27 @@ var zhyd = window.zhyd || {
var
$li
=
$
(
this
);
$li
.
bind
(
'
click
'
,
add
);
});
$this
.
on
(
'
itemAdded
'
,
function
(
event
)
{
var
tag
=
event
.
item
;
if
(
!
event
.
options
)
{
$
.
post
(
'
/tag/add
'
,
{
name
:
t
ag
,
description
:
tag
},
function
(
response
)
{
$
(
"
.bootstrap-tagsinput input
"
).
bind
(
'
keydown
'
,
function
(
event
){
var
thisVal
=
$
(
this
).
val
();
console
.
log
(
event
.
key
)
;
if
(
event
.
key
==
'
Enter
'
||
event
.
keyCode
==
'
13
'
)
{
$
.
post
(
'
/tag/add
'
,
{
name
:
t
hisVal
,
description
:
thisVal
},
function
(
response
)
{
if
(
response
.
status
!==
200
)
{
$
this
.
tagsinput
(
'
remove
'
,
tag
,
{
del
:
false
}
);
$
.
alert
.
error
(
response
.
message
);
}
else
{
var
data
=
response
.
data
;
$
(
'
<li data-value="
'
+
data
.
id
+
'
">
'
+
data
.
name
+
'
</li>
'
).
bind
(
'
click
'
,
add
).
appendTo
(
$
(
$bindBox
)
);
$
this
.
tagsinput
(
'
add
'
,
{
"
id
"
:
data
.
id
,
"
name
"
:
data
.
name
},
{
addNew
:
true
}
);
}
});
}
});
$this
.
on
(
'
itemAdded
'
,
function
(
event
)
{
var
tag
=
event
.
item
;
if
(
event
.
options
&&
event
.
options
.
addNew
)
{
$
(
"
.bootstrap-tagsinput input
"
).
val
(
''
);
$
(
'
<li data-value="
'
+
tag
.
id
+
'
">
'
+
tag
.
name
+
'
</li>
'
).
bind
(
'
click
'
,
add
).
appendTo
(
$
(
$bindBox
));
}
});
})
},
500
);
}
...
...
blog-admin/src/main/resources/static/assets/js/zhyd.publish-article.js
浏览文件 @
2f210ff2
...
...
@@ -68,7 +68,7 @@ $(".publishBtn").click(function () {
return
;
}
if
(
!
$
(
"
#description
"
).
val
()
||
!
$
(
"
#keywords
"
).
val
())
{
$
.
alert
.
error
(
"
请填写
下
SEO相关的内容,填写后更容易被收录哦
"
);
$
.
alert
.
error
(
"
请填写SEO相关的内容,填写后更容易被收录哦
"
);
return
;
}
var
isMarkdown
=
$
(
"
input[name=isMarkdown]
"
).
val
();
...
...
blog-admin/src/main/resources/templates/article/list.ftl
浏览文件 @
2f210ff2
...
...
@@ -83,7 +83,7 @@
var title = code;
title = title.length > 20 ? (title.substr(0, 20) + '...') : title;
var id = row.id;
var status = row.status ? '<span class="label label-success" style="margin-right: 5px;">已发布</span>' : '<span class="label label-danger">草稿</span>';
var status = row.status ? '<span class="label label-success" style="margin-right: 5px;">已发布</span>' : '<span class="label label-danger"
style="margin-right: 5px;"
>草稿</span>';
return status + '<a href="' + appConfig.wwwPath + '/article/' + id + '" target="_blank" title="' + code + '">' + title + '</a>';
}
}, {
...
...
blog-admin/src/main/resources/templates/article/publish-md.ftl
浏览文件 @
2f210ff2
...
...
@@ -62,137 +62,10 @@
</div>
</div>
</div>
<div class="modal fade" id="publishModal" tabindex="-1" role="dialog" aria-labelledby="publishLabel" data-backdrop="static">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="" role="tabpanel" data-example-id="togglable-tabs">
<ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
<li role="presentation" class="active">
<a href="#article" id="article-tab" role="tab" data-toggle="tab" aria-expanded="true">文章属性</a>
</li>
<li role="presentation" class="">
<a href="#seo" role="tab" id="seo-tab" data-toggle="tab" aria-expanded="false">SEO</a>
</li>
</ul>
<div id="" class="tab-content">
<div role="tabpanel" class="tab-pane fade active in" id="article" aria-labelledby="article-tab">
<div class="row">
<div class="col col-md-3">
<div class="item form-group">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="choose-local-img" style="text-align: center;">
<input id="cover-img-file" type="file" name="file" style="display: none">
<input id="cover-img-input" type="hidden" name="coverImage">
<div class="preview fa-2x" style="width: 100%;height: 186.98px;background: #f8fafc;border-radius: 5px;text-align: center;">
<img class="coverImage" src="" alt="">
</div>
<button type="button" class="btn btn-round btn-info" id="file-upload-btn" style="margin-top: 10px;">上传图片</button>
</div>
</div>
</div>
</div>
<div class="col col-md-9">
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="nickname">分类 <span class="required">*</span></label>
<div class="col-md-8 col-sm-8 col-xs-12">
<div class="input-group">
<select class="form-control" name="typeId" id="typeId" target="combox" data-url="/type/listAll" data-method="post" required="required"></select>
</div>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="mobile">标签(*3) <span class="required">*</span></label>
<div class="col-md-9 col-sm-9 col-xs-12">
<input type="text" name="tags" target="tagsinput" data-bind-box="#tags-list">
<ul class="list-unstyled list-inline tags-list" id="tags-list" target="combox" data-url="/tag/listAll" data-method="post" style="max-height: 150px;overflow-y: scroll;"></ul>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="mobile">状态 <span class="required">*</span></label>
<div class="col-md-10 col-sm-10 col-xs-12 fixed-radio-checkbox">
<ul class="list-unstyled list-inline">
<li><input type="radio" class="square" checked name="status" value="1"> 发布</li>
<li><input type="radio" class="square" name="status" value="0"> 草稿</li>
</ul>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="comment">开启评论 </label>
<div class="col-md-10 col-sm-10 col-xs-12 fixed-radio-checkbox">
<input type="checkbox" class="square" name="comment" id="comment">
</div>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="seo" aria-labelledby="seo-tab">
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="password">摘要 <span class="required">*</span></label>
<div class="col-md-8 col-sm-8 col-xs-12">
<textarea class="form-control col-md-7 col-xs-12" id="description" name="description" required="required"></textarea>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="password">关键词 <span class="required">*</span></label>
<div class="col-md-8 col-sm-8 col-xs-12">
<textarea class="form-control col-md-7 col-xs-12" id="keywords" name="keywords" required="required"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"> 返回修改</i></button>
<button type="button" class="btn btn-success publishBtn"><i class="fa fa-hand-o-up"> 确定发布</i></button>
</div>
</div>
</div>
</div>
<@publishmodal></@publishmodal>
</form>
</div>
<!--上传图片弹框-->
<div class="modal fade" id="chooseImg" tabindex="-1" role="dialog" aria-labelledby="addroleLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="addroleLabel">选择图片</h4>
</div>
<div class="modal-body">
<div class="" role="tabpanel" data-example-id="togglable-tabs">
<ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
<li role="presentation" class="active">
<a href="#tab_content1" id="home-tab" role="tab" data-toggle="tab" aria-expanded="true">素材库</a>
</li>
<li role="presentation" class="">
<a href="#tab_content2" role="tab" id="profile-tab" data-toggle="tab" aria-expanded="false">本地图片</a>
</li>
</ul>
<div id="myTabContent" class="tab-content">
<div role="tabpanel" class="tab-pane fade active in material-box" id="tab_content1" aria-labelledby="home-tab">
<ul class="list-unstyled list-material">
</ul>
</div>
<div role="tabpanel" class="tab-pane fade" id="tab_content2" aria-labelledby="profile-tab">
<button type="button" class="btn btn-success" id="file-btn">选择图片</button>
<div class="preview" class="fa-2x">
<img class="coverImage" src="" alt="">
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"> 关闭</i></button>
<button type="button" class="btn btn-success" data-dismiss="modal"><i class="fa fa-hand-o-up"> 确定</i></button>
</div>
</div>
</div>
</div>
<!--上传图片弹框-->
<@chooseImgModal></@chooseImgModal>
<@footer>
<script type="text/javascript" src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
...
...
blog-admin/src/main/resources/templates/article/publish.ftl
浏览文件 @
2f210ff2
...
...
@@ -49,134 +49,10 @@
</div>
</div>
</div>
<div class="modal fade" id="publishModal" tabindex="-1" role="dialog" aria-labelledby="publishLabel" data-backdrop="static">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="" role="tabpanel" data-example-id="togglable-tabs">
<ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
<li role="presentation" class="active">
<a href="#article" id="article-tab" role="tab" data-toggle="tab" aria-expanded="true">文章属性</a>
</li>
<li role="presentation" class="">
<a href="#seo" role="tab" id="seo-tab" data-toggle="tab" aria-expanded="false">SEO</a>
</li>
</ul>
<div id="" class="tab-content">
<div role="tabpanel" class="tab-pane fade active in" id="article" aria-labelledby="article-tab">
<div class="row">
<div class="col col-md-3">
<div class="item form-group">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="choose-local-img" style="text-align: center;">
<input id="cover-img-file" type="file" name="file" style="display: none">
<input id="cover-img-input" type="hidden" name="coverImage">
<div class="preview fa-2x" style="width: 100%;height: 186.98px;background: #f8fafc;border-radius: 5px;text-align: center;">
<img class="coverImage" src="" alt="">
</div>
<button type="button" class="btn btn-round btn-info" id="file-upload-btn" style="margin-top: 10px;">上传图片</button>
</div>
</div>
</div>
</div>
<div class="col col-md-9">
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="nickname">分类 <span class="required">*</span></label>
<div class="col-md-8 col-sm-8 col-xs-12">
<div class="input-group">
<select class="form-control" name="typeId" id="typeId" target="combox" data-url="/type/listAll" data-method="post" required="required"></select>
</div>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="mobile">标签(*3) <span class="required">*</span></label>
<div class="col-md-9 col-sm-9 col-xs-12">
<input type="text" name="tags" target="tagsinput" data-bind-box="#tags-list">
<ul class="list-unstyled list-inline tags-list" id="tags-list" target="combox" data-url="/tag/listAll" data-method="post" style="max-height: 150px;overflow-y: scroll;"></ul>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="mobile">状态 <span class="required">*</span></label>
<div class="col-md-10 col-sm-10 col-xs-12 fixed-radio-checkbox">
<ul class="list-unstyled list-inline">
<li><input type="radio" class="square" checked name="status" value="1"> 发布</li>
<li><input type="radio" class="square" name="status" value="0"> 草稿</li>
</ul>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="comment">开启评论 </label>
<div class="col-md-10 col-sm-10 col-xs-12 fixed-radio-checkbox">
<input type="checkbox" class="square" name="comment" id="comment">
</div>
</div>
</div>
</div>
</div>
<div role="tabpanel" class="tab-pane fade" id="seo" aria-labelledby="seo-tab">
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="password">摘要 <span class="required">*</span></label>
<div class="col-md-8 col-sm-8 col-xs-12">
<textarea class="form-control col-md-7 col-xs-12" id="description" name="description" required="required"></textarea>
</div>
</div>
<div class="item form-group">
<label class="control-label col-md-2 col-sm-2 col-xs-12" for="password">关键词 <span class="required">*</span></label>
<div class="col-md-8 col-sm-8 col-xs-12">
<textarea class="form-control col-md-7 col-xs-12" id="keywords" name="keywords" required="required"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"> 返回修改</i></button>
<button type="button" class="btn btn-success publishBtn"><i class="fa fa-hand-o-up"> 确定发布</i></button>
</div>
</div>
</div>
</div>
<@publishmodal></@publishmodal>
</form>
<div class="modal fade" id="chooseImg" tabindex="-1" role="dialog" aria-labelledby="addroleLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="addroleLabel">选择图片</h4>
</div>
<div class="modal-body">
<div class="" role="tabpanel" data-example-id="togglable-tabs">
<ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
<li role="presentation" class="active">
<a href="#tab_content1" id="home-tab" role="tab" data-toggle="tab" aria-expanded="true">素材库</a>
</li>
<li role="presentation" class="">
<a href="#tab_content2" role="tab" id="profile-tab" data-toggle="tab" aria-expanded="false">本地图片</a>
</li>
</ul>
<div id="myTabContent" class="tab-content">
<div role="tabpanel" class="tab-pane fade active in material-box" id="tab_content1" aria-labelledby="home-tab">
<ul class="list-unstyled list-material">
</ul>
</div>
<div role="tabpanel" class="tab-pane fade" id="tab_content2" aria-labelledby="profile-tab">
<button type="button" class="btn btn-success" id="file-btn">选择图片</button>
<div class="preview" class="fa-2x">
<img class="coverImage" src="" alt="">
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-close"> 关闭</i></button>
<button type="button" class="btn btn-success" data-dismiss="modal"><i class="fa fa-hand-o-up"> 确定</i></button>
</div>
</div>
</div>
</div>
<@chooseImgModal></@chooseImgModal>
<@footer>
<script>
articleId = '${id}';
...
...
blog-admin/src/main/resources/templates/include/macros.ftl
浏览文件 @
2f210ff2
...
...
@@ -90,4 +90,137 @@
<
#nested
>
</div>
</div>
</
#
macro>
<
#macro
publishmodal
>
<div
class=
"modal fade"
id=
"publishModal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"publishLabel"
data-backdrop=
"static"
>
<div
class=
"modal-dialog modal-lg"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-body"
>
<div
class=
""
role=
"tabpanel"
data-example-id=
"togglable-tabs"
>
<ul
id=
"myTab"
class=
"nav nav-tabs bar_tabs"
role=
"tablist"
>
<li
role=
"presentation"
class=
"active"
>
<a
href=
"#article"
id=
"article-tab"
role=
"tab"
data-toggle=
"tab"
aria-expanded=
"true"
>
文章属性
</a>
</li>
<li
role=
"presentation"
class=
""
>
<a
href=
"#seo"
role=
"tab"
id=
"seo-tab"
data-toggle=
"tab"
aria-expanded=
"false"
>
SEO
</a>
</li>
</ul>
<div
id=
""
class=
"tab-content"
>
<div
role=
"tabpanel"
class=
"tab-pane fade active in"
id=
"article"
aria-labelledby=
"article-tab"
>
<div
class=
"row"
>
<div
class=
"col col-md-3"
>
<div
class=
"item form-group"
>
<div
class=
"col-md-12 col-sm-12 col-xs-12"
>
<div
class=
"choose-local-img"
style=
"text-align: center;"
>
<input
id=
"cover-img-file"
type=
"file"
name=
"file"
style=
"display: none"
>
<input
id=
"cover-img-input"
type=
"hidden"
name=
"coverImage"
>
<div
class=
"preview fa-2x"
style=
"width: 100%;height: 186.98px;background: #f8fafc;border-radius: 5px;text-align: center;"
>
<img
class=
"coverImage"
src=
""
alt=
""
>
</div>
<button
type=
"button"
class=
"btn btn-round btn-info"
id=
"file-upload-btn"
style=
"margin-top: 10px;"
>
上传封面图片
</button>
</div>
</div>
</div>
</div>
<div
class=
"col col-md-9"
>
<div
class=
"item form-group"
>
<label
class=
"control-label col-md-2 col-sm-2 col-xs-12"
for=
"nickname"
>
分类
<span
class=
"required"
>
*
</span></label>
<div
class=
"col-md-8 col-sm-8 col-xs-12"
>
<div
class=
"input-group"
>
<select
class=
"form-control"
name=
"typeId"
id=
"typeId"
target=
"combox"
data-url=
"/type/listAll"
data-method=
"post"
required=
"required"
></select>
</div>
</div>
</div>
<div
class=
"item form-group"
>
<label
class=
"control-label col-md-2 col-sm-2 col-xs-12"
for=
"mobile"
>
标签(*3)
<span
class=
"required"
>
*
</span></label>
<div
class=
"col-md-9 col-sm-9 col-xs-12"
>
<input
type=
"text"
name=
"tags"
target=
"tagsinput"
data-bind-box=
"#tags-list"
>
<ul
class=
"list-unstyled list-inline tags-list"
id=
"tags-list"
target=
"combox"
data-url=
"/tag/listAll"
data-method=
"post"
style=
"max-height: 150px;overflow-y: scroll;"
></ul>
</div>
</div>
<div
class=
"item form-group"
>
<label
class=
"control-label col-md-2 col-sm-2 col-xs-12"
for=
"mobile"
>
状态
<span
class=
"required"
>
*
</span></label>
<div
class=
"col-md-10 col-sm-10 col-xs-12 fixed-radio-checkbox"
>
<ul
class=
"list-unstyled list-inline"
>
<li><input
type=
"radio"
class=
"square"
checked
name=
"status"
value=
"1"
>
发布
</li>
<li><input
type=
"radio"
class=
"square"
name=
"status"
value=
"0"
>
草稿
</li>
</ul>
</div>
</div>
<div
class=
"item form-group"
>
<label
class=
"control-label col-md-2 col-sm-2 col-xs-12"
for=
"comment"
>
开启评论
</label>
<div
class=
"col-md-10 col-sm-10 col-xs-12 fixed-radio-checkbox"
>
<input
type=
"checkbox"
class=
"square"
name=
"comment"
id=
"comment"
>
</div>
</div>
</div>
</div>
</div>
<div
role=
"tabpanel"
class=
"tab-pane fade"
id=
"seo"
aria-labelledby=
"seo-tab"
>
<div
class=
"item form-group"
>
<label
class=
"control-label col-md-2 col-sm-2 col-xs-12"
for=
"password"
>
摘要
<span
class=
"required"
>
*
</span></label>
<div
class=
"col-md-8 col-sm-8 col-xs-12"
>
<textarea
class=
"form-control col-md-7 col-xs-12"
id=
"description"
name=
"description"
required=
"required"
></textarea>
</div>
</div>
<div
class=
"item form-group"
>
<label
class=
"control-label col-md-2 col-sm-2 col-xs-12"
for=
"password"
>
关键词
<span
class=
"required"
>
*
</span></label>
<div
class=
"col-md-8 col-sm-8 col-xs-12"
>
<textarea
class=
"form-control col-md-7 col-xs-12"
id=
"keywords"
name=
"keywords"
required=
"required"
></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
><i
class=
"fa fa-angle-left"
>
返回修改
</i></button>
<button
type=
"button"
class=
"btn btn-success publishBtn"
><i
class=
"fa fa-paper-plane-o"
>
确定发布
</i></button>
</div>
</div>
</div>
</div>
</
#
macro>
<
#macro
chooseImgModal
>
<div
class=
"modal fade"
id=
"chooseImg"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"addroleLabel"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
><span
aria-hidden=
"true"
>
×
</span></button>
<h4
class=
"modal-title"
id=
"addroleLabel"
>
选择图片
</h4>
</div>
<div
class=
"modal-body"
>
<div
class=
""
role=
"tabpanel"
data-example-id=
"togglable-tabs"
>
<ul
id=
"myTab"
class=
"nav nav-tabs bar_tabs"
role=
"tablist"
>
<li
role=
"presentation"
class=
"active"
>
<a
href=
"#tab_content1"
id=
"home-tab"
role=
"tab"
data-toggle=
"tab"
aria-expanded=
"true"
>
素材库
</a>
</li>
<li
role=
"presentation"
class=
""
>
<a
href=
"#tab_content2"
role=
"tab"
id=
"profile-tab"
data-toggle=
"tab"
aria-expanded=
"false"
>
本地图片
</a>
</li>
</ul>
<div
id=
"myTabContent"
class=
"tab-content"
>
<div
role=
"tabpanel"
class=
"tab-pane fade active in material-box"
id=
"tab_content1"
aria-labelledby=
"home-tab"
>
<ul
class=
"list-unstyled list-material"
>
</ul>
</div>
<div
role=
"tabpanel"
class=
"tab-pane fade"
id=
"tab_content2"
aria-labelledby=
"profile-tab"
>
<button
type=
"button"
class=
"btn btn-round btn-info"
id=
"file-btn"
>
选择图片
</button>
<div
class=
"preview"
class=
"fa-2x"
>
<img
class=
"coverImage"
src=
""
alt=
""
>
</div>
</div>
</div>
</div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
><i
class=
"fa fa-close"
>
关闭
</i></button>
<button
type=
"button"
class=
"btn btn-success"
data-dismiss=
"modal"
><i
class=
"fa fa-hand-o-up"
>
确定
</i></button>
</div>
</div>
</div>
</div>
</
#
macro>
\ No newline at end of file
blog-core/src/main/java/com/zyd/blog/business/service/BizTagsService.java
浏览文件 @
2f210ff2
...
...
@@ -18,4 +18,6 @@ import com.zyd.blog.framework.object.AbstractService;
public
interface
BizTagsService
extends
AbstractService
<
Tags
,
Long
>
{
PageInfo
<
Tags
>
findPageBreakByCondition
(
TagsConditionVO
vo
);
Tags
getByName
(
String
name
);
}
blog-core/src/main/java/com/zyd/blog/business/service/impl/BizTagsServiceImpl.java
浏览文件 @
2f210ff2
...
...
@@ -6,6 +6,7 @@ import com.zyd.blog.business.annotation.RedisCache;
import
com.zyd.blog.business.entity.Tags
;
import
com.zyd.blog.business.service.BizTagsService
;
import
com.zyd.blog.business.vo.TagsConditionVO
;
import
com.zyd.blog.framework.exception.ZhydException
;
import
com.zyd.blog.persistence.beans.BizTags
;
import
com.zyd.blog.persistence.mapper.BizTagsMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -37,23 +39,32 @@ public class BizTagsServiceImpl implements BizTagsService {
public
PageInfo
<
Tags
>
findPageBreakByCondition
(
TagsConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
(),
vo
.
getPageSize
());
List
<
BizTags
>
list
=
bizTagsMapper
.
findPageBreakByCondition
(
vo
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
null
;
}
List
<
Tags
>
boList
=
new
ArrayList
<>();
for
(
BizTags
bizTags
:
list
)
{
boList
.
add
(
new
Tags
(
bizTags
));
}
List
<
Tags
>
boList
=
getTags
(
list
);
if
(
boList
==
null
)
return
null
;
PageInfo
bean
=
new
PageInfo
<
BizTags
>(
list
);
bean
.
setList
(
boList
);
return
bean
;
}
@Override
public
Tags
getByName
(
String
name
)
{
if
(
StringUtils
.
isEmpty
(
name
))
{
return
null
;
}
BizTags
tags
=
new
BizTags
();
tags
.
setName
(
name
);
tags
=
bizTagsMapper
.
selectOne
(
tags
);
return
null
==
tags
?
null
:
new
Tags
(
tags
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@RedisCache
(
flush
=
true
)
public
Tags
insert
(
Tags
entity
)
{
Assert
.
notNull
(
entity
,
"Tags不可为空!"
);
if
(
this
.
getByName
(
entity
.
getName
())
!=
null
)
{
throw
new
ZhydException
(
"标签添加失败,标签已存在!["
+
entity
.
getName
()
+
"]"
);
}
entity
.
setUpdateTime
(
new
Date
());
entity
.
setCreateTime
(
new
Date
());
bizTagsMapper
.
insertSelective
(
entity
.
getBizTags
());
...
...
@@ -73,6 +84,10 @@ public class BizTagsServiceImpl implements BizTagsService {
@RedisCache
(
flush
=
true
)
public
boolean
updateSelective
(
Tags
entity
)
{
Assert
.
notNull
(
entity
,
"Tags不可为空!"
);
Tags
old
=
this
.
getByName
(
entity
.
getName
());
if
(
old
!=
null
&&
!
old
.
getId
().
equals
(
entity
.
getId
()))
{
throw
new
ZhydException
(
"标签修改失败,标签已存在!["
+
entity
.
getName
()
+
"]"
);
}
entity
.
setUpdateTime
(
new
Date
());
return
bizTagsMapper
.
updateByPrimaryKeySelective
(
entity
.
getBizTags
())
>
0
;
}
...
...
@@ -89,6 +104,10 @@ public class BizTagsServiceImpl implements BizTagsService {
public
List
<
Tags
>
listAll
()
{
List
<
BizTags
>
entityList
=
bizTagsMapper
.
selectAll
();
return
getTags
(
entityList
);
}
private
List
<
Tags
>
getTags
(
List
<
BizTags
>
entityList
)
{
if
(
CollectionUtils
.
isEmpty
(
entityList
))
{
return
null
;
}
...
...
update.md
浏览文件 @
2f210ff2
...
...
@@ -8,6 +8,7 @@
-
Fixed issue :
[
IN4T1
](
https://gitee.com/yadong.zhang/DBlog/issues/IN4T1
)
-
Fixed issue :
[
IN807
](
https://gitee.com/yadong.zhang/DBlog/issues/IN807
)
-
Fixed issue :
[
IO4P6
](
https://gitee.com/yadong.zhang/DBlog/issues/IO4P6
)
-
Fixed issue :
[
IO5HQ
](
https://gitee.com/yadong.zhang/DBlog/issues/IO5HQ
)
-
Fixed issue :
[
IOWDY
](
https://gitee.com/yadong.zhang/DBlog/issues/IOWDY
)
-
Fixed issue :
[
IP2I1
](
https://gitee.com/yadong.zhang/DBlog/issues/IP2I1
)
-
新增:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录