Skip to content

Commit

Permalink
feat: 调整配置
Browse files Browse the repository at this point in the history
  • Loading branch information
godLei6 committed Nov 17, 2024
1 parent a1a11fd commit 6183f55
Show file tree
Hide file tree
Showing 6 changed files with 1,253 additions and 1,226 deletions.
4 changes: 4 additions & 0 deletions service/apisvr/http/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -6644,6 +6644,10 @@
"format": "int64"
}
},
"projectID": {
"type": "string",
"description": "过滤项目下共有的物模型"
},
"areaID": {
"type": "string"
},
Expand Down
1 change: 1 addition & 0 deletions service/apisvr/http/things/schema/common.api
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ type (
UserPerm int64 `json:"userPerm,optional"`//用户权限操作: 1:r(只读) 3:rw(可读可写)
GroupID int64 `json:"groupID,optional"`
GroupIDs []int64 `json:"groupIDs,optional"`
ProjectID int64 `json:"projectID,optional,string"`//过滤项目下共有的物模型
AreaID int64 `json:"areaID,optional,string"`
AreaIDPath string `json:"areaIDPath,optional"` //过滤区域id路径下有设备的产品
PropertyMode string `json:"propertyMode,optional"`//属性类型可用 读写类型: r(只读) rw(可读可写)
Expand Down
1 change: 1 addition & 0 deletions service/apisvr/internal/types/types.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ func (l *CommonSchemaIndexLogic) CommonSchemaIndex(in *dm.CommonSchemaIndexReq)
}
in.ProductIDs = append(in.ProductIDs, cols...)
}
if in.ProjectID != 0 {
cols, err := relationDB.NewDeviceInfoRepo(l.ctx).FindProductIDsByFilter(l.ctx, relationDB.DeviceFilter{ProjectIDs: []int64{in.ProjectID}})
if err != nil {
return nil, err
}
if len(cols) == 0 {
return &dm.CommonSchemaIndexResp{}, nil
}
in.ProductIDs = append(in.ProductIDs, cols...)
}

if in.GroupID != 0 {
cols, err := relationDB.NewDeviceInfoRepo(l.ctx).FindProductIDsByFilter(l.ctx, relationDB.DeviceFilter{GroupID: in.GroupID})
Expand Down
Loading

0 comments on commit 6183f55

Please sign in to comment.