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

import com.td.boss.common.controller.*;
import com.td.boss.common.pojo.Result;
import com.td.boss.game.commallother.pojo.ComMallOther;
import com.td.boss.game.commallother.vo.ComMallOtherSimpleVo;
import com.td.boss.game.commallother.vo.ComMallOtherVo;
import com.td.boss.game.commallother.service.ComMallOtherService;
import com.td.boss.util.CopyUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/game/comMallOther/")
public class ComMallOtherController extends CommonController<ComMallOtherVo, ComMallOther, Integer> {
    @Autowired
    private ComMallOtherService comMallOtherService;

    /**
     * 获取商城装备栏列表
     *
     * @param userId
     * @return
     */
    @GetMapping("getMallEquipmentList")
    public Result<List<ComMallOtherSimpleVo>> getEquipmentListFunction(@RequestParam(value = "userId") String userId) {
        ComMallOtherVo comMallOtherVo = new ComMallOtherVo();
        Result result = comMallOtherService.list(comMallOtherVo);
        List<ComMallOtherSimpleVo> comMallOtherSimpleVos = CopyUtil.copyList((List<ComMallOtherSimpleVo>) result.getData(), ComMallOtherSimpleVo.class);
        return Result.of(comMallOtherSimpleVos);
    }
}
