package com.td.boss.game.comcnttosnb.controller;

import com.td.boss.common.controller.CommonController;
import com.td.boss.common.pojo.Result;
import com.td.boss.game.comcnttosnb.pojo.ComCntToSnb;
import com.td.boss.game.comcnttosnb.service.ComCntToSnbService;
import com.td.boss.game.comcnttosnb.vo.ComCntToSnbVo;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/game/comCntToSnb/")
public class ComCntToSnbController extends CommonController<ComCntToSnbVo, ComCntToSnb, Integer> {
    @Autowired
    private ComCntToSnbService comCntToSnbService;

    @GetMapping("get")
    public Result<ComCntToSnbVo> get(@RequestParam(value = "userId") String userId) {
        return Result.of(comCntToSnbService.findByUserId(userId));
    }

    @GetMapping("receive")
    public Result<String> receive(@RequestParam(value = "userId") String userId) {
        return comCntToSnbService.receiveByUserId(userId);
    }
}
