Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
deae3ffa
Commit
deae3ffa
authored
Aug 01, 2024
by
DavidHuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
灰度逻辑
parent
1a74324d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
12 deletions
+11
-12
YHUatHelper.swift
.../galaxy/Classes/Modules/UatModule(灰度功能)/YHUatHelper.swift
+8
-6
YHUatHelperViewModel.swift
...lasses/Modules/UatModule(灰度功能)/YHUatHelperViewModel.swift
+3
-6
No files found.
galaxy/galaxy/Classes/Modules/UatModule(灰度功能)/YHUatHelper.swift
View file @
deae3ffa
...
...
@@ -10,14 +10,13 @@ import Foundation
extension
Int
{
//
命中结果 0-未找到该规则,走默认逻辑 1-未命中,2-命中
//
1-可见 2-不可见 3-新界面
var
uatValue
:
Bool
{
if
self
==
1
{
return
false
}
else
if
self
==
2
{
return
true
}
else
if
self
==
2
{
return
false
}
return
false
}
}
...
...
@@ -106,8 +105,11 @@ extension YHUatHelper {
if
let
arr
=
viewModel
.
dataList
?
.
list
{
for
(
_
,
item
)
in
arr
.
enumerated
()
{
if
item
.
module_number
.
int
==
module
.
rawValue
{
return
item
.
result
.
uatValue
if
item
.
module_number
.
int
==
module
.
rawValue
,
item
.
result
==
2
{
if
let
model
=
item
.
show_config
{
return
model
.
op
.
uatValue
}
return
module
.
defaultValue
}
}
}
...
...
galaxy/galaxy/Classes/Modules/UatModule(灰度功能)/YHUatHelperViewModel.swift
View file @
deae3ffa
...
...
@@ -10,10 +10,8 @@ import Foundation
import
HandyJSON
//{"op": 1}
class
YHUatModel2
:
HandyJSON
{
var
op
:
Int
=
-
1
var
op
:
Int
=
-
1
//"op": 1, //1-可见 2-不可见
required
init
()
{
}
}
...
...
@@ -36,7 +34,7 @@ class YHUatModel : HandyJSON {
*/
var
module_number
:
String
=
""
var
result
:
Int
=
0
//命中结果 0-未找到该规则,走默认逻辑 1-未命中,2-命中
var
show_config
:
String
=
""
var
show_config
:
YHUatModel2
?
required
init
()
{
}
...
...
@@ -59,8 +57,7 @@ extension YHUatHelperViewModel {
//请求灰度功能列表配置
func
getUatList
(
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
// let params: [String] = ["1", "2","3", "4","5","6", "7","9"]
let
params
:
[
String
]
=
[
"1"
]
let
params
:
[
String
]
=
[
"1"
,
"2"
,
"3"
,
"4"
,
"5"
,
"6"
,
"7"
,
"9"
]
var
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Uat
.
uatListApi
for
(
index
,
item
)
in
params
.
enumerated
()
{
if
index
==
0
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment