cloudroam
2025-01-07 1d0fc6126fb664e81a1a3737d8eaf4a618e7cb0f
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
61
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);
    }
 
}