feat:【system】【infra】新增租户、租户套餐、社交、OAuth2、参数配置、数据源配置等管理页面及相关 API 接口
This commit is contained in:
45
src/api/infra/config/index.ts
Normal file
45
src/api/infra/config/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 参数配置信息 */
|
||||
export interface Config {
|
||||
id?: number
|
||||
category: string
|
||||
name: string
|
||||
key: string
|
||||
value: string
|
||||
type: number
|
||||
visible: boolean
|
||||
remark: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取参数配置分页列表 */
|
||||
export function getConfigPage(params: PageParam) {
|
||||
return http.get<PageResult<Config>>('/infra/config/page', params)
|
||||
}
|
||||
|
||||
/** 获取参数配置详情 */
|
||||
export function getConfig(id: number) {
|
||||
return http.get<Config>(`/infra/config/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 根据参数键名查询参数值 */
|
||||
export function getConfigKey(configKey: string) {
|
||||
return http.get<string>(`/infra/config/get-value-by-key?key=${configKey}`)
|
||||
}
|
||||
|
||||
/** 创建参数配置 */
|
||||
export function createConfig(data: Config) {
|
||||
return http.post<number>('/infra/config/create', data)
|
||||
}
|
||||
|
||||
/** 更新参数配置 */
|
||||
export function updateConfig(data: Config) {
|
||||
return http.put<boolean>('/infra/config/update', data)
|
||||
}
|
||||
|
||||
/** 删除参数配置 */
|
||||
export function deleteConfig(id: number) {
|
||||
return http.delete<boolean>(`/infra/config/delete?id=${id}`)
|
||||
}
|
||||
36
src/api/infra/data-source-config/index.ts
Normal file
36
src/api/infra/data-source-config/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 数据源配置信息 */
|
||||
export interface DataSourceConfig {
|
||||
id?: number
|
||||
name: string
|
||||
url: string
|
||||
username: string
|
||||
password: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取数据源配置列表(无分页) */
|
||||
export function getDataSourceConfigList() {
|
||||
return http.get<DataSourceConfig[]>('/infra/data-source-config/list')
|
||||
}
|
||||
|
||||
/** 获取数据源配置详情 */
|
||||
export function getDataSourceConfig(id: number) {
|
||||
return http.get<DataSourceConfig>(`/infra/data-source-config/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建数据源配置 */
|
||||
export function createDataSourceConfig(data: DataSourceConfig) {
|
||||
return http.post<number>('/infra/data-source-config/create', data)
|
||||
}
|
||||
|
||||
/** 更新数据源配置 */
|
||||
export function updateDataSourceConfig(data: DataSourceConfig) {
|
||||
return http.put<boolean>('/infra/data-source-config/update', data)
|
||||
}
|
||||
|
||||
/** 删除数据源配置 */
|
||||
export function deleteDataSourceConfig(id: number) {
|
||||
return http.delete<boolean>(`/infra/data-source-config/delete?id=${id}`)
|
||||
}
|
||||
48
src/api/system/oauth2/client/index.ts
Normal file
48
src/api/system/oauth2/client/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** OAuth2.0 客户端信息 */
|
||||
export interface OAuth2Client {
|
||||
id?: number
|
||||
clientId: string
|
||||
secret: string
|
||||
name: string
|
||||
logo: string
|
||||
description: string
|
||||
status: number
|
||||
accessTokenValiditySeconds: number
|
||||
refreshTokenValiditySeconds: number
|
||||
redirectUris: string[]
|
||||
autoApprove: boolean
|
||||
authorizedGrantTypes: string[]
|
||||
scopes: string[]
|
||||
authorities: string[]
|
||||
resourceIds: string[]
|
||||
additionalInformation: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取 OAuth2.0 客户端分页列表 */
|
||||
export function getOAuth2ClientPage(params: PageParam) {
|
||||
return http.get<PageResult<OAuth2Client>>('/system/oauth2-client/page', params)
|
||||
}
|
||||
|
||||
/** 获取 OAuth2.0 客户端详情 */
|
||||
export function getOAuth2Client(id: number) {
|
||||
return http.get<OAuth2Client>(`/system/oauth2-client/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建 OAuth2.0 客户端 */
|
||||
export function createOAuth2Client(data: OAuth2Client) {
|
||||
return http.post<number>('/system/oauth2-client/create', data)
|
||||
}
|
||||
|
||||
/** 更新 OAuth2.0 客户端 */
|
||||
export function updateOAuth2Client(data: OAuth2Client) {
|
||||
return http.put<boolean>('/system/oauth2-client/update', data)
|
||||
}
|
||||
|
||||
/** 删除 OAuth2.0 客户端 */
|
||||
export function deleteOAuth2Client(id: number) {
|
||||
return http.delete<boolean>(`/system/oauth2-client/delete?id=${id}`)
|
||||
}
|
||||
24
src/api/system/oauth2/token/index.ts
Normal file
24
src/api/system/oauth2/token/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** OAuth2.0 令牌信息 */
|
||||
export interface OAuth2Token {
|
||||
id?: number
|
||||
accessToken: string
|
||||
refreshToken: string
|
||||
userId: number
|
||||
userType: number
|
||||
clientId: string
|
||||
createTime?: Date
|
||||
expiresTime?: Date
|
||||
}
|
||||
|
||||
/** 获取 OAuth2.0 令牌分页列表 */
|
||||
export function getOAuth2TokenPage(params: PageParam) {
|
||||
return http.get<PageResult<OAuth2Token>>('/system/oauth2-token/page', params)
|
||||
}
|
||||
|
||||
/** 删除 OAuth2.0 令牌 */
|
||||
export function deleteOAuth2Token(accessToken: string) {
|
||||
return http.delete<boolean>(`/system/oauth2-token/delete?accessToken=${accessToken}`)
|
||||
}
|
||||
41
src/api/system/social/client/index.ts
Normal file
41
src/api/system/social/client/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 社交客户端信息 */
|
||||
export interface SocialClient {
|
||||
id?: number
|
||||
name: string
|
||||
socialType: number
|
||||
userType: number
|
||||
clientId: string
|
||||
clientSecret: string
|
||||
agentId?: string
|
||||
publicKey?: string
|
||||
status: number
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取社交客户端分页列表 */
|
||||
export function getSocialClientPage(params: PageParam) {
|
||||
return http.get<PageResult<SocialClient>>('/system/social-client/page', params)
|
||||
}
|
||||
|
||||
/** 获取社交客户端详情 */
|
||||
export function getSocialClient(id: number) {
|
||||
return http.get<SocialClient>(`/system/social-client/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建社交客户端 */
|
||||
export function createSocialClient(data: SocialClient) {
|
||||
return http.post<number>('/system/social-client/create', data)
|
||||
}
|
||||
|
||||
/** 更新社交客户端 */
|
||||
export function updateSocialClient(data: SocialClient) {
|
||||
return http.put<boolean>('/system/social-client/update', data)
|
||||
}
|
||||
|
||||
/** 删除社交客户端 */
|
||||
export function deleteSocialClient(id: number) {
|
||||
return http.delete<boolean>(`/system/social-client/delete?id=${id}`)
|
||||
}
|
||||
28
src/api/system/social/user/index.ts
Normal file
28
src/api/system/social/user/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 社交用户信息 */
|
||||
export interface SocialUser {
|
||||
id?: number
|
||||
type: number
|
||||
openid: string
|
||||
token: string
|
||||
rawTokenInfo: string
|
||||
nickname: string
|
||||
avatar: string
|
||||
rawUserInfo: string
|
||||
code: string
|
||||
state: string
|
||||
createTime?: Date
|
||||
updateTime?: Date
|
||||
}
|
||||
|
||||
/** 获取社交用户分页列表 */
|
||||
export function getSocialUserPage(params: PageParam) {
|
||||
return http.get<PageResult<SocialUser>>('/system/social-user/page', params)
|
||||
}
|
||||
|
||||
/** 获取社交用户详情 */
|
||||
export function getSocialUser(id: number) {
|
||||
return http.get<SocialUser>(`/system/social-user/get?id=${id}`)
|
||||
}
|
||||
42
src/api/system/tenant-package/index.ts
Normal file
42
src/api/system/tenant-package/index.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 租户套餐信息 */
|
||||
export interface TenantPackage {
|
||||
id?: number
|
||||
name: string
|
||||
status: number
|
||||
remark: string
|
||||
menuIds: number[]
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取租户套餐分页列表 */
|
||||
export function getTenantPackagePage(params: PageParam) {
|
||||
return http.get<PageResult<TenantPackage>>('/system/tenant-package/page', params)
|
||||
}
|
||||
|
||||
/** 获取租户套餐精简信息列表 */
|
||||
export function getTenantPackageList() {
|
||||
return http.get<TenantPackage[]>('/system/tenant-package/get-simple-list')
|
||||
}
|
||||
|
||||
/** 获取租户套餐详情 */
|
||||
export function getTenantPackage(id: number) {
|
||||
return http.get<TenantPackage>(`/system/tenant-package/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建租户套餐 */
|
||||
export function createTenantPackage(data: TenantPackage) {
|
||||
return http.post<number>('/system/tenant-package/create', data)
|
||||
}
|
||||
|
||||
/** 更新租户套餐 */
|
||||
export function updateTenantPackage(data: TenantPackage) {
|
||||
return http.put<boolean>('/system/tenant-package/update', data)
|
||||
}
|
||||
|
||||
/** 删除租户套餐 */
|
||||
export function deleteTenantPackage(id: number) {
|
||||
return http.delete<boolean>(`/system/tenant-package/delete?id=${id}`)
|
||||
}
|
||||
46
src/api/system/tenant/index.ts
Normal file
46
src/api/system/tenant/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 租户信息 */
|
||||
export interface Tenant {
|
||||
id?: number
|
||||
name: string
|
||||
packageId: number
|
||||
contactName: string
|
||||
contactMobile: string
|
||||
accountCount: number
|
||||
expireTime: Date
|
||||
websites: string[]
|
||||
status: number
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取租户分页列表 */
|
||||
export function getTenantPage(params: PageParam) {
|
||||
return http.get<PageResult<Tenant>>('/system/tenant/page', params)
|
||||
}
|
||||
|
||||
/** 获取租户精简信息列表 */
|
||||
export function getSimpleTenantList() {
|
||||
return http.get<Tenant[]>('/system/tenant/simple-list')
|
||||
}
|
||||
|
||||
/** 获取租户详情 */
|
||||
export function getTenant(id: number) {
|
||||
return http.get<Tenant>(`/system/tenant/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建租户 */
|
||||
export function createTenant(data: Tenant) {
|
||||
return http.post<number>('/system/tenant/create', data)
|
||||
}
|
||||
|
||||
/** 更新租户 */
|
||||
export function updateTenant(data: Tenant) {
|
||||
return http.put<boolean>('/system/tenant/update', data)
|
||||
}
|
||||
|
||||
/** 删除租户 */
|
||||
export function deleteTenant(id: number) {
|
||||
return http.delete<boolean>(`/system/tenant/delete?id=${id}`)
|
||||
}
|
||||
Reference in New Issue
Block a user