[新加坡类型添加]
This commit is contained in:
yangyakun
2026-03-25 14:50:57 +08:00
parent 62c682c446
commit 62e0def581
17 changed files with 27 additions and 16 deletions

View File

@@ -168,7 +168,8 @@ enum class ProjectType {
dali,
mogo,
saas,
yantai
yantai,
singapore,
}
enum class EnvType {

View File

@@ -35,6 +35,7 @@ object FlavorUtils {
Project.DALI -> info.append("dali")
Project.MOGO -> info.append("mogo")
Project.YANTAI -> info.append("yantai")
Project.SINGAPORE -> info.append("singapore")
}
if (AppIdentityModeUtils.isT1T2(FunctionBuildConfig.appIdentityMode)) {
@@ -147,6 +148,7 @@ object FlavorUtils {
Project.DALI -> ProjectType.dali
Project.MOGO -> ProjectType.mogo
Project.YANTAI -> ProjectType.yantai
Project.SINGAPORE -> ProjectType.singapore
}
envType = when (DebugConfig.getNetMode()) {

View File

@@ -63,6 +63,9 @@ abstract class MyDataBase : RoomDatabase() {
fun getDBName():MyDataBase{
val roomName = when (ProjectUtils.getProjectType()) {
Project.SINGAPORE -> {
"singapore_offline_db"
}
Project.SAAS -> {
"saas_offline_db"
}

View File

@@ -37,7 +37,7 @@ object RepositoryManager {
get() {
if (field == null) {
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if (AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
field = WeaknetRepository()
CallerLogger.d(TAG, "saas shuttle 支持db")
@@ -80,7 +80,7 @@ object RepositoryManager {
get() {
if (field == null) {
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if (AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
field = WriteOffCacheRepository()
CallerLogger.d(TAG, "saas shuttle 核销缓存")

View File

@@ -135,7 +135,7 @@ abstract class MyDataBase : RoomDatabase() {
fun getDBName(): MyDataBase {
val roomName = when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if (AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
"shuttle_db"
} else if (AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {

View File

@@ -39,7 +39,7 @@ class NormalRepository : ILineRepository {
get() {
if (field == null) {
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if (AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
// throw NetException("非缓存weakNetInterface 初始化环境错误 isBus")
throw NetException(StringUtils.getString(R.string.module_och_init_env_error_bus))

View File

@@ -54,7 +54,7 @@ class WeaknetRepository : ILineRepository {
get() {
if (field == null) {
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if (AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
field = SaasShuttleServiceManager
} else if (AppIdentityModeUtils.isScheduled(FunctionBuildConfig.appIdentityMode)) {

View File

@@ -40,7 +40,7 @@ class WriteOffCacheRepository : IWriteOffRepository {
get() {
if(field==null){
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
field = SaasScheduledServiceManager
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {

View File

@@ -35,7 +35,7 @@ class WriteOffNormallRepository: IWriteOffRepository {
get() {
if(field==null){
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
// throw NetException("writeoff 核销 初始化环境错误 SAAS")
throw NetException(StringUtils.getString(R.string.module_och_verification_init_env_error_saas))
}

View File

@@ -36,7 +36,7 @@ object RepositoryManager {
get() {
if(field==null){
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
field = WeaknetRepository()
CallerLogger.d(TAG,"saas shuttle 支持db")
@@ -76,7 +76,7 @@ object RepositoryManager {
get() {
if(field==null){
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
field = WriteOffCacheRepository()
CallerLogger.d(TAG,"saas shuttle 核销缓存")

View File

@@ -135,7 +135,7 @@ abstract class MyDataBase : RoomDatabase() {
fun getDBName():MyDataBase{
val roomName = when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
"shuttle_db"
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {

View File

@@ -39,7 +39,7 @@ class NormalRepository: ILineRepository {
get() {
if(field==null){
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
// throw NetException("非缓存weakNetInterface 初始化环境错误 isBus")
throw NetException(StringUtils.getString(R.string.module_och_init_env_error_bus))

View File

@@ -54,7 +54,7 @@ class WeaknetRepository : ILineRepository {
get() {
if(field==null){
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
field = SaasShuttleServiceManager
}else if(AppIdentityModeUtils.isScheduled(FunctionBuildConfig.appIdentityMode)) {

View File

@@ -40,7 +40,7 @@ class WriteOffCacheRepository : IWriteOffRepository {
get() {
if(field==null){
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
if(AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
field = SaasScheduledServiceManager
}else if(AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) {

View File

@@ -35,7 +35,7 @@ class WriteOffNormallRepository: IWriteOffRepository {
get() {
if(field==null){
when (ProjectUtils.getProjectType()) {
Project.SAAS -> {
Project.SAAS,Project.SINGAPORE -> {
// throw NetException("writeoff 核销 初始化环境错误 SAAS")
throw NetException(StringUtils.getString(R.string.module_och_verification_init_env_error_saas))
}

View File

@@ -88,7 +88,7 @@ object ToolKitDataManager : IToolKitItemClickListener, IDataCenterBizListener {
ToolTypeEnum.OPERATION_PANEL.name,
getDefaultItemView(ctx, "运营面板", R.drawable.icon_toolkit_item_operation_panel)
)
if (ProjectUtils.isSaas()) {
if (ProjectUtils.isSaas()||ProjectUtils.isSingapore()) {
it += ToolKitBean(
ToolTypeEnum.TAKE_OVER_HISTORY.name,
getDefaultItemView(

View File

@@ -7,6 +7,10 @@ object ProjectUtils {
return DebugConfig.getProjectFlavor() == Project.SAAS.value
}
fun isSingapore(): Boolean {
return DebugConfig.getProjectFlavor() == Project.SINGAPORE.value
}
fun isDali(): Boolean {
return DebugConfig.getProjectFlavor() == Project.DALI.value
}
@@ -44,6 +48,7 @@ object ProjectUtils {
enum class Project(val value: String) {
SAAS("saas"),
SINGAPORE("singapore"),
DALI("dali"),
MOGO("mogo"),
YANTAI("yantai")