修改权限逻辑
This commit is contained in:
@ -33,4 +33,9 @@ public interface TransConstant {
|
||||
*/
|
||||
String OSS_ID_TO_URL = "oss_id_to_url";
|
||||
|
||||
/**
|
||||
* 项目id转名称
|
||||
*/
|
||||
String PROJECT_ID_TO_NAME = "project_id_to_name";
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
package org.dromara.common.translation.core.impl;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.translation.annotation.TranslationType;
|
||||
import org.dromara.common.translation.constant.TransConstant;
|
||||
import org.dromara.common.translation.core.TranslationInterface;
|
||||
import org.dromara.system.api.RemoteProjectService;
|
||||
|
||||
/**
|
||||
* 项目名称翻译实现
|
||||
*
|
||||
* @author lilemy
|
||||
* @date 2025-09-10 16:13
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@TranslationType(type = TransConstant.PROJECT_ID_TO_NAME)
|
||||
public class ProjectNameTranslationImpl implements TranslationInterface<String> {
|
||||
|
||||
@DubboReference
|
||||
private RemoteProjectService remoteProjectService;
|
||||
|
||||
/**
|
||||
* 翻译
|
||||
*
|
||||
* @param key 需要被翻译的键(不为空)
|
||||
* @param other 其他参数
|
||||
* @return 返回键对应的值
|
||||
*/
|
||||
@Override
|
||||
public String translation(Object key, String other) {
|
||||
if (key instanceof Long id) {
|
||||
return remoteProjectService.selectProjectNameById(id);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -4,3 +4,4 @@ org.dromara.common.translation.core.impl.DictTypeTranslationImpl
|
||||
org.dromara.common.translation.core.impl.OssUrlTranslationImpl
|
||||
org.dromara.common.translation.core.impl.UserNameTranslationImpl
|
||||
org.dromara.common.translation.core.impl.NicknameTranslationImpl
|
||||
org.dromara.common.translation.core.impl.ProjectNameTranslationImpl
|
||||
|
||||
Reference in New Issue
Block a user