package com.fs.live.controller;

import com.fs.common.core.controller.BaseController;
import com.fs.common.core.domain.R;
import com.fs.common.core.redis.RedisCache;
import com.fs.his.domain.FsUser;
import com.fs.his.service.IFsUserService;
import com.fs.live.domain.LiveUserBehaviorTrack;
import com.fs.live.service.ILiveUserBehaviorTrackService;
import com.fs.live.util.LiveBehaviorTrackUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@RequestMapping("/app/live/liveData")
public class LiveDataController extends BaseController {

    @Autowired
    private RedisCache redisCache;

    @Autowired
    private ILiveUserBehaviorTrackService behaviorTrackService;
    /**
     * 点赞
     * */
    @GetMapping("/like/{liveId}")
    public R like(@PathVariable("liveId") Long liveId) {
        //直播间总点赞数
        Long increment = redisCache.incr("live:like:" + liveId, 1);
        return R.ok().put("like",increment);
    }
}
