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

import com.td.boss.common.controller.*;
import com.td.boss.common.pojo.Result;
import com.td.boss.game.combosses.pojo.ComBosses;
import com.td.boss.game.comrewards.pojo.ComRewards;
import com.td.boss.game.comrewards.vo.ComRewardsVo;
import com.td.boss.game.comrewards.service.ComRewardsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/game/comRewards/")
public class ComRewardsController extends CommonController<ComRewardsVo, ComRewards, Integer> {
    @Autowired
    private ComRewardsService comRewardsService;

    @GetMapping("getBossReward")
    public Result<Map> getBossReward(@RequestParam("userId") String userId ) {
        ComRewards comRewards = comRewardsService.findByUserIdAndType(userId,0);
        Map map = new HashMap();
        if(comRewards == null){
            return Result.of(null,false,"bosses 奖励不存在！");
        }

        map.put("mnt",comRewards.getMnt());
        map.put("mnw",comRewards.getMnw());
        map.put("bgb",comRewards.getBgb());
        map.put("mns",comRewards.getMns());
        return Result.of(map);
    }
}
