wanghc
2023-07-04 a042e0e63f86a0880d20e57c14ec4a60b65801fb
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
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.resp.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));
        }
    }
}