|
|
@@ -3,6 +3,7 @@ package cn.reghao.oss.console.app.service;
|
|
|
import cn.reghao.jutil.jdk.converter.ByteConverter;
|
|
|
import cn.reghao.jutil.jdk.converter.ByteType;
|
|
|
import cn.reghao.jutil.jdk.result.Result;
|
|
|
+import cn.reghao.oss.console.app.model.dto.ChannelProcessDto;
|
|
|
import cn.reghao.oss.console.app.rpc.RemoteService;
|
|
|
import cn.reghao.oss.console.util.AuthKeyContext;
|
|
|
import cn.reghao.oss.store.api.dto.ObjectChannel;
|
|
|
@@ -46,8 +47,8 @@ public class UploadChannelService {
|
|
|
return Result.fail(String.format("store_node with id %s not exist", nodeId));
|
|
|
}
|
|
|
|
|
|
- //int createBy = UserContext.getUser().getId();
|
|
|
- int createBy = 410;
|
|
|
+ int createBy = UserContext.getUser().getId();
|
|
|
+ //int createBy = 410;
|
|
|
String channelPrefix = uploadChannelDto.getChannelPrefix();
|
|
|
UploadChannel uploadChannel = uploadChannelRepository.findByPrefixAndCreateByAndNodeId(channelPrefix, createBy, nodeId);
|
|
|
if (uploadChannel != null) {
|
|
|
@@ -98,6 +99,20 @@ public class UploadChannelService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void updateProcessFile(ChannelProcessDto channelProcessDto) {
|
|
|
+ int id = channelProcessDto.getId();
|
|
|
+ UploadChannel uploadChannel = uploadChannelRepository.findById(id).orElse(null);
|
|
|
+ if (uploadChannel != null) {
|
|
|
+ boolean processFile = channelProcessDto.getProcessFile();
|
|
|
+ boolean current = uploadChannel.getProcessFile();
|
|
|
+ if (processFile != current) {
|
|
|
+ uploadChannel.setProcessFile(processFile);
|
|
|
+ uploadChannelRepository.save(uploadChannel);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public Page<UploadChannelVo> getUploadChannels(PageRequest pageRequest) {
|
|
|
int loginUser = UserContext.getUser().getId();
|
|
|
Page<UploadChannel> page = uploadChannelRepository.findByCreateBy(loginUser, pageRequest);
|