package com.mosty.yjzl.controller;

import com.mosty.base.model.vo.yjzl.TbFzycPzVo;
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.yjzl.service.TbFzycPzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;


@Api(tags = "犯罪预测配置接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbFzycPz")
public class TbFzycPzController {

    private TbFzycPzService tbFzycService;

    @ApiOperation("新增数据")
    @JwtSysUser
    @PostMapping
    @Log(title = "犯罪预测配置新增", businessType = BusinessType.INSERT)
    public ResponseResult<Integer> add(@RequestBody TbFzycPzVo vo) {
        return ResponseResult.success(tbFzycService.insert(vo));
    }

    @ApiOperation("更新数据")
    @JwtSysUser
    @PutMapping
    @Log(title = "犯罪预测配置更新", businessType = BusinessType.UPDATE)
    public ResponseResult<Integer> edit(@RequestBody TbFzycPzVo vo) {
        return ResponseResult.success(tbFzycService.updateById(vo));
    }

    @ApiOperation("删除数据")
    @JwtSysUser
    @DeleteMapping("/{id}")
    @Log(title = "犯罪预测配置删除", businessType = BusinessType.DELETE)
    public ResponseResult<Integer> update(@PathVariable("id") String id) {
        return ResponseResult.success(tbFzycService.deleteById(id));
    }



}
