| | |
| | | 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; |
| | |
| | | @Autowired |
| | | IEchoServices iEchoServices; |
| | | |
| | | @Autowired |
| | | IUserService iUserService; |
| | | |
| | | @PostMapping("queryEcho.do") |
| | | @ResponseBody |
| | | public ServerResponse queryEcho() { |
| | |
| | | @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 { |