package com.mosty.sjzx.controller;

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.base.model.entity.sjzx.TbSjCyjl;
import com.mosty.sjzx.service.TbSjCyjlService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("tbSjCyjl")
public class TbSjCyjlController {

    @Resource
    private TbSjCyjlService tbSjCyjlService;

    @GetMapping("slectPolice")
    @ApiOperation("大屏-查询参与警力列表")
    @JwtSysUser
    @Log(title = "大屏-查询参与警力列表", businessType = BusinessType.OTHER)
    public ResponseResult queryAll() {
        return ResponseResult.success(this.tbSjCyjlService.queryAll());
    }

    @ApiOperation("通过主键查询单条数据")
    @GetMapping("{id}")
    @JwtSysUser
    @Log(title = "通过主键查询单条数据", businessType = BusinessType.OTHER)
    public ResponseResult<TbSjCyjl> queryById(@PathVariable("id") String id) {
        return ResponseResult.success(this.tbSjCyjlService.queryById(id));
    }

    @ApiOperation("大屏-警力调度-参与警力")
    @PostMapping("/joinCopCount")
    @Log(title = "大屏-警力调度-参与警力", businessType = BusinessType.OTHER)
    public ResponseResult joinCopCount(@RequestBody TbSjCyjl tbSjCyjl) {
        return ResponseResult.success(tbSjCyjlService.joinCopCount(tbSjCyjl));
    }
}


