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
4a31d2f8
Commit
4a31d2f8
authored
Jun 04, 2025
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 推送
parent
3464e93f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
3 deletions
+28
-3
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+2
-0
Applegate(JPush).swift
galaxy/galaxy/Applegate(JPush).swift
+6
-3
YHMsgViewModel.swift
...alaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
+19
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+1
-0
No files found.
galaxy/galaxy/AppDelegate.swift
View file @
4a31d2f8
...
@@ -22,6 +22,8 @@ import HyphenateChat
...
@@ -22,6 +22,8 @@ import HyphenateChat
@main
@main
class
AppDelegate
:
UIResponder
,
UIApplicationDelegate
,
WXApiDelegate
{
class
AppDelegate
:
UIResponder
,
UIApplicationDelegate
,
WXApiDelegate
{
private
lazy
var
liveViewModel
=
YHLiveSalesViewModel
()
private
lazy
var
liveViewModel
=
YHLiveSalesViewModel
()
let
viewModel
=
YHMsgViewModel
()
var
window
:
UIWindow
?
var
window
:
UIWindow
?
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
func
application
(
_
application
:
UIApplication
,
didFinishLaunchingWithOptions
launchOptions
:
[
UIApplication
.
LaunchOptionsKey
:
Any
]?)
->
Bool
{
...
...
galaxy/galaxy/Applegate(JPush).swift
View file @
4a31d2f8
...
@@ -120,15 +120,18 @@ extension AppDelegate: JPUSHRegisterDelegate {
...
@@ -120,15 +120,18 @@ extension AppDelegate: JPUSHRegisterDelegate {
goToMessagePage
()
goToMessagePage
()
if
let
msgType
=
userInfo
[
"msg_type"
]
as?
Int
,
msgType
==
YHMessageType
.
article
.
rawValue
{
if
let
msgType
=
userInfo
[
"msg_type"
]
as?
Int
,
msgType
==
YHMessageType
.
article
.
rawValue
{
let
model
=
YHNewsModel
()
let
model
=
YHNewsModel
()
model
.
id
=
userInfo
[
"msg_id"
]
as?
String
??
""
let
taskId
=
userInfo
[
"task_id"
]
as?
Int
??
0
model
.
article_id
=
userInfo
[
"article_id"
]
as?
Int
??
0
model
.
article_id
=
userInfo
[
"article_id"
]
as?
Int
??
0
model
.
news_type
=
userInfo
[
"news_type"
]
as?
Int
??
0
model
.
news_type
=
userInfo
[
"news_type"
]
as?
Int
??
0
model
.
cover_img
=
userInfo
[
"cover_img"
]
as?
String
??
""
model
.
cover_img
=
userInfo
[
"cover_img"
]
as?
String
??
""
model
.
url
=
userInfo
[
"url"
]
as?
String
??
""
model
.
url
=
userInfo
[
"url"
]
as?
String
??
""
model
.
media_url
=
userInfo
[
"media_url"
]
as?
String
??
""
model
.
media_url
=
userInfo
[
"media_url"
]
as?
String
??
""
model
.
media_transcode_url
=
userInfo
[
"media_transcode_url"
]
as?
String
??
""
model
.
media_transcode_url
=
userInfo
[
"media_transcode_url"
]
as?
String
??
""
printLog
(
"DDDDY:
\(
model
.
id
)
"
)
yh_newsList
.
enterDetail
(
model
)
yh_newsList
.
enterDetail
(
model
)
yh_newsList
.
markRead
(
model
)
self
.
viewModel
.
readMessage
(
taskId
:
taskId
)
{
_
,
_
in
}
}
}
})
})
}
}
...
...
galaxy/galaxy/Classes/Modules/Message(消息)/VM/YHMsgViewModel.swift
View file @
4a31d2f8
...
@@ -140,6 +140,25 @@ class YHMsgViewModel: NSObject {
...
@@ -140,6 +140,25 @@ class YHMsgViewModel: NSObject {
}
}
}
}
func
readMessage
(
taskId
:
Int
,
_
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Message
.
readPushMsgApi
let
params
:
[
String
:
Any
]
=
[
"type"
:
YHMessageType
.
article
.
rawValue
,
"task_id"
:
taskId
]
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
_
in
printLog
(
"model 是 ==>
\(
json
)
"
)
if
json
.
code
==
200
{
callBackBlock
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBackBlock
(
false
,
error
)
}
}
failBlock
:
{
error
in
callBackBlock
(
false
,
error
)
}
}
func
requestTotalUnreadMsgCount
(
_
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
func
requestTotalUnreadMsgCount
(
_
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Message
.
unreadTotalCountApi
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Message
.
unreadTotalCountApi
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
4a31d2f8
...
@@ -433,6 +433,7 @@ class YHAllApiName {
...
@@ -433,6 +433,7 @@ class YHAllApiName {
static
let
msgDetaiListApi
=
"infoflow/message/list/v2"
static
let
msgDetaiListApi
=
"infoflow/message/list/v2"
// 标记消息已读
// 标记消息已读
static
let
readMsgApi
=
"infoflow/read-push"
static
let
readMsgApi
=
"infoflow/read-push"
static
let
readPushMsgApi
=
"infoflow/read-push-from-bar"
// 获取未读消息总数
// 获取未读消息总数
static
let
unreadTotalCountApi
=
"infoflow/unread-total"
static
let
unreadTotalCountApi
=
"infoflow/unread-total"
// 报备设备信息
// 报备设备信息
...
...
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