Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
48054424
Commit
48054424
authored
May 09, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改通知的业务编写
parent
aaa6c3d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
7 deletions
+23
-7
src/main/java/com/stylefeng/guns/modular/system/controller/NoticeController.java
+10
-2
src/main/webapp/WEB-INF/view/system/notice/notice_edit.html
+13
-5
No files found.
src/main/java/com/stylefeng/guns/modular/system/controller/NoticeController.java
View file @
48054424
...
@@ -59,6 +59,8 @@ public class NoticeController extends BaseController {
...
@@ -59,6 +59,8 @@ public class NoticeController extends BaseController {
*/
*/
@RequestMapping
(
"/notice_update/{noticeId}"
)
@RequestMapping
(
"/notice_update/{noticeId}"
)
public
String
noticeUpdate
(
@PathVariable
Integer
noticeId
,
Model
model
)
{
public
String
noticeUpdate
(
@PathVariable
Integer
noticeId
,
Model
model
)
{
Notice
notice
=
this
.
noticeMapper
.
selectById
(
noticeId
);
model
.
addAttribute
(
"notice"
,
notice
);
return
PREFIX
+
"notice_edit.html"
;
return
PREFIX
+
"notice_edit.html"
;
}
}
...
@@ -78,7 +80,7 @@ public class NoticeController extends BaseController {
...
@@ -78,7 +80,7 @@ public class NoticeController extends BaseController {
@RequestMapping
(
value
=
"/add"
)
@RequestMapping
(
value
=
"/add"
)
@ResponseBody
@ResponseBody
public
Object
add
(
Notice
notice
)
{
public
Object
add
(
Notice
notice
)
{
if
(
ToolUtil
.
isOneEmpty
(
notice
,
notice
.
getTitle
(),
notice
.
getContent
()))
{
if
(
ToolUtil
.
isOneEmpty
(
notice
,
notice
.
getTitle
(),
notice
.
getContent
()))
{
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
}
}
notice
.
setCreater
(
ShiroKit
.
getUser
().
getId
());
notice
.
setCreater
(
ShiroKit
.
getUser
().
getId
());
...
@@ -97,13 +99,19 @@ public class NoticeController extends BaseController {
...
@@ -97,13 +99,19 @@ public class NoticeController extends BaseController {
return
SUCCESS_TIP
;
return
SUCCESS_TIP
;
}
}
/**
/**
* 修改通知
* 修改通知
*/
*/
@RequestMapping
(
value
=
"/update"
)
@RequestMapping
(
value
=
"/update"
)
@ResponseBody
@ResponseBody
public
Object
update
(
Notice
notice
)
{
public
Object
update
(
Notice
notice
)
{
if
(
ToolUtil
.
isOneEmpty
(
notice
,
notice
.
getId
(),
notice
.
getTitle
(),
notice
.
getContent
()))
{
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
}
Notice
old
=
this
.
noticeMapper
.
selectById
(
notice
.
getId
());
old
.
setTitle
(
notice
.
getTitle
());
old
.
setContent
(
notice
.
getContent
());
old
.
updateById
();
return
super
.
SUCCESS_TIP
;
return
super
.
SUCCESS_TIP
;
}
}
...
...
src/main/webapp/WEB-INF/view/system/notice/notice_edit.html
View file @
48054424
...
@@ -6,12 +6,20 @@
...
@@ -6,12 +6,20 @@
<input
type=
"hidden"
id=
"id"
value=
"${notice.id}"
>
<input
type=
"hidden"
id=
"id"
value=
"${notice.id}"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-
6 b-r
"
>
<div
class=
"col-sm-
12
"
>
<div
class=
"form-group"
>
</div
>
<label
class=
"col-sm-1 control-label"
>
标题
</label
>
<div
class=
"col-sm-11"
>
<div
class=
"col-sm-6
"
>
<input
class=
"form-control"
id=
"title"
type=
"text"
value=
"${notice.title}
"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-1 control-label"
>
内容
</label>
<div
class=
"col-sm-11"
>
<textarea
class=
"form-control"
id=
"content"
type=
"text"
>
${notice.content}
</textarea>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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