项目初始化提交,移除仓库默认README
build / build-push (push) Failing after 48s

This commit is contained in:
chenxing
2026-08-21 09:37:21 +08:00
parent 729e1d0c35
commit 000993df80
30 changed files with 1497 additions and 0 deletions
@@ -0,0 +1,42 @@
package com.yunhai.userhome.service.impl;
import com.yunhai.platform.openapi.client.YschBaseOpenApi;
import com.yunhai.platform.utils.enums.ClientEnum;
import com.yunhai.platform.utils.model.BoaApp;
import com.yunhai.platform.utils.model.BoaAppType;
import com.yunhai.platform.utils.model.BoaUser;
import com.yunhai.userhome.service.AppRemoteService;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
/**
* {@link AppRemoteService} 真实实现:经 yh-platform {@code YschBaseOpenApi} 调 UserBase
* {@code GET /oapi/app/list?userId=&clientType=}(自动带 app-auth 签名)。
*/
@Service
public class OpenApiAppRemoteServiceImpl implements AppRemoteService {
@Override
public List<BoaAppType> getUserApps(BoaUser user) {
if (user == null || user.getId() == null) {
return Collections.emptyList();
}
// PC 浏览器端;UserBase 侧已按 userId 权限过滤(组开通 ∪ 角色模块所属应用,超管全量)
return YschBaseOpenApi.getUserApp(user.getId(), ClientEnum.PC_BROWSER);
}
@Override
public Optional<BoaApp> getAppById(BoaUser user, Integer appId) {
if (appId == null) {
return Optional.empty();
}
return getUserApps(user).stream()
.filter(t -> t.getApps() != null)
.flatMap(t -> t.getApps().stream())
.filter(a -> appId.equals(a.getId()))
.findFirst();
}
}