package com.mosty.qwzx.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.dto.qwzx.TbQwSpsHdgjChangeDto;
import com.mosty.base.model.dto.spxl.TbSpxlSpxlfaUpdateDto;
import com.mosty.base.model.entity.qwzx.TbQwSpsCsdw;
import com.mosty.base.model.entity.spxl.TbSpxlSpxlfa;
import com.mosty.base.model.query.qwzx.TbQwSpsCsdwQuery;
import com.mosty.base.model.query.spxl.TbSpxlSpxlfaQuery;
import com.mosty.base.model.vo.qwzx.TbQwSpsCsdwVo;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.qwzx.service.TbQwSpsCsdwService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author dw
 * @since 2022/9/17
 **/
@Api(tags = "世乒赛参赛队伍相关接口")
@RestController
@AllArgsConstructor
@RequestMapping("/tbQwSpsCsdw")
public class TbQwSpsCsdwController {

    @Resource
    private TbQwSpsCsdwService tbQwSpsCsdwService;

    @ApiOperation("根据条件查询所有的参赛队伍")
    @JwtSysUser
    @GetMapping("getList")
    public ResponseResult<Object> getList(TbQwSpsCsdwQuery dto) {
        return ResponseResult.success(this.tbQwSpsCsdwService.getList(dto));
    }

    @ApiOperation("查询某一个队伍的当前的状态")
    @JwtSysUser
    @GetMapping("getCsdwInfo/{id}")
    public ResponseResult<TbQwSpsCsdwVo> getCsdwInfo(@PathVariable("id") String id) {
        return ResponseResult.success(this.tbQwSpsCsdwService.getCsdwInfo(id));
    }

    @ApiOperation("参赛队伍活动轨迹变更")
    @JwtSysUser
    @PostMapping("changeHdgj")
    public ResponseResult<Void> changeHdgj(@RequestBody TbQwSpsHdgjChangeDto dto) {
        this.tbQwSpsCsdwService.changeHdgj(dto);
        return ResponseResult.success();
    }
}
