Files
PicList/src/main/events/rpc/routes/plugin/index.ts
2025-07-31 17:37:30 +08:00

34 lines
706 B
TypeScript

import { IRPCActionType } from '#/types/enum'
import { RPCRouter } from '~/events/rpc/router'
import {
pluginGetListFunc,
pluginImportLocalFunc,
pluginInstallFunc,
pluginUpdateAllFunc
} from '~/events/rpc/routes/plugin/utils'
const pluginRouter = new RPCRouter()
const pluginRoutes = [
{
action: IRPCActionType.PLUGIN_GET_LIST,
handler: pluginGetListFunc
},
{
action: IRPCActionType.PLUGIN_INSTALL,
handler: pluginInstallFunc
},
{
action: IRPCActionType.PLUGIN_IMPORT_LOCAL,
handler: pluginImportLocalFunc
},
{
action: IRPCActionType.PLUGIN_UPDATE_ALL,
handler: pluginUpdateAllFunc
}
]
pluginRouter.addBatch(pluginRoutes)
export { pluginRouter }