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 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(); } }