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
63f0f9cf
Commit
63f0f9cf
authored
Apr 28, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增字典 解决id获取不到的bug
parent
823064e9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
11 deletions
+11
-11
pom.xml
+1
-1
src/main/java/com/stylefeng/guns/modular/system/controller/DictController.java
+9
-10
src/main/java/com/stylefeng/guns/modular/system/service/IDictService.java
+1
-0
No files found.
pom.xml
View file @
63f0f9cf
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
<dependency>
<dependency>
<groupId>
com.baomidou
</groupId>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus
</artifactId>
<artifactId>
mybatis-plus
</artifactId>
<version>
2.0.
5
</version>
<version>
2.0.
7
</version>
</dependency>
</dependency>
<!--END-->
<!--END-->
...
...
src/main/java/com/stylefeng/guns/modular/system/controller/DictController.java
View file @
63f0f9cf
...
@@ -6,9 +6,9 @@ import com.stylefeng.guns.common.annotion.log.BussinessLog;
...
@@ -6,9 +6,9 @@ import com.stylefeng.guns.common.annotion.log.BussinessLog;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.common.exception.BussinessException
;
import
com.stylefeng.guns.common.exception.BussinessException
;
import
com.stylefeng.guns.core.support.StrKit
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.core.util.ToolUtil
;
import
com.stylefeng.guns.modular.system.dao.DictDao
;
import
com.stylefeng.guns.modular.system.dao.DictDao
;
import
com.stylefeng.guns.modular.system.service.IDictService
;
import
com.stylefeng.guns.modular.system.warpper.DictWarpper
;
import
com.stylefeng.guns.modular.system.warpper.DictWarpper
;
import
com.stylefeng.guns.persistence.dao.DictMapper
;
import
com.stylefeng.guns.persistence.dao.DictMapper
;
import
com.stylefeng.guns.persistence.model.Dict
;
import
com.stylefeng.guns.persistence.model.Dict
;
...
@@ -19,7 +19,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -19,7 +19,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -41,6 +40,9 @@ public class DictController extends BaseController {
...
@@ -41,6 +40,9 @@ public class DictController extends BaseController {
@Resource
@Resource
DictMapper
dictMapper
;
DictMapper
dictMapper
;
@Resource
IDictService
dictService
;
/**
/**
* 跳转到字典管理首页
* 跳转到字典管理首页
*/
*/
...
@@ -71,17 +73,18 @@ public class DictController extends BaseController {
...
@@ -71,17 +73,18 @@ public class DictController extends BaseController {
/**
/**
* 新增字典
* 新增字典
* @param dictValues 格式例如 1:启用;2:禁用;3:冻结
*
* @param dictValues 格式例如 "1:启用;2:禁用;3:冻结"
*/
*/
@BussinessLog
(
value
=
"添加字典记录"
,
key
=
"dictName"
)
@BussinessLog
(
value
=
"添加字典记录"
,
key
=
"dictName"
)
@RequestMapping
(
value
=
"/add"
)
@RequestMapping
(
value
=
"/add"
)
@ResponseBody
@ResponseBody
public
Object
add
(
String
dictName
,
String
dictValues
)
{
public
Object
add
(
String
dictName
,
String
dictValues
)
{
if
(
ToolUtil
.
isOneEmpty
(
dictName
,
dictValues
))
{
if
(
ToolUtil
.
isOneEmpty
(
dictName
,
dictValues
))
{
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
}
}
this
.
dictService
.
addDict
(
dictName
,
dictValues
);
return
SUCCESS_TIP
;
return
SUCCESS_TIP
;
}
}
...
@@ -138,8 +141,4 @@ public class DictController extends BaseController {
...
@@ -138,8 +141,4 @@ public class DictController extends BaseController {
return
SUCCESS_TIP
;
return
SUCCESS_TIP
;
}
}
public
static
void
main
(
String
[]
args
){
String
[]
split
=
StrKit
.
split
(
"1:启用;2:禁用;3:冻结;"
,
";"
);
System
.
out
.
println
(
Arrays
.
toString
(
split
));
}
}
}
src/main/java/com/stylefeng/guns/modular/system/service/IDictService.java
View file @
63f0f9cf
...
@@ -15,4 +15,5 @@ public interface IDictService {
...
@@ -15,4 +15,5 @@ public interface IDictService {
* @Date 2017/4/27 17:01
* @Date 2017/4/27 17:01
*/
*/
void
addDict
(
String
dictName
,
String
dictValues
);
void
addDict
(
String
dictName
,
String
dictValues
);
}
}
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