提交 936be31c 编写于 作者: ibizdev's avatar ibizdev

zhouweidong@lab.ibiz5.com 发布系统代码

上级 41717033
...@@ -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\/select$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/msguseraccounts\/fetchdefault$/)).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\/select(\?[\w-./?%&=,]*)*$/)).reply((config: any) => { mock.onGet(new RegExp(/^\/msguseraccounts\/fetchdefault(\?[\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:{}];
});
...@@ -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
...@@ -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 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册