gongchunyi
5 小时以前 84746c6a1fe8fb6c0216495110895cb5d346563e
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
package com.ruoyi.aftersalesservice.controller;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.aftersalesservice.pojo.AfterSalesServiceFile;
import com.ruoyi.aftersalesservice.service.AfterSalesServiceFileService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
 
/**
 * <br>
 * 售后服务附件表控制层
 * </br>
 *
 * @author deslrey
 * @version 1.0
 * @since 2026/03/02 11:20
 */
@RestController
@Api(tags = "售后服务附件表")
@RequestMapping("/afterSalesService/file")
public class AfterSalesServiceFileController extends BaseController {
 
    @Autowired
    private AfterSalesServiceFileService afterSalesServiceFileService;
 
    @PostMapping("/upload")
    @ApiOperation("售后服务-文件上传")
    @Log(title = "售后服务-文件上传", businessType = BusinessType.INSERT)
    public AjaxResult fileUpload(@RequestParam("file") MultipartFile file,
                                 @RequestParam("id") Long afterSalesServiceId) {
        afterSalesServiceFileService.fileUpload(file, afterSalesServiceId);
        return AjaxResult.success("上传成功");
    }
 
    @GetMapping("/listPage")
    @ApiOperation("售后处理-售后附件列表")
    @Log(title = "售后处理-售后附件列表", businessType = BusinessType.OTHER)
    public AjaxResult fileList(Page<AfterSalesServiceFile> page, Long afterSalesServiceId) {
        return AjaxResult.success(afterSalesServiceFileService.fileList(page, afterSalesServiceId));
    }
 
    @DeleteMapping("/del/{fileId}")
    @ApiOperation("售后处理-删除附件")
    @Log(title = "售后处理-删除附件", businessType = BusinessType.DELETE)
    public AjaxResult delFile(@PathVariable Long fileId) {
        afterSalesServiceFileService.delFile(fileId);
        return AjaxResult.success("删除成功!");
    }
}