| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- package com.malk.gewu.controller;
- /**
- * 错误抛出与拦截详见 CatchException
- */
- import com.malk.gewu.service.GWService;
- import com.malk.server.common.McR;
- import com.malk.utils.UtilFile;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- @Slf4j
- @RestController
- @RequestMapping
- public class GWController {
- @Autowired
- private GWService gwService;
- /**
- * 同步花名册信息
- */
- @PostMapping("sync")
- McR syncRoster() {
- gwService.syncRoster();
- return McR.success();
- }
- /**
- * test
- */
- @PostMapping("test")
- McR test() {
- // String path = JSONUtil.class.getClassLoader().getResource("templates/personnel").getPath();
- // log.info("xxx, {}", path);
- // String json = UtilFile.readJsonStringFromFile(path);
- //
- // return McR.success(JSON.parse(json));
- // return McR.success(UtilFile.readJsonObjectFromResource("templates/personnel"));
- return McR.success(UtilFile.readJsonObjectFromResource("static/json/personnel.json"));
- // return McR.success(ddClient_personnel.getPersonnelMeta(ddClient.getAccessToken(), ddConf.getAgentId()));
- }
- }
|