将单套餐分配和套餐系列分配改成代理系列授权
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m23s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m23s
This commit is contained in:
90
src/api/modules/shopSeriesGrant.ts
Normal file
90
src/api/modules/shopSeriesGrant.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* 代理系列授权 API 服务
|
||||
*/
|
||||
|
||||
import { BaseService } from '../BaseService'
|
||||
import type {
|
||||
ShopSeriesGrantResponse,
|
||||
ShopSeriesGrantQueryParams,
|
||||
CreateShopSeriesGrantRequest,
|
||||
UpdateShopSeriesGrantRequest,
|
||||
ManageGrantPackagesRequest,
|
||||
BaseResponse,
|
||||
PaginationResponse
|
||||
} from '@/types/api'
|
||||
|
||||
export class ShopSeriesGrantService extends BaseService {
|
||||
/**
|
||||
* 获取代理系列授权分页列表
|
||||
* GET /api/admin/shop-series-grants
|
||||
* @param params 查询参数
|
||||
*/
|
||||
static getShopSeriesGrants(
|
||||
params?: ShopSeriesGrantQueryParams
|
||||
): Promise<PaginationResponse<ShopSeriesGrantResponse>> {
|
||||
return this.getPage<ShopSeriesGrantResponse>('/api/admin/shop-series-grants', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建代理系列授权
|
||||
* POST /api/admin/shop-series-grants
|
||||
* @param data 授权数据
|
||||
*/
|
||||
static createShopSeriesGrant(
|
||||
data: CreateShopSeriesGrantRequest
|
||||
): Promise<BaseResponse<ShopSeriesGrantResponse>> {
|
||||
return this.create<ShopSeriesGrantResponse>('/api/admin/shop-series-grants', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取代理系列授权详情
|
||||
* GET /api/admin/shop-series-grants/{id}
|
||||
* @param id 授权ID
|
||||
*/
|
||||
static getShopSeriesGrantDetail(
|
||||
id: number
|
||||
): Promise<BaseResponse<ShopSeriesGrantResponse>> {
|
||||
return this.getOne<ShopSeriesGrantResponse>(`/api/admin/shop-series-grants/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新代理系列授权
|
||||
* PUT /api/admin/shop-series-grants/{id}
|
||||
* @param id 授权ID
|
||||
* @param data 授权数据
|
||||
*/
|
||||
static updateShopSeriesGrant(
|
||||
id: number,
|
||||
data: UpdateShopSeriesGrantRequest
|
||||
): Promise<BaseResponse<ShopSeriesGrantResponse>> {
|
||||
return this.update<ShopSeriesGrantResponse>(
|
||||
`/api/admin/shop-series-grants/${id}`,
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理系列授权
|
||||
* DELETE /api/admin/shop-series-grants/{id}
|
||||
* @param id 授权ID
|
||||
*/
|
||||
static deleteShopSeriesGrant(id: number): Promise<BaseResponse> {
|
||||
return this.remove(`/api/admin/shop-series-grants/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理代理系列授权的套餐
|
||||
* PUT /api/admin/shop-series-grants/{id}/packages
|
||||
* @param id 授权ID
|
||||
* @param data 套餐管理数据
|
||||
*/
|
||||
static manageGrantPackages(
|
||||
id: number,
|
||||
data: ManageGrantPackagesRequest
|
||||
): Promise<BaseResponse<ShopSeriesGrantResponse>> {
|
||||
return this.put<BaseResponse<ShopSeriesGrantResponse>>(
|
||||
`/api/admin/shop-series-grants/${id}/packages`,
|
||||
data
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user