|
@@ -20,6 +20,7 @@ import org.brynhild.common.utils.TimeUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -65,7 +66,7 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
if(!category.getOwnerId().equals(tokenValidateResult.getUserId().longValue())){
|
|
|
return new Result(false,StatusCode.ERROR,"分类不存在或查询失败");
|
|
|
}
|
|
|
- return new Result(true,StatusCode.OK,"查询成功",category);
|
|
|
+ return new Result(true,StatusCode.OK,"查询成功",new CategoryResponse(category));
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -78,7 +79,10 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
if(categoryList==null){
|
|
|
return new Result(false,StatusCode.ERROR,"查询失败");
|
|
|
}
|
|
|
- return new Result(true,StatusCode.OK,"查询成功",categoryList);
|
|
|
+ List<CategoryResponse> categoryResponses=new ArrayList<CategoryResponse>(){{
|
|
|
+ categoryList.forEach(k->this.add(new CategoryResponse(k)));
|
|
|
+ }};
|
|
|
+ return new Result(true,StatusCode.OK,"查询成功",categoryResponses);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -151,7 +155,10 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
return new Result(false,StatusCode.ERROR,"没有该分类的操作权限");
|
|
|
}
|
|
|
final List<FileEntity> fileEntityList = fileRepository.findByCategoryId(info.getCategoryId());
|
|
|
- return new Result(true,StatusCode.OK,"查询成功",fileEntityList);
|
|
|
+ List<FileResponse> fileResponses=new ArrayList<FileResponse>(){{
|
|
|
+ fileEntityList.forEach(file -> this.add(new FileResponse(file)));
|
|
|
+ }};
|
|
|
+ return new Result(true,StatusCode.OK,"查询成功",fileResponses);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -161,7 +168,10 @@ public class DocumentServiceImpl implements IDocumentService {
|
|
|
return new Result(false, StatusCode.ERROR, "身份验证失败");
|
|
|
}
|
|
|
final List<FileEntity> fileEntityList = fileRepository.findByKeyWord(info.getKeyword(), tokenValidateResult.getUserId().longValue());
|
|
|
- return new Result(true,StatusCode.OK,"查询成功",fileEntityList);
|
|
|
+ List<FileResponse> fileResponses=new ArrayList<FileResponse>(){{
|
|
|
+ fileEntityList.forEach(file -> this.add(new FileResponse(file)));
|
|
|
+ }};
|
|
|
+ return new Result(true,StatusCode.OK,"查询成功",fileResponses);
|
|
|
}
|
|
|
|
|
|
@Override
|