Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
50784c10
authored
Jun 18, 2026
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(api): change subscription product options and catalog endpoints to use GET method
parent
b8f5ba4a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
19 deletions
+10
-19
controller/topup_waffo_pancake.go
+5
-14
router/api-router.go
+2
-2
web/default/src/features/subscriptions/api.ts
+1
-1
web/default/src/features/system-settings/integrations/waffo-pancake-api.ts
+2
-2
No files found.
controller/topup_waffo_pancake.go
View file @
50784c10
...
@@ -103,11 +103,6 @@ func getWaffoPancakeBuyerEmail(user *model.User) string {
...
@@ -103,11 +103,6 @@ func getWaffoPancakeBuyerEmail(user *model.User) string {
// the body and fall back to persisted creds when the body is blank (see
// the body and fall back to persisted creds when the body is blank (see
// resolveWaffoPancakeAdminCreds). Only SaveWaffoPancake writes to OptionMap.
// resolveWaffoPancakeAdminCreds). Only SaveWaffoPancake writes to OptionMap.
type
waffoPancakeCredsRequest
struct
{
MerchantID
string
`json:"merchant_id"`
PrivateKey
string
`json:"private_key"`
}
type
saveWaffoPancakeRequest
struct
{
type
saveWaffoPancakeRequest
struct
{
MerchantID
string
`json:"merchant_id"`
MerchantID
string
`json:"merchant_id"`
PrivateKey
string
`json:"private_key"`
PrivateKey
string
`json:"private_key"`
...
@@ -221,15 +216,11 @@ func CreateWaffoPancakePair(c *gin.Context) {
...
@@ -221,15 +216,11 @@ func CreateWaffoPancakePair(c *gin.Context) {
// Doubles as a credential probe (a successful 200 proves the resolved creds
// Doubles as a credential probe (a successful 200 proves the resolved creds
// authenticate). See resolveWaffoPancakeAdminCreds for credential resolution.
// authenticate). See resolveWaffoPancakeAdminCreds for credential resolution.
func
ListWaffoPancakeCatalog
(
c
*
gin
.
Context
)
{
func
ListWaffoPancakeCatalog
(
c
*
gin
.
Context
)
{
var
req
waffoPancakeCredsRequest
// Missing query creds mean "use persisted creds".
// An empty body means "use persisted creds"; only fail on malformed JSON.
merchantID
,
privateKey
:=
resolveWaffoPancakeAdminCreds
(
if
c
.
Request
.
ContentLength
>
0
{
strings
.
TrimSpace
(
c
.
Query
(
"merchant_id"
)),
if
err
:=
c
.
ShouldBindJSON
(
&
req
);
err
!=
nil
{
strings
.
TrimSpace
(
c
.
Query
(
"private_key"
)),
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"message"
:
"error"
,
"data"
:
"参数错误"
})
)
return
}
}
merchantID
,
privateKey
:=
resolveWaffoPancakeAdminCreds
(
req
.
MerchantID
,
req
.
PrivateKey
)
if
merchantID
==
""
||
privateKey
==
""
{
if
merchantID
==
""
||
privateKey
==
""
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"message"
:
"error"
,
"data"
:
"Waffo Pancake 凭证未配置"
})
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"message"
:
"error"
,
"data"
:
"Waffo Pancake 凭证未配置"
})
return
return
...
...
router/api-router.go
View file @
50784c10
...
@@ -191,11 +191,11 @@ func SetApiRouter(router *gin.Engine) {
...
@@ -191,11 +191,11 @@ func SetApiRouter(router *gin.Engine) {
optionRoute
.
DELETE
(
"/channel_affinity_cache"
,
controller
.
ClearChannelAffinityCache
)
optionRoute
.
DELETE
(
"/channel_affinity_cache"
,
controller
.
ClearChannelAffinityCache
)
optionRoute
.
POST
(
"/rest_model_ratio"
,
controller
.
ResetModelRatio
)
optionRoute
.
POST
(
"/rest_model_ratio"
,
controller
.
ResetModelRatio
)
optionRoute
.
POST
(
"/migrate_console_setting"
,
controller
.
MigrateConsoleSetting
)
// 用于迁移检测的旧键,下个版本会删除
optionRoute
.
POST
(
"/migrate_console_setting"
,
controller
.
MigrateConsoleSetting
)
// 用于迁移检测的旧键,下个版本会删除
optionRoute
.
POS
T
(
"/waffo-pancake/catalog"
,
controller
.
ListWaffoPancakeCatalog
)
optionRoute
.
GE
T
(
"/waffo-pancake/catalog"
,
controller
.
ListWaffoPancakeCatalog
)
optionRoute
.
POST
(
"/waffo-pancake/pair"
,
controller
.
CreateWaffoPancakePair
)
optionRoute
.
POST
(
"/waffo-pancake/pair"
,
controller
.
CreateWaffoPancakePair
)
optionRoute
.
POST
(
"/waffo-pancake/save"
,
controller
.
SaveWaffoPancake
)
optionRoute
.
POST
(
"/waffo-pancake/save"
,
controller
.
SaveWaffoPancake
)
optionRoute
.
POST
(
"/waffo-pancake/subscription-product"
,
controller
.
CreateWaffoPancakeSubscriptionProduct
)
optionRoute
.
POST
(
"/waffo-pancake/subscription-product"
,
controller
.
CreateWaffoPancakeSubscriptionProduct
)
optionRoute
.
POS
T
(
"/waffo-pancake/subscription-product-options"
,
controller
.
ListWaffoPancakeSubscriptionProductOptions
)
optionRoute
.
GE
T
(
"/waffo-pancake/subscription-product-options"
,
controller
.
ListWaffoPancakeSubscriptionProductOptions
)
}
}
// Custom OAuth provider management (root only)
// Custom OAuth provider management (root only)
...
...
web/default/src/features/subscriptions/api.ts
View file @
50784c10
...
@@ -159,7 +159,7 @@ export async function listWaffoPancakeSubscriptionProductOptions(): Promise<
...
@@ -159,7 +159,7 @@ export async function listWaffoPancakeSubscriptionProductOptions(): Promise<
products
:
{
id
:
string
;
name
:
string
;
status
:
string
}[]
products
:
{
id
:
string
;
name
:
string
;
status
:
string
}[]
}
>
}
>
>
{
>
{
const
res
=
await
api
.
pos
t
(
const
res
=
await
api
.
ge
t
(
'/api/option/waffo-pancake/subscription-product-options'
'/api/option/waffo-pancake/subscription-product-options'
)
)
return
res
.
data
return
res
.
data
...
...
web/default/src/features/system-settings/integrations/waffo-pancake-api.ts
View file @
50784c10
...
@@ -64,9 +64,9 @@ export async function listWaffoPancakeCatalog(
...
@@ -64,9 +64,9 @@ export async function listWaffoPancakeCatalog(
merchantID
:
string
,
merchantID
:
string
,
privateKey
:
string
privateKey
:
string
):
Promise
<
CatalogResponse
>
{
):
Promise
<
CatalogResponse
>
{
const
res
=
await
api
.
pos
t
<
CatalogResponse
>
(
const
res
=
await
api
.
ge
t
<
CatalogResponse
>
(
'/api/option/waffo-pancake/catalog'
,
'/api/option/waffo-pancake/catalog'
,
{
merchant_id
:
merchantID
,
private_key
:
privateKey
}
{
params
:
{
merchant_id
:
merchantID
,
private_key
:
privateKey
}
}
)
)
return
res
.
data
return
res
.
data
}
}
...
...
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