|
@@ -47,7 +47,7 @@ public class UploadChannelService {
|
|
|
return Result.fail(String.format("store_node with id %s not exist", nodeId));
|
|
return Result.fail(String.format("store_node with id %s not exist", nodeId));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- int createBy = UserContext.getUser().getId();
|
|
|
|
|
|
|
+ long createBy = UserContext.getUser().getId();
|
|
|
//int createBy = 410;
|
|
//int createBy = 410;
|
|
|
String channelPrefix = uploadChannelDto.getChannelPrefix();
|
|
String channelPrefix = uploadChannelDto.getChannelPrefix();
|
|
|
UploadChannel uploadChannel = uploadChannelRepository.findByPrefixAndCreateByAndNodeId(channelPrefix, createBy, nodeId);
|
|
UploadChannel uploadChannel = uploadChannelRepository.findByPrefixAndCreateByAndNodeId(channelPrefix, createBy, nodeId);
|
|
@@ -80,7 +80,7 @@ public class UploadChannelService {
|
|
|
return Result.success();
|
|
return Result.success();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private int getNextChannelId(int userId) {
|
|
|
|
|
|
|
+ private int getNextChannelId(long userId) {
|
|
|
int channelId = 101;
|
|
int channelId = 101;
|
|
|
int total = uploadChannelRepository.countByCreateBy(userId);
|
|
int total = uploadChannelRepository.countByCreateBy(userId);
|
|
|
return channelId + total;
|
|
return channelId + total;
|
|
@@ -136,11 +136,11 @@ public class UploadChannelService {
|
|
|
return uploadChannelRepository.findById(id).orElse(null);
|
|
return uploadChannelRepository.findById(id).orElse(null);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public UploadChannel getByChannelIdAndCreateBy(int channelId, int createBy) {
|
|
|
|
|
|
|
+ public UploadChannel getByChannelIdAndCreateBy(int channelId, long createBy) {
|
|
|
return uploadChannelRepository.findByChannelIdAndCreateBy(channelId, createBy);
|
|
return uploadChannelRepository.findByChannelIdAndCreateBy(channelId, createBy);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public ObjectChannel getObjectChannelByChannelId(int channelId, int createBy) {
|
|
|
|
|
|
|
+ public ObjectChannel getObjectChannelByChannelId(int channelId, long createBy) {
|
|
|
UploadChannel uploadChannel = uploadChannelRepository.findByChannelIdAndCreateBy(channelId, createBy);
|
|
UploadChannel uploadChannel = uploadChannelRepository.findByChannelIdAndCreateBy(channelId, createBy);
|
|
|
return getObjectChannel(uploadChannel);
|
|
return getObjectChannel(uploadChannel);
|
|
|
}
|
|
}
|
|
@@ -154,12 +154,12 @@ public class UploadChannelService {
|
|
|
boolean seturl = uploadChannel.getSeturl();
|
|
boolean seturl = uploadChannel.getSeturl();
|
|
|
int scope = uploadChannel.getScope();
|
|
int scope = uploadChannel.getScope();
|
|
|
String domain = storeNodeService.getById(uploadChannel.getNodeId()).getDomain();
|
|
String domain = storeNodeService.getById(uploadChannel.getNodeId()).getDomain();
|
|
|
- int createBy = uploadChannel.getCreateBy();
|
|
|
|
|
|
|
+ long createBy = uploadChannel.getCreateBy();
|
|
|
return new ObjectChannel(channelId, name, channelPrefix, maxSize, fileType, seturl, scope, domain, createBy);
|
|
return new ObjectChannel(channelId, name, channelPrefix, maxSize, fileType, seturl, scope, domain, createBy);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public StoreNode getStoreNodeByChannelId(int channelId) throws Exception {
|
|
public StoreNode getStoreNodeByChannelId(int channelId) throws Exception {
|
|
|
- int userId = AuthKeyContext.getUser();
|
|
|
|
|
|
|
+ long userId = AuthKeyContext.getUser();
|
|
|
UploadChannel uploadChannel = uploadChannelRepository.findByChannelIdAndCreateBy(channelId, userId);
|
|
UploadChannel uploadChannel = uploadChannelRepository.findByChannelIdAndCreateBy(channelId, userId);
|
|
|
if (uploadChannel == null) {
|
|
if (uploadChannel == null) {
|
|
|
String errMsg = String.format("channel_id %s not exist", channelId);
|
|
String errMsg = String.format("channel_id %s not exist", channelId);
|
|
@@ -179,11 +179,11 @@ public class UploadChannelService {
|
|
|
return storeNode;
|
|
return storeNode;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public List<UploadChannel> getByNodeIdAndUserId(int nodeId, int userId) {
|
|
|
|
|
|
|
+ public List<UploadChannel> getByNodeIdAndUserId(int nodeId, long userId) {
|
|
|
return uploadChannelRepository.findByNodeIdAndCreateBy(nodeId, userId);
|
|
return uploadChannelRepository.findByNodeIdAndCreateBy(nodeId, userId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public List<UploadChannel> getByDomainAndCreateBy(String domain, int createBy) {
|
|
|
|
|
|
|
+ public List<UploadChannel> getByDomainAndCreateBy(String domain, long createBy) {
|
|
|
StoreNode storeNode = storeNodeService.getByDomain(domain);
|
|
StoreNode storeNode = storeNodeService.getByDomain(domain);
|
|
|
int nodeId = storeNode.getId();
|
|
int nodeId = storeNode.getId();
|
|
|
return getByNodeIdAndUserId(nodeId, createBy);
|
|
return getByNodeIdAndUserId(nodeId, createBy);
|