mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 04:10:20 +08:00
feat: add subscription managment (#1858)
* feat: subscription managment * fix: remove console log * fix: webhooks * fix linter * fix: fix via gofumpt * fix: review changes * fix: Copyright 2023 * Update account.go --------- Co-authored-by: hsluoyz <hsluoyz@qq.com>
This commit is contained in:
@ -177,6 +177,42 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/add-plan:
|
||||
post:
|
||||
tags:
|
||||
- Plan API
|
||||
description: add plan
|
||||
operationId: ApiController.AddPlan
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the plan
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/add-pricing:
|
||||
post:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: add pricing
|
||||
operationId: ApiController.AddPricing
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the pricing
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Pricing'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/add-product:
|
||||
post:
|
||||
tags:
|
||||
@ -278,6 +314,24 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
/api/add-subscription:
|
||||
post:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: add subscription
|
||||
operationId: ApiController.AddSubscription
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the subscription
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Subscription'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/add-syncer:
|
||||
post:
|
||||
tags:
|
||||
@ -552,6 +606,17 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-mfa/:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: ': Delete MFA'
|
||||
operationId: ApiController.DeleteMfa
|
||||
responses:
|
||||
"200":
|
||||
description: object
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
/api/delete-model:
|
||||
post:
|
||||
tags:
|
||||
@ -624,6 +689,42 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-plan:
|
||||
post:
|
||||
tags:
|
||||
- Plan API
|
||||
description: delete plan
|
||||
operationId: ApiController.DeletePlan
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the plan
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-pricing:
|
||||
post:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: delete pricing
|
||||
operationId: ApiController.DeletePricing
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the pricing
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Pricing'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-product:
|
||||
post:
|
||||
tags:
|
||||
@ -702,6 +803,24 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
/api/delete-subscription:
|
||||
post:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: delete subscription
|
||||
operationId: ApiController.DeleteSubscription
|
||||
parameters:
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the subscription
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Subscription'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/delete-syncer:
|
||||
post:
|
||||
tags:
|
||||
@ -995,6 +1114,19 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.User'
|
||||
/api/get-globle-certs:
|
||||
get:
|
||||
tags:
|
||||
- Cert API
|
||||
description: get globle certs
|
||||
operationId: ApiController.GetGlobleCerts
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Cert'
|
||||
/api/get-ldap:
|
||||
get:
|
||||
tags:
|
||||
@ -1027,6 +1159,23 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.Message'
|
||||
/api/get-message-answer:
|
||||
get:
|
||||
tags:
|
||||
- Message API
|
||||
description: get message answer
|
||||
operationId: ApiController.GetMessageAnswer
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the message
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.Message'
|
||||
/api/get-messages:
|
||||
get:
|
||||
tags:
|
||||
@ -1241,6 +1390,82 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Permission'
|
||||
/api/get-plan:
|
||||
get:
|
||||
tags:
|
||||
- Plan API
|
||||
description: get plan
|
||||
operationId: ApiController.GetPlan
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the plan
|
||||
required: true
|
||||
type: string
|
||||
- in: query
|
||||
name: includeOption
|
||||
description: Should include plan's option
|
||||
type: boolean
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
/api/get-plans:
|
||||
get:
|
||||
tags:
|
||||
- Plan API
|
||||
description: get plans
|
||||
operationId: ApiController.GetPlans
|
||||
parameters:
|
||||
- in: query
|
||||
name: owner
|
||||
description: The owner of plans
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
/api/get-pricing:
|
||||
get:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: get pricing
|
||||
operationId: ApiController.GetPricing
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the pricing
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.pricing'
|
||||
/api/get-pricings:
|
||||
get:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: get pricings
|
||||
operationId: ApiController.GetPricings
|
||||
parameters:
|
||||
- in: query
|
||||
name: owner
|
||||
description: The owner of pricings
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Pricing'
|
||||
/api/get-product:
|
||||
get:
|
||||
tags:
|
||||
@ -1277,6 +1502,17 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Product'
|
||||
/api/get-prometheus-info:
|
||||
get:
|
||||
tags:
|
||||
- Prometheus API
|
||||
description: get Prometheus Info
|
||||
operationId: ApiController.GetPrometheusInfo
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.PrometheusInfo'
|
||||
/api/get-provider:
|
||||
get:
|
||||
tags:
|
||||
@ -1466,6 +1702,42 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.User'
|
||||
/api/get-subscription:
|
||||
get:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: get subscription
|
||||
operationId: ApiController.GetSubscription
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the subscription
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/object.subscription'
|
||||
/api/get-subscriptions:
|
||||
get:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: get subscriptions
|
||||
operationId: ApiController.GetSubscriptions
|
||||
parameters:
|
||||
- in: query
|
||||
name: owner
|
||||
description: The owner of subscriptions
|
||||
required: true
|
||||
type: string
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.Subscription'
|
||||
/api/get-syncer:
|
||||
get:
|
||||
tags:
|
||||
@ -1975,6 +2247,39 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/mfa/setup/enable:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: enable totp
|
||||
operationId: ApiController.MfaSetupEnable
|
||||
responses:
|
||||
"200":
|
||||
description: object
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
/api/mfa/setup/initiate:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: setup MFA
|
||||
operationId: ApiController.MfaSetupInitiate
|
||||
responses:
|
||||
"200":
|
||||
description: Response object
|
||||
schema:
|
||||
$ref: '#/definitions/The'
|
||||
/api/mfa/setup/verify:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: setup verify totp
|
||||
operationId: ApiController.MfaSetupVerify
|
||||
responses:
|
||||
"200":
|
||||
description: object
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
/api/notify-payment:
|
||||
post:
|
||||
tags:
|
||||
@ -2048,6 +2353,17 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/set-preferred-mfa:
|
||||
post:
|
||||
tags:
|
||||
- MFA API
|
||||
description: ': Set specific Mfa Preferred'
|
||||
operationId: ApiController.SetPreferredMfa
|
||||
responses:
|
||||
"200":
|
||||
description: object
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
/api/signup:
|
||||
post:
|
||||
tags:
|
||||
@ -2268,6 +2584,52 @@ paths:
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/update-plan:
|
||||
post:
|
||||
tags:
|
||||
- Plan API
|
||||
description: update plan
|
||||
operationId: ApiController.UpdatePlan
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the plan
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the plan
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Plan'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/update-pricing:
|
||||
post:
|
||||
tags:
|
||||
- Pricing API
|
||||
description: update pricing
|
||||
operationId: ApiController.UpdatePricing
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the pricing
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the pricing
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Pricing'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/update-product:
|
||||
post:
|
||||
tags:
|
||||
@ -2361,6 +2723,29 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
/api/update-subscription:
|
||||
post:
|
||||
tags:
|
||||
- Subscription API
|
||||
description: update subscription
|
||||
operationId: ApiController.UpdateSubscription
|
||||
parameters:
|
||||
- in: query
|
||||
name: id
|
||||
description: The id ( owner/name ) of the subscription
|
||||
required: true
|
||||
type: string
|
||||
- in: body
|
||||
name: body
|
||||
description: The details of the subscription
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/object.Subscription'
|
||||
responses:
|
||||
"200":
|
||||
description: The Response object
|
||||
schema:
|
||||
$ref: '#/definitions/controllers.Response'
|
||||
/api/update-syncer:
|
||||
post:
|
||||
tags:
|
||||
@ -2555,10 +2940,10 @@ paths:
|
||||
schema:
|
||||
$ref: '#/definitions/Response'
|
||||
definitions:
|
||||
1183.0xc000455050.false:
|
||||
1183.0x1400042eb70.false:
|
||||
title: "false"
|
||||
type: object
|
||||
1217.0xc000455080.false:
|
||||
1217.0x1400042eba0.false:
|
||||
title: "false"
|
||||
type: object
|
||||
LaravelResponse:
|
||||
@ -2567,6 +2952,9 @@ definitions:
|
||||
Response:
|
||||
title: Response
|
||||
type: object
|
||||
The:
|
||||
title: The
|
||||
type: object
|
||||
controllers.AuthForm:
|
||||
title: AuthForm
|
||||
type: object
|
||||
@ -2591,9 +2979,9 @@ definitions:
|
||||
type: object
|
||||
properties:
|
||||
data:
|
||||
$ref: '#/definitions/1183.0xc000455050.false'
|
||||
$ref: '#/definitions/1183.0x1400042eb70.false'
|
||||
data2:
|
||||
$ref: '#/definitions/1217.0xc000455080.false'
|
||||
$ref: '#/definitions/1217.0x1400042eba0.false'
|
||||
msg:
|
||||
type: string
|
||||
name:
|
||||
@ -2799,6 +3187,17 @@ definitions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
object.GaugeVecInfo:
|
||||
title: GaugeVecInfo
|
||||
type: object
|
||||
properties:
|
||||
method:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
throughput:
|
||||
type: number
|
||||
format: double
|
||||
object.Header:
|
||||
title: Header
|
||||
type: object
|
||||
@ -2807,6 +3206,19 @@ definitions:
|
||||
type: string
|
||||
value:
|
||||
type: string
|
||||
object.HistogramVecInfo:
|
||||
title: HistogramVecInfo
|
||||
type: object
|
||||
properties:
|
||||
count:
|
||||
type: integer
|
||||
format: int64
|
||||
latency:
|
||||
type: string
|
||||
method:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
object.IntrospectionResponse:
|
||||
title: IntrospectionResponse
|
||||
type: object
|
||||
@ -2868,8 +3280,30 @@ definitions:
|
||||
type: string
|
||||
owner:
|
||||
type: string
|
||||
replyTo:
|
||||
type: string
|
||||
text:
|
||||
type: string
|
||||
object.MfaProps:
|
||||
title: MfaProps
|
||||
type: object
|
||||
properties:
|
||||
countryCode:
|
||||
type: string
|
||||
id:
|
||||
type: string
|
||||
isPreferred:
|
||||
type: boolean
|
||||
recoveryCodes:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
secret:
|
||||
type: string
|
||||
type:
|
||||
type: string
|
||||
url:
|
||||
type: string
|
||||
object.Model:
|
||||
title: Model
|
||||
type: object
|
||||
@ -3098,6 +3532,67 @@ definitions:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
object.Plan:
|
||||
title: Plan
|
||||
type: object
|
||||
properties:
|
||||
createdTime:
|
||||
type: string
|
||||
currency:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
displayName:
|
||||
type: string
|
||||
name:
|
||||
type: string
|
||||
owner:
|
||||
type: string
|
||||
pricePerMonth:
|
||||
type: number
|
||||
format: double
|
||||
pricePerYear:
|
||||
type: number
|
||||
format: double
|
||||
role:
|
||||
type: string
|
||||
options:
|
||||
type: array
|
||||
object.Pricing:
|
||||
title: Pricing
|
||||
type: object
|
||||
properties:
|
||||
application:
|
||||
type: string
|
||||
approveTime:
|
||||
type: string
|
||||
approver:
|
||||
type: string
|
||||
createdTime:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
displayName:
|
||||
type: string
|
||||
hasTrial:
|
||||
type: boolean
|
||||
isEnabled:
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
owner:
|
||||
type: string
|
||||
plans:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
state:
|
||||
type: string
|
||||
submitter:
|
||||
type: string
|
||||
trialDuration:
|
||||
type: integer
|
||||
format: int64
|
||||
object.Product:
|
||||
title: Product
|
||||
type: object
|
||||
@ -3141,6 +3636,21 @@ definitions:
|
||||
type: string
|
||||
tag:
|
||||
type: string
|
||||
object.PrometheusInfo:
|
||||
title: PrometheusInfo
|
||||
type: object
|
||||
properties:
|
||||
apiLatency:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.HistogramVecInfo'
|
||||
apiThroughput:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.GaugeVecInfo'
|
||||
totalThroughput:
|
||||
type: number
|
||||
format: double
|
||||
object.Provider:
|
||||
title: Provider
|
||||
type: object
|
||||
@ -3313,6 +3823,43 @@ definitions:
|
||||
type: string
|
||||
visible:
|
||||
type: boolean
|
||||
object.Subscription:
|
||||
title: Subscription
|
||||
type: object
|
||||
properties:
|
||||
approveTime:
|
||||
type: string
|
||||
approver:
|
||||
type: string
|
||||
createdTime:
|
||||
type: string
|
||||
description:
|
||||
type: string
|
||||
displayName:
|
||||
type: string
|
||||
duration:
|
||||
type: integer
|
||||
format: int64
|
||||
endDate:
|
||||
type: string
|
||||
format: datetime
|
||||
isEnabled:
|
||||
type: boolean
|
||||
name:
|
||||
type: string
|
||||
owner:
|
||||
type: string
|
||||
plan:
|
||||
type: string
|
||||
startDate:
|
||||
type: string
|
||||
format: datetime
|
||||
state:
|
||||
type: string
|
||||
submitter:
|
||||
type: string
|
||||
user:
|
||||
type: string
|
||||
object.Syncer:
|
||||
title: Syncer
|
||||
type: object
|
||||
@ -3612,6 +4159,10 @@ definitions:
|
||||
type: string
|
||||
microsoftonline:
|
||||
type: string
|
||||
multiFactorAuths:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/definitions/object.MfaProps'
|
||||
name:
|
||||
type: string
|
||||
naver:
|
||||
@ -3778,6 +4329,12 @@ definitions:
|
||||
type: string
|
||||
url:
|
||||
type: string
|
||||
object.pricing:
|
||||
title: pricing
|
||||
type: object
|
||||
object.subscription:
|
||||
title: subscription
|
||||
type: object
|
||||
protocol.CredentialAssertion:
|
||||
title: CredentialAssertion
|
||||
type: object
|
||||
|
Reference in New Issue
Block a user