zhou zhou
19 小时以前 eb49fb9a98d6dd4e4361daf4eac4f9313236b8e8
rsf-server/src/main/java/com/vincent/rsf/server/ai/controller/AiMcpMountController.java
@@ -1,6 +1,7 @@
package com.vincent.rsf.server.ai.controller;
import com.vincent.rsf.framework.common.R;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.vincent.rsf.server.ai.dto.AiMcpToolTestRequest;
import com.vincent.rsf.server.ai.entity.AiMcpMount;
import com.vincent.rsf.server.ai.service.AiMcpMountService;
@@ -29,25 +30,38 @@
    public R page(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<AiMcpMount, BaseParam> pageParam = new PageParam<>(baseParam, AiMcpMount.class);
        return R.ok().add(aiMcpMountService.page(pageParam, pageParam.buildWrapper(true)));
        return R.ok().add(aiMcpMountService.page(pageParam, pageParam.buildWrapper(true)
                .eq("tenant_id", getTenantId())
                .eq("deleted", 0)));
    }
    @PreAuthorize("hasAuthority('system:aiMcpMount:list')")
    @PostMapping("/aiMcpMount/list")
    public R list(@RequestBody Map<String, Object> map) {
        return R.ok().add(aiMcpMountService.list());
        return R.ok().add(aiMcpMountService.list(new LambdaQueryWrapper<AiMcpMount>()
                .eq(AiMcpMount::getTenantId, getTenantId())
                .eq(AiMcpMount::getDeleted, 0)
                .orderByAsc(AiMcpMount::getSort)
                .orderByDesc(AiMcpMount::getId)));
    }
    @PreAuthorize("hasAuthority('system:aiMcpMount:list')")
    @PostMapping({"/aiMcpMount/many/{ids}", "/aiMcpMounts/many/{ids}"})
    public R many(@PathVariable Long[] ids) {
        return R.ok().add(aiMcpMountService.listByIds(Arrays.asList(ids)));
        return R.ok().add(aiMcpMountService.list(new LambdaQueryWrapper<AiMcpMount>()
                .eq(AiMcpMount::getTenantId, getTenantId())
                .eq(AiMcpMount::getDeleted, 0)
                .in(AiMcpMount::getId, Arrays.asList(ids))));
    }
    @PreAuthorize("hasAuthority('system:aiMcpMount:list')")
    @GetMapping("/aiMcpMount/{id}")
    public R get(@PathVariable("id") Long id) {
        return R.ok().add(aiMcpMountService.getById(id));
        return R.ok().add(aiMcpMountService.getOne(new LambdaQueryWrapper<AiMcpMount>()
                .eq(AiMcpMount::getId, id)
                .eq(AiMcpMount::getTenantId, getTenantId())
                .eq(AiMcpMount::getDeleted, 0)
                .last("limit 1")));
    }
    @PreAuthorize("hasAuthority('system:aiMcpMount:list')")
@@ -66,7 +80,8 @@
    @OperationLog("Create AiMcpMount")
    @PostMapping("/aiMcpMount/save")
    public R save(@RequestBody AiMcpMount aiMcpMount) {
        aiMcpMountService.validateBeforeSave(aiMcpMount);
        aiMcpMount.setTenantId(getTenantId());
        aiMcpMountService.validateBeforeSave(aiMcpMount, getTenantId());
        aiMcpMount.setCreateBy(getLoginUserId());
        aiMcpMount.setCreateTime(new Date());
        aiMcpMount.setUpdateBy(getLoginUserId());
@@ -81,7 +96,8 @@
    @OperationLog("Update AiMcpMount")
    @PostMapping("/aiMcpMount/update")
    public R update(@RequestBody AiMcpMount aiMcpMount) {
        aiMcpMountService.validateBeforeUpdate(aiMcpMount);
        aiMcpMount.setTenantId(getTenantId());
        aiMcpMountService.validateBeforeUpdate(aiMcpMount, getTenantId());
        aiMcpMount.setUpdateBy(getLoginUserId());
        aiMcpMount.setUpdateTime(new Date());
        if (!aiMcpMountService.updateById(aiMcpMount)) {
@@ -103,6 +119,10 @@
    @PreAuthorize("hasAuthority('system:aiMcpMount:list')")
    @PostMapping("/aiMcpMount/export")
    public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception {
        ExcelUtil.build(ExcelUtil.create(aiMcpMountService.list(), AiMcpMount.class), response);
        ExcelUtil.build(ExcelUtil.create(aiMcpMountService.list(new LambdaQueryWrapper<AiMcpMount>()
                .eq(AiMcpMount::getTenantId, getTenantId())
                .eq(AiMcpMount::getDeleted, 0)
                .orderByAsc(AiMcpMount::getSort)
                .orderByDesc(AiMcpMount::getId)), AiMcpMount.class), response);
    }
}