routerAdd('POST', '/api/dictionary/list', function (e) {
    const guards = require(`${__hooks}/bai_api_pb_hooks/bai_api_shared/middlewares/requestGuards.js`)
    const dictionaryService = require(`${__hooks}/bai_api_pb_hooks/bai_api_shared/services/dictionaryService.js`)
    const logger = require(`${__hooks}/bai_api_pb_hooks/bai_api_shared/utils/logger.js`)
    const { success, fail } = require(`${__hooks}/bai_api_pb_hooks/bai_api_shared/utils/response.js`)

    try {
        guards.requireJson(e)

        const payload = guards.validateDictionaryListBody(e)
        const data = dictionaryService.listDictionaries(payload.keyword)

        return success(e, '查询字典列表成功', {
            items: data,
        })
    } catch (err) {
        const status = (err && err.statusCode) || (err && err.status) || 400
        logger.error('查询字典列表失败', {
            status: status,
            errMsg: (err && err.message) || '未知错误',
            data: (err && err.data) || {},
        })
        return fail(e, (err && err.message) || '操作失败', (err && err.data) || {}, status)
    }
})





