init
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import OptionService from '@/main/service/option/index'
|
||||
import { DEFINE_STRING } from '../../ipcDefineString'
|
||||
import { OptionType } from '../../enum/option'
|
||||
import { ipcMain } from 'electron'
|
||||
|
||||
function OptionIpc() {
|
||||
/** 获取指定的Option,通过key,不存在返回null */
|
||||
ipcMain.handle(
|
||||
DEFINE_STRING.OPTION.GET_OPTION_BY_KEY,
|
||||
async (_, key: string) => await OptionService.GetOptionByKey(key)
|
||||
)
|
||||
|
||||
/** 修改指定的Option,通过key,不存在则创建 */
|
||||
ipcMain.handle(
|
||||
DEFINE_STRING.OPTION.MODIFY_OPTION_BY_KEY,
|
||||
async (_, key: string, value: string, type: OptionType) =>
|
||||
await OptionService.ModifyOptionByKey(key, value, type)
|
||||
)
|
||||
}
|
||||
|
||||
export default OptionIpc
|
||||
Reference in New Issue
Block a user