huliguo
10 天以前 e3a2245265516fef78b4737d6fffc939e7c5e0af
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
package com.ruoyi.web.controller.errand;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.errand.domain.Phone;
import com.ruoyi.errand.object.vo.app.ConfirmOrderVO;
import com.ruoyi.errand.service.PhoneService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
@Validated
@RestController
@RequestMapping(value = "/app/phone")
 
@Slf4j
public class PhoneController {
    @Autowired
    private PhoneService phoneService;
 
    /**
     * 联系客服
     */
    @GetMapping("/getServletPhone")
    @ApiOperation(value = "获取客服电话",tags = { "app用户端-联系客服" })
    public R<String> getServletPhone() {
        return R.ok(phoneService.getServletPhone());
    }
 
    /**
     * 保存客服电话
     */
    @PutMapping("/saveServicePhone")
    @PreAuthorize("@ss.hasPermi('system:feedback:list')")
    @ApiOperation(value = "反馈管理-保存客服电话", tags = {"管理后台-系统管理"})
    public R<Void> saveServicePhone(@RequestParam("phone")String phone) {
        phoneService.saveServicePhone(phone);
        return R.ok();
    }
 
    /**
     * 联系客服
     */
    @GetMapping("/getSysPhone")
    @PreAuthorize("@ss.hasPermi('system:feedback:list')")
    @ApiOperation(value = "获取客服电话",tags = { "管理后台-系统管理" })
    public R<String> getSysPhone() {
        Phone one = phoneService.getOne(new LambdaQueryWrapper<Phone>().eq(Phone::getType, 1));
        if (one != null) {
            return R.ok(one.getPhone());
        }else {
            return R.ok();
        }
    }
 
}