刘光辉
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
package jnpf.dmsController.permission;
 
import cn.dev33.satoken.same.SaSameUtil;
import jnpf.base.ActionResult;
import jnpf.dmsPermission.DmsTrustedServiceGuard;
import jnpf.dmsService.expiry.DmsFileExpiryJob;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
@RestController
@RequestMapping("/Internal/dms/file-expiry")
@RequiredArgsConstructor
public class DmsInternalExpiryController {
    private final DmsTrustedServiceGuard guard;
    private final DmsFileExpiryJob job;
 
    /** Manual recovery uses exactly the same business checks and batch limits as scheduling. */
    @PostMapping("/run")
    public ActionResult<DmsFileExpiryJob.Result> run(
            @RequestHeader(value = "X-DMS-Service-Id", required = false) String serviceId) {
        SaSameUtil.checkCurrentRequestToken();
        guard.requireAllowed(serviceId);
        return ActionResult.success(job.run());
    }
}