Skip to content

Commit ac0e7c1

Browse files
author
杜美瑶
committed
提交发布/取消发布API打包文件 --reviewed by huangqh
1 parent 1d93d9d commit ac0e7c1

16 files changed

+996
-344
lines changed

dist/leaflet/iclient-leaflet-es6.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16526,6 +16526,81 @@ class iPortalUser_IPortalUser extends iPortalServiceBase_IPortalServiceBase {
1652616526
}
1652716527
})
1652816528
}
16529+
16530+
/**
16531+
* @function SuperMap.iPortalUser.prototype.publishOrUnpublish
16532+
* @description 发布/取消发布。
16533+
* @param {object} options - 发布/取消发布数据服务所需的参数。
16534+
* @param {object} options.dataId - 数据项id。
16535+
* @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
16536+
* @param {object} [options.dataServiceId] - 发布的服务 id。
16537+
* @param {boolean} forPublish - 是否取消发布。
16538+
* @returns {Promise} 返回发布/取消发布数据服务的 Promise 对象。
16539+
*/
16540+
publishOrUnpublish(option,forPublish){
16541+
if(!option.dataId || !option.serviceType) {
16542+
this.getErrMsgPromise("option.dataID and option.serviceType are Required!");
16543+
}
16544+
var dataId = option.dataId;
16545+
var dataServiceId = option.dataServiceId;
16546+
var serviceType = option.serviceType;
16547+
var publishUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?serviceType=" + serviceType;
16548+
if (dataServiceId) {
16549+
publishUrl += "&dataServiceId=" + dataServiceId;
16550+
}
16551+
return this.request("PUT",publishUrl,JSON.stringify(forPublish)).then(res=>{
16552+
// 发起服务状态查询
16553+
if(forPublish) {
16554+
// 发布服务的结果异步处理
16555+
// var publishStateUrl = this.iportalUrl + "web/mycontent/datas/" + dataId + "/publishstatus.rjson";
16556+
if (!dataServiceId) { // 发布服务时会回传serviceIDs,发布服务之前serviceIDs为空
16557+
dataServiceId = res.customResult;
16558+
}
16559+
return dataServiceId;
16560+
}else {
16561+
// 取消发布的结果同步处理
16562+
return res;
16563+
}
16564+
});
16565+
}
16566+
16567+
/**
16568+
* @function SuperMap.iPortalUser.prototype.getDataPublishedStatus
16569+
* @description 查询服务状态,发起服务状态查询。
16570+
* @param {number} dataId - 查询服务状态的数据项id。
16571+
* @param {string} dataServiceId - 发布的服务id。
16572+
* @returns {Promise} 返回查询服务状态的 Promise 对象。
16573+
*/
16574+
getDataPublishedStatus(dataId,dataServiceId){
16575+
var publishStateUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?dataServiceId="+dataServiceId+"&forPublish=true";
16576+
return this.request("GET",publishStateUrl);
16577+
}
16578+
16579+
/**
16580+
* @function SuperMap.iPortalUser.prototype.unPublishedDataService
16581+
* @description 取消发布。
16582+
* @param {object} options - 取消发布服务具体参数。
16583+
* @param {object} options.dataId - 数据项id。
16584+
* @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
16585+
* @param {object} [options.dataServiceId] - 发布的服务 id。
16586+
* @returns {Promise} 返回取消发布数据服务的 Promise 对象。
16587+
*/
16588+
unPublishDataService(option){
16589+
return this.publishOrUnpublish(option,false);
16590+
}
16591+
16592+
/**
16593+
* @function SuperMap.iPortalUser.prototype.publishedDataService
16594+
* @description 发布数据服务。
16595+
* @param {object} options - 发布数据服务具体参数。
16596+
* @param {object} options.dataId - 数据项id。
16597+
* @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
16598+
* @param {object} [options.dataServiceId] - 发布的服务 id。
16599+
* @returns {Promise} 返回发布数据服务的 Promise 对象。
16600+
*/
16601+
publishDataService(option){
16602+
return this.publishOrUnpublish(option,true);
16603+
}
1652916604
}
1653016605

1653116606
SuperMap.iPortalUser = iPortalUser_IPortalUser;

dist/leaflet/iclient-leaflet-es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/leaflet/iclient-leaflet.js

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18630,6 +18630,94 @@ function (_IPortalServiceBase) {
1863018630
}
1863118631
});
1863218632
}
18633+
/**
18634+
* @function SuperMap.iPortalUser.prototype.publishOrUnpublish
18635+
* @description 发布/取消发布。
18636+
* @param {object} options - 发布/取消发布数据服务所需的参数。
18637+
* @param {object} options.dataId - 数据项id。
18638+
* @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
18639+
* @param {object} [options.dataServiceId] - 发布的服务 id。
18640+
* @param {boolean} forPublish - 是否取消发布。
18641+
* @returns {Promise} 返回发布/取消发布数据服务的 Promise 对象。
18642+
*/
18643+
18644+
}, {
18645+
key: "publishOrUnpublish",
18646+
value: function publishOrUnpublish(option, forPublish) {
18647+
if (!option.dataId || !option.serviceType) {
18648+
this.getErrMsgPromise("option.dataID and option.serviceType are Required!");
18649+
}
18650+
18651+
var dataId = option.dataId;
18652+
var dataServiceId = option.dataServiceId;
18653+
var serviceType = option.serviceType;
18654+
var publishUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?serviceType=" + serviceType;
18655+
18656+
if (dataServiceId) {
18657+
publishUrl += "&dataServiceId=" + dataServiceId;
18658+
}
18659+
18660+
return this.request("PUT", publishUrl, JSON.stringify(forPublish)).then(function (res) {
18661+
// 发起服务状态查询
18662+
if (forPublish) {
18663+
// 发布服务的结果异步处理
18664+
// var publishStateUrl = this.iportalUrl + "web/mycontent/datas/" + dataId + "/publishstatus.rjson";
18665+
if (!dataServiceId) {
18666+
// 发布服务时会回传serviceIDs,发布服务之前serviceIDs为空
18667+
dataServiceId = res.customResult;
18668+
}
18669+
18670+
return dataServiceId;
18671+
} else {
18672+
// 取消发布的结果同步处理
18673+
return res;
18674+
}
18675+
});
18676+
}
18677+
/**
18678+
* @function SuperMap.iPortalUser.prototype.getDataPublishedStatus
18679+
* @description 查询服务状态,发起服务状态查询。
18680+
* @param {number} dataId - 查询服务状态的数据项id。
18681+
* @param {string} dataServiceId - 发布的服务id。
18682+
* @returns {Promise} 返回查询服务状态的 Promise 对象。
18683+
*/
18684+
18685+
}, {
18686+
key: "getDataPublishedStatus",
18687+
value: function getDataPublishedStatus(dataId, dataServiceId) {
18688+
var publishStateUrl = this.iportalUrl + "/web/mycontent/datas/" + dataId + "/publishstatus.json?dataServiceId=" + dataServiceId + "&forPublish=true";
18689+
return this.request("GET", publishStateUrl);
18690+
}
18691+
/**
18692+
* @function SuperMap.iPortalUser.prototype.unPublishedDataService
18693+
* @description 取消发布。
18694+
* @param {object} options - 取消发布服务具体参数。
18695+
* @param {object} options.dataId - 数据项id。
18696+
* @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
18697+
* @param {object} [options.dataServiceId] - 发布的服务 id。
18698+
* @returns {Promise} 返回取消发布数据服务的 Promise 对象。
18699+
*/
18700+
18701+
}, {
18702+
key: "unPublishDataService",
18703+
value: function unPublishDataService(option) {
18704+
return this.publishOrUnpublish(option, false);
18705+
}
18706+
/**
18707+
* @function SuperMap.iPortalUser.prototype.publishedDataService
18708+
* @description 发布数据服务。
18709+
* @param {object} options - 发布数据服务具体参数。
18710+
* @param {object} options.dataId - 数据项id。
18711+
* @param {object} options.serviceType - 发布的服务类型,目前支持发布的服务类型包括:RESTDATA, RESTMAP, RESTREALSPACE, RESTSPATIALANALYST。
18712+
* @param {object} [options.dataServiceId] - 发布的服务 id。
18713+
* @returns {Promise} 返回发布数据服务的 Promise 对象。
18714+
*/
18715+
18716+
}, {
18717+
key: "publishDataService",
18718+
value: function publishDataService(option) {
18719+
return this.publishOrUnpublish(option, true);
18720+
}
1863318721
}]);
1863418722

1863518723
return IPortalUser;

0 commit comments

Comments
 (0)