|
@@ -1,142 +0,0 @@
|
|
|
-//package com.example.nngkxxdp.controller;
|
|
|
-//
|
|
|
-//import java.util.Date;
|
|
|
-//
|
|
|
-//import cn.hutool.core.date.DateUtil;
|
|
|
-//import com.example.nngkxxdp.entity.TFileLibrary;
|
|
|
-//import com.example.nngkxxdp.service.TFileLibraryService;
|
|
|
-//import com.example.nngkxxdp.util.Blank;
|
|
|
-//import com.example.nngkxxdp.util.ConstStr;
|
|
|
-//import com.example.nngkxxdp.util.SendUtil;
|
|
|
-//import org.springframework.data.domain.Page;
|
|
|
-//import org.springframework.data.domain.PageRequest;
|
|
|
-//import org.springframework.http.ResponseEntity;
|
|
|
-//import org.springframework.web.bind.annotation.*;
|
|
|
-//
|
|
|
-//import javax.annotation.Resource;
|
|
|
-//import java.util.Map;
|
|
|
-//
|
|
|
-///**
|
|
|
-// * (TFileLibrary)表控制层
|
|
|
-// *
|
|
|
-// * @author makejava
|
|
|
-// * @since 2021-12-06 16:26:11
|
|
|
-// */
|
|
|
-//@RestController
|
|
|
-//@RequestMapping("tFileLibrary")
|
|
|
-//public class TFileLibraryController {
|
|
|
-// /**
|
|
|
-// * 服务对象
|
|
|
-// */
|
|
|
-// @Resource
|
|
|
-// private TFileLibraryService tFileLibraryService;
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 查询文件信息
|
|
|
-// *
|
|
|
-// * @param typeId
|
|
|
-// * @param page
|
|
|
-// * @param limit
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @GetMapping("/getAllFileByType")
|
|
|
-// public Map<String, Object> getAllFile(Integer typeId,Integer page, Integer limit) {
|
|
|
-// if (Blank.isEmpty(limit, page)) {
|
|
|
-// return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
|
|
|
-// }
|
|
|
-// page = (page-1)*limit;
|
|
|
-// return tFileLibraryService.getAllFile(typeId, page, limit);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 添加文件信息
|
|
|
-// *
|
|
|
-// * @param userId
|
|
|
-// * @param typeId
|
|
|
-// * @param title
|
|
|
-// * @param content
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @PostMapping("/addFile")
|
|
|
-// public Map<String, Object> addFile(Integer userId, Integer typeId, String title, String content, String createTime) {
|
|
|
-// if (Blank.isEmpty(userId, typeId)) {
|
|
|
-// return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
|
|
|
-// }
|
|
|
-// TFileLibrary tFileLibrary = new TFileLibrary();
|
|
|
-// tFileLibrary.setUserId(userId);
|
|
|
-// tFileLibrary.setTypeId(typeId);
|
|
|
-// tFileLibrary.setTitle(title);
|
|
|
-// tFileLibrary.setContent(content);
|
|
|
-// tFileLibrary.setState(0);
|
|
|
-// if (createTime == null) {
|
|
|
-// tFileLibrary.setCreateTime(new Date());
|
|
|
-// }
|
|
|
-// tFileLibrary.setCreateTime(DateUtil.parse(createTime));
|
|
|
-// return tFileLibraryService.addFile(tFileLibrary);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 更新文件信息
|
|
|
-// *
|
|
|
-// * @param userId
|
|
|
-// * @param typeId
|
|
|
-// * @param title
|
|
|
-// * @param content
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @PostMapping("/updateFile")
|
|
|
-// public Map<String, Object> updateFile(Long id, Integer userId, Integer typeId, String title, Integer state, String content) {
|
|
|
-// if (Blank.isEmpty(title, content, state, typeId, userId, id)) {
|
|
|
-// return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
|
|
|
-// }
|
|
|
-// TFileLibrary tFileLibrary = new TFileLibrary();
|
|
|
-// tFileLibrary.setId(id);
|
|
|
-// tFileLibrary.setUserId(userId);
|
|
|
-// tFileLibrary.setTypeId(typeId);
|
|
|
-// tFileLibrary.setTitle(title);
|
|
|
-// tFileLibrary.setContent(content);
|
|
|
-// tFileLibrary.setState(state);
|
|
|
-// tFileLibrary.setUpdateTime(new Date());
|
|
|
-// return tFileLibraryService.updateFile(tFileLibrary);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 删除文件
|
|
|
-// *
|
|
|
-// * @param id
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @GetMapping("/delFile")
|
|
|
-// public Map<String, Object> delFile(Long id) {
|
|
|
-// if (Blank.isEmpty(id)) {
|
|
|
-// return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
|
|
|
-// }
|
|
|
-// return tFileLibraryService.delFile(id);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * Es搜索
|
|
|
-// *
|
|
|
-// * @param typeId
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @GetMapping("/getFileByEs")
|
|
|
-// public Map<String, Object> getFileByEs(Integer page, Integer limit, Integer typeId, String keywords) {
|
|
|
-// if (Blank.isEmpty(limit, page, keywords)) {
|
|
|
-// return SendUtil.send(false, ConstStr.REQUEST_WRONGPARAMS);
|
|
|
-// }
|
|
|
-// page = (page-1)*limit;
|
|
|
-// return tFileLibraryService.getFileByEs(page, limit, typeId, keywords);
|
|
|
-// }
|
|
|
-//
|
|
|
-// /**
|
|
|
-// * 数据库添加到es(测试)
|
|
|
-// *
|
|
|
-// * @return
|
|
|
-// */
|
|
|
-// @GetMapping("/addFileByEs")
|
|
|
-// public Map<String, Object> addFileByEs() {
|
|
|
-// return tFileLibraryService.addFileByEs();
|
|
|
-// }
|
|
|
-//}
|
|
|
-//
|