feat: add client self-service purchases and integration kit
Some checks failed
Check / delivery-static (push) Has been cancelled
Check / api (push) Has been cancelled
Check / web (push) Has been cancelled

Co-Authored-By: Craft Agent <agents-noreply@craft.do>
This commit is contained in:
2026-10-15 17:33:52 +08:00
parent 68a2b4d892
commit cfcc9b386b
33 changed files with 2598 additions and 44 deletions

View File

@@ -42,6 +42,8 @@ func operation(path string) string {
return "payment_checkout"
case "/api/v1/payments/:channel/notify":
return "payment_notify"
case "/api/v1/client/plans", "/api/v1/client/purchases", "/api/v1/client/purchases/status", "/api/v1/client/purchases/claim":
return "client_purchase"
case "/api/v1/portal/snapshot":
return "login"
case "/api/v1/auth/login":
@@ -121,11 +123,14 @@ func (o *Operations) Middleware() gin.HandlerFunc {
c.Abort()
}
}()
if op == "login" || op == "activation" || op == "heartbeat" || op == "download" || op == "payment_checkout" || op == "payment_notify" {
if op == "login" || op == "activation" || op == "heartbeat" || op == "download" || op == "payment_checkout" || op == "payment_notify" || op == "client_purchase" {
limit := 60
if op == "payment_notify" {
limit = 600
}
if op == "client_purchase" {
limit = 60
}
if op == "login" {
limit = 10
}