Skip to content

Commit

Permalink
Spotless Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzm0809 authored and github-actions[bot] committed Sep 25, 2024
1 parent 1c0b38a commit 1e7dfbf
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.dinky.service.resource.impl;

import lombok.extern.slf4j.Slf4j;
import org.dinky.assertion.DinkyAssert;
import org.dinky.data.dto.TreeNodeDTO;
import org.dinky.data.enums.Status;
Expand Down Expand Up @@ -55,6 +54,7 @@
import cn.hutool.core.lang.Assert;
import cn.hutool.core.lang.Opt;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Service
Expand Down Expand Up @@ -320,8 +320,8 @@ public void uploadFile(Integer pid, String desc, MultipartFile file) {
public boolean remove(Integer id) {
Assert.isFalse(
Opt.ofNullable(getById(id))
.orElseThrow(() -> new BusException(Status.RESOURCE_DIR_OR_FILE_NOT_EXIST))
.getPid()
.orElseThrow(() -> new BusException(Status.RESOURCE_DIR_OR_FILE_NOT_EXIST))
.getPid()
== -1,
() -> new BusException(Status.ROOT_DIR_NOT_ALLOW_DELETE));
try {
Expand All @@ -331,7 +331,8 @@ public boolean remove(Integer id) {

if (systemConfiguration.getPhysicalDeletion().getValue()) {
getBaseResourceManager().remove(byId.getFullName());
log.warn("The resource type you have configured is [{}] and physical deletion is enabled. The File or Directory [{}] will be deleted",
log.warn(
"The resource type you have configured is [{}] and physical deletion is enabled. The File or Directory [{}] will be deleted",
systemConfiguration.getResourcesModel().getValue().name(),
byId.getFullName());
}
Expand Down
3 changes: 2 additions & 1 deletion dinky-web/src/locales/en-US/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,8 @@ export default {
'rc.resource.enable.tips':
'Please go to [Setting Center -> Global Settings -> Resource Configuration] to enable the resource management function!!!',
'rc.resource.delete': 'Delete Resource',
'rc.resource.deleteConfirm': 'We have detected that you have enabled physical deletion mode. Once executed, it cannot be restored and this operation is irreversible. Are you sure you want to delete this resource file?',
'rc.resource.deleteConfirm':
'We have detected that you have enabled physical deletion mode. Once executed, it cannot be restored and this operation is irreversible. Are you sure you want to delete this resource file?',

'rc.template.codeType': 'Code Type',
'rc.template.codeTypePlaceholder': 'Please select code type! ',
Expand Down
3 changes: 2 additions & 1 deletion dinky-web/src/locales/zh-CN/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,8 @@ export default {
'rc.resource.enable': '未启用资源管理功能',
'rc.resource.enable.tips': '请前往 [配置中心 -> 全局配置 -> Resource 配置] 中启用资源管理功能!!!',
'rc.resource.delete': '删除资源',
'rc.resource.deleteConfirm': '检测到你开启了物理删除模式,一旦执行无法恢复,此操作不可逆, 确定删除该资源文件吗?',
'rc.resource.deleteConfirm':
'检测到你开启了物理删除模式,一旦执行无法恢复,此操作不可逆, 确定删除该资源文件吗?',

'rc.template.codeType': '代码类型',
'rc.template.codeTypePlaceholder': '请选择代码类型!',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
import { connect } from 'umi';

const ResourceOverView: React.FC<connect> = (props) => {
const { dispatch, enableResource ,resourcePhysicalDelete} = props;
const { dispatch, enableResource, resourcePhysicalDelete } = props;

const [resourceState, setResourceState] = useState<ResourceState>(InitResourceState);

Expand Down Expand Up @@ -153,15 +153,13 @@ const ResourceOverView: React.FC<connect> = (props) => {
Modal.confirm({
title: l('rc.resource.delete'),
content: l('rc.resource.deleteConfirm'),
onOk: async () => realDelete(),
onOk: async () => realDelete()
});
}
await realDelete();
}
};



/**
* the node right click event OF rename,
*/
Expand Down
7 changes: 3 additions & 4 deletions dinky-web/src/pages/SettingCenter/GlobalSetting/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,13 @@ const ConfigModel: ConfigModelType = {

const physicalDelete = response.some(
(item: BaseConfigProperties) =>
item.key === GLOBAL_SETTING_KEYS.SYS_RESOURCE_SETTINGS_BASE_PHYSICAL_DELETION && item.value == true
item.key === GLOBAL_SETTING_KEYS.SYS_RESOURCE_SETTINGS_BASE_PHYSICAL_DELETION &&
item.value == true
);
yield put({
type: 'updateResourcePhysicalDelete',
payload: physicalDelete
});


}
}
},
Expand Down Expand Up @@ -161,7 +160,7 @@ const ConfigModel: ConfigModelType = {
...state,
resourcePhysicalDelete: payload
};
},
}
}
};

Expand Down

0 comments on commit 1e7dfbf

Please sign in to comment.