Sfoglia il codice sorgente

翻译器调整
1. 支持数组类型字段的翻译
2. 支持对CommonResult结果的翻译

yucheng 4 anni fa
parent
commit
7c1546db2e

+ 3 - 0
fm-person/src/main/java/com/persagy/fm/department/controller/DepartmentController.java

@@ -14,6 +14,8 @@ import com.persagy.fm.department.service.IDepartmentService;
 import com.persagy.fm.department.utils.DepDataUtil;
 import com.persagy.fm.depproject.service.IDepProjectService;
 import com.persagy.fm.saas.project.model.vo.ProjectTreeItemVO;
+import com.persagy.fm.translate.model.Trans;
+import com.persagy.fm.translate.model.TransType;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
@@ -68,6 +70,7 @@ public class DepartmentController {
 //                    type = TransType.SERVICE, result = "name", batch = true,
 //                    condition = "id", parameter = "projectIds", target = "projectsShowName")
 //    })
+    @Trans(type = TransType.SERVICE, batch = true, source = "personNameTranslator", parameter = "managers", target = "managerShowName")
     public CommonResult<ResponseDepartmentItemVO> queryDepartmentDetail(
             @Valid @RequestBody QueryDepartmentDetailDTO queryDepartmentDetailDTO) {
         Department department = departmentService.queryDepartmentDetail(queryDepartmentDetailDTO.getId());

+ 0 - 1
fm-person/src/main/java/com/persagy/fm/department/service/impl/DepartmentServiceImpl.java

@@ -167,7 +167,6 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
     }
 
     @Override
-    @Trans(type = TransType.SERVICE, batch = true, source = "personNameTranslator", parameter = "managers", target = "managerShowName")
     public Department queryDepartmentDetail(Long id) {
         Department department = getById(id);
         if (department == null) {