Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xylt
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
xylt
Commits
79f19625
提交
79f19625
authored
1月 28, 2019
作者:
liupengfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
b0b5fa69
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
87 行增加
和
0 行删除
+87
-0
DictionaryController.java
...ysuser/bg/controller/dictionary/DictionaryController.java
+87
-0
没有找到文件。
com.zrqx.sysuser/src/main/java/com/zrqx/sysuser/bg/controller/dictionary/DictionaryController.java
0 → 100644
浏览文件 @
79f19625
package
com
.
zrqx
.
sysuser
.
bg
.
controller
.
dictionary
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.zrqx.core.constant.sysuser.SysUserRequestPath
;
import
com.zrqx.core.enums.sysuser.dictionary.DictonaryCodeEnum
;
import
com.zrqx.core.form.sysuser.bg.dictionary.DictionaryPageForm
;
import
com.zrqx.core.model.sysuser.dictionary.Dictionary
;
import
com.zrqx.core.util.page.PageInfo
;
import
com.zrqx.core.util.page.PageParam
;
import
com.zrqx.core.util.response.CallBack
;
import
com.zrqx.sysuser.bg.service.dictionary.DictionaryService
;
/**
* 数据字典 Controller
*/
@RestController
@RequestMapping
(
SysUserRequestPath
.
BG
+
SysUserRequestPath
.
DICTIONARY
)
@Api
(
description
=
"系统管理-数据字典"
)
public
class
DictionaryController
{
@Autowired
private
DictionaryService
dictionaryService
;
@ApiOperation
(
value
=
"查询数据字典"
,
notes
=
"按条件分页查询数据字典"
)
@GetMapping
(
SysUserRequestPath
.
PAGE
)
public
CallBack
<
PageInfo
<
Dictionary
>>
getPageList
(
DictionaryPageForm
entity
,
PageParam
pageParam
)
{
return
CallBack
.
success
(
dictionaryService
.
queryByCriteria
(
entity
,
pageParam
));
}
@ApiOperation
(
value
=
"查询数据字典"
,
notes
=
"根据数据字典ID查询一个页脚"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"数据字典id"
,
dataType
=
"int"
,
paramType
=
"path"
,
required
=
true
)
@GetMapping
(
value
=
"/{id}"
)
public
CallBack
<
Dictionary
>
get
(
@PathVariable
Integer
id
){
return
CallBack
.
success
(
dictionaryService
.
selectByPrimaryKey
(
id
));
}
@ApiOperation
(
value
=
"新增数据字典"
,
notes
=
"新增一个数据字典"
)
@PostMapping
(
SysUserRequestPath
.
SAVE
)
public
CallBack
<
Boolean
>
save
(
@RequestBody
Dictionary
entity
)
{
entity
.
setCreateTime
(
new
Date
());
return
CallBack
.
success
(
dictionaryService
.
insert
(
entity
));
}
@ApiOperation
(
value
=
"更新数据字典"
,
notes
=
"根据数据字典ID更新一个数据字典,空值默认不更新"
)
@PostMapping
(
SysUserRequestPath
.
UPDATE
)
public
CallBack
<
Boolean
>
update
(
@RequestBody
Dictionary
entity
)
{
entity
.
setUpdateTime
(
new
Date
());
return
CallBack
.
success
(
dictionaryService
.
updateByPrimaryKeySelective
(
entity
));
}
@ApiOperation
(
value
=
"批量更新数据字典"
,
notes
=
"根据数据字典对象集合更新"
)
@PostMapping
(
SysUserRequestPath
.
BATCH_UPDATE
)
public
CallBack
<
Boolean
>
batchUpdate
(
@RequestBody
List
<
Dictionary
>
entitys
)
{
for
(
Dictionary
dictionary
:
entitys
)
{
dictionary
.
setUpdateTime
(
new
Date
());
dictionaryService
.
updateByPrimaryKeySelective
(
dictionary
);
}
return
CallBack
.
success
();
}
@ApiOperation
(
value
=
"删除数据字典"
,
notes
=
"根据数据字典ID删除一个数据字典"
)
@PostMapping
(
SysUserRequestPath
.
DELETE_OID
)
public
CallBack
<
Boolean
>
delete
(
@PathVariable
Integer
oid
)
{
return
CallBack
.
success
(
dictionaryService
.
deleteByPrimaryKey
(
oid
));
}
@ApiOperation
(
value
=
"删除数据字典"
,
notes
=
"批量删除数据字典"
)
@PostMapping
(
SysUserRequestPath
.
BATCH_DELETE
)
public
CallBack
<
Boolean
>
deletes
(
@RequestBody
Integer
[]
id
)
{
dictionaryService
.
createCriteria
().
andIn
(
"id"
,
Arrays
.
asList
(
id
));
return
CallBack
.
success
(
dictionaryService
.
deleteByCriteria
());
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论