AccidentCarController.java
1.75 KB
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
46
47
48
49
package cn.fw.valhalla.controller.app;
import cn.fw.common.web.annotation.ControllerMethod;
import cn.fw.common.web.auth.LoginAuthBean;
import cn.fw.common.web.auth.annotation.CurrentUser;
import cn.fw.data.base.domain.common.Message;
import cn.fw.security.auth.client.annotation.Authorization;
import cn.fw.security.auth.client.enums.AuthType;
import cn.fw.valhalla.domain.dto.AccidentPoolDTO;
import cn.fw.valhalla.service.bus.cust.AccidentPoolBizService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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 static cn.fw.common.web.util.ResultBuilder.success;
/**
* @author : kurisu
* @className : AccidentCarController
* @description : 事故车处理控制器
* @date: 2020-08-15 14:52
*/
@Slf4j
@RestController
@Authorization(AuthType.APP)
@Validated
@RequestMapping("/app/accident")
public class AccidentCarController {
private final AccidentPoolBizService accidentPoolBizService;
@Autowired
public AccidentCarController(final AccidentPoolBizService accidentPoolBizService) {
this.accidentPoolBizService = accidentPoolBizService;
}
@PostMapping("/pool/save")
@ControllerMethod("新增事故车线索")
public Message<Long> save(@CurrentUser LoginAuthBean currentUser,
@RequestBody @Valid final AccidentPoolDTO accidentPoolDTO) {
return success(accidentPoolBizService.add2Pool(currentUser, accidentPoolDTO));
}
}