44323
2023-11-27 aa925d851857f50eff0556411366690d9a78a0e5
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 com.dsh.other.controller;
 
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.other.entity.Phone;
import com.dsh.other.model.vo.questionVo.UpdatePhoneVO;
import com.dsh.other.service.PhoneService;
import com.dsh.other.util.ResultUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
 
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
 
 
/**
 * 客服电话 控制器
 */
 
@Controller
@RequestMapping("")
public class TPhoneController {
 
    @Resource
    private PhoneService phoneService;
 
    @RequestMapping(value = "/base/phone/list")
    @ResponseBody
    public List<Phone> list() {
        return phoneService.list(new QueryWrapper<>());
    }
 
    /**
     * 修改客服电话
     */
    @RequestMapping("/update")
    @ResponseBody
    public Object update(@RequestBody Phone phone) {
        String phone1 = phone.getPhone();
        String substring = phone1.substring(0, phone1.length() - 1);
        phone.setPhone(substring);
        phone.setInsertTime(new Date());
        phoneService.updateById(phone);
        return ResultUtil.success();
    }
}