提交 118fae27 编写于 作者: ibizdev's avatar ibizdev

ibiz4j 发布系统代码

上级 a52ec714
......@@ -9,6 +9,7 @@ export default {
region_id: "RegionId",
access_token: "管理账号token",
expires_time: "管理账号token过期时间",
disabled: "是否禁用",
},
views: {
editview: {
......
......@@ -8,6 +8,7 @@ export default {
region_id: "RegionId",
access_token: "管理账号token",
expires_time: "管理账号token过期时间",
disabled: "是否禁用",
},
views: {
editview: {
......
......@@ -114,16 +114,165 @@ mock.onGet(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})\/select$/)).r
console.groupEnd();
return [status, _items];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// Create
mock.onPost(new RegExp(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: Create");
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(/^\/msgopenaccesses\/([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(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: 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(/^\/msgopenaccesses\/([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(/^\/msgopenaccesses\/getdraft$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: 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(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/checkkey$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: 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(/^\/msgopenaccesses\/([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(/^\/msgopenaccesses\/?([a-zA-Z0-9\-\;]{0,35})\/save$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: 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(/^\/msgopenaccesses\/([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
mock.onGet(new RegExp(/^\/msgopenaccesses\/select$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/msgopenaccesses\/fetchdefault$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
let status = MockAdapter.mockStatus(config);
......@@ -138,7 +287,7 @@ mock.onGet(new RegExp(/^\/msgopenaccesses\/select$/)).reply((config: any) => {
});
// FetchDefault
mock.onGet(new RegExp(/^\/msgopenaccesses\/select(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
mock.onGet(new RegExp(/^\/msgopenaccesses\/fetchdefault(\?[\w-./?%&=,]*)*$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: FetchDefault");
console.table({url:config.url, method: config.method, data:config.data});
if(config.url.includes('page')){
......@@ -173,3 +322,59 @@ mock.onGet(new RegExp(/^\/msgopenaccesses\/select(\?[\w-./?%&=,]*)*$/)).reply((c
// URI参数传递情况未实现
// URI参数传递情况未实现
// Remove
mock.onDelete(new RegExp(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: 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(/^\/msgopenaccesses\/([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(/^\/msgopenaccesses\/([a-zA-Z0-9\-\;]{1,35})$/)).reply((config: any) => {
console.groupCollapsed("实体:msgopenaccess 方法: 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(/^\/msgopenaccesses\/([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 MsgOpenAccessServiceBase extends EntityService {
return res;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgOpenAccessServiceBase
*/
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(`/msgopenaccesses`,data,isloading);
return res;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgOpenAccessServiceBase
*/
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(`/msgopenaccesses/${context.msgopenaccess}`,data,isloading);
return res;
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgOpenAccessServiceBase
*/
public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().delete(`/msgopenaccesses/${context.msgopenaccess}`,isloading);
return res;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgOpenAccessServiceBase
*/
public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/msgopenaccesses/${context.msgopenaccess}`,isloading);
return res;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgOpenAccessServiceBase
*/
public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = await Http.getInstance().get(`/msgopenaccesses/getdraft`,isloading);
res.data.msgopenaccess = data.msgopenaccess;
return res;
}
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgOpenAccessServiceBase
*/
public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
let res:any = Http.getInstance().post(`/msgopenaccesses/${context.msgopenaccess}/checkkey`,data,isloading);
return res;
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof MsgOpenAccessServiceBase
*/
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(`/msgopenaccesses/${context.msgopenaccess}/save`,data,isloading);
return res;
}
/**
* FetchDefault接口方法
*
......@@ -63,5 +180,8 @@ export default class MsgOpenAccessServiceBase extends EntityService {
* @memberof MsgOpenAccessServiceBase
*/
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(`/msgopenaccesses/fetchdefault`,tempData,isloading);
return res;
}
}
\ No newline at end of file
......@@ -39,6 +39,9 @@ export default class PickupViewpickupviewpanelModel {
{
name: 'expires_time',
},
{
name: 'disabled',
},
]
}
......
......@@ -105,6 +105,14 @@ public class MsgOpenAccess extends EntityMP implements Serializable {
@JSONField(name = "expires_time" , format="yyyy-MM-dd HH:mm:ss")
@JsonProperty("expires_time")
private Timestamp expiresTime;
/**
* 是否禁用
*/
@DEField(defaultValue = "0")
@TableField(value = "disabled")
@JSONField(name = "disabled")
@JsonProperty("disabled")
private Integer disabled;
......@@ -174,6 +182,14 @@ public class MsgOpenAccess extends EntityMP implements Serializable {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(expiresTime);
}
/**
* 设置 [是否禁用]
*/
public void setDisabled(Integer disabled){
this.disabled = disabled ;
this.modify("disabled",disabled);
}
}
......
......@@ -4,7 +4,7 @@
<!--输出实体[MSG_OPEN_ACCESS]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-msg_open_access-21-1">
<changeSet author="a_A_5d9d78509" id="tab-msg_open_access-24-1">
<createTable tableName="IBZOPENACCESS">
<column name="ACCESSID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_MSG_OPEN_ACCESS_ACCESSID"/>
......@@ -23,6 +23,8 @@
</column>
<column name="EXPIRES_TIME" remarks="" type="DATETIME">
</column>
<column name="DISABLED" remarks="" type="INT">
</column>
</createTable>
</changeSet>
......
......@@ -5,7 +5,7 @@
<!--该方法用于重写mybatis中selectById方法,以实现查询逻辑属性-->
<select id="selectById" resultMap="MsgOpenAccessResultMap" databaseId="mysql">
<![CDATA[select t1.* from (SELECT t1.`ACCESSID`, t1.`ACCESSNAME`, t1.`ACCESS_KEY`, t1.`ACCESS_TOKEN`, t1.`EXPIRES_TIME`, t1.`OPEN_TYPE`, t1.`REGION_ID`, t1.`SECRET_KEY` FROM `IBZOPENACCESS` t1 ) t1 where accessid=#{id}]]>
<![CDATA[select t1.* from (SELECT t1.`ACCESSID`, t1.`ACCESSNAME`, t1.`ACCESS_KEY`, t1.`ACCESS_TOKEN`, t1.`DISABLED`, t1.`EXPIRES_TIME`, t1.`OPEN_TYPE`, t1.`REGION_ID`, t1.`SECRET_KEY` FROM `IBZOPENACCESS` t1 ) t1 where accessid=#{id}]]>
</select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
......@@ -34,12 +34,12 @@
<!--数据查询[Default]-->
<sql id="Default" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCESSID`, t1.`ACCESSNAME`, t1.`ACCESS_KEY`, t1.`ACCESS_TOKEN`, t1.`EXPIRES_TIME`, t1.`OPEN_TYPE`, t1.`REGION_ID`, t1.`SECRET_KEY` FROM `IBZOPENACCESS` t1
<![CDATA[ SELECT t1.`ACCESSID`, t1.`ACCESSNAME`, t1.`ACCESS_KEY`, t1.`ACCESS_TOKEN`, t1.`DISABLED`, t1.`EXPIRES_TIME`, t1.`OPEN_TYPE`, t1.`REGION_ID`, t1.`SECRET_KEY` FROM `IBZOPENACCESS` t1
]]>
</sql>
<!--数据查询[View]-->
<sql id="View" databaseId="mysql">
<![CDATA[ SELECT t1.`ACCESSID`, t1.`ACCESSNAME`, t1.`ACCESS_KEY`, t1.`ACCESS_TOKEN`, t1.`EXPIRES_TIME`, t1.`OPEN_TYPE`, t1.`REGION_ID`, t1.`SECRET_KEY` FROM `IBZOPENACCESS` t1
<![CDATA[ SELECT t1.`ACCESSID`, t1.`ACCESSNAME`, t1.`ACCESS_KEY`, t1.`ACCESS_TOKEN`, t1.`DISABLED`, t1.`EXPIRES_TIME`, t1.`OPEN_TYPE`, t1.`REGION_ID`, t1.`SECRET_KEY` FROM `IBZOPENACCESS` t1
]]>
</sql>
</mapper>
......
......@@ -89,6 +89,14 @@ public class MsgOpenAccessDTO extends DTOBase implements Serializable {
@JsonProperty("expires_time")
private Timestamp expiresTime;
/**
* 属性 [DISABLED]
*
*/
@JSONField(name = "disabled")
@JsonProperty("disabled")
private Integer disabled;
/**
* 设置 [ACCESSNAME]
......@@ -146,6 +154,14 @@ public class MsgOpenAccessDTO extends DTOBase implements Serializable {
this.modify("expires_time",expiresTime);
}
/**
* 设置 [DISABLED]
*/
public void setDisabled(Integer disabled){
this.disabled = disabled ;
this.modify("disabled",disabled);
}
}
......@@ -47,5 +47,117 @@ public class MsgOpenAccessResource {
@Lazy
public MsgOpenAccessMapping msgopenaccessMapping;
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-Create-all')")
@ApiOperation(value = "新建接入开放平台", tags = {"接入开放平台" }, notes = "新建接入开放平台")
@RequestMapping(method = RequestMethod.POST, value = "/msgopenaccesses")
@Transactional
public ResponseEntity<MsgOpenAccessDTO> create(@RequestBody MsgOpenAccessDTO msgopenaccessdto) {
MsgOpenAccess domain = msgopenaccessMapping.toDomain(msgopenaccessdto);
msgopenaccessService.create(domain);
MsgOpenAccessDTO dto = msgopenaccessMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-Create-all')")
@ApiOperation(value = "批量新建接入开放平台", tags = {"接入开放平台" }, notes = "批量新建接入开放平台")
@RequestMapping(method = RequestMethod.POST, value = "/msgopenaccesses/batch")
public ResponseEntity<Boolean> createBatch(@RequestBody List<MsgOpenAccessDTO> msgopenaccessdtos) {
msgopenaccessService.createBatch(msgopenaccessMapping.toDomain(msgopenaccessdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-Update-all')")
@ApiOperation(value = "更新接入开放平台", tags = {"接入开放平台" }, notes = "更新接入开放平台")
@RequestMapping(method = RequestMethod.PUT, value = "/msgopenaccesses/{msgopenaccess_id}")
@Transactional
public ResponseEntity<MsgOpenAccessDTO> update(@PathVariable("msgopenaccess_id") String msgopenaccess_id, @RequestBody MsgOpenAccessDTO msgopenaccessdto) {
MsgOpenAccess domain = msgopenaccessMapping.toDomain(msgopenaccessdto);
domain .setId(msgopenaccess_id);
msgopenaccessService.update(domain );
MsgOpenAccessDTO dto = msgopenaccessMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-Update-all')")
@ApiOperation(value = "批量更新接入开放平台", tags = {"接入开放平台" }, notes = "批量更新接入开放平台")
@RequestMapping(method = RequestMethod.PUT, value = "/msgopenaccesses/batch")
public ResponseEntity<Boolean> updateBatch(@RequestBody List<MsgOpenAccessDTO> msgopenaccessdtos) {
msgopenaccessService.updateBatch(msgopenaccessMapping.toDomain(msgopenaccessdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-Remove-all')")
@ApiOperation(value = "删除接入开放平台", tags = {"接入开放平台" }, notes = "删除接入开放平台")
@RequestMapping(method = RequestMethod.DELETE, value = "/msgopenaccesses/{msgopenaccess_id}")
@Transactional
public ResponseEntity<Boolean> remove(@PathVariable("msgopenaccess_id") String msgopenaccess_id) {
return ResponseEntity.status(HttpStatus.OK).body(msgopenaccessService.remove(msgopenaccess_id));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-Remove-all')")
@ApiOperation(value = "批量删除接入开放平台", tags = {"接入开放平台" }, notes = "批量删除接入开放平台")
@RequestMapping(method = RequestMethod.DELETE, value = "/msgopenaccesses/batch")
public ResponseEntity<Boolean> removeBatch(@RequestBody List<String> ids) {
msgopenaccessService.removeBatch(ids);
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-Get-all')")
@ApiOperation(value = "获取接入开放平台", tags = {"接入开放平台" }, notes = "获取接入开放平台")
@RequestMapping(method = RequestMethod.GET, value = "/msgopenaccesses/{msgopenaccess_id}")
public ResponseEntity<MsgOpenAccessDTO> get(@PathVariable("msgopenaccess_id") String msgopenaccess_id) {
MsgOpenAccess domain = msgopenaccessService.get(msgopenaccess_id);
MsgOpenAccessDTO dto = msgopenaccessMapping.toDto(domain);
return ResponseEntity.status(HttpStatus.OK).body(dto);
}
@ApiOperation(value = "获取接入开放平台草稿", tags = {"接入开放平台" }, notes = "获取接入开放平台草稿")
@RequestMapping(method = RequestMethod.GET, value = "/msgopenaccesses/getdraft")
public ResponseEntity<MsgOpenAccessDTO> getDraft() {
return ResponseEntity.status(HttpStatus.OK).body(msgopenaccessMapping.toDto(msgopenaccessService.getDraft(new MsgOpenAccess())));
}
@ApiOperation(value = "检查接入开放平台", tags = {"接入开放平台" }, notes = "检查接入开放平台")
@RequestMapping(method = RequestMethod.POST, value = "/msgopenaccesses/checkkey")
public ResponseEntity<Boolean> checkKey(@RequestBody MsgOpenAccessDTO msgopenaccessdto) {
return ResponseEntity.status(HttpStatus.OK).body(msgopenaccessService.checkKey(msgopenaccessMapping.toDomain(msgopenaccessdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-Save-all')")
@ApiOperation(value = "保存接入开放平台", tags = {"接入开放平台" }, notes = "保存接入开放平台")
@RequestMapping(method = RequestMethod.POST, value = "/msgopenaccesses/save")
public ResponseEntity<Boolean> save(@RequestBody MsgOpenAccessDTO msgopenaccessdto) {
return ResponseEntity.status(HttpStatus.OK).body(msgopenaccessService.save(msgopenaccessMapping.toDomain(msgopenaccessdto)));
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-Save-all')")
@ApiOperation(value = "批量保存接入开放平台", tags = {"接入开放平台" }, notes = "批量保存接入开放平台")
@RequestMapping(method = RequestMethod.POST, value = "/msgopenaccesses/savebatch")
public ResponseEntity<Boolean> saveBatch(@RequestBody List<MsgOpenAccessDTO> msgopenaccessdtos) {
msgopenaccessService.saveBatch(msgopenaccessMapping.toDomain(msgopenaccessdtos));
return ResponseEntity.status(HttpStatus.OK).body(true);
}
@PreAuthorize("hasAnyAuthority('ROLE_SUPERADMIN','ibznotify-MsgOpenAccess-searchDefault-all')")
@ApiOperation(value = "获取DEFAULT", tags = {"接入开放平台" } ,notes = "获取DEFAULT")
@RequestMapping(method= RequestMethod.GET , value="/msgopenaccesses/fetchdefault")
public ResponseEntity<List<MsgOpenAccessDTO>> fetchDefault(MsgOpenAccessSearchContext context) {
Page<MsgOpenAccess> domains = msgopenaccessService.searchDefault(context) ;
List<MsgOpenAccessDTO> list = msgopenaccessMapping.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-MsgOpenAccess-searchDefault-all')")
@ApiOperation(value = "查询DEFAULT", tags = {"接入开放平台" } ,notes = "查询DEFAULT")
@RequestMapping(method= RequestMethod.POST , value="/msgopenaccesses/searchdefault")
public ResponseEntity<Page<MsgOpenAccessDTO>> searchDefault(@RequestBody MsgOpenAccessSearchContext context) {
Page<MsgOpenAccess> domains = msgopenaccessService.searchDefault(context) ;
return ResponseEntity.status(HttpStatus.OK)
.body(new PageImpl(msgopenaccessMapping.toDto(domains.getContent()), context.getPageable(), domains.getTotalElements()));
}
}
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册