package org.springblade.qinzhesync.controller; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; import org.springblade.qinzhesync.service.QinzheSyncService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @Slf4j @RestController @RequestMapping("/test/qinzhe") @Tag(name = "主制分工表", description = "主制分工表") public class SyncController { @Autowired private QinzheSyncService service; /** * 新增 */ @GetMapping("/sync") @Operation(summary = "同步", description = "同步分工表") public R sync() { try { service.syncData(); }catch (Exception e) { log.error("同步失败", e);; return R.fail(e.getMessage()); } return R.status(true); } }