Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzdict
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzdict
提交
59212962
提交
59212962
编写于
4月 14, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ibizdev提交
上级
969b71ad
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
84 行增加
和
0 行删除
+84
-0
IBZDictResource.java
.../cn/ibizlab/service/dictapi/resource/IBZDictResource.java
+84
-0
未找到文件。
ibzdict-provider/ibzdict-provider-dictapi/src/main/java/cn/ibizlab/service/dictapi/resource/IBZDictResource.java
浏览文件 @
59212962
...
...
@@ -47,5 +47,89 @@ public class IBZDictResource {
@Autowired
private
IIBZDictService
ibzdictService
;
@ApiOperation
(
value
=
"Get"
,
tags
=
{
"IBZDict"
},
notes
=
"Get"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictapi/ibzdicts/{ibzdict_id}"
)
public
ResponseEntity
<
IBZDictDTO
>
get
(
@PathVariable
(
"ibzdict_id"
)
String
ibzdict_id
)
{
IBZDict
domain
=
ibzdictService
.
get
(
ibzdict_id
);
IBZDictDTO
dto
=
IBZDictMapping
.
MAPPER
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"Create"
,
tags
=
{
"IBZDict"
},
notes
=
"Create"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictapi/ibzdicts"
)
@Transactional
public
ResponseEntity
<
IBZDictDTO
>
create
(
@RequestBody
IBZDictDTO
ibzdictdto
)
{
IBZDict
domain
=
IBZDictMapping
.
MAPPER
.
toDomain
(
ibzdictdto
);
ibzdictService
.
create
(
domain
);
IBZDictDTO
dto
=
IBZDictMapping
.
MAPPER
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"CheckKey"
,
tags
=
{
"IBZDict"
},
notes
=
"CheckKey"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictapi/ibzdicts/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
IBZDictDTO
ibzdictdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"GetDraft"
,
tags
=
{
"IBZDict"
},
notes
=
"GetDraft"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictapi/ibzdicts/getdraft"
)
@Transactional
public
ResponseEntity
<
IBZDictDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
new
IBZDictDTO
());
}
@ApiOperation
(
value
=
"Update"
,
tags
=
{
"IBZDict"
},
notes
=
"Update"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/dictapi/ibzdicts/{ibzdict_id}"
)
@Transactional
public
ResponseEntity
<
IBZDictDTO
>
update
(
@PathVariable
(
"ibzdict_id"
)
String
ibzdict_id
,
@RequestBody
IBZDictDTO
ibzdictdto
)
{
IBZDict
domain
=
IBZDictMapping
.
MAPPER
.
toDomain
(
ibzdictdto
);
domain
.
setDictId
(
ibzdict_id
);
ibzdictService
.
update
(
domain
);
IBZDictDTO
dto
=
IBZDictMapping
.
MAPPER
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"Remove"
,
tags
=
{
"IBZDict"
},
notes
=
"Remove"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/dictapi/ibzdicts/{ibzdict_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"ibzdict_id"
)
String
ibzdict_id
)
{
IBZDictDTO
ibzdictdto
=
new
IBZDictDTO
();
IBZDict
domain
=
new
IBZDict
();
ibzdictdto
.
setDictId
(
ibzdict_id
);
domain
.
setDictId
(
ibzdict_id
);
Boolean
rst
=
ibzdictService
.
remove
(
domain
.
getDictId
());
if
(
rst
){
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
rst
);
}
else
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
rst
);
}
}
//SAVE
@ApiOperation
(
value
=
"Save"
,
tags
=
{
"IBZDict"
},
notes
=
"Save"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/dictapi/ibzdicts/{ibzdict_id}/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
IBZDictDTO
ibzdictdto
)
{
IBZDict
ibzdict
=
IBZDictMapping
.
MAPPER
.
toDomain
(
ibzdictdto
);
Boolean
b
=
ibzdictService
.
save
(
ibzdict
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
b
);
}
//9
@ApiOperation
(
value
=
"获取DEFAULT"
,
tags
=
{
"IBZDict"
}
,
notes
=
"获取DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/dictapi/ibzdicts/fetchdefault"
)
public
ResponseEntity
<
List
<
IBZDictDTO
>>
fetchDefault
(
IBZDictSearchContext
context
)
{
List
<
IBZDictDTO
>
list
=
new
ArrayList
<
IBZDictDTO
>();
Page
<
IBZDict
>
domains
=
ibzdictService
.
searchDefault
(
context
)
;
for
(
IBZDict
ibzdict
:
domains
.
getContent
()){
IBZDictDTO
dto
=
IBZDictMapping
.
MAPPER
.
toDto
(
ibzdict
);
list
.
add
(
dto
);
}
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录