ContractController.java 819 Bytes
package vion.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vion.cron.ContractRunner;
import vion.service.IContractService;

/**
 * 合同管理
 */
@RestController
@RequestMapping("/api")
@RequiredArgsConstructor
public class ContractController {

    private final IContractService contractService;

    private final ContractRunner contractRunner;

    @PostMapping("/contractSync")
    @SaCheckPermission(value = "contract:sync", orRole="admin")
    public String manualSyncContract() {
        return contractRunner.contractSync() ? "成功" : "失败";
    }
}