xuhy
2026-03-27 0923c2a6f1a7b4d28e39f566f9ff27557e2bf250
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TServiceGuideFileController.java
@@ -1,9 +1,22 @@
package com.ruoyi.web.controller.api;
import org.springframework.web.bind.annotation.RequestMapping;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.dto.TServiceGuideFileDTO;
import com.ruoyi.system.model.TServiceGuideFile;
import com.ruoyi.system.query.TServiceGuideFileQuery;
import com.ruoyi.system.service.TServiceGuideFileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * <p>
@@ -13,9 +26,73 @@
 * @author xiaochen
 * @since 2025-11-06
 */
@Api(tags = "办事指南文件管理")
@RestController
@RequestMapping("/t-service-guide-file")
public class TServiceGuideFileController {
    private final TServiceGuideFileService serviceGuideFileService;
    @Autowired
    public TServiceGuideFileController(TServiceGuideFileService serviceGuideFileService) {
        this.serviceGuideFileService = serviceGuideFileService;
    }
    /**
     * 获取办事指南文件管理管理列表
     */
    @ApiOperation(value = "获取办事指南文件管理分页列表")
    @PostMapping(value = "/pageList")
    public R<PageInfo<TServiceGuideFile>> pageList(@RequestBody TServiceGuideFileQuery query) {
        return R.ok(serviceGuideFileService.pageList(query));
    }
    /**
     * 获取办事指南文件管理管理列表
     */
    @ApiOperation(value = "获取办事指南文件管理列表")
    @PostMapping(value = "/list")
    public R<List<TServiceGuideFile>> list() {
        return R.ok(serviceGuideFileService.list(Wrappers.lambdaQuery(TServiceGuideFile.class).orderByDesc(TServiceGuideFile::getCreateTime)));
    }
    /**
     * 添加办事指南文件管理管理
     */
    @Log(title = "办事指南文件管理信息-新增办事指南文件管理", businessType = BusinessType.INSERT)
    @ApiOperation(value = "添加办事指南文件管理")
    @PostMapping(value = "/add")
    public R<Boolean> add(@Validated @RequestBody TServiceGuideFileDTO dto) {
        return R.ok(serviceGuideFileService.saveBatch(dto.getList()));
    }
    /**
     * 查看办事指南文件管理详情
     */
    @ApiOperation(value = "查看办事指南文件管理详情")
    @GetMapping(value = "/getDetailById")
    public R<TServiceGuideFile> getDetailById(@RequestParam String id) {
        return R.ok(serviceGuideFileService.getById(id));
    }
    /**
     * 删除办事指南文件管理
     */
    @Log(title = "办事指南文件管理信息-删除办事指南文件管理", businessType = BusinessType.DELETE)
    @ApiOperation(value = "删除办事指南文件管理")
    @DeleteMapping(value = "/deleteById")
    public R<Boolean> deleteById(@RequestParam String id) {
        return R.ok(serviceGuideFileService.removeById(id));
    }
    /**
     * 批量删除办事指南文件管理
     */
    @Log(title = "办事指南文件管理信息-删除办事指南文件管理", businessType = BusinessType.DELETE)
    @ApiOperation(value = "批量删除办事指南文件管理")
    @DeleteMapping(value = "/deleteByIds")
    public R<Boolean> deleteByIds(@RequestBody List<String> ids) {
        return R.ok(serviceGuideFileService.removeByIds(ids));
    }
}