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
1ee3b471
Commit
1ee3b471
authored
May 16, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增通知管理的日志
parent
49f6587c
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
2 deletions
+60
-2
src/main/java/com/stylefeng/guns/common/constant/Dict.java
+5
-0
src/main/java/com/stylefeng/guns/common/constant/dictmap/DeleteDict.java
+2
-0
src/main/java/com/stylefeng/guns/common/constant/dictmap/NoticeMap.java
+22
-0
src/main/java/com/stylefeng/guns/common/constant/factory/ConstantFactory.java
+17
-0
src/main/java/com/stylefeng/guns/modular/system/controller/NoticeController.java
+14
-2
No files found.
src/main/java/com/stylefeng/guns/common/constant/Dict.java
View file @
1ee3b471
...
...
@@ -38,4 +38,9 @@ public interface Dict {
*/
String
DictMap
=
"DictMap"
;
/**
* 通知管理业务的字典
*/
String
NoticeMap
=
"NoticeMap"
;
}
src/main/java/com/stylefeng/guns/common/constant/dictmap/DeleteDict.java
View file @
1ee3b471
...
...
@@ -16,6 +16,7 @@ public class DeleteDict extends AbstractDictMap {
put
(
"deptId"
,
"部门名称"
);
put
(
"menuId"
,
"菜单名称"
);
put
(
"dictId"
,
"字典名称"
);
put
(
"noticeId"
,
"通知名称"
);
}
@Override
...
...
@@ -24,6 +25,7 @@ public class DeleteDict extends AbstractDictMap {
putFieldWrapperMethodName
(
"deptId"
,
"getCacheObject"
);
putFieldWrapperMethodName
(
"menuId"
,
"getCacheObject"
);
putFieldWrapperMethodName
(
"dictId"
,
"getCacheObject"
);
putFieldWrapperMethodName
(
"noticeId"
,
"getCacheObject"
);
}
}
src/main/java/com/stylefeng/guns/common/constant/dictmap/NoticeMap.java
0 → 100644
View file @
1ee3b471
package
com
.
stylefeng
.
guns
.
common
.
constant
.
dictmap
;
import
com.stylefeng.guns.common.constant.dictmap.base.AbstractDictMap
;
/**
* 通知的映射
*
* @author fengshuonan
* @date 2017-05-06 15:01
*/
public
class
NoticeMap
extends
AbstractDictMap
{
@Override
public
void
init
()
{
put
(
"title"
,
"标题"
);
put
(
"content"
,
"内容"
);
}
@Override
protected
void
initBeWrapped
()
{
}
}
src/main/java/com/stylefeng/guns/common/constant/factory/ConstantFactory.java
View file @
1ee3b471
...
...
@@ -34,6 +34,7 @@ public class ConstantFactory {
private
DictMapper
dictMapper
=
SpringContextHolder
.
getBean
(
DictMapper
.
class
);
private
UserMapper
userMapper
=
SpringContextHolder
.
getBean
(
UserMapper
.
class
);
private
MenuMapper
menuMapper
=
SpringContextHolder
.
getBean
(
MenuMapper
.
class
);
private
NoticeMapper
noticeMapper
=
SpringContextHolder
.
getBean
(
NoticeMapper
.
class
);
public
static
ConstantFactory
me
()
{
return
SpringContextHolder
.
getBean
(
"constantFactory"
);
...
...
@@ -175,6 +176,22 @@ public class ConstantFactory {
}
/**
* 获取通知标题
*/
public
String
getNoticeTitle
(
Integer
dictId
){
if
(
ToolUtil
.
isEmpty
(
dictId
))
{
return
""
;
}
else
{
Notice
notice
=
noticeMapper
.
selectById
(
dictId
);
if
(
notice
==
null
)
{
return
""
;
}
else
{
return
notice
.
getTitle
();
}
}
}
/**
* 获取性别名称
*/
public
String
getSexName
(
Integer
sex
)
{
...
...
src/main/java/com/stylefeng/guns/modular/system/controller/NoticeController.java
View file @
1ee3b471
package
com
.
stylefeng
.
guns
.
modular
.
system
.
controller
;
import
com.stylefeng.guns.common.annotion.log.BussinessLog
;
import
com.stylefeng.guns.common.constant.Dict
;
import
com.stylefeng.guns.common.constant.factory.ConstantFactory
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.common.exception.BussinessException
;
import
com.stylefeng.guns.core.log.LogObjectHolder
;
import
com.stylefeng.guns.core.shiro.ShiroKit
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.modular.system.dao.NoticeDao
;
...
...
@@ -10,11 +14,11 @@ import com.stylefeng.guns.modular.system.warpper.NoticeWrapper;
import
com.stylefeng.guns.persistence.dao.NoticeMapper
;
import
com.stylefeng.guns.persistence.model.Notice
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
javax.annotation.Resource
;
import
java.util.Date
;
...
...
@@ -90,6 +94,7 @@ public class NoticeController extends BaseController {
*/
@RequestMapping
(
value
=
"/add"
)
@ResponseBody
@BussinessLog
(
value
=
"新增通知"
,
key
=
"title"
,
dict
=
Dict
.
NoticeMap
)
public
Object
add
(
Notice
notice
)
{
if
(
ToolUtil
.
isOneEmpty
(
notice
,
notice
.
getTitle
(),
notice
.
getContent
()))
{
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
...
...
@@ -105,8 +110,14 @@ public class NoticeController extends BaseController {
*/
@RequestMapping
(
value
=
"/delete"
)
@ResponseBody
@BussinessLog
(
value
=
"删除通知"
,
key
=
"noticeId"
,
dict
=
Dict
.
DeleteDict
)
public
Object
delete
(
@RequestParam
Integer
noticeId
)
{
//缓存通知名称
LogObjectHolder
.
me
().
set
(
ConstantFactory
.
me
().
getNoticeTitle
(
noticeId
));
this
.
noticeMapper
.
deleteById
(
noticeId
);
return
SUCCESS_TIP
;
}
...
...
@@ -115,6 +126,7 @@ public class NoticeController extends BaseController {
*/
@RequestMapping
(
value
=
"/update"
)
@ResponseBody
@BussinessLog
(
value
=
"修改通知"
,
key
=
"title"
,
dict
=
Dict
.
NoticeMap
)
public
Object
update
(
Notice
notice
)
{
if
(
ToolUtil
.
isOneEmpty
(
notice
,
notice
.
getId
(),
notice
.
getTitle
(),
notice
.
getContent
()))
{
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
...
...
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