CustomerController.java 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package com.loan.system.controller.wechat;
  2. import com.loan.system.domain.pojo.Result;
  3. import com.loan.system.service.CustomerService;
  4. import com.loan.system.utils.ResultUtil;
  5. import io.swagger.annotations.Api;
  6. import io.swagger.annotations.ApiOperation;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.security.access.prepost.PreAuthorize;
  9. import org.springframework.web.bind.annotation.*;
  10. @RestController
  11. @RequestMapping("/wechat/customers")
  12. @Api(tags = "微信客户接口")
  13. public class CustomerController {
  14. @Autowired
  15. private CustomerService customerService;
  16. @GetMapping
  17. @ApiOperation("查询所有客户")
  18. public Result findAllCustomers(Integer pageNum, Integer pageSize){
  19. return ResultUtil.success("success", customerService.getAllCustomers(pageNum, pageSize,false));
  20. }
  21. @GetMapping("/{id}")
  22. @ApiOperation("按id选择客户")
  23. public Result findCustomerById(@PathVariable Long id){
  24. return ResultUtil.success("success", customerService.findByCustomerIdAndIsDelete( id, false));
  25. }
  26. @GetMapping("/{key}")
  27. @ApiOperation("按关键字(姓名/手机号)选择客户")
  28. @PreAuthorize("@pms.hasAnyRoles('SYSTEM_ADMIN','LEAD_SALES', 'ASSIST_SALES')")
  29. public Result findCustomerByKey(@PathVariable("key") String key,Integer pageNum, Integer pageSize){
  30. return ResultUtil.success("success", customerService.getCustomerByKey(key,false , pageNum, pageSize));
  31. }
  32. @PostMapping("/confirm/main")
  33. @ApiOperation("手机号与身份证鉴权")
  34. public Result confirm(@RequestBody String mobile){
  35. return ResultUtil.success("success");
  36. }
  37. @PostMapping("/confirm/faceAuth")
  38. @ApiOperation("人脸识别鉴权")
  39. public Result faceAuth(@RequestBody String mobile){
  40. return ResultUtil.success("success");
  41. }
  42. @PostMapping("/confirm/bankAccount")
  43. @ApiOperation("银行账号鉴权")
  44. public Result bankAccount(@RequestBody String mobile){
  45. return ResultUtil.success("success");
  46. }
  47. }