package com.game.business.controller;

import com.game.business.domain.AppGameBetting;
import com.game.common.core.controller.BaseController;
import com.game.common.core.domain.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/game/record")
public class GameController extends BaseController{

    /**
     * 下注
     */
    @PostMapping(value = "/betting")
    public AjaxResult betting(@RequestBody AppGameBetting gameBetting)
    {
        // 获取用户金额，判断投注金额是否大于余额
        if(gameBetting.getBettingAmount() > 0){
            return error("余额不足，投注失败。");
        }

        // 投注时间判断，根据游戏ID和期号，查询游戏开奖剩余时间
        if(gameBetting.getBettingAmount() > 0){
            return error("已超过投注下单时间");
        }

        // 插入投注记录
    }

}
