jack
2024-03-28 3698d82e83cdb9c687c0e932093e712bda729b42
src/main/java/com/nq/controller/echo/EChoController.java
@@ -3,6 +3,7 @@
import com.nq.common.ServerResponse;
import com.nq.pojo.User;
import com.nq.service.IEchoServices;
import com.nq.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
@@ -22,6 +23,9 @@
    @Autowired
    IEchoServices iEchoServices;
    @Autowired
    IUserService iUserService;
    @PostMapping("queryEcho.do")
    @ResponseBody
    public ServerResponse queryEcho() {
@@ -32,6 +36,10 @@
    @PostMapping("buyEcho.do")
    @ResponseBody
    public ServerResponse buyEcho(@RequestParam("eId") String eid, @RequestParam("money") Integer money, HttpServletRequest request) {
        User user = this.iUserService.getCurrentRefreshUser(request);
        if(user == null){
              return ServerResponse.createByErrorMsg("Please Login");
        }
        if (iEchoServices.buyECho(eid, money,request)) {
            return ServerResponse.createBySuccess("Buy Successed");
        } else {