mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 10:58:35 +08:00
[fix] 遥测模型是字符串时后端获取错误
This commit is contained in:
@@ -58,11 +58,13 @@ func (p *ProductTemplateApi) InsertProductTemplate(rc *restfulx.ReqCtx) {
|
||||
data.Id = model2.GenerateID()
|
||||
if data.Classify == entity.ATTRIBUTES_TSL || data.Classify == entity.TELEMETRY_TSL {
|
||||
// 向超级表及子表中添加字段
|
||||
len := 0
|
||||
len := 100
|
||||
stable := data.Pid + "_" + data.Classify
|
||||
if data.Classify == entity.TELEMETRY_TSL {
|
||||
if data.Type == "string" {
|
||||
len = int(data.Define["length"].(int64))
|
||||
if maxLength, ok := data.Define["maxLength"].(float64); ok {
|
||||
len = int(maxLength)
|
||||
}
|
||||
}
|
||||
}
|
||||
err := global.TdDb.AddSTableField(stable, data.Key, data.Type, len)
|
||||
|
||||
Reference in New Issue
Block a user