issue #10 #11 Add language selection feature.

This commit is contained in:
paul kim
2024-06-02 15:31:53 +09:00
parent bc7ea606f8
commit a069902c86
8 changed files with 471 additions and 2 deletions

View File

@@ -118,6 +118,8 @@ HotelTV.api = (function() {
"update_event": __apifxn_get_base_url() + "/api/" + _api_ver + "/assets/" + _dev_familly + "/" + _serial_num + "/event",
/* Status */
"set_device_status": __apifxn_get_base_url() + "/api/" + _api_ver + "/assets/" + _dev_familly + "/" + _serial_num + "/state",
/* Dataset */
"dataset": __apifxn_get_base_url() + "/api/" + _api_ver + "/assets/" + _dev_familly + "/" + _serial_num + "/dataset",
/*
"get_emergency": __apifxn_get_base_url() + "/api/" + _api_ver + "/settops/" + _serial_num + "/emergency",
"set_message_status": __apifxn_get_base_url() + "/api/" + _api_ver + "/settops/" + _serial_num + "/messages",
@@ -176,6 +178,13 @@ HotelTV.api = (function() {
xhr.setRequestHeader("Authorization", "Bearer " + __apifxn_get_token());
xhr.send(null);
break;
case "PUT":
xhr.open('PUT', sz_url);
xhr.setRequestHeader("Accept", "application/json");
xhr.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xhr.setRequestHeader("Authorization", "Bearer " + __apifxn_get_token());
xhr.send(JSON.stringify(dic_param)); // 폼 데이터 객체 전송
break;
case "POST":
xhr.open('POST', sz_url);
xhr.setRequestHeader("Accept", "application/json");
@@ -753,6 +762,32 @@ HotelTV.api = (function() {
});
},
GetUsrDataset: function() {
return new Promise((resolve, reject) => {
let sz_api_url = __apifxn_get_api_url("dataset");
__apifxn_CallCmsApi("GET", `${sz_api_url}`, "dataset", null).then(_result => {
//console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data));
}).catch(_error => {
console.error(`Failure::>${_error.reason}`);
reject(_error.reason);
});
});
},
SetUsrDataset: function(_item_json) {
return new Promise((resolve, reject) => {
let sz_api_url = __apifxn_get_api_url("dataset");
__apifxn_CallCmsApi("PUT", `${sz_api_url}`, "dataset", _item_json).then(_result => {
//console.log(`Success::>${_result.data}`);
resolve(JSON.parse(_result.data));
}).catch(_error => {
console.error(`Failure::>${_error.reason}`);
reject(_error.reason);
});
});
},
/**
* 통계데이터 발송 API
* @param {array} _arrary_event
@@ -780,6 +815,12 @@ HotelTV.api = (function() {
});
},
/**
* 다비이스 상태 리포트 API
* @param {array} _dev_inf
* @param {array} _gst_info
* @param {array} _usage_inf
*/
ReportBrief: function(_dev_inf, _gst_info, _usage_inf) {
let _json_report = {
"updated": "YYYY-MM-DD HH:MM:SS",