南昌市物联网技防平台-公安版
zengh
2021-06-04 c926acaadc3d98fd8ba8926466b842f1edb3aee3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package org.springblade.jfpt.riskreporting.controller;
 
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springblade.jfpt.riskreporting.entity.RiskReporting;
import org.springblade.jfpt.riskreporting.service.RiskReportingService;
import org.springblade.jfpt.visitrecord.entity.Visitrecord;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.validation.Valid;
import java.util.Date;
 
/**
 * 风险记录控制层
 * @author zhongrj
 * @time 2021-05-26
 */
 
@RestController
@AllArgsConstructor
@RequestMapping("/riskReporting")
public class RiskReportingController extends BladeController {
 
    private final RiskReportingService riskReportingService;
 
    /**
     * 新增风险记录信息
     * @param riskReporting  风险记录对象
     */
    @PostMapping("/save")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "新增", notes = "传入riskReporting")
    public R save(@Valid @RequestBody RiskReporting riskReporting) {
        //设置信息
        riskReporting.setCreateTime(new Date());
        //请求新增并返回
        return R.status(riskReportingService.insert(riskReporting));
    }
}