xuhy
2024-02-29 b3dd958fb089c7549373a7bf17a393b547742cc6
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
62
63
64
65
66
package com.ruoyi.web.controller.api;
 
 
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.TAdvertisementConfig;
import com.ruoyi.system.domain.TCustomerService;
import com.ruoyi.system.service.TConfigService;
import com.ruoyi.system.service.TCustomerServiceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * <p>
 * 客服配置表 前端控制器
 * </p>
 *
 * @author xiaochen
 * @since 2024-02-29
 */
@Api(tags = "客服配置")
@RestController
@RequestMapping("/tCustomerService")
public class TCustomerServiceController {
 
    private final TCustomerServiceService customerServiceService;
 
    @Autowired
    public TCustomerServiceController(TCustomerServiceService customerServiceService) {
        this.customerServiceService = customerServiceService;
    }
 
    /**
     * 查询客服配置
     */
    @ApiOperation(value = "查询客服配置")
    @GetMapping("/getCustomerServiceList")
    public AjaxResult<List<TCustomerService>> getCustomerServiceList()
    {
        return AjaxResult.success(customerServiceService.list());
    }
 
    /**
     * 添加客服配置
     */
    @ApiOperation(value = "添加客服配置")
    @PostMapping("/addCustomerService")
    public AjaxResult addCustomerService(@RequestBody TCustomerService customerService)
    {
        return AjaxResult.success(customerServiceService.save(customerService));
    }
 
    /**
     * 删除客服配置
     */
    @ApiOperation(value = "删除客服配置")
    @DeleteMapping("/deleteCustomerService")
    public AjaxResult deleteCustomerService(@RequestParam Long serviceId)
    {
        return AjaxResult.success(customerServiceService.removeById(serviceId));
    }
 
}