package com.fs.app.controller.live;

import com.fs.app.annotation.Login;
import com.fs.app.controller.AppBaseController;
import com.fs.app.facade.LiveFacadeService;
import com.fs.common.core.domain.R;
import com.fs.live.param.RedPO;
import org.springframework.beans.factory.annotation.Autowired;
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("/app/live/liveRed")
public class LiveRedController extends AppBaseController {

    @Autowired
    private LiveFacadeService liveFacadeService;

    /**
     * 领取红包
     */
    @Login
    @PostMapping("/claim")
    public R claim(@RequestBody RedPO red) {
        red.setUserId(Long.parseLong(getUserId()));
        return liveFacadeService.redClaim(red);
    }

}
