package com.mzl.flower.web.v2.configParam;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.mzl.flower.base.BaseController;
|
import com.mzl.flower.base.R;
|
import com.mzl.flower.base.ReturnDataDTO;
|
import com.mzl.flower.dto.request.configParam.ConfigCustomerServiceDTO;
|
import com.mzl.flower.dto.request.configParam.ConfigCustomerServiceQueryDTO;
|
import com.mzl.flower.dto.response.configParam.ConfigCustomerServiceVO;
|
import com.mzl.flower.service.config.ConfigCustomerServiceService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.RequiredArgsConstructor;
|
import org.springframework.http.ResponseEntity;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.validation.constraints.NotNull;
|
|
/**
|
* @author fanghaowei
|
* @version version2.0
|
* @className ConfigCustomerServiceController
|
* @date 2024/8/26
|
* @description 客服配置管理功能开发
|
*/
|
@Api(value = "客服配置管理", tags = "客服配置管理")
|
@RestController
|
@RequestMapping("/api")
|
@RequiredArgsConstructor
|
public class ConfigCustomerServiceController extends BaseController {
|
|
private final ConfigCustomerServiceService configCustomerServiceService;
|
|
@GetMapping("/configCustomer/list")
|
@ApiOperation(value = "客服配置列表", httpMethod = "GET")
|
public ResponseEntity<ReturnDataDTO<Page<ConfigCustomerServiceVO>>> getConfigCustomerServiceList(Page page, ConfigCustomerServiceQueryDTO dto) {
|
return returnData(R.SUCCESS.getCode(), configCustomerServiceService.queryPage(dto, page));
|
}
|
|
@GetMapping(value = "/configCustomer/delete")
|
@ApiOperation(value = "删除客服配置 ", httpMethod = "GET", notes = "ID")
|
public ResponseEntity delete(@NotNull(message = "id不能为空") Long id) {
|
configCustomerServiceService.deleteConfigCustomerService(String.valueOf(id));
|
return returnData(R.SUCCESS.getCode(), null);
|
}
|
|
@PostMapping(value = "/configCustomer/new")
|
@ApiOperation(value = "保存客服配置", httpMethod = "POST")
|
public ResponseEntity insert(@RequestBody ConfigCustomerServiceDTO configCustomerServiceDTO) {
|
configCustomerServiceService.saveConfigCustomerService(configCustomerServiceDTO);
|
return returnData(R.SUCCESS.getCode(), null);
|
}
|
|
@PostMapping(value = "/configCustomer/edit")
|
@ApiOperation(value = "更新客服配置", httpMethod = "POST")
|
public ResponseEntity update(@RequestBody ConfigCustomerServiceDTO configCustomerServiceDTO) {
|
configCustomerServiceService.updateConfigCustomerService(configCustomerServiceDTO);
|
return returnData(R.SUCCESS.getCode(), null);
|
}
|
|
}
|