UserSyncController.java
1.41 KB
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
51
package com.mass.controller;
import com.mass.service.UserSyncService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.repository.query.Param;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.IOException;
@Slf4j
@RestController
@RequestMapping(value = "/sync")
public class UserSyncController {
@Resource
private UserSyncService userSyncService;
@GetMapping("/syncAllUser")
public String syncAllUser() throws IOException {
userSyncService.syncAllUser();
return "ok";
}
@GetMapping("/syncUpdateUser")
public String syncUpdateUser() throws IOException {
userSyncService.syncUpdateUser();
return "ok";
}
@GetMapping("/syncAllOrg")
public String syncAllOrg() throws IOException {
userSyncService.syncAllOrg();
return "ok";
}
@GetMapping("/syncUpdateOrg")
public String syncUpdateOrg() throws IOException {
userSyncService.syncUpdateOrg();
return "ok";
}
@GetMapping("/getLastExecTime")
public String getLastExecTime(@Param("fileName") String fileName) throws IOException {
userSyncService.getLastExecTime(fileName);
return "ok";
}
}