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

    try {
        guards.requireJson(e)
        guards.requireManagePlatformUser(e)

        const payload = guards.validateDocumentHistoryListBody(e)
        const data = documentService.listDocumentHistories(payload)

        return success(e, '查询文档操作历史成功', {
            items: data,
        })
    } catch (err) {
        const status = (err && err.statusCode) || (err && err.status) || 400
        logger.error('查询文档操作历史失败', {
            status: status,
            message: (err && err.message) || '未知错误',
            data: (err && err.data) || {},
        })
        return e.json(status, {
            code: status,
            msg: (err && err.message) || '查询文档操作历史失败',
            data: (err && err.data) || {},
        })
    }
})
