Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile
Commits
2b513c1e
Commit
2b513c1e
authored
Jun 14, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传卡组传参改为deckfile类型,添加云备份封面图显示
parent
00a459a6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
13 deletions
+18
-13
mobile/src/main/java/cn/garymb/ygomobile/bean/events/DeckFile.java
...c/main/java/cn/garymb/ygomobile/bean/events/DeckFile.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareApiUtil.java
...va/cn/garymb/ygomobile/deck_square/DeckSquareApiUtil.java
+10
-9
mobile/src/main/java/cn/garymb/ygomobile/deck_square/MyDeckListAdapter.java
...va/cn/garymb/ygomobile/deck_square/MyDeckListAdapter.java
+1
-0
mobile/src/main/java/cn/garymb/ygomobile/deck_square/api_response/PushCardJson.java
...rymb/ygomobile/deck_square/api_response/PushCardJson.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/DeckListAdapter.java
...java/cn/garymb/ygomobile/ui/adapters/DeckListAdapter.java
+1
-1
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODeckDialogUtil.java
...ain/java/cn/garymb/ygomobile/utils/YGODeckDialogUtil.java
+4
-1
No files found.
mobile/src/main/java/cn/garymb/ygomobile/bean/events/DeckFile.java
View file @
2b513c1e
...
...
@@ -59,7 +59,7 @@ public class DeckFile extends TextSelect {
}
public
int
getFirstCode
()
{
public
Integer
getFirstCode
()
{
return
firstCode
;
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/deck_square/DeckSquareApiUtil.java
View file @
2b513c1e
...
...
@@ -9,6 +9,7 @@ import java.io.IOException;
import
java.util.HashMap
;
import
java.util.Map
;
import
cn.garymb.ygomobile.bean.events.DeckFile
;
import
cn.garymb.ygomobile.deck_square.api_response.BasicResponse
;
import
cn.garymb.ygomobile.deck_square.api_response.DeckIdResponse
;
import
cn.garymb.ygomobile.deck_square.api_response.DownloadDeckResponse
;
...
...
@@ -155,10 +156,10 @@ public class DeckSquareApiUtil {
* 阻塞方法,用于推送新卡组。首先从服务器请求一个新的卡组id,之后将卡组上传到服务器
* 先同步推送,之后异步推送。首先调用服务端api获取卡组id,之后将卡组id设置到ydk中,之后调用服务器api将卡组上传
*
* @param deck
Path
* @param
deckName
* @param deck
file
* @param
loginToken
*/
public
static
PushDeckResponse
requestIdAndPushDeck
(
String
deckPath
,
String
deckNam
e
,
LoginToken
loginToken
)
throws
IOException
{
public
static
PushDeckResponse
requestIdAndPushDeck
(
DeckFile
deckFil
e
,
LoginToken
loginToken
)
throws
IOException
{
if
(
loginToken
==
null
)
{
return
null
;
...
...
@@ -189,7 +190,7 @@ public class DeckSquareApiUtil {
return
null
;
}
return
pushDeck
(
deck
Path
,
deckNam
e
,
loginToken
,
deckId
);
return
pushDeck
(
deck
Fil
e
,
loginToken
,
deckId
);
}
...
...
@@ -199,15 +200,14 @@ public class DeckSquareApiUtil {
* 如果在服务器存在deckId相同的记录,则更新卡组,deckName会覆盖服务器上的卡组名
* 如果在服务器存在deckName相同、deckId不同的记录,则更新失败
*
* @param deckPath
* @param deckName
* @param deckfile
* @param loginToken
* @param deckId
* @return
* @throws IOException
*/
private
static
PushDeckResponse
pushDeck
(
String
deckPath
,
String
deckNam
e
,
LoginToken
loginToken
,
String
deckId
)
throws
IOException
{
String
deckContent
=
DeckSquareFileUtil
.
setDeckId
(
deck
Path
,
loginToken
.
getUserId
(),
deckId
);
private
static
PushDeckResponse
pushDeck
(
DeckFile
deckfil
e
,
LoginToken
loginToken
,
String
deckId
)
throws
IOException
{
String
deckContent
=
DeckSquareFileUtil
.
setDeckId
(
deck
file
.
getPath
()
,
loginToken
.
getUserId
(),
deckId
);
PushDeckResponse
result
=
null
;
String
url
=
"http://rarnu.xyz:38383/api/mdpro3/sync/single"
;
...
...
@@ -223,7 +223,8 @@ public class DeckSquareApiUtil {
PushCardJson
.
DeckData
deckData
=
new
PushCardJson
.
DeckData
();
deckData
.
setDeckId
(
deckId
);
deckData
.
setDeckName
(
deckName
);
deckData
.
setDeckName
(
deckfile
.
getName
());
deckData
.
getDeckCoverCard1
(
deckfile
.
getFirstCode
());
deckData
.
setDelete
(
false
);
deckData
.
setDeckYdk
(
deckContent
);
pushCardJson
.
setDeck
(
deckData
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/deck_square/MyDeckListAdapter.java
View file @
2b513c1e
...
...
@@ -71,6 +71,7 @@ public class MyDeckListAdapter extends BaseQuickAdapter<MyDeckItem, BaseViewHold
item
.
setDeckSouce
(
1
);
item
.
setDeckId
(
detail
.
getDeckId
());
item
.
setUserId
(
detail
.
getUserId
());
item
.
setDeckCoverCard1
(
detail
.
getDeckCoverCard1
());
item
.
setUpdateDate
(
detail
.
getDeckUpdateDate
());
item
.
setPublic
(
detail
.
isPublic
());
myOnlineDecks
.
add
(
item
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/deck_square/api_response/PushCardJson.java
View file @
2b513c1e
...
...
@@ -57,7 +57,7 @@ public class PushCardJson {
this
.
deckName
=
deckName
;
}
public
Integer
getDeckCoverCard1
()
{
public
Integer
getDeckCoverCard1
(
Integer
firstCode
)
{
return
deckCoverCard1
;
}
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/adapters/DeckListAdapter.java
View file @
2b513c1e
...
...
@@ -94,7 +94,7 @@ public class DeckListAdapter<T extends TextSelect> extends BaseQuickAdapter<T, D
LogUtil
.
i
(
TAG
,
"deckFile "
+
deckFile
.
toString
());
//上传卡组
VUiKit
.
defer
().
when
(()
->
{
PushDeckResponse
result
=
DeckSquareApiUtil
.
requestIdAndPushDeck
(
deckFile
.
getPath
(),
deckFile
.
getName
()
,
loginToken
);
PushDeckResponse
result
=
DeckSquareApiUtil
.
requestIdAndPushDeck
(
deckFile
,
loginToken
);
return
result
;
}).
fail
(
e
->
{
...
...
mobile/src/main/java/cn/garymb/ygomobile/utils/YGODeckDialogUtil.java
View file @
2b513c1e
...
...
@@ -688,7 +688,10 @@ public class YGODeckDialogUtil {
ygoDialog
.
dismiss
();
}
public
void
hide
()
{
if
(
ygoDialog
!=
null
&&
ygoDialog
.
isShowing
())
ygoDialog
.
hide
();
}
}
}
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