zhongjiajie commented on code in PR #10792:
URL: https://github.com/apache/dolphinscheduler/pull/10792#discussion_r914609382


##########
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:
   > 
![image](https://user-images.githubusercontent.com/11962619/177508241-ba73452d-aa22-48e8-ae8a-daaa851486d9.png)
 You can throw a ServiceException and catch it in the outside. This way we 
don't have to use map as result, WDYT?
   
   do you mean we should do some think like that? e389459



-- 
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]

Reply via email to