Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
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
MyCard
console
Commits
5093f333
Commit
5093f333
authored
Jul 23, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add full
parent
b9138d83
Pipeline
#39414
passed with stages
in 1 minute and 34 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
console-api/src/update/update.controller.ts
console-api/src/update/update.controller.ts
+4
-2
console-api/src/update/update.service.ts
console-api/src/update/update.service.ts
+2
-2
No files found.
console-api/src/update/update.controller.ts
View file @
5093f333
...
@@ -42,15 +42,17 @@ export class UpdateController {
...
@@ -42,15 +42,17 @@ export class UpdateController {
@
ApiOperation
({
summary
:
'
获取 app 完整包 metalink
'
,
description
:
'
只包含完整包的
'
})
@
ApiOperation
({
summary
:
'
获取 app 完整包 metalink
'
,
description
:
'
只包含完整包的
'
})
@
ApiParam
({
name
:
'
id
'
,
description
:
'
APP 的 id
'
})
@
ApiParam
({
name
:
'
id
'
,
description
:
'
APP 的 id
'
})
@
ApiParam
({
name
:
'
version
'
,
description
:
'
APP 的版本号
'
})
@
ApiParam
({
name
:
'
version
'
,
description
:
'
APP 的版本号
'
})
@
ApiParam
({
name
:
'
full
'
,
description
:
'
强制使用完整包
'
})
@
ApiOkResponse
({
type
:
String
})
@
ApiOkResponse
({
type
:
String
})
// @Header('Cache-Control', 'public, max-age=31536000, immutable')
// @Header('Cache-Control', 'public, max-age=31536000, immutable')
async
getFullPackageMetalink
(
async
getFullPackageMetalink
(
@
Param
(
'
id
'
)
id
:
string
,
@
Param
(
'
id
'
)
id
:
string
,
@
Query
(
new
ValidationPipe
({
transform
:
true
}))
depot
:
DepotDto
,
@
Query
(
new
ValidationPipe
({
transform
:
true
}))
depot
:
DepotDto
,
@
Param
(
'
version
'
)
version
:
string
,
@
Param
(
'
version
'
)
version
:
string
,
@
Ip
()
ip
:
string
@
Ip
()
ip
:
string
,
@
Query
(
'
full
'
)
full
:
string
|
undefined
=
undefined
)
{
)
{
return
this
.
updateService
.
getFullPackageMetalink
(
id
,
depot
,
version
,
ip
);
return
this
.
updateService
.
getFullPackageMetalink
(
id
,
depot
,
version
,
ip
,
!!
full
);
}
}
@
Get
(
'
single/:path
'
)
@
Get
(
'
single/:path
'
)
...
...
console-api/src/update/update.service.ts
View file @
5093f333
...
@@ -158,7 +158,7 @@ export class UpdateService extends ConsoleLogger {
...
@@ -158,7 +158,7 @@ export class UpdateService extends ConsoleLogger {
};
};
}
}
async
getFullPackageMetalink
(
id
:
string
,
depotDto
:
DepotDto
,
version
:
string
,
ip
:
string
)
{
async
getFullPackageMetalink
(
id
:
string
,
depotDto
:
DepotDto
,
version
:
string
,
ip
:
string
,
full
=
false
)
{
const
tryRole
=
(
role
:
ArchiveType
,
noErrorExit
=
false
)
=>
const
tryRole
=
(
role
:
ArchiveType
,
noErrorExit
=
false
)
=>
this
.
getArchives
(
this
.
getArchives
(
id
,
id
,
...
@@ -167,7 +167,7 @@ export class UpdateService extends ConsoleLogger {
...
@@ -167,7 +167,7 @@ export class UpdateService extends ConsoleLogger {
(
qb
)
=>
qb
.
select
([
'
archive.hash
'
,
'
archive.path
'
,
'
archive.size
'
]).
andWhere
(
'
archive.role = :role
'
,
{
role
}),
(
qb
)
=>
qb
.
select
([
'
archive.hash
'
,
'
archive.path
'
,
'
archive.size
'
]).
andWhere
(
'
archive.role = :role
'
,
{
role
}),
noErrorExit
noErrorExit
);
);
let
archives
=
await
tryRole
(
ArchiveType
.
Fulls
,
true
);
let
archives
=
full
?
[]
:
await
tryRole
(
ArchiveType
.
Fulls
,
true
);
if
(
!
archives
.
length
)
{
if
(
!
archives
.
length
)
{
archives
=
await
tryRole
(
ArchiveType
.
Full
);
archives
=
await
tryRole
(
ArchiveType
.
Full
);
}
}
...
...
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