first commit
This commit is contained in:
51
src/api/bpm/category/index.ts
Normal file
51
src/api/bpm/category/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
const baseUrl = '/bpm/category'
|
||||
|
||||
/** 流程分类 */
|
||||
export interface Category {
|
||||
id?: number
|
||||
name: string // 分类名
|
||||
code: string // 分类标志
|
||||
status: number // 分类状态
|
||||
description?: string // 分类描述
|
||||
sort: number // 分类排序
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取流程分类分页列表 */
|
||||
export function getCategoryPage(params: PageParam) {
|
||||
return http.get<PageResult<Category>>(`${baseUrl}/page`, params)
|
||||
}
|
||||
|
||||
/** 获取流程分类详情 */
|
||||
export function getCategory(id: number) {
|
||||
return http.get<Category>(`${baseUrl}/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建流程分类 */
|
||||
export function createCategory(data: Category) {
|
||||
return http.post<number>(`${baseUrl}/create`, data)
|
||||
}
|
||||
|
||||
/** 更新流程分类 */
|
||||
export function updateCategory(data: Category) {
|
||||
return http.put<boolean>(`${baseUrl}/update`, data)
|
||||
}
|
||||
|
||||
/** 删除流程分类 */
|
||||
export function deleteCategory(id: number) {
|
||||
return http.delete<boolean>(`${baseUrl}/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 获取流程分类简单列表 */
|
||||
export function getCategorySimpleList() {
|
||||
return http.get<Category[]>(`${baseUrl}/simple-list`)
|
||||
}
|
||||
|
||||
/** 批量修改流程分类的排序 */
|
||||
export function updateCategorySortBatch(ids: number[]) {
|
||||
const params = ids.join(',')
|
||||
return http.put<boolean>(`${baseUrl}/update-sort-batch?ids=${params}`)
|
||||
}
|
||||
26
src/api/bpm/definition/index.ts
Normal file
26
src/api/bpm/definition/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 流程定义 */
|
||||
export interface ProcessDefinition {
|
||||
id: string
|
||||
key: string
|
||||
name: string
|
||||
description?: string
|
||||
icon?: string
|
||||
category: string
|
||||
formType?: number
|
||||
formId?: number
|
||||
formCustomCreatePath?: string
|
||||
formCustomViewPath?: string
|
||||
suspensionState: number
|
||||
}
|
||||
|
||||
/** 获取流程定义列表 */
|
||||
export function getProcessDefinitionList(params?: { suspensionState?: number }) {
|
||||
return http.get<ProcessDefinition[]>('/bpm/process-definition/list', params)
|
||||
}
|
||||
|
||||
/** 获取流程定义详情 */
|
||||
export function getProcessDefinition(id?: string, key?: string) {
|
||||
return http.get<ProcessDefinition>('/bpm/process-definition/get', { id, key })
|
||||
}
|
||||
30
src/api/bpm/oa/leave/index.ts
Normal file
30
src/api/bpm/oa/leave/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 请假申请 */
|
||||
export interface Leave {
|
||||
id: number
|
||||
status: number
|
||||
type: number
|
||||
reason: string
|
||||
processInstanceId: string
|
||||
startTime: Date | any
|
||||
endTime: Date | any
|
||||
createTime: Date
|
||||
startUserSelectAssignees?: Record<string, string[]>
|
||||
}
|
||||
|
||||
/** 创建请假申请 */
|
||||
export function createLeave(data: Partial<Leave>) {
|
||||
return http.post<number>('/bpm/oa/leave/create', data)
|
||||
}
|
||||
|
||||
/** 获得请假申请 */
|
||||
export function getLeave(id: number) {
|
||||
return http.get<Leave>(`/bpm/oa/leave/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 获得请假申请分页 */
|
||||
export function getLeavePage(params: PageParam) {
|
||||
return http.get<PageResult<Leave>>('/bpm/oa/leave/page', params)
|
||||
}
|
||||
38
src/api/bpm/process-expression/index.ts
Normal file
38
src/api/bpm/process-expression/index.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
const baseUrl = '/bpm/process-expression'
|
||||
|
||||
/** 流程表达式 */
|
||||
export interface ProcessExpression {
|
||||
id?: number
|
||||
name: string // 表达式名字
|
||||
status: number // 表达式状态
|
||||
expression: string // 表达式
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取流程表达式分页列表 */
|
||||
export function getProcessExpressionPage(params: PageParam) {
|
||||
return http.get<PageResult<ProcessExpression>>(`${baseUrl}/page`, params)
|
||||
}
|
||||
|
||||
/** 获取流程表达式详情 */
|
||||
export function getProcessExpression(id: number) {
|
||||
return http.get<ProcessExpression>(`${baseUrl}/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建流程表达式 */
|
||||
export function createProcessExpression(data: ProcessExpression) {
|
||||
return http.post<number>(`${baseUrl}/create`, data)
|
||||
}
|
||||
|
||||
/** 更新流程表达式 */
|
||||
export function updateProcessExpression(data: ProcessExpression) {
|
||||
return http.put<boolean>(`${baseUrl}/update`, data)
|
||||
}
|
||||
|
||||
/** 删除流程表达式 */
|
||||
export function deleteProcessExpression(id: number) {
|
||||
return http.delete<boolean>(`${baseUrl}/delete?id=${id}`)
|
||||
}
|
||||
41
src/api/bpm/process-listener/index.ts
Normal file
41
src/api/bpm/process-listener/index.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
const baseUrl = '/bpm/process-listener'
|
||||
|
||||
/** 流程监听器 */
|
||||
export interface ProcessListener {
|
||||
id?: number
|
||||
name: string // 监听器名字
|
||||
type: string // 监听器类型
|
||||
status: number // 监听器状态
|
||||
event: string // 监听事件
|
||||
valueType: string // 监听器值类型
|
||||
value: string // 监听器值
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取流程监听器分页列表 */
|
||||
export function getProcessListenerPage(params: PageParam) {
|
||||
return http.get<PageResult<ProcessListener>>(`${baseUrl}/page`, params)
|
||||
}
|
||||
|
||||
/** 获取流程监听器详情 */
|
||||
export function getProcessListener(id: number) {
|
||||
return http.get<ProcessListener>(`${baseUrl}/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建流程监听器 */
|
||||
export function createProcessListener(data: ProcessListener) {
|
||||
return http.post<number>(`${baseUrl}/create`, data)
|
||||
}
|
||||
|
||||
/** 更新流程监听器 */
|
||||
export function updateProcessListener(data: ProcessListener) {
|
||||
return http.put<boolean>(`${baseUrl}/update`, data)
|
||||
}
|
||||
|
||||
/** 删除流程监听器 */
|
||||
export function deleteProcessListener(id: number) {
|
||||
return http.delete<boolean>(`${baseUrl}/delete?id=${id}`)
|
||||
}
|
||||
141
src/api/bpm/processInstance/index.ts
Normal file
141
src/api/bpm/processInstance/index.ts
Normal file
@@ -0,0 +1,141 @@
|
||||
import type { Task } from '@/api/bpm/task'
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import type {
|
||||
BpmCandidateStrategyEnum,
|
||||
BpmNodeTypeEnum,
|
||||
} from '@/utils/constants'
|
||||
import { http } from '@/http/http'
|
||||
/** 流程实例用户信息 */
|
||||
export interface User {
|
||||
id: number
|
||||
nickname: string
|
||||
avatar?: string
|
||||
deptName?: string
|
||||
}
|
||||
|
||||
/** 流程定义 */
|
||||
export interface ProcessDefinition {
|
||||
id: string
|
||||
key: string
|
||||
name: string
|
||||
description?: string
|
||||
icon?: string
|
||||
category: string
|
||||
formType?: number
|
||||
formId?: number
|
||||
formCustomCreatePath?: string
|
||||
formCustomViewPath?: string
|
||||
suspensionState: number
|
||||
}
|
||||
|
||||
/** 流程实例 */
|
||||
export interface ProcessInstance {
|
||||
id: string
|
||||
name: string
|
||||
status: number
|
||||
category?: string
|
||||
categoryName?: string
|
||||
createTime?: number
|
||||
startTime?: number
|
||||
endTime?: number
|
||||
startUser?: User
|
||||
businessKey?: string
|
||||
processDefinition?: ProcessDefinition
|
||||
summary?: {
|
||||
key: string
|
||||
value: string
|
||||
}[]
|
||||
}
|
||||
|
||||
/** 审批详情 */
|
||||
export interface ApprovalDetail {
|
||||
processInstance: ProcessInstance
|
||||
processDefinition: ProcessDefinition
|
||||
activityNodes: ApprovalNodeInfo[]
|
||||
todoTask: Task
|
||||
}
|
||||
|
||||
/** 审批详情的节点信息 */
|
||||
export interface ApprovalNodeInfo {
|
||||
candidateStrategy?: BpmCandidateStrategyEnum
|
||||
candidateUsers?: User[]
|
||||
endTime?: Date
|
||||
id: string
|
||||
name: string
|
||||
nodeType: BpmNodeTypeEnum
|
||||
startTime?: Date
|
||||
status: number
|
||||
processInstanceId?: string
|
||||
tasks: ApprovalTaskInfo[]
|
||||
}
|
||||
|
||||
/** 审批详情的节点的任务 */
|
||||
export interface ApprovalTaskInfo {
|
||||
id: number
|
||||
assigneeUser: User
|
||||
ownerUser: User
|
||||
reason: string
|
||||
signPicUrl: string
|
||||
status: number
|
||||
}
|
||||
|
||||
/** 抄送流程实例 */
|
||||
export interface ProcessInstanceCopy {
|
||||
id: string
|
||||
processInstanceId: string
|
||||
processInstanceName: string
|
||||
startUser: User
|
||||
createTime: number
|
||||
summary?: {
|
||||
key: string
|
||||
value: string
|
||||
}[]
|
||||
}
|
||||
|
||||
/** 查询我发起的流程分页列表 */
|
||||
export function getProcessInstanceMyPage(params: PageParam) {
|
||||
return http.get<PageResult<ProcessInstance>>('/bpm/process-instance/my-page', params)
|
||||
}
|
||||
|
||||
/** 查询抄送我的流程分页列表 */
|
||||
export function getProcessInstanceCopyPage(params: PageParam) {
|
||||
return http.get<PageResult<ProcessInstanceCopy>>('/bpm/process-instance/copy/page', params)
|
||||
}
|
||||
|
||||
/** 查询流程实例详情 */
|
||||
export function getProcessInstance(id: string) {
|
||||
return http.get<ProcessInstance>(`/bpm/process-instance/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 获取审批详情 */
|
||||
export function getApprovalDetail(params: { processDefinitionId?: string, processInstanceId?: string, activityId?: string, taskId?: string, processVariablesStr?: string }) {
|
||||
return http.get<ApprovalDetail>('/bpm/process-instance/get-approval-detail', params)
|
||||
}
|
||||
|
||||
/** 新增流程实例 */
|
||||
export function createProcessInstance(data: {
|
||||
processDefinitionId: string
|
||||
variables: Record<string, any>
|
||||
}) {
|
||||
return http.post<string>('/bpm/process-instance/create', data)
|
||||
}
|
||||
|
||||
/** 申请人取消流程实例 */
|
||||
export function cancelProcessInstanceByStartUser(id: string, reason: string) {
|
||||
return http.delete<boolean>('/bpm/process-instance/cancel-by-start-user', { id, reason })
|
||||
}
|
||||
|
||||
/** 查询管理员流程实例分页 */
|
||||
export function getProcessInstanceManagerPage(params: PageParam) {
|
||||
return http.get<PageResult<ProcessInstance>>('/bpm/process-instance/manager-page', params)
|
||||
}
|
||||
|
||||
/** 管理员取消流程实例 */
|
||||
export function cancelProcessInstanceByAdmin(id: string, reason: string) {
|
||||
return http.delete<boolean>('/bpm/process-instance/cancel-by-admin', { id, reason })
|
||||
}
|
||||
|
||||
/** 获取下一个节点审批人 */
|
||||
export function getNextApproveNodes(params) {
|
||||
return http.get<ApprovalNodeInfo[]>('/bpm/process-instance/get-next-approval-nodes', params)
|
||||
}
|
||||
102
src/api/bpm/task/index.ts
Normal file
102
src/api/bpm/task/index.ts
Normal file
@@ -0,0 +1,102 @@
|
||||
import type { ProcessInstance } from '@/api/bpm/processInstance'
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 任务处理人 */
|
||||
// TODO @芋艿:貌似暂时不需要这个?!
|
||||
export interface TaskUser {
|
||||
id: number
|
||||
nickname: string
|
||||
avatar?: string
|
||||
deptName?: string
|
||||
}
|
||||
|
||||
/** 操作按钮设置 */
|
||||
export interface OperationButtonSetting {
|
||||
displayName: string // 按钮名称
|
||||
enable: boolean // 是否启用
|
||||
}
|
||||
|
||||
/** 流程任务 */
|
||||
export interface Task {
|
||||
id: string
|
||||
name: string
|
||||
status: number
|
||||
createTime: Date
|
||||
endTime?: Date
|
||||
durationInMillis?: number // 持续时间
|
||||
reason?: string
|
||||
assigneeUser?: TaskUser
|
||||
ownerUser?: TaskUser
|
||||
processInstanceId?: string // 流程实例 ID
|
||||
processInstance: ProcessInstance
|
||||
reasonRequire?: boolean // 是否填写审批意见
|
||||
signEnable?: boolean // 是否需要签名
|
||||
buttonsSetting?: Record<number, OperationButtonSetting> // 按钮设置
|
||||
children?: Task[] // 由加签生成,包含多层子任务
|
||||
}
|
||||
|
||||
/** 查询待办任务分页列表 */
|
||||
export function getTaskTodoPage(params: PageParam) {
|
||||
return http.get<PageResult<Task>>('/bpm/task/todo-page', params)
|
||||
}
|
||||
|
||||
/** 查询已办任务分页列表 */
|
||||
export function getTaskDonePage(params: PageParam) {
|
||||
return http.get<PageResult<Task>>('/bpm/task/done-page', params)
|
||||
}
|
||||
|
||||
/** 审批通过 */
|
||||
export function approveTask(data: {
|
||||
id: string
|
||||
reason: string
|
||||
signPicUrl?: string // 签名图片 URL
|
||||
nextAssignees?: Record<string, number[]> // 下一个节点审批人
|
||||
}) {
|
||||
return http.put<boolean>('/bpm/task/approve', data)
|
||||
}
|
||||
|
||||
/** 审批拒绝 */
|
||||
export function rejectTask(data: { id: string, reason: string }) {
|
||||
return http.put<boolean>('/bpm/task/reject', data)
|
||||
}
|
||||
|
||||
/** 根据流程实例 ID 查询任务列表 */
|
||||
export function getTaskListByProcessInstanceId(processInstanceId: string) {
|
||||
return http.get<Task[]>(`/bpm/task/list-by-process-instance-id?processInstanceId=${processInstanceId}`)
|
||||
}
|
||||
|
||||
/** 查询任务管理分页 */
|
||||
export function getTaskManagerPage(params: PageParam) {
|
||||
return http.get<PageResult<Task>>('/bpm/task/manager-page', params)
|
||||
}
|
||||
|
||||
/** 委派任务 */
|
||||
export function delegateTask(data: { id: string, delegateUserId: string, reason: string }) {
|
||||
return http.put<boolean>('/bpm/task/delegate', data)
|
||||
}
|
||||
|
||||
/** 转办任务 */
|
||||
export function transferTask(data: { id: string, assigneeUserId: string, reason: string }) {
|
||||
return http.put<boolean>('/bpm/task/transfer', data)
|
||||
}
|
||||
|
||||
/** 退回任务 */
|
||||
export function returnTask(data: { id: string, targetTaskDefinitionKey: string, reason: string }) {
|
||||
return http.put<boolean>('/bpm/task/return', data)
|
||||
}
|
||||
|
||||
/** 获取可退回的节点列表 */
|
||||
export function getTaskListByReturn(taskId: string) {
|
||||
return http.get<any[]>(`/bpm/task/list-by-return?id=${taskId}`)
|
||||
}
|
||||
|
||||
/** 加签任务 */
|
||||
export function signCreateTask(data: { id: string, type: string, userIds: number[], reason: string }) {
|
||||
return http.put<boolean>('/bpm/task/create-sign', data)
|
||||
}
|
||||
|
||||
/** 减签任务 */
|
||||
export function signDeleteTask(data: { id: string, reason: string }) {
|
||||
return http.delete<boolean>('/bpm/task/delete-sign', data)
|
||||
}
|
||||
45
src/api/bpm/user-group/index.ts
Normal file
45
src/api/bpm/user-group/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
const baseUrl = '/bpm/user-group'
|
||||
|
||||
/** 用户组 */
|
||||
export interface UserGroup {
|
||||
id?: number
|
||||
name: string // 组名
|
||||
description: string // 描述
|
||||
userIds: number[] // 成员用户编号数组
|
||||
status: number // 状态
|
||||
remark: string // 备注
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取用户组分页列表 */
|
||||
export function getUserGroupPage(params: PageParam) {
|
||||
return http.get<PageResult<UserGroup>>(`${baseUrl}/page`, params)
|
||||
}
|
||||
|
||||
/** 获取用户组详情 */
|
||||
export function getUserGroup(id: number) {
|
||||
return http.get<UserGroup>(`${baseUrl}/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建用户组 */
|
||||
export function createUserGroup(data: UserGroup) {
|
||||
return http.post<number>(`${baseUrl}/create`, data)
|
||||
}
|
||||
|
||||
/** 更新用户组 */
|
||||
export function updateUserGroup(data: UserGroup) {
|
||||
return http.put<boolean>(`${baseUrl}/update`, data)
|
||||
}
|
||||
|
||||
/** 删除用户组 */
|
||||
export function deleteUserGroup(id: number) {
|
||||
return http.delete<boolean>(`${baseUrl}/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 获取用户组简单列表 */
|
||||
export function getUserGroupSimpleList() {
|
||||
return http.get<UserGroup[]>(`${baseUrl}/simple-list`)
|
||||
}
|
||||
36
src/api/infra/api-access-log/index.ts
Normal file
36
src/api/infra/api-access-log/index.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** API 访问日志信息 */
|
||||
export interface ApiAccessLog {
|
||||
id: number
|
||||
traceId: string
|
||||
userId: number
|
||||
userType: number
|
||||
applicationName: string
|
||||
requestMethod: string
|
||||
requestParams: string
|
||||
responseBody: string
|
||||
requestUrl: string
|
||||
userIp: string
|
||||
userAgent: string
|
||||
operateModule: string
|
||||
operateName: string
|
||||
operateType: number
|
||||
beginTime: Date
|
||||
endTime: Date
|
||||
duration: number
|
||||
resultCode: number
|
||||
resultMsg: string
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
/** 获取 API 访问日志分页列表 */
|
||||
export function getApiAccessLogPage(params: PageParam) {
|
||||
return http.get<PageResult<ApiAccessLog>>('/infra/api-access-log/page', params)
|
||||
}
|
||||
|
||||
/** 获取 API 访问日志详情 */
|
||||
export function getApiAccessLog(id: number) {
|
||||
return http.get<ApiAccessLog>(`/infra/api-access-log/get?id=${id}`)
|
||||
}
|
||||
45
src/api/infra/api-error-log/index.ts
Normal file
45
src/api/infra/api-error-log/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** API 错误日志信息 */
|
||||
export interface ApiErrorLog {
|
||||
id: number
|
||||
traceId: string
|
||||
userId: number
|
||||
userType: number
|
||||
applicationName: string
|
||||
requestMethod: string
|
||||
requestParams: string
|
||||
requestUrl: string
|
||||
userIp: string
|
||||
userAgent: string
|
||||
exceptionTime: Date
|
||||
exceptionName: string
|
||||
exceptionMessage: string
|
||||
exceptionRootCauseMessage: string
|
||||
exceptionStackTrace: string
|
||||
exceptionClassName: string
|
||||
exceptionFileName: string
|
||||
exceptionMethodName: string
|
||||
exceptionLineNumber: number
|
||||
processUserId: number
|
||||
processStatus: number
|
||||
processTime: Date
|
||||
resultCode: number
|
||||
createTime: Date
|
||||
}
|
||||
|
||||
/** 获取 API 错误日志分页列表 */
|
||||
export function getApiErrorLogPage(params: PageParam) {
|
||||
return http.get<PageResult<ApiErrorLog>>('/infra/api-error-log/page', params)
|
||||
}
|
||||
|
||||
/** 获取 API 错误日志详情 */
|
||||
export function getApiErrorLog(id: number) {
|
||||
return http.get<ApiErrorLog>(`/infra/api-error-log/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 更新 API 错误日志的处理状态 */
|
||||
export function updateApiErrorLogStatus(id: number, processStatus: number) {
|
||||
return http.put<boolean>(`/infra/api-error-log/update-status?id=${id}&processStatus=${processStatus}`)
|
||||
}
|
||||
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}`)
|
||||
}
|
||||
67
src/api/infra/file/config/index.ts
Normal file
67
src/api/infra/file/config/index.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 文件客户端配置 */
|
||||
export interface FileClientConfig {
|
||||
basePath?: string
|
||||
host?: string
|
||||
port?: number
|
||||
username?: string
|
||||
password?: string
|
||||
mode?: string
|
||||
endpoint?: string
|
||||
bucket?: string
|
||||
accessKey?: string
|
||||
accessSecret?: string
|
||||
enablePathStyleAccess?: boolean
|
||||
enablePublicAccess?: boolean
|
||||
region?: string
|
||||
domain?: string
|
||||
}
|
||||
|
||||
/** 文件配置信息 */
|
||||
export interface FileConfig {
|
||||
id?: number
|
||||
name: string
|
||||
storage?: number
|
||||
master?: boolean
|
||||
visible?: boolean
|
||||
config?: FileClientConfig
|
||||
remark?: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 查询文件配置分页列表 */
|
||||
export function getFileConfigPage(params: PageParam) {
|
||||
return http.get<PageResult<FileConfig>>('/infra/file-config/page', params)
|
||||
}
|
||||
|
||||
/** 查询文件配置详情 */
|
||||
export function getFileConfig(id: number) {
|
||||
return http.get<FileConfig>(`/infra/file-config/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 新增文件配置 */
|
||||
export function createFileConfig(data: FileConfig) {
|
||||
return http.post<number>('/infra/file-config/create', data)
|
||||
}
|
||||
|
||||
/** 修改文件配置 */
|
||||
export function updateFileConfig(data: FileConfig) {
|
||||
return http.put<boolean>('/infra/file-config/update', data)
|
||||
}
|
||||
|
||||
/** 删除文件配置 */
|
||||
export function deleteFileConfig(id: number) {
|
||||
return http.delete<boolean>(`/infra/file-config/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 更新文件配置为主配置 */
|
||||
export function updateFileConfigMaster(id: number) {
|
||||
return http.put<boolean>(`/infra/file-config/update-master?id=${id}`)
|
||||
}
|
||||
|
||||
/** 测试文件配置 */
|
||||
export function testFileConfig(id: number) {
|
||||
return http.get<string>(`/infra/file-config/test?id=${id}`)
|
||||
}
|
||||
97
src/api/infra/file/index.ts
Normal file
97
src/api/infra/file/index.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
import { useToast } from 'wot-design-uni'
|
||||
import { http } from '@/http/http'
|
||||
import { useTokenStore } from '@/store/token'
|
||||
import { useUserStore } from '@/store/user'
|
||||
|
||||
/** 文件信息 */
|
||||
export interface FileVO {
|
||||
id?: number
|
||||
configId?: number
|
||||
path: string
|
||||
name?: string
|
||||
url?: string
|
||||
size?: number
|
||||
type?: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 文件预签名信息 */
|
||||
export interface FilePresignedUrlRespVO {
|
||||
configId: number // 配置编号
|
||||
uploadUrl: string // 文件上传 URL
|
||||
url: string // 文件访问 URL
|
||||
path: string // 文件路径
|
||||
}
|
||||
|
||||
/** 创建文件请求 */
|
||||
export interface FileCreateReqVO {
|
||||
configId: number
|
||||
url: string
|
||||
path: string
|
||||
name: string
|
||||
type?: string
|
||||
size?: number
|
||||
}
|
||||
|
||||
/** 获取文件预签名地址 */
|
||||
export function getFilePresignedUrl(name: string, directory?: string) {
|
||||
return http.get<FilePresignedUrlRespVO>('/infra/file/presigned-url', { name, directory })
|
||||
}
|
||||
|
||||
/** 创建文件记录 */
|
||||
export function createFile(data: FileCreateReqVO) {
|
||||
return http.post<string>('/infra/file/create', data)
|
||||
}
|
||||
|
||||
/** 获取文件详情 */
|
||||
export function getFile(id: number) {
|
||||
return http.get<FileVO>(`/infra/file/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 删除文件 */
|
||||
export function deleteFile(id: number) {
|
||||
return http.delete(`/infra/file/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传文件到后端
|
||||
*
|
||||
* @param filePath 本地文件路径
|
||||
* @param directory 目录(可选)
|
||||
* @returns 文件访问 URL
|
||||
*/
|
||||
export function uploadFile(filePath: string, directory?: string): Promise<string> {
|
||||
const tokenStore = useTokenStore()
|
||||
const userStore = useUserStore()
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.uploadFile({
|
||||
url: `${import.meta.env.VITE_SERVER_BASEURL}/infra/file/upload`,
|
||||
filePath,
|
||||
name: 'file',
|
||||
header: {
|
||||
'Accept': '*/*',
|
||||
'tenant-id': userStore.tenantId,
|
||||
'Authorization': `Bearer ${tokenStore.validToken}`,
|
||||
},
|
||||
formData: directory ? { directory } : undefined,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
const result = JSON.parse(res.data)
|
||||
if (result.code === 0) {
|
||||
resolve(result.data)
|
||||
} else {
|
||||
const toast = useToast()
|
||||
toast.show(result.msg || '上传失败')
|
||||
reject(new Error(result.msg || '上传失败'))
|
||||
}
|
||||
} else {
|
||||
reject(new Error('上传失败'))
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('上传失败:', err)
|
||||
reject(err)
|
||||
},
|
||||
})
|
||||
})
|
||||
}
|
||||
60
src/api/infra/job/index.ts
Normal file
60
src/api/infra/job/index.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
// TODO @AI:不用 baseUrl 方式
|
||||
const baseUrl = '/infra/job'
|
||||
|
||||
/** 定时任务信息 */
|
||||
export interface Job {
|
||||
id?: number
|
||||
name: string
|
||||
status: number
|
||||
handlerName: string
|
||||
handlerParam: string
|
||||
cronExpression: string
|
||||
retryCount: number
|
||||
retryInterval: number
|
||||
monitorTimeout: number
|
||||
createTime?: Date
|
||||
nextTimes?: Date[]
|
||||
}
|
||||
|
||||
/** 获取定时任务分页列表 */
|
||||
export function getJobPage(params: PageParam) {
|
||||
return http.get<PageResult<Job>>(`${baseUrl}/page`, params)
|
||||
}
|
||||
|
||||
/** 获取定时任务详情 */
|
||||
export function getJob(id: number) {
|
||||
return http.get<Job>(`${baseUrl}/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建定时任务 */
|
||||
export function createJob(data: Job) {
|
||||
return http.post<number>(`${baseUrl}/create`, data)
|
||||
}
|
||||
|
||||
/** 更新定时任务 */
|
||||
export function updateJob(data: Job) {
|
||||
return http.put<boolean>(`${baseUrl}/update`, data)
|
||||
}
|
||||
|
||||
/** 删除定时任务 */
|
||||
export function deleteJob(id: number) {
|
||||
return http.delete<boolean>(`${baseUrl}/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 更新定时任务状态 */
|
||||
export function updateJobStatus(id: number, status: number) {
|
||||
return http.put<boolean>(`${baseUrl}/update-status`, { id, status })
|
||||
}
|
||||
|
||||
/** 立即执行一次定时任务 */
|
||||
export function runJob(id: number) {
|
||||
return http.put<boolean>(`${baseUrl}/trigger?id=${id}`)
|
||||
}
|
||||
|
||||
/** 获取定时任务的下 n 次执行时间 */
|
||||
export function getJobNextTimes(id: number) {
|
||||
return http.get<Date[]>(`${baseUrl}/get_next_times?id=${id}`)
|
||||
}
|
||||
31
src/api/infra/job/log/index.ts
Normal file
31
src/api/infra/job/log/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
// TODO @AI:不用 baseUrl 方式
|
||||
const baseUrl = '/infra/job-log'
|
||||
|
||||
/** 定时任务日志信息 */
|
||||
export interface JobLog {
|
||||
id?: number
|
||||
jobId: number
|
||||
handlerName: string
|
||||
handlerParam: string
|
||||
cronExpression: string
|
||||
executeIndex: string
|
||||
beginTime: Date
|
||||
endTime: Date
|
||||
duration: string
|
||||
status: number
|
||||
createTime?: string
|
||||
result: string
|
||||
}
|
||||
|
||||
/** 获取定时任务日志分页列表 */
|
||||
export function getJobLogPage(params: PageParam) {
|
||||
return http.get<PageResult<JobLog>>(`${baseUrl}/page`, params)
|
||||
}
|
||||
|
||||
/** 获取定时任务日志详情 */
|
||||
export function getJobLog(id: number) {
|
||||
return http.get<JobLog>(`${baseUrl}/get?id=${id}`)
|
||||
}
|
||||
148
src/api/login.ts
Normal file
148
src/api/login.ts
Normal file
@@ -0,0 +1,148 @@
|
||||
import type {
|
||||
AuthPermissionInfo,
|
||||
IAuthLoginRes,
|
||||
ICaptcha,
|
||||
IDoubleTokenRes,
|
||||
} from './types/login'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/**
|
||||
* 登录表单
|
||||
*/
|
||||
export interface ILoginForm {
|
||||
type: 'username' | 'register' | 'sms'
|
||||
username?: string
|
||||
password?: string
|
||||
nickname?: string
|
||||
captchaVerification?: string
|
||||
mobile?: string
|
||||
code?: string
|
||||
}
|
||||
|
||||
/** 账号密码登录 Request VO */
|
||||
export interface AuthLoginReqVO {
|
||||
password?: string
|
||||
username?: string
|
||||
captchaVerification?: string
|
||||
// 绑定社交登录时,需要传递如下参数
|
||||
socialType?: number
|
||||
socialCode?: string
|
||||
socialState?: string
|
||||
}
|
||||
|
||||
/** 注册 Request VO */
|
||||
export interface AuthRegisterReqVO {
|
||||
username: string
|
||||
password: string
|
||||
captchaVerification: string
|
||||
}
|
||||
|
||||
/** 短信登录 Request VO */
|
||||
export interface AuthSmsLoginReqVO {
|
||||
mobile: string
|
||||
code: string
|
||||
}
|
||||
|
||||
/** 发送短信验证码 Request VO */
|
||||
export interface AuthSmsSendReqVO {
|
||||
mobile: string
|
||||
scene: number
|
||||
}
|
||||
|
||||
/** 租户信息 */
|
||||
export interface TenantVO {
|
||||
id: number
|
||||
name: string
|
||||
}
|
||||
|
||||
/** 重置密码 Request VO */
|
||||
export interface AuthResetPasswordReqVO {
|
||||
mobile: string
|
||||
code: string
|
||||
password: string
|
||||
}
|
||||
|
||||
/** 获取验证码 */
|
||||
export function getCode(data: any) {
|
||||
return http.post<ICaptcha>('/system/captcha/get', data, null, null, { original: true })
|
||||
}
|
||||
|
||||
/** 校验验证码 */
|
||||
export function checkCaptcha(data: any) {
|
||||
return http.post<boolean>('/system/captcha/check', data, null, null, { original: true })
|
||||
}
|
||||
|
||||
/** 使用账号密码登录 */
|
||||
export function login(data: AuthLoginReqVO) {
|
||||
return http.post<IAuthLoginRes>('/system/auth/login', data)
|
||||
}
|
||||
|
||||
/** 注册用户 */
|
||||
export function register(data: AuthRegisterReqVO) {
|
||||
return http.post<IAuthLoginRes>('/system/auth/register', data)
|
||||
}
|
||||
|
||||
/** 短信登录 */
|
||||
export function smsLogin(data: AuthSmsLoginReqVO) {
|
||||
return http.post<IAuthLoginRes>('/system/auth/sms-login', data)
|
||||
}
|
||||
|
||||
/** 发送短信验证码 */
|
||||
export function sendSmsCode(data: AuthSmsSendReqVO) {
|
||||
return http.post<boolean>('/system/auth/send-sms-code', data)
|
||||
}
|
||||
|
||||
/** 获取租户简单列表 */
|
||||
export function getTenantSimpleList() {
|
||||
return http.get<TenantVO[]>('/system/tenant/simple-list')
|
||||
}
|
||||
|
||||
/** 根据租户域名获取租户信息 */
|
||||
export function getTenantByWebsite(website: string) {
|
||||
return http.get<TenantVO>(`/system/tenant/get-by-website?website=${website}`)
|
||||
}
|
||||
|
||||
/** 通过短信重置密码 */
|
||||
export function smsResetPassword(data: AuthResetPasswordReqVO) {
|
||||
return http.post<boolean>('/system/auth/reset-password', data)
|
||||
}
|
||||
|
||||
/** 刷新token */
|
||||
export function refreshToken(refreshToken: string) {
|
||||
return http.post<IDoubleTokenRes>(`/system/auth/refresh-token?refreshToken=${refreshToken}`)
|
||||
}
|
||||
|
||||
/** 获取权限信息 */
|
||||
export function getAuthPermissionInfo() {
|
||||
return http.get<AuthPermissionInfo>('/system/auth/get-permission-info')
|
||||
}
|
||||
|
||||
/** 退出登录 */
|
||||
export function logout() {
|
||||
return http.post<void>('/system/auth/logout')
|
||||
}
|
||||
|
||||
// TODO @芋艿:三方登录
|
||||
/**
|
||||
* 获取微信登录凭证
|
||||
* @returns Promise 包含微信登录凭证(code)
|
||||
*/
|
||||
export function getWxCode() {
|
||||
return new Promise<UniApp.LoginRes>((resolve, reject) => {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: res => resolve(res),
|
||||
fail: err => reject(new Error(err)),
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// TODO @芋艿:三方登录
|
||||
/**
|
||||
* 微信登录
|
||||
* @param params 微信登录参数,包含code
|
||||
* @returns Promise 包含登录结果
|
||||
*/
|
||||
export function wxLogin(data: { code: string }) {
|
||||
return http.post<IAuthLoginRes>('/auth/wxLogin', data)
|
||||
}
|
||||
19
src/api/system/area/index.ts
Normal file
19
src/api/system/area/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 地区信息 */
|
||||
export interface Area {
|
||||
id: number
|
||||
name: string
|
||||
parentId?: number
|
||||
children?: Area[]
|
||||
}
|
||||
|
||||
/** 获得地区树 */
|
||||
export function getAreaTree() {
|
||||
return http.get<Area[]>('/system/area/tree')
|
||||
}
|
||||
|
||||
/** 获得 IP 对应的地区名 */
|
||||
export function getAreaByIp(ip: string) {
|
||||
return http.get<string>(`/system/area/get-by-ip?ip=${ip}`)
|
||||
}
|
||||
45
src/api/system/dept/index.ts
Normal file
45
src/api/system/dept/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 部门信息 */
|
||||
export interface Dept {
|
||||
id?: number
|
||||
name: string
|
||||
parentId: number
|
||||
status: number
|
||||
sort: number
|
||||
leaderUserId?: number
|
||||
phone?: string
|
||||
email?: string
|
||||
createTime?: Date
|
||||
children?: Dept[]
|
||||
}
|
||||
|
||||
/** 获取部门列表 */
|
||||
export function getDeptList(params?: { name?: string, status?: number }) {
|
||||
return http.get<Dept[]>('/system/dept/list', params)
|
||||
}
|
||||
|
||||
/** 获取部门精简列表 */
|
||||
export function getSimpleDeptList() {
|
||||
return http.get<Dept[]>('/system/dept/simple-list')
|
||||
}
|
||||
|
||||
/** 获取部门详情 */
|
||||
export function getDept(id: number) {
|
||||
return http.get<Dept>(`/system/dept/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建部门 */
|
||||
export function createDept(data: Dept) {
|
||||
return http.post<number>('/system/dept/create', data)
|
||||
}
|
||||
|
||||
/** 更新部门 */
|
||||
export function updateDept(data: Dept) {
|
||||
return http.put<boolean>('/system/dept/update', data)
|
||||
}
|
||||
|
||||
/** 删除部门 */
|
||||
export function deleteDept(id: number) {
|
||||
return http.delete<boolean>(`/system/dept/delete?id=${id}`)
|
||||
}
|
||||
46
src/api/system/dict/data/index.ts
Normal file
46
src/api/system/dict/data/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 字典数据 */
|
||||
export interface DictData {
|
||||
id?: number
|
||||
dictType: string
|
||||
label: string
|
||||
value: string
|
||||
colorType?: string
|
||||
cssClass?: string
|
||||
sort?: number
|
||||
status: number
|
||||
remark?: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 查询字典数据(精简)列表 */
|
||||
export function getSimpleDictDataList() {
|
||||
return http.get<DictData[]>('/system/dict-data/simple-list')
|
||||
}
|
||||
|
||||
/** 查询字典数据分页列表 */
|
||||
export function getDictDataPage(params: PageParam) {
|
||||
return http.get<PageResult<DictData>>('/system/dict-data/page', params)
|
||||
}
|
||||
|
||||
/** 查询字典数据详情 */
|
||||
export function getDictData(id: number) {
|
||||
return http.get<DictData>(`/system/dict-data/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 新增字典数据 */
|
||||
export function createDictData(data: DictData) {
|
||||
return http.post<number>('/system/dict-data/create', data)
|
||||
}
|
||||
|
||||
/** 修改字典数据 */
|
||||
export function updateDictData(data: DictData) {
|
||||
return http.put<boolean>('/system/dict-data/update', data)
|
||||
}
|
||||
|
||||
/** 删除字典数据 */
|
||||
export function deleteDictData(id: number) {
|
||||
return http.delete<boolean>(`/system/dict-data/delete?id=${id}`)
|
||||
}
|
||||
42
src/api/system/dict/type/index.ts
Normal file
42
src/api/system/dict/type/index.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 字典类型 */
|
||||
export interface DictType {
|
||||
id?: number
|
||||
name: string
|
||||
type: string
|
||||
status: number
|
||||
remark?: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 查询字典类型(精简)列表 */
|
||||
export function getSimpleDictTypeList() {
|
||||
return http.get<DictType[]>('/system/dict-type/list-all-simple')
|
||||
}
|
||||
|
||||
/** 查询字典类型分页列表 */
|
||||
export function getDictTypePage(params: PageParam) {
|
||||
return http.get<PageResult<DictType>>('/system/dict-type/page', params)
|
||||
}
|
||||
|
||||
/** 查询字典类型详情 */
|
||||
export function getDictType(id: number) {
|
||||
return http.get<DictType>(`/system/dict-type/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 新增字典类型 */
|
||||
export function createDictType(data: DictType) {
|
||||
return http.post<number>('/system/dict-type/create', data)
|
||||
}
|
||||
|
||||
/** 修改字典类型 */
|
||||
export function updateDictType(data: DictType) {
|
||||
return http.put<boolean>('/system/dict-type/update', data)
|
||||
}
|
||||
|
||||
/** 删除字典类型 */
|
||||
export function deleteDictType(id: number) {
|
||||
return http.delete<boolean>(`/system/dict-type/delete?id=${id}`)
|
||||
}
|
||||
26
src/api/system/login-log/index.ts
Normal file
26
src/api/system/login-log/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 登录日志信息 */
|
||||
export interface LoginLog {
|
||||
id?: number
|
||||
traceId?: string
|
||||
userId?: number
|
||||
userType?: number
|
||||
logType?: number
|
||||
username?: string
|
||||
userIp?: string
|
||||
userAgent?: string
|
||||
result?: number
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取登录日志分页列表 */
|
||||
export function getLoginLogPage(params: PageParam) {
|
||||
return http.get<PageResult<LoginLog>>('/system/login-log/page', params)
|
||||
}
|
||||
|
||||
/** 获取登录日志详情 */
|
||||
export function getLoginLog(id: number) {
|
||||
return http.get<LoginLog>(`/system/login-log/get?id=${id}`)
|
||||
}
|
||||
45
src/api/system/mail/account/index.ts
Normal file
45
src/api/system/mail/account/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 邮箱账号信息 */
|
||||
export interface MailAccount {
|
||||
id?: number
|
||||
mail: string
|
||||
username: string
|
||||
password?: string
|
||||
host: string
|
||||
port: number
|
||||
sslEnable: boolean
|
||||
starttlsEnable: boolean
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 获取邮箱账号分页列表 */
|
||||
export function getMailAccountPage(params: PageParam) {
|
||||
return http.get<PageResult<MailAccount>>('/system/mail-account/page', params)
|
||||
}
|
||||
|
||||
/** 获取邮箱账号(精简)列表 */
|
||||
export function getSimpleMailAccountList() {
|
||||
return http.get<MailAccount[]>('/system/mail-account/simple-list')
|
||||
}
|
||||
|
||||
/** 获取邮箱账号详情 */
|
||||
export function getMailAccount(id: number) {
|
||||
return http.get<MailAccount>(`/system/mail-account/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建邮箱账号 */
|
||||
export function createMailAccount(data: MailAccount) {
|
||||
return http.post<number>('/system/mail-account/create', data)
|
||||
}
|
||||
|
||||
/** 更新邮箱账号 */
|
||||
export function updateMailAccount(data: MailAccount) {
|
||||
return http.put<boolean>('/system/mail-account/update', data)
|
||||
}
|
||||
|
||||
/** 删除邮箱账号 */
|
||||
export function deleteMailAccount(id: number) {
|
||||
return http.delete<boolean>(`/system/mail-account/delete?id=${id}`)
|
||||
}
|
||||
34
src/api/system/mail/log/index.ts
Normal file
34
src/api/system/mail/log/index.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 邮件日志信息 */
|
||||
export interface MailLog {
|
||||
id?: number
|
||||
userId?: number
|
||||
userType?: number
|
||||
templateId?: number
|
||||
templateCode?: string
|
||||
templateTitle?: string
|
||||
templateContent?: string
|
||||
templateParams?: Record<string, any>
|
||||
accountId?: number
|
||||
fromMail?: string
|
||||
toMails?: string[]
|
||||
ccMails?: string[]
|
||||
bccMails?: string[]
|
||||
sendStatus?: number
|
||||
sendTime?: string
|
||||
sendMessageId?: string
|
||||
sendException?: string
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 获取邮件日志分页列表 */
|
||||
export function getMailLogPage(params: PageParam) {
|
||||
return http.get<PageResult<MailLog>>('/system/mail-log/page', params)
|
||||
}
|
||||
|
||||
/** 获取邮件日志详情 */
|
||||
export function getMailLog(id: number) {
|
||||
return http.get<MailLog>(`/system/mail-log/get?id=${id}`)
|
||||
}
|
||||
56
src/api/system/mail/template/index.ts
Normal file
56
src/api/system/mail/template/index.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 邮件模板信息 */
|
||||
export interface MailTemplate {
|
||||
id?: number
|
||||
name: string
|
||||
code: string
|
||||
accountId?: number
|
||||
nickname?: string
|
||||
title: string
|
||||
content: string
|
||||
status: number
|
||||
remark?: string
|
||||
params?: string[]
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 发送邮件请求 */
|
||||
export interface MailSendReqVO {
|
||||
templateCode: string
|
||||
templateParams: Record<string, any>
|
||||
toMails: string[]
|
||||
ccMails?: string[]
|
||||
bccMails?: string[]
|
||||
}
|
||||
|
||||
/** 获取邮件模板分页列表 */
|
||||
export function getMailTemplatePage(params: PageParam) {
|
||||
return http.get<PageResult<MailTemplate>>('/system/mail-template/page', params)
|
||||
}
|
||||
|
||||
/** 获取邮件模板详情 */
|
||||
export function getMailTemplate(id: number) {
|
||||
return http.get<MailTemplate>(`/system/mail-template/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建邮件模板 */
|
||||
export function createMailTemplate(data: MailTemplate) {
|
||||
return http.post<number>('/system/mail-template/create', data)
|
||||
}
|
||||
|
||||
/** 更新邮件模板 */
|
||||
export function updateMailTemplate(data: MailTemplate) {
|
||||
return http.put<boolean>('/system/mail-template/update', data)
|
||||
}
|
||||
|
||||
/** 删除邮件模板 */
|
||||
export function deleteMailTemplate(id: number) {
|
||||
return http.delete<boolean>(`/system/mail-template/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 发送邮件 */
|
||||
export function sendMail(data: MailSendReqVO) {
|
||||
return http.post<number>('/system/mail-template/send-mail', data)
|
||||
}
|
||||
51
src/api/system/menu/index.ts
Normal file
51
src/api/system/menu/index.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 菜单信息 */
|
||||
export interface Menu {
|
||||
id?: number
|
||||
name: string
|
||||
permission: string
|
||||
type: number
|
||||
sort: number
|
||||
parentId: number
|
||||
path: string
|
||||
icon: string
|
||||
component: string
|
||||
componentName?: string
|
||||
status: number
|
||||
visible: boolean
|
||||
keepAlive: boolean
|
||||
alwaysShow?: boolean
|
||||
createTime?: Date
|
||||
children?: Menu[]
|
||||
}
|
||||
|
||||
/** 获取菜单列表 */
|
||||
export function getMenuList(params?: { name?: string, status?: number }) {
|
||||
return http.get<Menu[]>('/system/menu/list', params)
|
||||
}
|
||||
|
||||
/** 获取菜单精简列表 */
|
||||
export function getSimpleMenuList() {
|
||||
return http.get<Menu[]>('/system/menu/simple-list')
|
||||
}
|
||||
|
||||
/** 获取菜单详情 */
|
||||
export function getMenu(id: number) {
|
||||
return http.get<Menu>(`/system/menu/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建菜单 */
|
||||
export function createMenu(data: Menu) {
|
||||
return http.post<number>('/system/menu/create', data)
|
||||
}
|
||||
|
||||
/** 更新菜单 */
|
||||
export function updateMenu(data: Menu) {
|
||||
return http.put<boolean>('/system/menu/update', data)
|
||||
}
|
||||
|
||||
/** 删除菜单 */
|
||||
export function deleteMenu(id: number) {
|
||||
return http.delete<boolean>(`/system/menu/delete?id=${id}`)
|
||||
}
|
||||
39
src/api/system/notice/index.ts
Normal file
39
src/api/system/notice/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
const baseUrl = '/system/notice'
|
||||
|
||||
/** 通知公告信息 */
|
||||
export interface Notice {
|
||||
id?: number
|
||||
title: string
|
||||
content: string
|
||||
type: number
|
||||
status: number
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取通知公告分页列表 */
|
||||
export function getNoticePage(params: PageParam) {
|
||||
return http.get<PageResult<Notice>>(`${baseUrl}/page`, params)
|
||||
}
|
||||
|
||||
/** 获取通知公告详情 */
|
||||
export function getNotice(id: number) {
|
||||
return http.get<Notice>(`${baseUrl}/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建通知公告 */
|
||||
export function createNotice(data: Notice) {
|
||||
return http.post<number>(`${baseUrl}/create`, data)
|
||||
}
|
||||
|
||||
/** 更新通知公告 */
|
||||
export function updateNotice(data: Notice) {
|
||||
return http.put<boolean>(`${baseUrl}/update`, data)
|
||||
}
|
||||
|
||||
/** 删除通知公告 */
|
||||
export function deleteNotice(id: number) {
|
||||
return http.delete<boolean>(`${baseUrl}/delete?id=${id}`)
|
||||
}
|
||||
54
src/api/system/notify/message/index.ts
Normal file
54
src/api/system/notify/message/index.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 站内信消息信息 */
|
||||
export interface NotifyMessage {
|
||||
id: number
|
||||
userId: number
|
||||
userType: number
|
||||
templateId: number
|
||||
templateCode: string
|
||||
templateNickname: string
|
||||
templateContent: string
|
||||
templateType: number
|
||||
templateParams: string
|
||||
readStatus: boolean
|
||||
readTime: Date
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 查询站内信消息列表 */
|
||||
export function getNotifyMessagePage(params: PageParam) {
|
||||
return http.get<PageResult<NotifyMessage>>('/system/notify-message/page', params)
|
||||
}
|
||||
|
||||
/** 查询站内信消息详情 */
|
||||
export function getNotifyMessage(id: number) {
|
||||
return http.get<NotifyMessage>(`/system/notify-message/get`, { id })
|
||||
}
|
||||
|
||||
/** 获取我的站内信分页 */
|
||||
export function getMyNotifyMessagePage(params: PageParam) {
|
||||
return http.get<PageResult<NotifyMessage>>('/system/notify-message/my-page', params)
|
||||
}
|
||||
|
||||
/** 获取我的站内信详情 */
|
||||
export function getMyNotifyMessage(id: number) {
|
||||
return http.get<NotifyMessage>(`/system/notify-message/get`, { id })
|
||||
}
|
||||
|
||||
/** 批量标记站内信已读 */
|
||||
export function updateNotifyMessageRead(ids: number | number[]) {
|
||||
const idsArray = Array.isArray(ids) ? ids : [ids]
|
||||
return http.put<boolean>('/system/notify-message/update-read', undefined, { ids: idsArray })
|
||||
}
|
||||
|
||||
/** 标记所有站内信为已读 */
|
||||
export function updateAllNotifyMessageRead() {
|
||||
return http.put<boolean>('/system/notify-message/update-all-read')
|
||||
}
|
||||
|
||||
/** 获取当前用户的未读站内信数量 */
|
||||
export function getUnreadNotifyMessageCount() {
|
||||
return http.get<number>('/system/notify-message/get-unread-count')
|
||||
}
|
||||
54
src/api/system/notify/template/index.ts
Normal file
54
src/api/system/notify/template/index.ts
Normal file
@@ -0,0 +1,54 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 站内信模板信息 */
|
||||
export interface NotifyTemplate {
|
||||
id?: number
|
||||
name: string
|
||||
nickname: string
|
||||
code: string
|
||||
content: string
|
||||
type?: number
|
||||
params?: string[]
|
||||
status: number
|
||||
remark?: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 发送站内信请求 */
|
||||
export interface NotifySendReqVO {
|
||||
userId: number
|
||||
userType: number
|
||||
templateCode: string
|
||||
templateParams: Record<string, any>
|
||||
}
|
||||
|
||||
/** 查询站内信模板列表 */
|
||||
export function getNotifyTemplatePage(params: PageParam) {
|
||||
return http.get<PageResult<NotifyTemplate>>('/system/notify-template/page', params)
|
||||
}
|
||||
|
||||
/** 查询站内信模板详情 */
|
||||
export function getNotifyTemplate(id: number) {
|
||||
return http.get<NotifyTemplate>(`/system/notify-template/get`, { id })
|
||||
}
|
||||
|
||||
/** 新增站内信模板 */
|
||||
export function createNotifyTemplate(data: NotifyTemplate) {
|
||||
return http.post<number>('/system/notify-template/create', data)
|
||||
}
|
||||
|
||||
/** 修改站内信模板 */
|
||||
export function updateNotifyTemplate(data: NotifyTemplate) {
|
||||
return http.put<boolean>('/system/notify-template/update', data)
|
||||
}
|
||||
|
||||
/** 删除站内信模板 */
|
||||
export function deleteNotifyTemplate(id: number) {
|
||||
return http.delete<boolean>(`/system/notify-template/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 发送站内信 */
|
||||
export function sendNotify(data: NotifySendReqVO) {
|
||||
return http.post<number>('/system/notify-template/send-notify', data)
|
||||
}
|
||||
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}`)
|
||||
}
|
||||
31
src/api/system/operate-log/index.ts
Normal file
31
src/api/system/operate-log/index.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 操作日志信息 */
|
||||
export interface OperateLog {
|
||||
id?: number
|
||||
traceId?: string
|
||||
userId?: number
|
||||
userType?: number
|
||||
userName?: string
|
||||
type?: string
|
||||
subType?: string
|
||||
bizId?: number
|
||||
action?: string
|
||||
extra?: string
|
||||
requestMethod?: string
|
||||
requestUrl?: string
|
||||
userIp?: string
|
||||
userAgent?: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取操作日志分页列表 */
|
||||
export function getOperateLogPage(params: PageParam) {
|
||||
return http.get<PageResult<OperateLog>>('/system/operate-log/page', params)
|
||||
}
|
||||
|
||||
/** 获取操作日志详情 */
|
||||
export function getOperateLog(id: number) {
|
||||
return http.get<OperateLog>(`/system/operate-log/get?id=${id}`)
|
||||
}
|
||||
43
src/api/system/post/index.ts
Normal file
43
src/api/system/post/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 岗位信息 */
|
||||
export interface Post {
|
||||
id?: number
|
||||
name: string
|
||||
code: string
|
||||
sort: number
|
||||
status: number
|
||||
remark?: string
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 获取岗位分页列表 */
|
||||
export function getPostPage(params: PageParam) {
|
||||
return http.get<PageResult<Post>>('/system/post/page', params)
|
||||
}
|
||||
|
||||
/** 获取岗位精简列表 */
|
||||
export function getSimplePostList() {
|
||||
return http.get<Post[]>('/system/post/simple-list')
|
||||
}
|
||||
|
||||
/** 获取岗位详情 */
|
||||
export function getPost(id: number) {
|
||||
return http.get<Post>(`/system/post/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建岗位 */
|
||||
export function createPost(data: Post) {
|
||||
return http.post<number>('/system/post/create', data)
|
||||
}
|
||||
|
||||
/** 更新岗位 */
|
||||
export function updatePost(data: Post) {
|
||||
return http.put<boolean>('/system/post/update', data)
|
||||
}
|
||||
|
||||
/** 删除岗位 */
|
||||
export function deletePost(id: number) {
|
||||
return http.delete<boolean>(`/system/post/delete?id=${id}`)
|
||||
}
|
||||
46
src/api/system/role/index.ts
Normal file
46
src/api/system/role/index.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 角色信息 */
|
||||
export interface Role {
|
||||
id: number
|
||||
name: string
|
||||
code: string
|
||||
sort: number
|
||||
status: number
|
||||
type?: number
|
||||
remark?: string
|
||||
dataScope?: number
|
||||
dataScopeDeptIds?: number[]
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取角色分页列表 */
|
||||
export function getRolePage(params: PageParam) {
|
||||
return http.get<PageResult<Role>>('/system/role/page', params)
|
||||
}
|
||||
|
||||
/** 获取角色详情 */
|
||||
export function getRole(id: number) {
|
||||
return http.get<Role>(`/system/role/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建角色 */
|
||||
export function createRole(data: Role) {
|
||||
return http.post<number>('/system/role/create', data)
|
||||
}
|
||||
|
||||
/** 更新角色 */
|
||||
export function updateRole(data: Role) {
|
||||
return http.put<boolean>('/system/role/update', data)
|
||||
}
|
||||
|
||||
/** 删除角色 */
|
||||
export function deleteRole(id: number) {
|
||||
return http.delete<boolean>(`/system/role/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 获取角色精简列表 */
|
||||
export function getSimpleRoleList() {
|
||||
return http.get<Role[]>('/system/role/simple-list')
|
||||
}
|
||||
45
src/api/system/sms/channel/index.ts
Normal file
45
src/api/system/sms/channel/index.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 短信渠道信息 */
|
||||
export interface SmsChannel {
|
||||
id?: number
|
||||
code: string
|
||||
status: number
|
||||
signature: string
|
||||
remark?: string
|
||||
apiKey: string
|
||||
apiSecret?: string
|
||||
callbackUrl?: string
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 获取短信渠道分页列表 */
|
||||
export function getSmsChannelPage(params: PageParam) {
|
||||
return http.get<PageResult<SmsChannel>>('/system/sms-channel/page', params)
|
||||
}
|
||||
|
||||
/** 获取短信渠道精简列表 */
|
||||
export function getSimpleSmsChannelList() {
|
||||
return http.get<SmsChannel[]>('/system/sms-channel/simple-list')
|
||||
}
|
||||
|
||||
/** 获取短信渠道详情 */
|
||||
export function getSmsChannel(id: number) {
|
||||
return http.get<SmsChannel>(`/system/sms-channel/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建短信渠道 */
|
||||
export function createSmsChannel(data: SmsChannel) {
|
||||
return http.post<number>('/system/sms-channel/create', data)
|
||||
}
|
||||
|
||||
/** 更新短信渠道 */
|
||||
export function updateSmsChannel(data: SmsChannel) {
|
||||
return http.put<boolean>('/system/sms-channel/update', data)
|
||||
}
|
||||
|
||||
/** 删除短信渠道 */
|
||||
export function deleteSmsChannel(id: number) {
|
||||
return http.delete<boolean>(`/system/sms-channel/delete?id=${id}`)
|
||||
}
|
||||
39
src/api/system/sms/log/index.ts
Normal file
39
src/api/system/sms/log/index.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 短信日志信息 */
|
||||
export interface SmsLog {
|
||||
id?: number
|
||||
channelId?: number
|
||||
channelCode: string
|
||||
templateId?: number
|
||||
templateCode: string
|
||||
templateType?: number
|
||||
templateContent: string
|
||||
templateParams?: Record<string, any>
|
||||
apiTemplateId: string
|
||||
mobile: string
|
||||
userId?: number
|
||||
userType?: number
|
||||
sendStatus?: number
|
||||
sendTime?: string
|
||||
apiSendCode?: string
|
||||
apiSendMsg?: string
|
||||
apiRequestId?: string
|
||||
apiSerialNo?: string
|
||||
receiveStatus?: number
|
||||
receiveTime?: string
|
||||
apiReceiveCode?: string
|
||||
apiReceiveMsg?: string
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 获取短信日志分页列表 */
|
||||
export function getSmsLogPage(params: PageParam) {
|
||||
return http.get<PageResult<SmsLog>>('/system/sms-log/page', params)
|
||||
}
|
||||
|
||||
/** 获取短信日志详情 */
|
||||
export function getSmsLog(id: number) {
|
||||
return http.get<SmsLog>(`/system/sms-log/get?id=${id}`)
|
||||
}
|
||||
55
src/api/system/sms/template/index.ts
Normal file
55
src/api/system/sms/template/index.ts
Normal file
@@ -0,0 +1,55 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 短信模板信息 */
|
||||
export interface SmsTemplate {
|
||||
id?: number
|
||||
type?: number
|
||||
status: number
|
||||
code: string
|
||||
name: string
|
||||
content: string
|
||||
remark?: string
|
||||
apiTemplateId: string
|
||||
channelId?: number
|
||||
channelCode?: string
|
||||
params?: string[]
|
||||
createTime?: Date
|
||||
}
|
||||
|
||||
/** 发送短信请求 */
|
||||
export interface SmsSendReqVO {
|
||||
mobile: string
|
||||
templateCode: string
|
||||
templateParams: Record<string, any>
|
||||
}
|
||||
|
||||
/** 获取短信模板分页列表 */
|
||||
export function getSmsTemplatePage(params: PageParam) {
|
||||
return http.get<PageResult<SmsTemplate>>('/system/sms-template/page', params)
|
||||
}
|
||||
|
||||
/** 获取短信模板详情 */
|
||||
export function getSmsTemplate(id: number) {
|
||||
return http.get<SmsTemplate>(`/system/sms-template/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建短信模板 */
|
||||
export function createSmsTemplate(data: SmsTemplate) {
|
||||
return http.post<number>('/system/sms-template/create', data)
|
||||
}
|
||||
|
||||
/** 更新短信模板 */
|
||||
export function updateSmsTemplate(data: SmsTemplate) {
|
||||
return http.put<boolean>('/system/sms-template/update', data)
|
||||
}
|
||||
|
||||
/** 删除短信模板 */
|
||||
export function deleteSmsTemplate(id: number) {
|
||||
return http.delete<boolean>(`/system/sms-template/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 发送短信 */
|
||||
export function sendSms(data: SmsSendReqVO) {
|
||||
return http.post<number>('/system/sms-template/send-sms', data)
|
||||
}
|
||||
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}`)
|
||||
}
|
||||
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 | any
|
||||
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}`)
|
||||
}
|
||||
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}`)
|
||||
}
|
||||
72
src/api/system/user/index.ts
Normal file
72
src/api/system/user/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import type { PageParam, PageResult } from '@/http/types'
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 用户信息 */
|
||||
export interface User {
|
||||
id?: number
|
||||
username: string
|
||||
nickname: string
|
||||
password?: string
|
||||
deptId?: number
|
||||
deptName?: string
|
||||
postIds?: number[]
|
||||
email?: string
|
||||
mobile?: string
|
||||
sex?: number
|
||||
avatar?: string
|
||||
status: number
|
||||
remark?: string
|
||||
loginIp?: string
|
||||
loginDate?: string
|
||||
createTime?: string
|
||||
}
|
||||
|
||||
/** 获取用户分页列表 */
|
||||
export function getUserPage(params: PageParam) {
|
||||
return http.get<PageResult<User>>('/system/user/page', params)
|
||||
}
|
||||
|
||||
/** 获取用户详情 */
|
||||
export function getUser(id: number) {
|
||||
return http.get<User>(`/system/user/get?id=${id}`)
|
||||
}
|
||||
|
||||
/** 创建用户 */
|
||||
export function createUser(data: User) {
|
||||
return http.post<number>('/system/user/create', data)
|
||||
}
|
||||
|
||||
/** 更新用户 */
|
||||
export function updateUser(data: User) {
|
||||
return http.put<boolean>('/system/user/update', data)
|
||||
}
|
||||
|
||||
/** 删除用户 */
|
||||
export function deleteUser(id: number) {
|
||||
return http.delete<boolean>(`/system/user/delete?id=${id}`)
|
||||
}
|
||||
|
||||
/** 重置用户密码 */
|
||||
export function resetUserPassword(id: number, password: string) {
|
||||
return http.put<boolean>('/system/user/update-password', { id, password })
|
||||
}
|
||||
|
||||
/** 修改用户状态 */
|
||||
export function updateUserStatus(id: number, status: number) {
|
||||
return http.put<boolean>('/system/user/update-status', { id, status })
|
||||
}
|
||||
|
||||
/** 获取用户拥有的角色列表 */
|
||||
export function getUserRoleIds(userId: number) {
|
||||
return http.get<number[]>(`/system/permission/list-user-roles?userId=${userId}`)
|
||||
}
|
||||
|
||||
/** 分配用户角色 */
|
||||
export function assignUserRole(userId: number, roleIds: number[]) {
|
||||
return http.post<boolean>('/system/permission/assign-user-role', { userId, roleIds })
|
||||
}
|
||||
|
||||
/** 获取用户精简列表 */
|
||||
export function getSimpleUserList() {
|
||||
return http.get<User[]>('/system/user/simple-list')
|
||||
}
|
||||
48
src/api/system/user/profile/index.ts
Normal file
48
src/api/system/user/profile/index.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { http } from '@/http/http'
|
||||
|
||||
/** 用户个人中心信息 */
|
||||
export interface UserProfileVO {
|
||||
id: number
|
||||
username: string
|
||||
nickname: string
|
||||
email?: string
|
||||
mobile?: string
|
||||
sex?: number
|
||||
avatar?: string
|
||||
loginIp: string
|
||||
loginDate: Date
|
||||
createTime: Date
|
||||
roles: { id: number, name: string }[]
|
||||
dept: { id: number, name: string }
|
||||
posts: { id: number, name: string }[]
|
||||
}
|
||||
|
||||
/** 更新个人信息请求 */
|
||||
export interface UpdateProfileReqVO {
|
||||
nickname?: string
|
||||
email?: string
|
||||
mobile?: string
|
||||
sex?: number
|
||||
avatar?: string
|
||||
}
|
||||
|
||||
/** 更新密码请求 */
|
||||
export interface UpdatePasswordReqVO {
|
||||
oldPassword: string
|
||||
newPassword: string
|
||||
}
|
||||
|
||||
/** 获取登录用户个人信息 */
|
||||
export function getUserProfile() {
|
||||
return http.get<UserProfileVO>('/system/user/profile/get')
|
||||
}
|
||||
|
||||
/** 修改用户个人信息 */
|
||||
export function updateUserProfile(data: UpdateProfileReqVO) {
|
||||
return http.put<boolean>('/system/user/profile/update', data)
|
||||
}
|
||||
|
||||
/** 修改用户个人密码 */
|
||||
export function updateUserPassword(data: UpdatePasswordReqVO) {
|
||||
return http.put<boolean>('/system/user/profile/update-password', data)
|
||||
}
|
||||
109
src/api/types/login.ts
Normal file
109
src/api/types/login.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
// 认证模式类型
|
||||
export type AuthMode = 'single' | 'double'
|
||||
|
||||
// 单Token响应类型
|
||||
export interface ISingleTokenRes {
|
||||
token: string
|
||||
expiresIn: number // 有效期(秒)
|
||||
}
|
||||
|
||||
// 双Token响应类型
|
||||
export interface IDoubleTokenRes {
|
||||
accessToken: string
|
||||
refreshToken: string
|
||||
// accessExpiresIn: number // 访问令牌有效期(秒)
|
||||
// refreshExpiresIn: number // 刷新令牌有效期(秒)
|
||||
expiresTime: number // 访问令牌过期时间,单位:毫秒
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录返回的信息,其实就是 token 信息
|
||||
*/
|
||||
export type IAuthLoginRes = ISingleTokenRes | IDoubleTokenRes
|
||||
|
||||
/**
|
||||
* 用户信息
|
||||
*/
|
||||
export interface IUserInfoRes {
|
||||
userId: number
|
||||
username: string
|
||||
nickname: string
|
||||
avatar?: string
|
||||
[key: string]: any // 允许其他扩展字段
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限信息
|
||||
*/
|
||||
export interface AuthPermissionInfo {
|
||||
user: IUserInfoRes
|
||||
roles: string[]
|
||||
permissions: string[]
|
||||
// menus: AppRouteRecordRaw[]; // add by 芋艿:暂时用不到
|
||||
}
|
||||
|
||||
// 认证存储数据结构
|
||||
// TODO @芋艿:可以考虑删除
|
||||
export interface AuthStorage {
|
||||
mode: AuthMode
|
||||
tokens: ISingleTokenRes | IDoubleTokenRes
|
||||
userInfo?: IUserInfoRes
|
||||
loginTime: number // 登录时间戳
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
export interface ICaptcha {
|
||||
captchaEnabled: boolean
|
||||
uuid: string
|
||||
image: string
|
||||
}
|
||||
/**
|
||||
* 上传成功的信息
|
||||
*/
|
||||
export interface IUploadSuccessInfo {
|
||||
fileId: number
|
||||
originalName: string
|
||||
fileName: string
|
||||
storagePath: string
|
||||
fileHash: string
|
||||
fileType: string
|
||||
fileBusinessType: string
|
||||
fileSize: number
|
||||
}
|
||||
/**
|
||||
* 更新用户信息
|
||||
*/
|
||||
export interface IUpdateInfo {
|
||||
id: number
|
||||
name: string
|
||||
sex: string
|
||||
}
|
||||
/**
|
||||
* 更新用户信息
|
||||
*/
|
||||
export interface IUpdatePassword {
|
||||
id: number
|
||||
oldPassword: string
|
||||
newPassword: string
|
||||
confirmPassword: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为单Token响应
|
||||
* @param tokenRes 登录响应数据
|
||||
* @returns 是否为单Token响应
|
||||
*/
|
||||
export function isSingleTokenRes(tokenRes: IAuthLoginRes): tokenRes is ISingleTokenRes {
|
||||
return 'token' in tokenRes && !('refreshToken' in tokenRes)
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否为双Token响应
|
||||
* @param tokenRes 登录响应数据
|
||||
* @returns 是否为双Token响应
|
||||
*/
|
||||
export function isDoubleTokenRes(tokenRes: IAuthLoginRes): tokenRes is IDoubleTokenRes {
|
||||
return 'accessToken' in tokenRes && 'refreshToken' in tokenRes
|
||||
}
|
||||
Reference in New Issue
Block a user