feat: 完善接口19-顶部通知铃铛与站内通知中心
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m5s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 4m5s
This commit is contained in:
@@ -6,8 +6,6 @@ import { BaseService } from '../BaseService'
|
||||
import type {
|
||||
PlatformAccount,
|
||||
AccountQueryParams,
|
||||
PlatformSalesperson,
|
||||
PlatformSalespersonQueryParams,
|
||||
CreatePlatformAccountParams,
|
||||
BaseResponse,
|
||||
PaginationResponse
|
||||
@@ -25,16 +23,6 @@ export class AccountService extends BaseService {
|
||||
return this.getPage<PlatformAccount>('/api/admin/accounts', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取启用的平台业务员候选
|
||||
* GET /api/admin/accounts?account_type=platform&status=1
|
||||
*/
|
||||
static getPlatformSalespeople(
|
||||
params: PlatformSalespersonQueryParams
|
||||
): Promise<PaginationResponse<PlatformSalesperson>> {
|
||||
return this.getPage<PlatformSalesperson>('/api/admin/accounts', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建账号
|
||||
* POST /api/admin/accounts
|
||||
|
||||
@@ -31,7 +31,9 @@ import type {
|
||||
AssetOperationLogsParams,
|
||||
AssetPackageUsageRecord,
|
||||
UpdateAssetPackageUsedDataRequest,
|
||||
UpdateAssetPackageExpiresAtRequest
|
||||
UpdateAssetPackageExpiresAtRequest,
|
||||
ExpiringAssetItem,
|
||||
ExpiringAssetQueryParams
|
||||
} from '@/types/api'
|
||||
|
||||
const runRateLimitedAssetAction = async <T>(
|
||||
@@ -45,6 +47,19 @@ const runRateLimitedAssetAction = async <T>(
|
||||
}
|
||||
|
||||
export class AssetService extends BaseService {
|
||||
/**
|
||||
* 获取管理端临期资产列表
|
||||
* GET /api/admin/expiring-assets
|
||||
*/
|
||||
static getExpiringAssets(
|
||||
params?: ExpiringAssetQueryParams
|
||||
): Promise<
|
||||
BaseResponse<{ items: ExpiringAssetItem[]; total: number; page: number; size: number }>
|
||||
> {
|
||||
return this.get<
|
||||
BaseResponse<{ items: ExpiringAssetItem[]; total: number; page: number; size: number }>
|
||||
>('/api/admin/expiring-assets', params)
|
||||
}
|
||||
/**
|
||||
* 通过任意标识符查询设备或卡的完整详情
|
||||
* 支持虚拟号、ICCID、IMEI、SN、MSISDN
|
||||
|
||||
@@ -1,24 +1,25 @@
|
||||
import { BaseService } from '../BaseService'
|
||||
import type {
|
||||
BaseResponse,
|
||||
NotificationItem,
|
||||
NotificationListResponse,
|
||||
NotificationQueryParams,
|
||||
NotificationSummary,
|
||||
NotificationReadAllRequest,
|
||||
NotificationReadAllResponse,
|
||||
NotificationReadResponse,
|
||||
NotificationUnreadCount,
|
||||
NotificationUnreadSummary,
|
||||
NotificationTarget
|
||||
} from '@/types/api'
|
||||
|
||||
export class NotificationService extends BaseService {
|
||||
static getUnreadCount(): Promise<
|
||||
BaseResponse<number | { count?: number; unread_count?: number }>
|
||||
> {
|
||||
return this.get<BaseResponse<number | { count?: number; unread_count?: number }>>(
|
||||
'/api/admin/notifications/unread-count'
|
||||
)
|
||||
static getUnreadCount(): Promise<BaseResponse<NotificationUnreadCount>> {
|
||||
return this.get<BaseResponse<NotificationUnreadCount>>('/api/admin/notifications/unread-count')
|
||||
}
|
||||
|
||||
static getUnreadSummary(): Promise<BaseResponse<NotificationSummary>> {
|
||||
return this.get<BaseResponse<NotificationSummary>>('/api/admin/notifications/unread-summary')
|
||||
static getUnreadSummary(): Promise<BaseResponse<NotificationUnreadSummary>> {
|
||||
return this.get<BaseResponse<NotificationUnreadSummary>>(
|
||||
'/api/admin/notifications/unread-summary'
|
||||
)
|
||||
}
|
||||
|
||||
static getNotifications(
|
||||
@@ -27,15 +28,23 @@ export class NotificationService extends BaseService {
|
||||
return this.get<BaseResponse<NotificationListResponse>>('/api/admin/notifications', params)
|
||||
}
|
||||
|
||||
static markRead(id: number | string): Promise<BaseResponse<NotificationItem>> {
|
||||
return this.put<BaseResponse<NotificationItem>>(`/api/admin/notifications/${id}/read`, {})
|
||||
static markRead(id: number): Promise<BaseResponse<NotificationReadResponse>> {
|
||||
return this.put<BaseResponse<NotificationReadResponse>>(
|
||||
`/api/admin/notifications/${id}/read`,
|
||||
{}
|
||||
)
|
||||
}
|
||||
|
||||
static markAllRead(): Promise<BaseResponse> {
|
||||
return this.put<BaseResponse>('/api/admin/notifications/read-all', {})
|
||||
static markAllRead(
|
||||
data: NotificationReadAllRequest = {}
|
||||
): Promise<BaseResponse<NotificationReadAllResponse>> {
|
||||
return this.put<BaseResponse<NotificationReadAllResponse>>(
|
||||
'/api/admin/notifications/read-all',
|
||||
data
|
||||
)
|
||||
}
|
||||
|
||||
static getTarget(id: number | string): Promise<BaseResponse<NotificationTarget>> {
|
||||
static getTarget(id: number): Promise<BaseResponse<NotificationTarget>> {
|
||||
return this.get<BaseResponse<NotificationTarget>>(`/api/admin/notifications/${id}/target`)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,9 @@ import type {
|
||||
AssignShopRolesRequest,
|
||||
UpdateShopCreditLimitRequest,
|
||||
BaseResponse,
|
||||
PaginationResponse
|
||||
PaginationResponse,
|
||||
ShopBusinessOwnerCandidate,
|
||||
ShopBusinessOwnerCandidateQueryParams
|
||||
} from '@/types/api'
|
||||
|
||||
export class ShopService extends BaseService {
|
||||
@@ -25,6 +27,27 @@ export class ShopService extends BaseService {
|
||||
return this.getPage<ShopResponse>('/api/admin/shops', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺业务员候选
|
||||
* GET /api/admin/shops/business-owner-candidates
|
||||
*/
|
||||
static getBusinessOwnerCandidates(
|
||||
params?: ShopBusinessOwnerCandidateQueryParams
|
||||
): Promise<PaginationResponse<ShopBusinessOwnerCandidate>> {
|
||||
return this.getPage<ShopBusinessOwnerCandidate>(
|
||||
'/api/admin/shops/business-owner-candidates',
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取店铺详情
|
||||
* GET /api/admin/shops/{id}
|
||||
*/
|
||||
static getShopDetail(id: number): Promise<BaseResponse<ShopResponse>> {
|
||||
return this.getOne<ShopResponse>(`/api/admin/shops/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 店铺级联查询(树结构)
|
||||
* GET /api/admin/shops/cascade
|
||||
|
||||
Reference in New Issue
Block a user