zhongjiajie commented on code in PR #10792:
URL: https://github.com/apache/dolphinscheduler/pull/10792#discussion_r913579809
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/TenantServiceImpl.java:
##########
@@ -77,9 +78,36 @@ public class TenantServiceImpl extends BaseServiceImpl
implements TenantService
@Autowired
private UserMapper userMapper;
+ @Autowired
+ private QueueService queueService;
+
@Autowired(required = false)
private StorageOperate storageOperate;
+ /**
+ * Valid tenantCode when we want to create or update tenant object
+ *
+ * @param tenantCode Tenant code of tenant object
+ * @return Optional of Status map
+ */
+ private Optional<Map<String, Object>> tenantCodeValid(String tenantCode) {
+ Map<String, Object> result = new HashMap<>();
+ if (StringUtils.isEmpty(tenantCode)) {
+ putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, tenantCode);
Review Comment:
I init function is `private Optional<Status> tenantCodeValid(String
tenantCode)`, but finilly I foud some of our status have to do stirng format
before we return to web ui, like
https://github.com/apache/dolphinscheduler/blob/d16e0ddb2f1c68fccc5cf41481d769c2a1012379/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java#L34.
I try to rewrite the message of status
```java
String specificMsg =
String.format(Status.REQUEST_PARAMS_NOT_VALID_ERROR.getMsg(), tenantCode);
```
and add set it to status mesage, but it seem that we should not do that, So
I add map type as return
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]