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
cab92121
Commit
cab92121
authored
Jun 24, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首次人脉授权信息接口联调
parent
b3e79596
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
76 additions
and
17 deletions
+76
-17
YHInformationAuthorizationStepOneViewController.swift
...)/C/YHInformationAuthorizationStepOneViewController.swift
+30
-6
YHInformationAuthorizationStepTwoViewController.swift
...)/C/YHInformationAuthorizationStepTwoViewController.swift
+14
-3
YHPeopleViewController.swift
...sses/Modules/Community(社区)/C/YHPeopleViewController.swift
+5
-3
YHUserInformationModel.swift
...sses/Modules/Community(社区)/M/YHUserInformationModel.swift
+21
-3
YHInformationAuthorizeViewModel.swift
...es/Community(社区)/VM/YHInformationAuthorizeViewModel.swift
+0
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+2
-0
YHOSSManager.swift
galaxy/galaxy/Classes/Tools/Upload/YHOSSManager.swift
+4
-2
No files found.
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHInformationAuthorizationStepOneViewController.swift
View file @
cab92121
...
@@ -27,8 +27,20 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
...
@@ -27,8 +27,20 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
}
}
func
getData
()
{
func
getData
()
{
items
=
viewModel
.
getBaseDataSource
()
viewModel
.
requestUserInfo
{[
weak
self
]
success
,
error
in
tableView
.
reloadData
()
guard
let
self
=
self
else
{
return
}
self
.
items
=
viewModel
.
getBaseDataSource
()
self
.
tableView
.
reloadData
()
let
url
=
URL
(
string
:
self
.
viewModel
.
model
.
avatar
)
self
.
photoImageView
.
kf
.
setImage
(
with
:
url
)
if
self
.
viewModel
.
isCanNext
()
{
nextButton
.
isEnabled
=
true
nextButton
.
backgroundColor
=
UIColor
.
brandMainColor
}
else
{
nextButton
.
isEnabled
=
false
nextButton
.
backgroundColor
=
UIColor
.
brandMainColor
.
withAlphaComponent
(
0.4
)
}
}
}
}
func
setView
()
{
func
setView
()
{
...
@@ -164,16 +176,27 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
...
@@ -164,16 +176,27 @@ class YHInformationAuthorizationStepOneViewController: YHBaseViewController {
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
YHImagePickerView
.
show
()
{[
weak
self
]
image
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
self
.
photoImageView
.
image
=
image
self
.
photoImageView
.
image
=
image
self
.
viewModel
.
uploadImage
(
image
,
true
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
viewModel
.
model
.
avatar
=
success
??
""
}
}
}
}
}
@objc
func
changeHead
()
{
@objc
func
changeHead
()
{
viewModel
.
requestChangeHead
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
let
url
=
URL
(
string
:
self
.
viewModel
.
model
.
avatar
)
self
.
photoImageView
.
kf
.
setImage
(
with
:
url
)
}
}
}
@objc
func
nextStep
()
{
@objc
func
nextStep
()
{
let
vc
=
YHInformationAuthorizationStepTwoViewController
()
viewModel
.
requestSaveUserInfo
{[
weak
self
]
success
,
error
in
self
.
navigationController
?
.
pushViewController
(
vc
)
guard
let
self
=
self
else
{
return
}
let
vc
=
YHInformationAuthorizationStepTwoViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
}
}
...
@@ -196,7 +219,8 @@ extension YHInformationAuthorizationStepOneViewController: UITableViewDelegate,
...
@@ -196,7 +219,8 @@ extension YHInformationAuthorizationStepOneViewController: UITableViewDelegate,
nextButton
.
backgroundColor
=
UIColor
.
brandMainColor
.
withAlphaComponent
(
0.4
)
nextButton
.
backgroundColor
=
UIColor
.
brandMainColor
.
withAlphaComponent
(
0.4
)
}
}
if
model
.
id
!=
.
id1
&&
model
.
id
!=
.
id3
&&
model
.
id
!=
.
id5
{
if
model
.
id
!=
.
id1
&&
model
.
id
!=
.
id3
&&
model
.
id
!=
.
id5
{
self
.
getData
()
self
.
items
=
viewModel
.
getBaseDataSource
()
self
.
tableView
.
reloadData
()
}
}
}
}
return
cell
return
cell
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHInformationAuthorizationStepTwoViewController.swift
View file @
cab92121
...
@@ -24,8 +24,16 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
...
@@ -24,8 +24,16 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
}
}
func
getData
()
{
func
getData
()
{
items
=
viewModel
.
getBaseSetDataSource
()
if
stepFlag
{
tableView
.
reloadData
()
items
=
viewModel
.
getBaseSetDataSource
()
tableView
.
reloadData
()
}
else
{
viewModel
.
requestUserAuthorization
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
items
=
viewModel
.
getBaseSetDataSource
()
tableView
.
reloadData
()
}
}
}
}
func
setView
()
{
func
setView
()
{
...
@@ -106,7 +114,10 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
...
@@ -106,7 +114,10 @@ class YHInformationAuthorizationStepTwoViewController: UIViewController {
}
}
@objc
func
nextStep
()
{
@objc
func
nextStep
()
{
viewModel
.
requestAuthorizationSubmit
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/C/YHPeopleViewController.swift
View file @
cab92121
...
@@ -153,9 +153,11 @@ class YHPeopleViewController: YHBaseViewController {
...
@@ -153,9 +153,11 @@ class YHPeopleViewController: YHBaseViewController {
return
return
}
}
let
view
=
YHPeopleSuccessView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
))
// let view = YHPeopleSuccessView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight))
let
window
=
UIApplication
.
shared
.
yhKeyWindow
()
// let window = UIApplication.shared.yhKeyWindow()
window
?
.
addSubview
(
view
)
// window?.addSubview(view)
let
vc
=
YHInformationAuthorizationStepOneViewController
()
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
func
resetAnimation
()
{
func
resetAnimation
()
{
...
...
galaxy/galaxy/Classes/Modules/Community(社区)/M/YHUserInformationModel.swift
View file @
cab92121
...
@@ -56,8 +56,26 @@ class YHMainUserInformationModel: YHBaseModel {
...
@@ -56,8 +56,26 @@ class YHMainUserInformationModel: YHBaseModel {
}
}
class
YHMainUserInformationSetModel
:
YHBaseModel
{
class
YHMainUserInformationSetModel
:
YHBaseModel
{
var
isRea
:
Bool
=
true
var
uid
:
String
=
""
var
isWork
:
Bool
=
true
var
information_to_card
:
Int
=
2
var
isSchool
:
Bool
=
true
var
authorization_basic_information
:
Int
=
2
var
public_education_experience
:
Int
=
2
var
public_work_experience
:
Int
=
2
var
isclick_card
:
Int
=
2
}
class
YHUserInformationDetailModel
:
YHBaseModel
{
var
username
:
String
=
""
var
avatar
:
String
=
""
var
address
:
YHUserInformationDetailAddressModel
=
YHUserInformationDetailAddressModel
()
var
college
:
String
=
""
var
industry
:
String
=
""
var
position
:
String
=
""
}
class
YHUserInformationDetailAddressModel
:
YHBaseModel
{
var
country
:
String
=
""
var
province
:
String
=
""
var
city
:
String
=
""
}
}
galaxy/galaxy/Classes/Modules/Community(社区)/VM/YHInformationAuthorizeViewModel.swift
View file @
cab92121
This diff is collapsed.
Click to expand it.
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
cab92121
...
@@ -320,6 +320,8 @@ class YHAllApiName {
...
@@ -320,6 +320,8 @@ class YHAllApiName {
static
let
change
=
"super-app/avatar/change"
static
let
change
=
"super-app/avatar/change"
static
let
userSubmit
=
"super-app/user-base/submit"
static
let
userSubmit
=
"super-app/user-base/submit"
static
let
authorizationSubmit
=
"super-app/authorization/submit"
static
let
authorizationSubmit
=
"super-app/authorization/submit"
static
let
userInfo
=
"super-app/user-base/info"
static
let
userAuthorization
=
"super-app/user/authorization"
}
}
}
}
galaxy/galaxy/Classes/Tools/Upload/YHOSSManager.swift
View file @
cab92121
...
@@ -69,7 +69,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
...
@@ -69,7 +69,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
}
}
func
putObject
(
image
:
UIImage
,
_
isPublic
:
Bool
=
false
,
callBackBlock
:
@escaping
(
_
success
:
String
?,
_
error
:
YHErrorModel
?)
->
())
{
func
putObject
(
image
:
UIImage
,
_
isPublic
:
Bool
=
false
,
callBackBlock
:
@escaping
(
_
success
:
String
?,
_
error
:
YHErrorModel
?)
->
())
{
let
request
=
OSSPutObjectRequest
()
let
request
=
OSSPutObject
ACL
Request
()
let
size
=
Int
(
2
*
1024
*
1024
)
let
size
=
Int
(
2
*
1024
*
1024
)
guard
let
imageData
=
image
.
compressOriginalImage
(
size
)
else
{
guard
let
imageData
=
image
.
compressOriginalImage
(
size
)
else
{
callBackBlock
(
nil
,
YHErrorModel
())
callBackBlock
(
nil
,
YHErrorModel
())
...
@@ -87,6 +87,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
...
@@ -87,6 +87,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
let
currentDateMMdd
=
dateFormatter
.
string
(
from
:
Date
())
let
currentDateMMdd
=
dateFormatter
.
string
(
from
:
Date
())
self
.
fileName
.
append
(
name
)
self
.
fileName
.
append
(
name
)
if
isPublic
{
if
isPublic
{
request
.
acl
=
"public-read-write"
request
.
objectKey
=
"5000000"
+
"/"
+
currentDateMMdd
+
"/"
+
"
\(
name
)
"
request
.
objectKey
=
"5000000"
+
"/"
+
currentDateMMdd
+
"/"
+
"
\(
name
)
"
}
else
{
}
else
{
request
.
objectKey
=
"4001001"
+
"/"
+
currentDateMMdd
+
"/"
+
"
\(
name
)
"
request
.
objectKey
=
"4001001"
+
"/"
+
currentDateMMdd
+
"/"
+
"
\(
name
)
"
...
@@ -121,7 +122,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
...
@@ -121,7 +122,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
}
}
func
putFile
(
file
:
String
,
_
isPublic
:
Bool
=
false
,
callBackBlock
:
@escaping
(
_
success
:
String
?,
_
error
:
YHErrorModel
?)
->
())
{
func
putFile
(
file
:
String
,
_
isPublic
:
Bool
=
false
,
callBackBlock
:
@escaping
(
_
success
:
String
?,
_
error
:
YHErrorModel
?)
->
())
{
let
request
=
OSSPutObjectRequest
()
let
request
=
OSSPutObject
ACL
Request
()
guard
let
fileData
=
try
?
Data
(
contentsOf
:
URL
(
string
:
file
)
??
URL
(
fileURLWithPath
:
""
))
else
{
guard
let
fileData
=
try
?
Data
(
contentsOf
:
URL
(
string
:
file
)
??
URL
(
fileURLWithPath
:
""
))
else
{
callBackBlock
(
nil
,
YHErrorModel
())
callBackBlock
(
nil
,
YHErrorModel
())
return
return
...
@@ -138,6 +139,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
...
@@ -138,6 +139,7 @@ class YHOSSManager: NSObject, URLSessionDelegate {
dateFormatter
.
dateFormat
=
"yyyyMMdd"
dateFormatter
.
dateFormat
=
"yyyyMMdd"
let
currentDateMMdd
=
dateFormatter
.
string
(
from
:
Date
())
let
currentDateMMdd
=
dateFormatter
.
string
(
from
:
Date
())
if
isPublic
{
if
isPublic
{
request
.
acl
=
"public-read-write"
request
.
objectKey
=
"5000000"
+
"/"
+
currentDateMMdd
+
"/"
+
"
\(
name
)
"
request
.
objectKey
=
"5000000"
+
"/"
+
currentDateMMdd
+
"/"
+
"
\(
name
)
"
}
else
{
}
else
{
request
.
objectKey
=
"4001001"
+
"/"
+
currentDateMMdd
+
"/"
+
"
\(
name
)
"
request
.
objectKey
=
"4001001"
+
"/"
+
currentDateMMdd
+
"/"
+
"
\(
name
)
"
...
...
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