刘光辉
5 小时以前 06f314545ac3514d7ce28939920866ae8188d31c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package jnpf.onlyoffice;
 
import jnpf.base.ActionResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
 
/** ELN 记录修订与 OnlyOffice 编辑/保存之间的内部互斥契约。 */
@FeignClient(name = "jnpf-biz-common", path = "/Internal/onlyoffice/record-revision",
        contextId = "recordRevisionFenceApi")
public interface RecordRevisionFenceApi {
 
    @PostMapping("/acquire")
    ActionResult<String> acquire(@RequestParam("tenantId") String tenantId,
                                 @RequestParam("recordId") String recordId,
                                 @RequestParam("fileId") String fileId,
                                 @RequestParam("fileType") String fileType);
 
    /** 用调用方操作码幂等获取短时冻结 lease,网络响应丢失时可安全重试。 */
    @PostMapping("/acquire-for-operation")
    ActionResult<String> acquireForOperation(@RequestParam("tenantId") String tenantId,
                                             @RequestParam("recordId") String recordId,
                                             @RequestParam("fileId") String fileId,
                                             @RequestParam("fileType") String fileType,
                                             @RequestParam("operationCode") String operationCode);
 
    @PostMapping("/complete")
    ActionResult<Boolean> complete(@RequestParam("tenantId") String tenantId,
                                   @RequestParam("recordId") String recordId,
                                   @RequestParam("fileId") String fileId,
                                   @RequestParam("fileType") String fileType,
                                   @RequestParam("token") String token);
 
    @PostMapping("/release")
    ActionResult<Boolean> release(@RequestParam("tenantId") String tenantId,
                                  @RequestParam("recordId") String recordId,
                                  @RequestParam("fileId") String fileId,
                                  @RequestParam("fileType") String fileType,
                                  @RequestParam("token") String token);
 
    /** 释放短时 fence,并推进文档 key,避免重新打开时命中更新前的文档缓存。 */
    @PostMapping("/release-after-document-update")
    ActionResult<Boolean> releaseAfterDocumentUpdate(
            @RequestParam("tenantId") String tenantId,
            @RequestParam("recordId") String recordId,
            @RequestParam("fileId") String fileId,
            @RequestParam("fileType") String fileType,
            @RequestParam("token") String token);
}