x
Build docker and publish / build (20.15.1) (push) Has been cancelled

This commit is contained in:
2026-05-06 03:19:04 -07:00
parent 559d59b4f8
commit 463d3e2315
@@ -28,12 +28,15 @@ func NewGetDeviceListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get
func (l *GetDeviceListLogic) GetDeviceList() (resp *types.GetDeviceListResponse, err error) { func (l *GetDeviceListLogic) GetDeviceList() (resp *types.GetDeviceListResponse, err error) {
userInfo := l.ctx.Value(constant.CtxKeyUser).(*user.User) userInfo := l.ctx.Value(constant.CtxKeyUser).(*user.User)
scopeHelper := newFamilyScopeHelper(l.ctx, l.svcCtx) // 只查当前用户自己的设备(不查家庭组其他成员的设备)
scopeUserIds, err := scopeHelper.resolveScopedUserIds(userInfo.Id) // 原始代码(保留以供对照):
if err != nil { // scopeHelper := newFamilyScopeHelper(l.ctx, l.svcCtx)
return nil, err // scopeUserIds, err := scopeHelper.resolveScopedUserIds(userInfo.Id)
} // if err != nil {
list, count, err := l.svcCtx.UserModel.QueryDeviceListByUserIds(l.ctx, scopeUserIds) // return nil, err
// }
// list, count, err := l.svcCtx.UserModel.QueryDeviceListByUserIds(l.ctx, scopeUserIds)
list, count, err := l.svcCtx.UserModel.QueryDeviceList(l.ctx, userInfo.Id)
if err != nil { if err != nil {
return nil, err return nil, err
} }