package com.itheima.controller;

import com.itheima.service.RedPacketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/*****
 * @Author: http://www.itheima.com
 * @Description: com.itheima.controller.RedPacketController
 ****/
@RestController
@RequestMapping(value = "/red/packet")
public class RedPacketController {

    @Autowired
    private RedPacketService redPacketService;

    /****
     * 用于抢红包
     */
    @GetMapping(value = "/grab")
    public Double grab(){
        return redPacketService.grab();
    }


}
