---
title: "公文智能排版返回文件替换钩子(2025.09.01基线以上支持)"
publicId: "5d81c546-80ca-4b0c-a7f6-befa68f9785c"
source: "https://weapp.eteams.cn/build/techdoc/wdoc/index.html#/public/doc/5d81c546-80ca-4b0c-a7f6-befa68f9785c"
---
**二开接口标识：**ODOC_AI_FORMAT_001

**参数：**

| 参数名 |  | 必选 | 类型 | 说明 |
| --- | --- | --- | --- | --- |
| fileId |  | 是 | String | 原始排版后文件id |
| formatId |  | 是 | String | 公文格式Id |
| userId |  | 是 | String | 用户Id |

**返回值：**

| 参数名 |  | 必选 | 类型 | 说明 |
| --- | --- | --- | --- | --- |
| fileId |  | 是 | String | 替换后文件id |

示例：

```
@Slf4j
@WeaHookReg(code = "ODOC_AI_FORMAT_001", order = 0)
public class AiProofreadHook extends RegHookEvent {

    @Override
    public WeaHookResponse handle(WeaHookRequest request, WeaHookResponse response, AppInfo appInfo) throws Exception {
        Map<String, Object> params = request.getParams();

        Map<String, Object> resultMap = new HashMap<>();
        // todo
        resultMap.put("fileId", -1L);
 
        response.setResult(resultMap);

        return response;
    }

    @Override
    public void rollBack(WeaHookRequest request, WeaHookResponse response, AppInfo appInfo) throws Exception {
    }
}
```
