mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-17 02:20:26 +08:00
实现用户计费方式相关多个接口
This commit is contained in:
@@ -228,6 +228,10 @@ func (this *BaseService) PermissionError() error {
|
||||
return errors.New("Permission Denied")
|
||||
}
|
||||
|
||||
func (this *BaseService) NotImplementedYet() error {
|
||||
return errors.New("not implemented yet")
|
||||
}
|
||||
|
||||
// NullTx 空的数据库事务
|
||||
func (this *BaseService) NullTx() *dbs.Tx {
|
||||
return nil
|
||||
|
||||
@@ -61,7 +61,7 @@ func (this *NodeRegionService) DeleteNodeRegion(ctx context.Context, req *pb.Del
|
||||
|
||||
// FindAllEnabledNodeRegions 查找所有区域
|
||||
func (this *NodeRegionService) FindAllEnabledNodeRegions(ctx context.Context, req *pb.FindAllEnabledNodeRegionsRequest) (*pb.FindAllEnabledNodeRegionsResponse, error) {
|
||||
_, err := this.ValidateAdmin(ctx)
|
||||
_, _, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -87,7 +87,7 @@ func (this *NodeRegionService) FindAllEnabledNodeRegions(ctx context.Context, re
|
||||
|
||||
// FindAllAvailableNodeRegions 查找所有启用的区域
|
||||
func (this *NodeRegionService) FindAllAvailableNodeRegions(ctx context.Context, req *pb.FindAllAvailableNodeRegionsRequest) (*pb.FindAllAvailableNodeRegionsResponse, error) {
|
||||
_, err := this.ValidateAdmin(ctx)
|
||||
_, _, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
24
internal/rpc/services/service_user_ext.go
Normal file
24
internal/rpc/services/service_user_ext.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
|
||||
//go:build !plus
|
||||
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
)
|
||||
|
||||
// FindUserPriceInfo 读取用户计费信息
|
||||
func (this *UserService) FindUserPriceInfo(ctx context.Context, req *pb.FindUserPriceInfoRequest) (*pb.FindUserPriceInfoResponse, error) {
|
||||
return nil, this.NotImplementedYet()
|
||||
}
|
||||
|
||||
// UpdateUserPriceType 修改用户计费方式
|
||||
func (this *UserService) UpdateUserPriceType(ctx context.Context, req *pb.UpdateUserPriceTypeRequest) (*pb.RPCSuccess, error) {
|
||||
return nil, this.NotImplementedYet()
|
||||
}
|
||||
|
||||
// UpdateUserPricePeriod 修改用户计费周期
|
||||
func (this *UserService) UpdateUserPricePeriod(ctx context.Context, req *pb.UpdateUserPricePeriodRequest) (*pb.RPCSuccess, error) {
|
||||
return nil, this.NotImplementedYet()
|
||||
}
|
||||
Reference in New Issue
Block a user