Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibznotify
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibznotify
提交
936be31c
提交
936be31c
编写于
8月 12, 2020
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong@lab.ibiz5.com 发布系统代码
上级
41717033
变更
3
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
446 行增加
和
9 行删除
+446
-9
msg-user-accounts.ts
...eb/src/mock/entity/msg-user-accounts/msg-user-accounts.ts
+214
-9
msg-user-account-service-base.ts
...service/msg-user-account/msg-user-account-service-base.ts
+120
-0
MsgUserAccountResource.java
...main/java/cn/ibizlab/api/rest/MsgUserAccountResource.java
+112
-0
未找到文件。
app_web/src/mock/entity/msg-user-accounts/msg-user-accounts.ts
浏览文件 @
936be31c
...
@@ -114,16 +114,165 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
...
@@ -114,16 +114,165 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
];
return
[
status
,
_items
];
});
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// Create
// URI参数传递情况未实现
mock
.
onPost
(
new
RegExp
(
/^
\/
msguseraccounts
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
// URI参数传递情况未实现
console
.
groupCollapsed
(
"实体:msguseraccount 方法: Create"
);
// URI参数传递情况未实现
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// URI参数传递情况未实现
let
status
=
MockAdapter
.
mockStatus
(
config
);
// URI参数传递情况未实现
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
msguseraccounts
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
msguseraccounts
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:msguseraccount 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
msguseraccounts
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
msguseraccounts
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:msguseraccount 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
msguseraccounts
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:msguseraccount 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
msguseraccounts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
msguseraccounts
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:msguseraccount 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
msguseraccounts
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
msguseraccounts
\/
selec
t$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
msguseraccounts
\/
fetchdefaul
t$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:msguseraccount 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:msguseraccount 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
@@ -138,7 +287,7 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/select$/)).reply((config: any) => {
...
@@ -138,7 +287,7 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/select$/)).reply((config: any) => {
});
});
// FetchDefault
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
msguseraccounts
\/
selec
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
msguseraccounts
\/
fetchdefaul
t
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:msguseraccount 方法: FetchDefault"
);
console
.
groupCollapsed
(
"实体:msguseraccount 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
if
(
config
.
url
.
includes
(
'page'
)){
...
@@ -173,3 +322,59 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/select(\?[\w-./?%&=,]*)*$/)).reply((c
...
@@ -173,3 +322,59 @@ mock.onGet(new RegExp(/^\/msguseraccounts\/select(\?[\w-./?%&=,]*)*$/)).reply((c
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
msguseraccounts
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:msguseraccount 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
msguseraccounts
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
tempValue
.
id
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
msguseraccounts
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:msguseraccount 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
msguseraccounts
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
tempValue
.
id
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_web/src/service/msg-user-account/msg-user-account-service-base.ts
浏览文件 @
936be31c
...
@@ -53,6 +53,123 @@ export default class MsgUserAccountServiceBase extends EntityService {
...
@@ -53,6 +53,123 @@ export default class MsgUserAccountServiceBase extends EntityService {
return
res
;
return
res
;
}
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgUserAccountServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/msguseraccounts`
,
data
,
isloading
);
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgUserAccountServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/msguseraccounts/
${
context
.
msguseraccount
}
`
,
data
,
isloading
);
return
res
;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgUserAccountServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
delete
(
`/msguseraccounts/
${
context
.
msguseraccount
}
`
,
isloading
);
return
res
;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgUserAccountServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/msguseraccounts/
${
context
.
msguseraccount
}
`
,
isloading
);
return
res
;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgUserAccountServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/msguseraccounts/getdraft`
,
isloading
);
res
.
data
.
msguseraccount
=
data
.
msguseraccount
;
return
res
;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgUserAccountServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/msguseraccounts/
${
context
.
msguseraccount
}
/checkkey`
,
data
,
isloading
);
return
res
;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgUserAccountServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/msguseraccounts/
${
context
.
msguseraccount
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
/**
* FetchDefault接口方法
* FetchDefault接口方法
*
*
...
@@ -63,5 +180,8 @@ export default class MsgUserAccountServiceBase extends EntityService {
...
@@ -63,5 +180,8 @@ export default class MsgUserAccountServiceBase extends EntityService {
* @memberof MsgUserAccountServiceBase
* @memberof MsgUserAccountServiceBase
*/
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
res
:
any
=
Http
.
getInstance
().
get
(
`/msguseraccounts/fetchdefault`
,
tempData
,
isloading
);
return
res
;
}
}
}
}
\ No newline at end of file
ibznotify-provider/ibznotify-provider-api/src/main/java/cn/ibizlab/api/rest/MsgUserAccountResource.java
浏览文件 @
936be31c
...
@@ -47,5 +47,117 @@ public class MsgUserAccountResource {
...
@@ -47,5 +47,117 @@ public class MsgUserAccountResource {
@Lazy
@Lazy
public
MsgUserAccountMapping
msguseraccountMapping
;
public
MsgUserAccountMapping
msguseraccountMapping
;
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-Create-all')"
)
@ApiOperation
(
value
=
"新建绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"新建绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/msguseraccounts"
)
@Transactional
public
ResponseEntity
<
MsgUserAccountDTO
>
create
(
@RequestBody
MsgUserAccountDTO
msguseraccountdto
)
{
MsgUserAccount
domain
=
msguseraccountMapping
.
toDomain
(
msguseraccountdto
);
msguseraccountService
.
create
(
domain
);
MsgUserAccountDTO
dto
=
msguseraccountMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-Create-all')"
)
@ApiOperation
(
value
=
"批量新建绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"批量新建绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/msguseraccounts/batch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
MsgUserAccountDTO
>
msguseraccountdtos
)
{
msguseraccountService
.
createBatch
(
msguseraccountMapping
.
toDomain
(
msguseraccountdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-Update-all')"
)
@ApiOperation
(
value
=
"更新绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"更新绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/msguseraccounts/{msguseraccount_id}"
)
@Transactional
public
ResponseEntity
<
MsgUserAccountDTO
>
update
(
@PathVariable
(
"msguseraccount_id"
)
String
msguseraccount_id
,
@RequestBody
MsgUserAccountDTO
msguseraccountdto
)
{
MsgUserAccount
domain
=
msguseraccountMapping
.
toDomain
(
msguseraccountdto
);
domain
.
setId
(
msguseraccount_id
);
msguseraccountService
.
update
(
domain
);
MsgUserAccountDTO
dto
=
msguseraccountMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-Update-all')"
)
@ApiOperation
(
value
=
"批量更新绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"批量更新绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/msguseraccounts/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
MsgUserAccountDTO
>
msguseraccountdtos
)
{
msguseraccountService
.
updateBatch
(
msguseraccountMapping
.
toDomain
(
msguseraccountdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-Remove-all')"
)
@ApiOperation
(
value
=
"删除绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"删除绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/msguseraccounts/{msguseraccount_id}"
)
@Transactional
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"msguseraccount_id"
)
String
msguseraccount_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
msguseraccountService
.
remove
(
msguseraccount_id
));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-Remove-all')"
)
@ApiOperation
(
value
=
"批量删除绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"批量删除绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/msguseraccounts/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
msguseraccountService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-Get-all')"
)
@ApiOperation
(
value
=
"获取绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"获取绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/msguseraccounts/{msguseraccount_id}"
)
public
ResponseEntity
<
MsgUserAccountDTO
>
get
(
@PathVariable
(
"msguseraccount_id"
)
String
msguseraccount_id
)
{
MsgUserAccount
domain
=
msguseraccountService
.
get
(
msguseraccount_id
);
MsgUserAccountDTO
dto
=
msguseraccountMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"获取绑定消息账号草稿"
,
tags
=
{
"绑定消息账号"
},
notes
=
"获取绑定消息账号草稿"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/msguseraccounts/getdraft"
)
public
ResponseEntity
<
MsgUserAccountDTO
>
getDraft
()
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
msguseraccountMapping
.
toDto
(
msguseraccountService
.
getDraft
(
new
MsgUserAccount
())));
}
@ApiOperation
(
value
=
"检查绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"检查绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/msguseraccounts/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
MsgUserAccountDTO
msguseraccountdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
msguseraccountService
.
checkKey
(
msguseraccountMapping
.
toDomain
(
msguseraccountdto
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-Save-all')"
)
@ApiOperation
(
value
=
"保存绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"保存绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/msguseraccounts/save"
)
public
ResponseEntity
<
Boolean
>
save
(
@RequestBody
MsgUserAccountDTO
msguseraccountdto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
msguseraccountService
.
save
(
msguseraccountMapping
.
toDomain
(
msguseraccountdto
)));
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-Save-all')"
)
@ApiOperation
(
value
=
"批量保存绑定消息账号"
,
tags
=
{
"绑定消息账号"
},
notes
=
"批量保存绑定消息账号"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/msguseraccounts/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
MsgUserAccountDTO
>
msguseraccountdtos
)
{
msguseraccountService
.
saveBatch
(
msguseraccountMapping
.
toDomain
(
msguseraccountdtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-searchDefault-all')"
)
@ApiOperation
(
value
=
"获取DEFAULT"
,
tags
=
{
"绑定消息账号"
}
,
notes
=
"获取DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/msguseraccounts/fetchdefault"
)
public
ResponseEntity
<
List
<
MsgUserAccountDTO
>>
fetchDefault
(
MsgUserAccountSearchContext
context
)
{
Page
<
MsgUserAccount
>
domains
=
msguseraccountService
.
searchDefault
(
context
)
;
List
<
MsgUserAccountDTO
>
list
=
msguseraccountMapping
.
toDto
(
domains
.
getContent
());
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
);
}
@PreAuthorize
(
"hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgUserAccount-searchDefault-all')"
)
@ApiOperation
(
value
=
"查询DEFAULT"
,
tags
=
{
"绑定消息账号"
}
,
notes
=
"查询DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/msguseraccounts/searchdefault"
)
public
ResponseEntity
<
Page
<
MsgUserAccountDTO
>>
searchDefault
(
@RequestBody
MsgUserAccountSearchContext
context
)
{
Page
<
MsgUserAccount
>
domains
=
msguseraccountService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
msguseraccountMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
}
}
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录