Commit 65c9ab23 authored by libin's avatar libin

客服悠

parent 196c0ba2
......@@ -18,7 +18,7 @@ import lombok.NoArgsConstructor;
public class CustomerServiceDTO {
private static final long serialVersionUID = 1L;
private String id;
private Long id;
/**
* 客服名称
......
......@@ -31,7 +31,7 @@ public class CustomerService {
@Id
@javax.persistence.Id
@GeneratedValue(generator = "JDBC")
private String id;
private Long id;
/**
* 客服名称
*/
......@@ -76,6 +76,10 @@ public class CustomerService {
* 客服电话
*/
private String telphone;
/**
* 登录密码
*/
private String password;
/**
* 是事删除 true:删除状态 1:正常
*/
......
......@@ -20,7 +20,7 @@ import java.io.Serializable;
public class CustomerServiceVO implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private Long id;
/**
* 客服名称
......
package com.xxfc.platform.im.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.im.biz.CustomerServiceBiz;
import com.xxfc.platform.im.biz.CustomerServiceMGBiz;
import com.xxfc.platform.im.vo.CustomerServiceVO;
import lombok.RequiredArgsConstructor;
......@@ -23,16 +24,19 @@ import java.util.List;
@RequestMapping("/app/unauth/customer_service")
public class CustomerServiceController {
private final CustomerServiceMGBiz customerServiceMGBiz;
private final CustomerServiceBiz customerServiceBiz;
@GetMapping("/list")
public ObjectRestResponse<List<CustomerServiceVO>> findAll(){
List<CustomerServiceVO> customerServiceVOS = customerServiceMGBiz.findAll();
// List<CustomerServiceVO> customerServiceVOS = customerServiceMGBiz.findAll();
List<CustomerServiceVO> customerServiceVOS = customerServiceBiz.findAll();
return ObjectRestResponse.succ(customerServiceVOS);
}
@GetMapping("/{id}")
public ObjectRestResponse<CustomerServiceVO> findById(@PathVariable(value = "id") String id){
CustomerServiceVO customerServiceVO = customerServiceMGBiz.findById(id);
public ObjectRestResponse<CustomerServiceVO> findById(@PathVariable(value = "id") Long id){
// CustomerServiceVO customerServiceVO = customerServiceMGBiz.findById(id);
CustomerServiceVO customerServiceVO = customerServiceBiz.findById(id);
return ObjectRestResponse.succ(customerServiceVO);
}
......
package com.xxfc.platform.im.rest.admin;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.im.biz.CustomerServiceBiz;
import com.xxfc.platform.im.biz.CustomerServiceMGBiz;
import com.xxfc.platform.im.biz.UserBiz;
import com.xxfc.platform.im.dto.CustomerServiceDTO;
import com.xxfc.platform.im.vo.CustomerServiceVO;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -21,12 +24,27 @@ public class CustomerServiceAdminController {
private final CustomerServiceMGBiz customerServiceMGBiz;
private final CustomerServiceBiz customerServiceBiz;
private final UserBiz userBiz;
@GetMapping("/page")
public ObjectRestResponse<PageDataVO<CustomerServiceVO>> findCustomerServiceWithPage(@RequestParam(value = "page") Integer page,
@RequestParam(value = "limit") Integer limit) {
PageDataVO<CustomerServiceVO> pageDataVO = customerServiceBiz.findCustomerServiceWithPage(page,limit);
return ObjectRestResponse.succ(pageDataVO);
}
@GetMapping("/{id}")
public ObjectRestResponse<CustomerServiceDTO> findCustomerService(@PathVariable(value = "id") Long id){
CustomerServiceDTO customerServiceDTO = customerServiceBiz.findCustomerServiceById(id);
return ObjectRestResponse.succ(customerServiceDTO);
}
@PostMapping("/add")
public ObjectRestResponse<Void> addCustomerService(@RequestBody CustomerServiceDTO customerServiceDTO){
customerServiceMGBiz.addCustomerService(customerServiceDTO);
// customerServiceMGBiz.addCustomerService(customerServiceDTO);
customerServiceBiz.addCustomerService(customerServiceDTO);
return ObjectRestResponse.succ();
}
......@@ -34,13 +52,15 @@ public class CustomerServiceAdminController {
public ObjectRestResponse<Void> updateCustomerService(@PathVariable(value = "telphone") String telphone,
@PathVariable(value = "password") String password){
userBiz.updatePasswordByPhone(telphone,password);
customerServiceBiz.updatePasswordByPhone(telphone,password);
return ObjectRestResponse.succ();
}
@DeleteMapping("/delete/{id}/{imUserId}")
public ObjectRestResponse<Void> deleteCustomerService(@PathVariable(value = "id") String id,
public ObjectRestResponse<Void> deleteCustomerService(@PathVariable(value = "id") Long id,
@PathVariable(value = "imUserId") Integer imUserId){
customerServiceMGBiz.updateCustomerServiceIsDelToTrue(id,imUserId);
// customerServiceMGBiz.updateCustomerServiceIsDelToTrue(id,imUserId);
customerServiceBiz.updateCustomerServiceIsDelToTrue(id,imUserId);
return ObjectRestResponse.succ();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment