package com.ruoyi.approve.controller;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.ruoyi.approve.mapper.KnowledgeBaseMapper;
|
import com.ruoyi.approve.pojo.KnowledgeBase;
|
import com.ruoyi.approve.pojo.RpaProcessAutomation;
|
import com.ruoyi.approve.service.KnowledgeBaseService;
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
import lombok.AllArgsConstructor;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import java.util.List;
|
|
@RestController
|
@RequestMapping("/knowledgeBase")
|
@AllArgsConstructor
|
public class KnowledgeBaseController {
|
@Autowired
|
private KnowledgeBaseService knowledgeBaseService;
|
|
/**、
|
* 获取列表
|
* @return
|
*/
|
@GetMapping("/getList")
|
public AjaxResult getList(@RequestParam(defaultValue = "1") long current,
|
@RequestParam(defaultValue = "10") long size, KnowledgeBase knowledgeBase) {
|
Page page = new Page(current, size);
|
return AjaxResult.success(knowledgeBaseService.listpage(page,knowledgeBase));
|
}
|
/**、
|
* 增添
|
* @return
|
*/
|
@PostMapping("/add")
|
public AjaxResult add(@RequestBody KnowledgeBase knowledgeBase){
|
return AjaxResult.success(knowledgeBaseService.save(knowledgeBase));
|
}
|
/**
|
* 更新
|
* @return
|
*/
|
@PostMapping("/update")
|
public AjaxResult update(@RequestBody KnowledgeBase knowledgeBase){
|
return AjaxResult.success(knowledgeBaseService.updateById(knowledgeBase));
|
}
|
/**
|
* 删除
|
* @return
|
*/
|
@DeleteMapping("/delete")
|
public AjaxResult delete(@RequestBody List<Long> ids){
|
if(CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID");
|
return AjaxResult.success(knowledgeBaseService.removeByIds(ids));
|
}
|
|
}
|