package com.jttech.pfcs.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; import com.jttech.pfcs.services.IPublicService; import com.jttech.pfcs.vo.ResponseVo; /** * @author wanghc * @version 1.0.0 * @date 2023-03-07 */ @RestController @RequestMapping("/pub") public class PublicController { private Logger mLogger = LoggerFactory.getLogger(getClass()); @Autowired private IPublicService mPublicService; @RequestMapping(value = "/heart", method = RequestMethod.GET) public ResponseVo heart() { final long beginTime = System.currentTimeMillis(); ResponseVo result = new ResponseVo(); try { mPublicService.heartTest(); return result; } finally { final long endTime = System.currentTimeMillis(); mLogger.info("Execute heart the result is {} time spent is {} ", result, (endTime - beginTime)); } } }