Skip to content

Commit

Permalink
[fix]: fix taos table structure
Browse files Browse the repository at this point in the history
  • Loading branch information
lgt1126 committed Jan 10, 2022
1 parent 23162cb commit 6661bb2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class TDEngineDatabaseInstaller {

private static final String CREATE_ZEUS_STABLE_HISTORY = "create stable if not exists history(clock TIMESTAMP, value DOUBLE) tags (deviceid BINARY(64), itemid BINARY(20))";
private static final String CREATE_ZEUS_STABLE_HISTORY_UINT = "create stable if not exists history_uint(clock TIMESTAMP, value BIGINT) tags (deviceid BINARY(64), itemid BINARY(20))";
private static final String CREATE_ZEUS_STABLE_HISTORY_TEXT = "create stable if not exists history_text(clock TIMESTAMP, value NCHAR(255)) tags (deviceid BINARY(64), itemid BINARY(20))";
private static final String CREATE_ZEUS_STABLE_HISTORY_TEXT = "create stable if not exists history_text(clock TIMESTAMP, value NCHAR(2048)) tags (deviceid BINARY(64), itemid BINARY(20))";
private static final String CREATE_ZEUS_STABLE_HISTORY_STR = "create stable if not exists history_str(clock TIMESTAMP, value NCHAR(255)) tags (deviceid BINARY(64), itemid BINARY(20))";


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public enum BizExceptionEnum implements AbstractBaseExceptionEnum {
PROTOCOL_COMPONENT_HAS_BIND_GATEWAY(2303, "协议组件已绑定协议网关,不能删除"),
PROTOCOL_SERVICE_EXISTS(2304, "通信服务名称已存在"),
PROTOCOL_SERVICE_NOT_EXISTS(2305, "通信服务不存在"),
PROTOCOL_SERVICE_PORT_EXISTS(2310, "端口已存在"),
PROTOCOL_SERVICE_HAS_BIND_GATEWAY(2306, "通信服务已绑定协议网关,不能删除"),
PROTOCOL_GATEWAY_NOT_EXISTS(2307, "协议网关不存在"),
PROTOCOL_SERVICE_HAS_BIND_COMPONENT(2308, "通信服务已绑定协议协议组件"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public ResponseData create(@Validated(BaseEntity.Create.class) @RequestBody Prot
if (count > 0) {
throw new ServiceException(BizExceptionEnum.PROTOCOL_SERVICE_EXISTS);
}
count = new QProtocolService().ip.eq(protocolServiceParam.getIp()).port.eq(protocolServiceParam.getPort()).findCount();
if (count > 0) {
throw new ServiceException(BizExceptionEnum.PROTOCOL_SERVICE_PORT_EXISTS);
}
return ResponseData.success(protocolSvrService.create(protocolServiceParam));
}

Expand All @@ -65,6 +69,10 @@ public ResponseData update(@Validated(BaseEntity.Update.class) @RequestBody Prot
if (count > 0) {
throw new ServiceException(BizExceptionEnum.PROTOCOL_SERVICE_EXISTS);
}
count = new QProtocolService().ip.eq(protocolServiceParam.getIp()).port.eq(protocolServiceParam.getPort()).protocolServiceId.ne(protocolServiceParam.getProtocolServiceId()).findCount();
if (count > 0) {
throw new ServiceException(BizExceptionEnum.PROTOCOL_SERVICE_PORT_EXISTS);
}
return ResponseData.success(protocolSvrService.update(protocolServiceParam));
}

Expand Down

0 comments on commit 6661bb2

Please sign in to comment.