jack
2024-03-27 9b857ed9a9c6e07cc656622b0664109e61638041
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
45
46
47
48
49
50
51
52
53
package com.nq.controller.echo;
 
import com.nq.common.ServerResponse;
import com.nq.pojo.User;
import com.nq.service.IEchoServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.servlet.http.HttpServletRequest;
 
/**
 * 利息报接口
 */
@Controller
@RequestMapping("/api/echo")
public class EChoController {
 
    @Autowired
    IEchoServices iEchoServices;
 
    @PostMapping("queryEcho.do")
    @ResponseBody
    public ServerResponse queryEcho() {
        return ServerResponse.createBySuccess(iEchoServices.queryList());
    }
 
 
    @PostMapping("buyEcho.do")
    @ResponseBody
    public ServerResponse buyEcho(@RequestParam("eId") String eid, @RequestParam("money") Integer money, HttpServletRequest request) {
        if (iEchoServices.buyECho(eid, money,request)) {
            return ServerResponse.createBySuccess("Buy Successed");
        } else {
            return ServerResponse.createByErrorMsg("Buy Fail");
        }
    }
 
 
    @PostMapping("queryOrderEcho.do")
    @ResponseBody
    public ServerResponse queryOrderEcho(HttpServletRequest request) {
      return ServerResponse.createBySuccess(iEchoServices.queryOrderEcho(request));
    }
 
 
 
 
 
}