Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
GMPhobos
Project
Project
Details
Activity
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gengmeiios
GMPhobos
Commits
0480fb9a
Commit
0480fb9a
authored
Aug 24, 2020
by
yueming lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加唯一标识字段
parent
9f212bfe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
GMPhobosPageViewModel.m
GMPhobos/Classes/PhobosDataStorage/GMPhobosPageViewModel.m
+4
-1
GMPhobosSqulitModel.m
GMPhobos/Classes/PhobosDataStorage/GMPhobosSqulitModel.m
+3
-1
PhobosDataManager.m
GMPhobos/Classes/PhobosDataStorage/PhobosDataManager.m
+2
-2
No files found.
GMPhobos/Classes/PhobosDataStorage/GMPhobosPageViewModel.m
View file @
0480fb9a
...
...
@@ -20,9 +20,12 @@
GMPhobosPageViewModel
*
model
=
[[
GMPhobosPageViewModel
alloc
]
init
];
//共有参数
model
.
table_name
=
name
;
model
.
data
=
[
GMPhobosTool
dictionaryToJsonString
:
data
];
NSTimeInterval
time
=
[[
NSDate
date
]
timeIntervalSince1970
]
*
1000
;
model
.
message_item_id
=
[
NSString
stringWithFormat
:
@"%.f/%lld"
,
time
,
mach_absolute_time
()];
NSMutableDictionary
*
messageDict
=
[
NSMutableDictionary
dictionaryWithDictionary
:
data
];
[
messageDict
setValue
:
model
.
message_item_id
forKey
:
@"message_item_id"
];
model
.
data
=
[
GMPhobosTool
dictionaryToJsonString
:
messageDict
];
NSLog
(
@"referrer_link*******%@"
,
messageDict
[
@"referrer_link"
]);
model
.
status
=
PhobosDataSendStatus_wait
;
model
.
phobos_type
=
phobosType
;
model
.
api
=
urlapi
;
...
...
GMPhobos/Classes/PhobosDataStorage/GMPhobosSqulitModel.m
View file @
0480fb9a
...
...
@@ -17,9 +17,11 @@
immediately
:(
BOOL
)
status
{
GMPhobosSqulitModel
*
model
=
[
GMPhobosSqulitModel
new
];
model
.
table_name
=
name
;
model
.
data
=
[
GMPhobosTool
dictionaryToJsonString
:
data
];
NSTimeInterval
time
=
[[
NSDate
date
]
timeIntervalSince1970
]
*
1000
;
model
.
message_item_id
=
[
NSString
stringWithFormat
:
@"%.f/%lld"
,
time
,
mach_absolute_time
()];
NSMutableDictionary
*
dict
=
[
NSMutableDictionary
dictionaryWithDictionary
:
data
];
[
dict
setValue
:
model
.
message_item_id
forKey
:
@"message_item_id"
];
model
.
data
=
[
GMPhobosTool
dictionaryToJsonString
:
dict
];
model
.
status
=
PhobosDataSendStatus_wait
;
model
.
phobos_type
=
phobosType
;
model
.
api
=
urlapi
;
...
...
GMPhobos/Classes/PhobosDataStorage/PhobosDataManager.m
View file @
0480fb9a
...
...
@@ -200,7 +200,7 @@ static PhobosDataManager *dataManager;
for
(
GMPhobosSqulitModel
*
model
in
entities
)
{
NSString
*
whereStr
=
[
NSString
stringWithFormat
:
@"where message_item_id = '%@'"
,
model
.
message_item_id
];
bool
status
=
[
_squlitManager
gm_deleteTable
:
model
.
table_name
whereFormat
:
whereStr
];
NSLog
(
@"删除状态:%d"
,
status
);
NSLog
(
@"
发送数据成功-
删除状态:%d"
,
status
);
}
}
...
...
@@ -211,7 +211,7 @@ static PhobosDataManager *dataManager;
bool
status
=
[
_squlitManager
gm_updateTable
:
model
.
table_name
dicOrModel
:
@{
@"status"
:
@
(
PhobosDataSendStatus_error
)}
whereFormat
:
whereStr
];
NSLog
(
@"发送失败后修改状态:%d"
,
status
);
NSLog
(
@"发送失败后
-
修改状态:%d"
,
status
);
}
}
...
...
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