初始化
This commit is contained in:
9
internal/controller/pricing/pricing.go
Normal file
9
internal/controller/pricing/pricing.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package pricing
|
||||
|
||||
// ControllerV1 是套餐定价控制器。
|
||||
type ControllerV1 struct{}
|
||||
|
||||
// NewV1 创建套餐定价控制器实例。
|
||||
func NewV1() *ControllerV1 {
|
||||
return &ControllerV1{}
|
||||
}
|
||||
21
internal/controller/pricing/pricing_v1.go
Normal file
21
internal/controller/pricing/pricing_v1.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package pricing
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"xk-of-api/api/pricing/v1"
|
||||
"xk-of-api/internal/response"
|
||||
"xk-of-api/internal/service"
|
||||
)
|
||||
|
||||
// Plans 获取官网可展示套餐。
|
||||
func (c *ControllerV1) Plans(ctx context.Context, req *v1.PlansReq) (res *v1.PlansRes, err error) {
|
||||
response.Success(ctx, service.Pricing.Plans())
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// AdminPlans 获取后台套餐列表。
|
||||
func (c *ControllerV1) AdminPlans(ctx context.Context, req *v1.AdminPlansReq) (res *v1.AdminPlansRes, err error) {
|
||||
response.Success(ctx, service.Pricing.Plans())
|
||||
return nil, nil
|
||||
}
|
||||
Reference in New Issue
Block a user