package com.ruoyi.component.translation.core.impl;

import com.ruoyi.component.core.service.DeptService;
import com.ruoyi.component.translation.annotation.TranslationType;
import com.ruoyi.component.translation.constant.TransConstant;
import com.ruoyi.component.translation.core.TranslationInterface;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

/**
 * 部门翻译实现
 *
 * @author Lion Li
 */
@Component
@AllArgsConstructor
@TranslationType(type = TransConstant.DEPT_ID_TO_NAME)
public class DeptNameTranslationImpl implements TranslationInterface<String> {

    private final DeptService deptService;

    @Override
    public String translation(Object key, String other) {
        return deptService.selectDeptNameByIds(key.toString());
    }
}
