package com.muzhi.huanshi.controller; import com.muzhi.huanshi.service.DingOaService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.web.bind.annotation.*; @Api(description = "钉钉") @RestController @RequestMapping("/dingservice") //@CrossOrigin//解决跨域问题 public class DingOaController { @Autowired private DingOaService dingOaService; //获取钉钉人员-同步至宜搭人员信息表 @ApiOperation(value = "获取钉钉人员-同步至宜搭人员信息表") @PostMapping("addDingdingRenyuan") // @Scheduled(cron = "0 10 23 * * ?")//每天23:10触发(也就是凌晨23点10分触发) // @Scheduled(cron = "0 0/10 * * * ?")//每10分钟执行一次 // @Scheduled(cron = "0 */10 * * * ?")//每隔10分钟执行一次 public String getKaoqin(){ String addDingdingRenyuan = dingOaService.addDingdingRenyuan(); return addDingdingRenyuan; } //统计钉钉考勤、请假、TB项目/任务工时 @ApiOperation(value = "统计钉钉考勤、请假、TB项目/任务工时表") @PostMapping("allTongji") // @Scheduled(cron = "0 30 10 * * ?")//每天01:30触发(也就是凌晨01点30分触发) // @Scheduled(cron = "0 0/10 * * * ?")//每10分钟执行一次 // @Scheduled(cron = "0 */10 * * * ?")//每隔10分钟执行一次 public String allTongji(int type){ String allTongji = dingOaService.allTongji(type); return allTongji; } }