package cn.huge.module.sync.controller;
|
|
import cn.huge.base.common.utils.ReturnFailUtils;
|
import cn.huge.base.common.utils.ReturnSucUtils;
|
import cn.huge.module.sync.service.SyncService;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
/**
|
* @title: 客户组织信息表接口api-web端
|
* @description: 客户组织信息表接口api-web端
|
* @company: hugeinfo
|
* @author: liyj
|
* @time: 2024-08-17 15:30:57
|
* @version: 1.0.0
|
*/
|
@Slf4j
|
@RestController
|
@RequestMapping("/api/sync")
|
public class SyncController {
|
|
@Autowired(required = false)
|
private HttpServletRequest request;
|
|
private final SyncService syncService;
|
|
public SyncController(SyncService syncService) {
|
this.syncService = syncService;
|
}
|
|
/**
|
* 数据迁移通用接口
|
* @url {ctx}/api/web/ctUnit/universalSync
|
* @return Object
|
*/
|
@GetMapping("/universalSync")
|
public Object universalSync() {
|
try {
|
syncService.syncData();
|
return ReturnSucUtils.getRepInfo( "处理成功", null);
|
} catch (Exception e) {
|
return ReturnFailUtils.getRepInfo();
|
}
|
}
|
|
|
}
|