puzhibing
2023-06-13 7860e5cb6db60aeb82c640651998f8294635df5b
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package com.dsh.course.controller;
 
import com.dsh.course.entity.Phone;
import com.dsh.course.model.dto.GetPhoneInfoRequest;
import com.dsh.course.service.IPhoneService;
import com.dsh.guns.modular.system.util.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
import java.util.Map;
 
/**
 * 系统电话控制器
 */
@Api
@RestController
@RequestMapping("/base/phone")
public class PhoneController {
 
    @Autowired
    private IPhoneService phoneService;
 
    /**
     * 获取系统所有电话
     * @return
     */
    @ResponseBody
    @PostMapping("/queryPhones")
    @ApiOperation(value = "Get home page phone获取首页电话", tags = {"Client - Home page用户端-首页"}, notes = "type=1(报警电话),type=2(投诉电话),type=3(包车调度电话)")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "Current location administrative area number当前定位行政区域编号", name = "code", required = true, dataType = "string")
    })
    public ResultUtil queryPhones(String code){
        try {
            List<Phone> phones = phoneService.queryPhones(code);
            return ResultUtil.success(phones);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    /**
     * 获取个人中心的客服电话
     * @param code
     * @return
     */
    @ResponseBody
    @PostMapping("/queryCustomerPhone")
    @ApiOperation(value = "Get the customer service number of the personal center获取个人中心的客服电话", tags = {"Client - Personal center用户端-个人中心", "Driver side - Home page司机端-首页"}, notes = "platform(平台电话),company(本地电话)")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "Current location administrative area number当前定位行政区域编号", name = "code", required = true, dataType = "string"),
            @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....")
    })
    public ResultUtil queryCustomerPhone(String code){
        try {
            Map<String, Object> map = phoneService.queryCustomerPhone(code);
            return ResultUtil.success(map);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
 
    /**
     * 获取忘记密码页面的电话
     * @return
     */
    @ResponseBody
    @PostMapping("/base/driver/queryPhone")
    @ApiOperation(value = "Get the phone for the forgotten password page获取忘记密码页面的电话", tags = {"Driver side - Login司机端-登录"}, notes = "")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "Current location City Administrative Number (510100)当前定位城市行政编号(510100)", name = "code", required = true, dataType = "String")
    })
    public ResultUtil queryPhone(String code){
        try {
            Map<String, Object> map = phoneService.queryPhone(code);
            return ResultUtil.success(map);
        }catch (Exception e){
            e.printStackTrace();
            return ResultUtil.runErr();
        }
    }
 
 
    @PostMapping(value = "/base/driver/selectPhoneByCompany")
    public String selectPhoneByCompany(@RequestBody GetPhoneInfoRequest request){
        return phoneService.selectPhoneByCompany(request);
    }
 
}