Commit de474189e0d1d97f6643c242a20e793b6c841ff7

Authored by chenjunyu_1481036421
1 parent 8b8cd510

fix:openapi bug与i18n

@@ -286,7 +286,7 @@ public class DeviceController extends BaseController { @@ -286,7 +286,7 @@ public class DeviceController extends BaseController {
286 throw new ThingsboardException(e.getErrorCode()); 286 throw new ThingsboardException(e.getErrorCode());
287 } 287 }
288 } 288 }
289 - return ResponseEntity.ok("私有成功"); 289 + return ResponseEntity.ok(String.format(MessageUtils.message("private.success")));
290 } 290 }
291 291
292 @ApiOperation(value = "Make device publicly available (assignDeviceToPublicCustomer)", 292 @ApiOperation(value = "Make device publicly available (assignDeviceToPublicCustomer)",
@@ -320,7 +320,7 @@ public class DeviceController extends BaseController { @@ -320,7 +320,7 @@ public class DeviceController extends BaseController {
320 throw new ThingsboardException(e.getErrorCode()); 320 throw new ThingsboardException(e.getErrorCode());
321 } 321 }
322 } 322 }
323 - return ResponseEntity.ok("公开成功"); 323 + return ResponseEntity.ok(String.format(MessageUtils.message("publicly.successful")));
324 } 324 }
325 325
326 @ApiOperation(value = "设备凭证详情", 326 @ApiOperation(value = "设备凭证详情",
@@ -100,7 +100,10 @@ public class TkOpenApiController extends BaseController { @@ -100,7 +100,10 @@ public class TkOpenApiController extends BaseController {
100 @GetMapping("/getMenu") 100 @GetMapping("/getMenu")
101 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN'},{})") 101 @PreAuthorize("@check.checkPermissions({'TENANT_ADMIN'},{})")
102 public ResponseEntity<List<ApiMenuDTO>> getMenu() throws ThingsboardException { 102 public ResponseEntity<List<ApiMenuDTO>> getMenu() throws ThingsboardException {
103 - return ResponseEntity.ok(apiService.getMenu(getCurrentUser().getCurrentTenantId())); 103 + List<String> tenantIds = new ArrayList<>();
  104 + tenantIds.add(EntityId.NULL_UUID.toString());
  105 + tenantIds.add(getCurrentUser().getTenantId().toString());
  106 + return ResponseEntity.ok(apiService.getMenu(tenantIds));
104 } 107 }
105 108
106 109
@@ -193,6 +193,8 @@ choice.device.profile.rule.chain.is.used.for.convert = The selected product [% s @@ -193,6 +193,8 @@ choice.device.profile.rule.chain.is.used.for.convert = The selected product [% s
193 choice.device.profile.rule.chain.is.used.for.scene = The selected product [% s] is currently being used by the scene linkage [% s] and cannot change the rule chain!! 193 choice.device.profile.rule.chain.is.used.for.scene = The selected product [% s] is currently being used by the scene linkage [% s] and cannot change the rule chain!!
194 openapi.app.isnull= The application does not exist 194 openapi.app.isnull= The application does not exist
195 openapi.api.isnull= API does not exist 195 openapi.api.isnull= API does not exist
  196 +publicly.successful = Publicly successful
  197 +private.success = Private Success
196 198
197 199
198 200
@@ -191,5 +191,7 @@ rule.chain.used.by.device.profile = 该规则链正在被ã€%s】产å“使用,ä¸ @@ -191,5 +191,7 @@ rule.chain.used.by.device.profile = 该规则链正在被ã€%s】产å“使用,ä¸
191 same.type.node.name.already.exists = 同类型的节点名称已被使用 191 same.type.node.name.already.exists = 同类型的节点名称已被使用
192 choice.device.profile.rule.chain.is.used.for.convert = 选中的产品【%s】正在被数据流转【%s】使用,不能更换规则链!! 192 choice.device.profile.rule.chain.is.used.for.convert = 选中的产品【%s】正在被数据流转【%s】使用,不能更换规则链!!
193 choice.device.profile.rule.chain.is.used.for.scene = 选中的产品【%s】正在被场景联动【%s】使用,不能更换规则链!! 193 choice.device.profile.rule.chain.is.used.for.scene = 选中的产品【%s】正在被场景联动【%s】使用,不能更换规则链!!
194 -openapi.app.isnull= 应用不存在  
195 -openapi.api.isnull= api不存在  
  194 +openapi.app.isnull = 应用不存在
  195 +openapi.api.isnull = api不存在
  196 +publicly.successful = 公开成功
  197 +private.success = 私有成功
@@ -103,9 +103,11 @@ public class OpenApiImpl extends AbstractBaseService<OpenApiMapper, TkOpenApiEnt @@ -103,9 +103,11 @@ public class OpenApiImpl extends AbstractBaseService<OpenApiMapper, TkOpenApiEnt
103 } 103 }
104 104
105 @Override 105 @Override
106 - public List<ApiMenuDTO> getMenu(String tenantId) { 106 + public List<ApiMenuDTO> getMenu(List<String> tenantIds) {
107 List<TkOpenApiEntity> list = baseMapper.selectList(new LambdaQueryWrapper<TkOpenApiEntity>() 107 List<TkOpenApiEntity> list = baseMapper.selectList(new LambdaQueryWrapper<TkOpenApiEntity>()
108 - .eq(TkOpenApiEntity::getTenantId,tenantId)); 108 + .in(tenantIds!= null,
  109 + TkOpenApiEntity::getTenantId,
  110 + tenantIds));
109 List<ApiMenuDTO> listDto = new ArrayList<>(); 111 List<ApiMenuDTO> listDto = new ArrayList<>();
110 if(!list.isEmpty()){ 112 if(!list.isEmpty()){
111 for (TkOpenApiEntity entity: list) { 113 for (TkOpenApiEntity entity: list) {
@@ -22,7 +22,7 @@ public interface OpenApiService extends BaseService<TkOpenApiEntity>{ @@ -22,7 +22,7 @@ public interface OpenApiService extends BaseService<TkOpenApiEntity>{
22 22
23 OpenApiDTO update(OpenApiDTO dto, String tenantId); 23 OpenApiDTO update(OpenApiDTO dto, String tenantId);
24 24
25 - List<ApiMenuDTO> getMenu(String tenantId); 25 + List<ApiMenuDTO> getMenu(List<String> tenantIds);
26 26
27 List<OpenApiContrlooerDTO> getByListId(List<String> ids); 27 List<OpenApiContrlooerDTO> getByListId(List<String> ids);
28 28