caishunfeng commented on code in PR #10792:
URL: https://github.com/apache/dolphinscheduler/pull/10792#discussion_r914576987
##########
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:

You can throw a ServiceException and catch it in the outside. This way we
don't have to use map as result, WDYT?
--
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]