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
39
40
41
42
43
44
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import com.jttech.pfcs.services.ITradeService;
import com.jttech.pfcs.vo.resp.ResponseVo;
 
/**
 * @author wanghc
 * @version 1.0.0
 * @date 2023-03-07
 */
@RestController
@RequestMapping("/trade")
public class TradeController {
    private Logger mLogger = LoggerFactory.getLogger(getClass());
 
    @Autowired
    private ITradeService mTradeService;
 
    /**
     * 单笔交易
     * @param content
     * @return
     */
    @PostMapping("/excute")
    public ResponseVo excute(String url, String content) {
        mLogger.info("TradeController.excute excute={}", content);
        final long beginTime = System.currentTimeMillis();
        ResponseVo result = new ResponseVo();
        try {
            String body = mTradeService.excute(url, content);
            return result.setBody(body);
        } finally {
            final long endTime = System.currentTimeMillis();
            mLogger.info("Execute excute the result is {} time spent is {} ", result, (endTime - beginTime));
        }
    }
}