Blame view

fw-valhalla-server/src/main/java/cn/fw/valhalla/controller/app/AccidentCarController.java 1.75 KB
e95f940e   张志伟   :art:
1
2
  package cn.fw.valhalla.controller.app;
  
0ce04411   张志伟   :sparkles:
3
  import cn.fw.common.web.annotation.ControllerMethod;
e95f940e   张志伟   :art:
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  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;
  
5b208ee4   张志伟   :bug:
19
20
  import javax.validation.Valid;
  
e95f940e   张志伟   :art:
21
  import static cn.fw.common.web.util.ResultBuilder.success;
e95f940e   张志伟   :art:
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  
  /**
   * @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")
0ce04411   张志伟   :sparkles:
44
      @ControllerMethod("新增事故车线索")
bf85c222   张志伟   :rocket:
45
      public Message<Long> save(@CurrentUser LoginAuthBean currentUser,
5b208ee4   张志伟   :bug:
46
                                @RequestBody @Valid final AccidentPoolDTO accidentPoolDTO) {
bf85c222   张志伟   :rocket:
47
          return success(accidentPoolBizService.add2Pool(currentUser, accidentPoolDTO));
e95f940e   张志伟   :art:
48
49
      }
  }