新版仿ok交易所-后端
zyy
2026-01-04 7295334ff00457c111484d2f021a9c33bbf4a5f2
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
package com.yami.trading.api.controller.exchange;
 
import com.yami.trading.common.constants.Constants;
import com.yami.trading.common.web.ResultObject;
import com.yami.trading.service.rate.ExchangeRateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.io.IOException;
 
@RestController
@CrossOrigin
public class APiListExchangeRateController {
 
    private static final Logger logger = LoggerFactory.getLogger(APiListExchangeRateController.class);
 
    @Autowired
    private ExchangeRateService exchangeRateService;
 
    @RequestMapping("api/exchangerate!list.action")
    public ResultObject list() throws IOException {
 
        ResultObject resultObject = new ResultObject();
 
        try {
            String out_or_in = Constants.OUT_OR_IN_DEFAULT;
            resultObject.setData(this.exchangeRateService.findBy(out_or_in));
        } catch (Exception e) {
            resultObject.setCode("1");
            resultObject.setMsg("程序错误");
            logger.error("error:", e);
        }
        return resultObject;
    }
}