merge with upstream
This commit is contained in:
commit
44a4e8eee5
@ -14,13 +14,6 @@
|
|||||||
-- limitations under the License.
|
-- limitations under the License.
|
||||||
--
|
--
|
||||||
|
|
||||||
DROP MATERIALIZED VIEW IF EXISTS thingsboard.entity_view_by_tenant_and_name;
|
|
||||||
DROP MATERIALIZED VIEW IF EXISTS thingsboard.entity_view_by_tenant_and_search_text;
|
|
||||||
DROP MATERIALIZED VIEW IF EXISTS thingsboard.entity_view_by_tenant_and_customer;
|
|
||||||
DROP MATERIALIZED VIEW IF EXISTS thingsboard.entity_view_by_tenant_and_entity_id;
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS thingsboard.entity_views;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS thingsboard.entity_views (
|
CREATE TABLE IF NOT EXISTS thingsboard.entity_views (
|
||||||
id timeuuid,
|
id timeuuid,
|
||||||
entity_id timeuuid,
|
entity_id timeuuid,
|
||||||
|
|||||||
@ -14,10 +14,8 @@
|
|||||||
-- limitations under the License.
|
-- limitations under the License.
|
||||||
--
|
--
|
||||||
|
|
||||||
DROP TABLE IF EXISTS entity_views;
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS entity_views (
|
CREATE TABLE IF NOT EXISTS entity_views (
|
||||||
id varchar(31) NOT NULL CONSTRAINT entity_view_pkey PRIMARY KEY,
|
id varchar(31) NOT NULL CONSTRAINT entity_views_pkey PRIMARY KEY,
|
||||||
entity_id varchar(31),
|
entity_id varchar(31),
|
||||||
entity_type varchar(255),
|
entity_type varchar(255),
|
||||||
tenant_id varchar(31),
|
tenant_id varchar(31),
|
||||||
|
|||||||
@ -36,6 +36,7 @@ import org.thingsboard.server.common.data.id.DeviceId;
|
|||||||
import org.thingsboard.server.common.data.id.EntityId;
|
import org.thingsboard.server.common.data.id.EntityId;
|
||||||
import org.thingsboard.server.common.data.relation.EntityRelation;
|
import org.thingsboard.server.common.data.relation.EntityRelation;
|
||||||
import org.thingsboard.server.common.data.security.DeviceCredentials;
|
import org.thingsboard.server.common.data.security.DeviceCredentials;
|
||||||
|
import org.thingsboard.server.common.data.security.DeviceCredentialsType;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -141,6 +142,17 @@ public class RestClient implements ClientHttpRequestInterceptor {
|
|||||||
return restTemplate.postForEntity(baseURL + "/api/device", device, Device.class).getBody();
|
return restTemplate.postForEntity(baseURL + "/api/device", device, Device.class).getBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DeviceCredentials updateDeviceCredentials(DeviceId deviceId, String token) {
|
||||||
|
DeviceCredentials deviceCredentials = getCredentials(deviceId);
|
||||||
|
deviceCredentials.setCredentialsType(DeviceCredentialsType.ACCESS_TOKEN);
|
||||||
|
deviceCredentials.setCredentialsId(token);
|
||||||
|
return saveDeviceCredentials(deviceCredentials);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DeviceCredentials saveDeviceCredentials(DeviceCredentials deviceCredentials) {
|
||||||
|
return restTemplate.postForEntity(baseURL + "/api/device/credentials", deviceCredentials, DeviceCredentials.class).getBody();
|
||||||
|
}
|
||||||
|
|
||||||
public Device createDevice(Device device) {
|
public Device createDevice(Device device) {
|
||||||
return restTemplate.postForEntity(baseURL + "/api/device", device, Device.class).getBody();
|
return restTemplate.postForEntity(baseURL + "/api/device", device, Device.class).getBody();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user