Skip to content

Commit

Permalink
feat: 设备列表新增查询参数
Browse files Browse the repository at this point in the history
  • Loading branch information
godLei6 committed Nov 5, 2024
1 parent dfb0807 commit e5a14be
Show file tree
Hide file tree
Showing 6 changed files with 122 additions and 100 deletions.
7 changes: 7 additions & 0 deletions service/apisvr/http/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7483,6 +7483,13 @@
"type": "integer",
"format": "int64"
},
"productCategoryIDs": {
"type": "array",
"items": {
"type": "integer",
"format": "int64"
}
},
"withShared": {
"type": "integer",
"format": "int64",
Expand Down
1 change: 1 addition & 0 deletions service/apisvr/http/things/device/info.api
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ type (
AreaIDPath string `json:"areaIDPath,optional"` //区域路径过滤
IsOnline int64 `json:"isOnline,optional,range=[0:2]"` // 在线状态过滤 1离线 2在线
ProductCategoryID int64 `json:"productCategoryID,optional"`
ProductCategoryIDs []int64 `json:"productCategoryIDs,optional"`
WithShared int64 `json:"withShared,optional,range=[0:2]"` // 过滤分享的设备1: 同时获取分享的设备 2:只获取分享的设备
WithCollect int64 `json:"withCollect,optional,range=[0:2]"` // 过滤收藏的设备(这里只获取收藏的设备) 1: 同时获取收藏的设备 2:只获取收藏的设备
Versions []string `json:"versions,optional"`
Expand Down
73 changes: 37 additions & 36 deletions service/apisvr/internal/types/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 30 additions & 29 deletions service/dmsvr/internal/logic/devicemanage/deviceInfoIndexLogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,36 @@ func (l *DeviceInfoIndexLogic) DeviceInfoIndex(in *dm.DeviceInfoIndexReq) (*dm.D
}

filter := relationDB.DeviceFilter{
TenantCode: in.TenantCode,
ProductID: in.ProductID,
ProductIDs: in.ProductIDs,
AreaIDs: in.AreaIDs,
AreaIDPath: in.AreaIDPath,
DeviceName: in.DeviceName,
DeviceNames: in.DeviceNames,
Gateway: utils.Copy[devices.Core](in.Gateway),
Cores: cores,
Iccid: in.Iccid,
Tags: in.Tags,
Range: in.Range,
Position: logic.ToStorePoint(in.Position),
DeviceAlias: in.DeviceAlias,
IsOnline: in.IsOnline,
ProductCategoryID: in.ProductCategoryID,
Versions: in.Versions,
SharedType: in.WithShared,
CollectType: in.WithCollect,
DeviceType: in.DeviceType,
DeviceTypes: in.DeviceTypes,
GroupID: in.GroupID,
Status: in.Status,
NotGroupID: in.NotGroupID,
NotAreaID: in.NotAreaID,
UserID: in.UserID,
NetType: in.NetType,
HasOwner: in.HasOwner,
Distributor: utils.Copy[stores.IDPathFilter](in.Distributor),
TenantCode: in.TenantCode,
ProductID: in.ProductID,
ProductIDs: in.ProductIDs,
AreaIDs: in.AreaIDs,
AreaIDPath: in.AreaIDPath,
DeviceName: in.DeviceName,
DeviceNames: in.DeviceNames,
Gateway: utils.Copy[devices.Core](in.Gateway),
Cores: cores,
Iccid: in.Iccid,
Tags: in.Tags,
Range: in.Range,
Position: logic.ToStorePoint(in.Position),
DeviceAlias: in.DeviceAlias,
IsOnline: in.IsOnline,
ProductCategoryID: in.ProductCategoryID,
ProductCategoryIDs: in.ProductCategoryIDs,
Versions: in.Versions,
SharedType: in.WithShared,
CollectType: in.WithCollect,
DeviceType: in.DeviceType,
DeviceTypes: in.DeviceTypes,
GroupID: in.GroupID,
Status: in.Status,
NotGroupID: in.NotGroupID,
NotAreaID: in.NotAreaID,
UserID: in.UserID,
NetType: in.NetType,
HasOwner: in.HasOwner,
Distributor: utils.Copy[stores.IDPathFilter](in.Distributor),
}
if in.RatedPower != nil {
filter.RatedPower = stores.GetCmp(in.RatedPower.CmpType, in.RatedPower.Value)
Expand Down
Loading

0 comments on commit e5a14be

Please sign in to comment.