forked from gzzfw/backEnd/gz-dyh

wangwh
2024-08-28 b47d4a7accabce974e19d2a1ffb3c5c67507d74b
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
50
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();
        }
    }
 
 
}