作者 yangfu

fix:字段更名

@@ -140,7 +140,7 @@ func (deviceCollectionService *DeviceCollectionService) DeviceCollection(createD @@ -140,7 +140,7 @@ func (deviceCollectionService *DeviceCollectionService) DeviceCollection(createD
140 } 140 }
141 } 141 }
142 newDeviceCollection.Values["Count"] = count 142 newDeviceCollection.Values["Count"] = count
143 - newDeviceCollection.Count = count 143 + newDeviceCollection.ProductCount = count
144 } 144 }
145 } 145 }
146 // TODO:测试假数据,后期注释掉 146 // TODO:测试假数据,后期注释掉
@@ -25,7 +25,7 @@ type DeviceCollection struct { @@ -25,7 +25,7 @@ type DeviceCollection struct {
25 // 设备数据值 25 // 设备数据值
26 Values map[string]interface{} `json:"values"` 26 Values map[string]interface{} `json:"values"`
27 // 数量(字库使用) 27 // 数量(字库使用)
28 - Count int `json:"count"` 28 + ProductCount int `json:"productCount"`
29 // 最后跟新时间(字库使用) 29 // 最后跟新时间(字库使用)
30 LatestUpdateTime time.Time `json:"latest_update_time"` 30 LatestUpdateTime time.Time `json:"latest_update_time"`
31 } 31 }
@@ -27,7 +27,7 @@ type DeviceCollection struct { @@ -27,7 +27,7 @@ type DeviceCollection struct {
27 // 删除时间 27 // 删除时间
28 DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"` 28 DeletedAt time.Time `pg:",soft_delete" comment:"删除时间"`
29 // 数量(字库使用) 29 // 数量(字库使用)
30 - Count int `comment:"数量" json:"count"` 30 + ProductCount int `comment:"数量"`
31 // 最后更新时间(字库使用) 31 // 最后更新时间(字库使用)
32 - LatestUpdateTime time.Time `comment:"最后更新时间" json:"latest_update_time"` 32 + LatestUpdateTime time.Time `comment:"最后更新时间"`
33 } 33 }
@@ -15,7 +15,7 @@ func TransformToDeviceCollectionDomainModelFromPgModels(deviceCollectionModel *m @@ -15,7 +15,7 @@ func TransformToDeviceCollectionDomainModelFromPgModels(deviceCollectionModel *m
15 CollectionTime: deviceCollectionModel.CreatedAt, 15 CollectionTime: deviceCollectionModel.CreatedAt,
16 ComStatus: deviceCollectionModel.ComStatus, 16 ComStatus: deviceCollectionModel.ComStatus,
17 Values: deviceCollectionModel.Values, 17 Values: deviceCollectionModel.Values,
18 - Count: deviceCollectionModel.Count, 18 + ProductCount: deviceCollectionModel.ProductCount,
19 LatestUpdateTime: deviceCollectionModel.LatestUpdateTime, 19 LatestUpdateTime: deviceCollectionModel.LatestUpdateTime,
20 }, nil 20 }, nil
21 } 21 }
@@ -35,7 +35,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi @@ -35,7 +35,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
35 "startup_status", 35 "startup_status",
36 "com_status", 36 "com_status",
37 "values", 37 "values",
38 - "count", 38 + "product_count",
39 "latest_update_time", 39 "latest_update_time",
40 } 40 }
41 insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields) 41 insertFieldsSnippet := sqlbuilder.SqlFieldsSnippet(sqlBuildFields)
@@ -61,7 +61,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi @@ -61,7 +61,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
61 &deviceCollection.StartupStatus, 61 &deviceCollection.StartupStatus,
62 &deviceCollection.ComStatus, 62 &deviceCollection.ComStatus,
63 &deviceCollection.Values, 63 &deviceCollection.Values,
64 - &deviceCollection.Count, 64 + &deviceCollection.ProductCount,
65 &deviceCollection.LatestUpdateTime, 65 &deviceCollection.LatestUpdateTime,
66 ), 66 ),
67 fmt.Sprintf("INSERT INTO manufacture.device_collections (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet), 67 fmt.Sprintf("INSERT INTO manufacture.device_collections (%s) VALUES (%s) RETURNING %s", insertFieldsSnippet, insertPlaceHoldersSnippet, returningFieldsSnippet),
@@ -73,7 +73,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi @@ -73,7 +73,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
73 deviceCollection.StartupStatus, 73 deviceCollection.StartupStatus,
74 deviceCollection.ComStatus, 74 deviceCollection.ComStatus,
75 deviceCollection.Values, 75 deviceCollection.Values,
76 - deviceCollection.Count, 76 + deviceCollection.ProductCount,
77 deviceCollection.LatestUpdateTime, 77 deviceCollection.LatestUpdateTime,
78 ); err != nil { 78 ); err != nil {
79 return deviceCollection, err 79 return deviceCollection, err
@@ -89,7 +89,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi @@ -89,7 +89,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
89 &deviceCollection.StartupStatus, 89 &deviceCollection.StartupStatus,
90 &deviceCollection.ComStatus, 90 &deviceCollection.ComStatus,
91 &deviceCollection.Values, 91 &deviceCollection.Values,
92 - &deviceCollection.Count, 92 + &deviceCollection.ProductCount,
93 &deviceCollection.LatestUpdateTime, 93 &deviceCollection.LatestUpdateTime,
94 ), 94 ),
95 fmt.Sprintf("UPDATE manufacture.device_collections SET %s WHERE device_collection_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet), 95 fmt.Sprintf("UPDATE manufacture.device_collections SET %s WHERE device_collection_id=? RETURNING %s", updateFieldsSnippet, returningFieldsSnippet),
@@ -101,7 +101,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi @@ -101,7 +101,7 @@ func (repository *DeviceCollectionRepository) Save(deviceCollection *domain.Devi
101 deviceCollection.StartupStatus, 101 deviceCollection.StartupStatus,
102 deviceCollection.ComStatus, 102 deviceCollection.ComStatus,
103 deviceCollection.Values, 103 deviceCollection.Values,
104 - deviceCollection.Count, 104 + deviceCollection.ProductCount,
105 deviceCollection.LatestUpdateTime, 105 deviceCollection.LatestUpdateTime,
106 deviceCollection.Identify(), 106 deviceCollection.Identify(),
107 ); err != nil { 107 ); err != nil {