status
stringclasses 1
value | repo_name
stringclasses 31
values | repo_url
stringclasses 31
values | issue_id
int64 1
104k
| title
stringlengths 4
233
| body
stringlengths 0
186k
⌀ | issue_url
stringlengths 38
56
| pull_url
stringlengths 37
54
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
unknown | language
stringclasses 5
values | commit_datetime
unknown | updated_file
stringlengths 7
188
| chunk_content
stringlengths 1
1.03M
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.enums;
import java.util.Locale;
import org.springframework.context.i18n.LocaleContextHolder;
/**
* status enum // todo #4855 One category one interval
*/
public enum Status {
SUCCESS(0, "success", "成功"),
INTERNAL_SERVER_ERROR_ARGS(10000, "Internal Server Error: {0}", "服务端异常: {0}"),
REQUEST_PARAMS_NOT_VALID_ERROR(10001, "request parameter {0} is not valid", "请求参数[{0}]无效"),
TASK_TIMEOUT_PARAMS_ERROR(10002, "task timeout parameter is not valid", "任务超时参数无效"),
USER_NAME_EXIST(10003, "user name already exists", "用户名已存在"),
USER_NAME_NULL(10004, "user name is null", "用户名不能为空"),
HDFS_OPERATION_ERROR(10006, "hdfs operation error", "hdfs操作错误"),
TASK_INSTANCE_NOT_FOUND(10008, "task instance not found", "任务实例不存在"),
OS_TENANT_CODE_EXIST(10009, "os tenant code {0} already exists", "操作系统租户[{0}]已存在"),
USER_NOT_EXIST(10010, "user {0} not exists", "用户[{0}]不存在"),
ALERT_GROUP_NOT_EXIST(10011, "alarm group not found", "告警组不存在"),
ALERT_GROUP_EXIST(10012, "alarm group already exists", "告警组名称已存在"),
USER_NAME_PASSWD_ERROR(10013, "user name or password error", "用户名或密码错误"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | LOGIN_SESSION_FAILED(10014, "create session failed!", "创建session失败"),
DATASOURCE_EXIST(10015, "data source name already exists", "数据源名称已存在"),
DATASOURCE_CONNECT_FAILED(10016, "data source connection failed", "建立数据源连接失败"),
TENANT_NOT_EXIST(10017, "tenant not exists", "租户不存在"),
PROJECT_NOT_FOUNT(10018, "project {0} not found ", "项目[{0}]不存在"),
PROJECT_ALREADY_EXISTS(10019, "project {0} already exists", "项目名称[{0}]已存在"),
TASK_INSTANCE_NOT_EXISTS(10020, "task instance {0} does not exist", "任务实例[{0}]不存在"),
TASK_INSTANCE_NOT_SUB_WORKFLOW_INSTANCE(10021, "task instance {0} is not sub process instance", "任务实例[{0}]不是子流程实例"),
SCHEDULE_CRON_NOT_EXISTS(10022, "scheduler crontab {0} does not exist", "调度配置定时表达式[{0}]不存在"),
SCHEDULE_CRON_ONLINE_FORBID_UPDATE(10023, "online status does not allow update operations", "调度配置上线状态不允许修改"),
SCHEDULE_CRON_CHECK_FAILED(10024, "scheduler crontab expression validation failure: {0}", "调度配置定时表达式验证失败: {0}"),
MASTER_NOT_EXISTS(10025, "master does not exist", "无可用master节点"),
SCHEDULE_STATUS_UNKNOWN(10026, "unknown status: {0}", "未知状态: {0}"),
CREATE_ALERT_GROUP_ERROR(10027, "create alert group error", "创建告警组错误"),
QUERY_ALL_ALERTGROUP_ERROR(10028, "query all alertgroup error", "查询告警组错误"),
LIST_PAGING_ALERT_GROUP_ERROR(10029, "list paging alert group error", "分页查询告警组错误"),
UPDATE_ALERT_GROUP_ERROR(10030, "update alert group error", "更新告警组错误"),
DELETE_ALERT_GROUP_ERROR(10031, "delete alert group error", "删除告警组错误"),
ALERT_GROUP_GRANT_USER_ERROR(10032, "alert group grant user error", "告警组授权用户错误"),
CREATE_DATASOURCE_ERROR(10033, "create datasource error", "创建数据源错误"),
UPDATE_DATASOURCE_ERROR(10034, "update datasource error", "更新数据源错误"),
QUERY_DATASOURCE_ERROR(10035, "query datasource error", "查询数据源错误"),
CONNECT_DATASOURCE_FAILURE(10036, "connect datasource failure", "建立数据源连接失败"),
CONNECTION_TEST_FAILURE(10037, "connection test failure", "测试数据源连接失败"),
DELETE_DATA_SOURCE_FAILURE(10038, "delete data source failure", "删除数据源失败"),
VERIFY_DATASOURCE_NAME_FAILURE(10039, "verify datasource name failure", "验证数据源名称失败"),
UNAUTHORIZED_DATASOURCE(10040, "unauthorized datasource", "未经授权的数据源"),
AUTHORIZED_DATA_SOURCE(10041, "authorized data source", "授权数据源失败"),
LOGIN_SUCCESS(10042, "login success", "登录成功"),
USER_LOGIN_FAILURE(10043, "user login failure", "用户登录失败"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | LIST_WORKERS_ERROR(10044, "list workers error", "查询worker列表错误"),
LIST_MASTERS_ERROR(10045, "list masters error", "查询master列表错误"),
UPDATE_PROJECT_ERROR(10046, "update project error", "更新项目信息错误"),
QUERY_PROJECT_DETAILS_BY_ID_ERROR(10047, "query project details by id error", "查询项目详细信息错误"),
CREATE_PROJECT_ERROR(10048, "create project error", "创建项目错误"),
LOGIN_USER_QUERY_PROJECT_LIST_PAGING_ERROR(10049, "login user query project list paging error", "分页查询项目列表错误"),
DELETE_PROJECT_ERROR(10050, "delete project error", "删除项目错误"),
QUERY_UNAUTHORIZED_PROJECT_ERROR(10051, "query unauthorized project error", "查询未授权项目错误"),
QUERY_AUTHORIZED_PROJECT(10052, "query authorized project", "查询授权项目错误"),
QUERY_QUEUE_LIST_ERROR(10053, "query queue list error", "查询队列列表错误"),
CREATE_RESOURCE_ERROR(10054, "create resource error", "创建资源错误"),
UPDATE_RESOURCE_ERROR(10055, "update resource error", "更新资源错误"),
QUERY_RESOURCES_LIST_ERROR(10056, "query resources list error", "查询资源列表错误"),
QUERY_RESOURCES_LIST_PAGING(10057, "query resources list paging", "分页查询资源列表错误"),
DELETE_RESOURCE_ERROR(10058, "delete resource error", "删除资源错误"),
VERIFY_RESOURCE_BY_NAME_AND_TYPE_ERROR(10059, "verify resource by name and type error", "资源名称或类型验证错误"),
VIEW_RESOURCE_FILE_ON_LINE_ERROR(10060, "view resource file online error", "查看资源文件错误"),
CREATE_RESOURCE_FILE_ON_LINE_ERROR(10061, "create resource file online error", "创建资源文件错误"),
RESOURCE_FILE_IS_EMPTY(10062, "resource file is empty", "资源文件内容不能为空"),
EDIT_RESOURCE_FILE_ON_LINE_ERROR(10063, "edit resource file online error", "更新资源文件错误"),
DOWNLOAD_RESOURCE_FILE_ERROR(10064, "download resource file error", "下载资源文件错误"),
CREATE_UDF_FUNCTION_ERROR(10065, "create udf function error", "创建UDF函数错误"),
VIEW_UDF_FUNCTION_ERROR(10066, "view udf function error", "查询UDF函数错误"),
UPDATE_UDF_FUNCTION_ERROR(10067, "update udf function error", "更新UDF函数错误"),
QUERY_UDF_FUNCTION_LIST_PAGING_ERROR(10068, "query udf function list paging error", "分页查询UDF函数列表错误"),
QUERY_DATASOURCE_BY_TYPE_ERROR(10069, "query datasource by type error", "查询数据源信息错误"),
VERIFY_UDF_FUNCTION_NAME_ERROR(10070, "verify udf function name error", "UDF函数名称验证错误"),
DELETE_UDF_FUNCTION_ERROR(10071, "delete udf function error", "删除UDF函数错误"),
AUTHORIZED_FILE_RESOURCE_ERROR(10072, "authorized file resource error", "授权资源文件错误"),
AUTHORIZE_RESOURCE_TREE(10073, "authorize resource tree display error", "授权资源目录树错误"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | UNAUTHORIZED_UDF_FUNCTION_ERROR(10074, "unauthorized udf function error", "查询未授权UDF函数错误"),
AUTHORIZED_UDF_FUNCTION_ERROR(10075, "authorized udf function error", "授权UDF函数错误"),
CREATE_SCHEDULE_ERROR(10076, "create schedule error", "创建调度配置错误"),
UPDATE_SCHEDULE_ERROR(10077, "update schedule error", "更新调度配置错误"),
PUBLISH_SCHEDULE_ONLINE_ERROR(10078, "publish schedule online error", "上线调度配置错误"),
OFFLINE_SCHEDULE_ERROR(10079, "offline schedule error", "下线调度配置错误"),
QUERY_SCHEDULE_LIST_PAGING_ERROR(10080, "query schedule list paging error", "分页查询调度配置列表错误"),
QUERY_SCHEDULE_LIST_ERROR(10081, "query schedule list error", "查询调度配置列表错误"),
QUERY_TASK_LIST_PAGING_ERROR(10082, "query task list paging error", "分页查询任务列表错误"),
QUERY_TASK_RECORD_LIST_PAGING_ERROR(10083, "query task record list paging error", "分页查询任务记录错误"),
CREATE_TENANT_ERROR(10084, "create tenant error", "创建租户错误"),
QUERY_TENANT_LIST_PAGING_ERROR(10085, "query tenant list paging error", "分页查询租户列表错误"),
QUERY_TENANT_LIST_ERROR(10086, "query tenant list error", "查询租户列表错误"),
UPDATE_TENANT_ERROR(10087, "update tenant error", "更新租户错误"),
DELETE_TENANT_BY_ID_ERROR(10088, "delete tenant by id error", "删除租户错误"),
VERIFY_OS_TENANT_CODE_ERROR(10089, "verify os tenant code error", "操作系统租户验证错误"),
CREATE_USER_ERROR(10090, "create user error", "创建用户错误"),
QUERY_USER_LIST_PAGING_ERROR(10091, "query user list paging error", "分页查询用户列表错误"),
UPDATE_USER_ERROR(10092, "update user error", "更新用户错误"),
DELETE_USER_BY_ID_ERROR(10093, "delete user by id error", "删除用户错误"),
GRANT_PROJECT_ERROR(10094, "grant project error", "授权项目错误"),
GRANT_RESOURCE_ERROR(10095, "grant resource error", "授权资源错误"),
GRANT_UDF_FUNCTION_ERROR(10096, "grant udf function error", "授权UDF函数错误"),
GRANT_DATASOURCE_ERROR(10097, "grant datasource error", "授权数据源错误"),
GET_USER_INFO_ERROR(10098, "get user info error", "获取用户信息错误"),
USER_LIST_ERROR(10099, "user list error", "查询用户列表错误"),
VERIFY_USERNAME_ERROR(10100, "verify username error", "用户名验证错误"),
UNAUTHORIZED_USER_ERROR(10101, "unauthorized user error", "查询未授权用户错误"),
AUTHORIZED_USER_ERROR(10102, "authorized user error", "查询授权用户错误"),
QUERY_TASK_INSTANCE_LOG_ERROR(10103, "view task instance log error", "查询任务实例日志错误"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR(10104, "download task instance log file error", "下载任务日志文件错误"),
CREATE_PROCESS_DEFINITION(10105, "create process definition", "创建工作流错误"),
VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR(10106, "verify process definition name unique error", "工作流定义名称验证错误"),
UPDATE_PROCESS_DEFINITION_ERROR(10107, "update process definition error", "更新工作流定义错误"),
RELEASE_PROCESS_DEFINITION_ERROR(10108, "release process definition error", "上线工作流错误"),
QUERY_DATAIL_OF_PROCESS_DEFINITION_ERROR(10109, "query datail of process definition error", "查询工作流详细信息错误"),
QUERY_PROCESS_DEFINITION_LIST(10110, "query process definition list", "查询工作流列表错误"),
ENCAPSULATION_TREEVIEW_STRUCTURE_ERROR(10111, "encapsulation treeview structure error", "查询工作流树形图数据错误"),
GET_TASKS_LIST_BY_PROCESS_DEFINITION_ID_ERROR(10112, "get tasks list by process definition id error", "查询工作流定义节点信息错误"),
QUERY_PROCESS_INSTANCE_LIST_PAGING_ERROR(10113, "query process instance list paging error", "分页查询工作流实例列表错误"),
QUERY_TASK_LIST_BY_PROCESS_INSTANCE_ID_ERROR(10114, "query task list by process instance id error", "查询任务实例列表错误"),
UPDATE_PROCESS_INSTANCE_ERROR(10115, "update process instance error", "更新工作流实例错误"),
QUERY_PROCESS_INSTANCE_BY_ID_ERROR(10116, "query process instance by id error", "查询工作流实例错误"),
DELETE_PROCESS_INSTANCE_BY_ID_ERROR(10117, "delete process instance by id error", "删除工作流实例错误"),
QUERY_SUB_PROCESS_INSTANCE_DETAIL_INFO_BY_TASK_ID_ERROR(10118, "query sub process instance detail info by task id error", "查询子流程任务实例错误"),
QUERY_PARENT_PROCESS_INSTANCE_DETAIL_INFO_BY_SUB_PROCESS_INSTANCE_ID_ERROR(10119, "query parent process instance detail info by sub process instance id error", "查询子流程该工作流实例错误"),
QUERY_PROCESS_INSTANCE_ALL_VARIABLES_ERROR(10120, "query process instance all variables error", "查询工作流自定义变量信息错误"),
ENCAPSULATION_PROCESS_INSTANCE_GANTT_STRUCTURE_ERROR(10121, "encapsulation process instance gantt structure error", "查询工作流实例甘特图数据错误"),
QUERY_PROCESS_DEFINITION_LIST_PAGING_ERROR(10122, "query process definition list paging error", "分页查询工作流定义列表错误"),
SIGN_OUT_ERROR(10123, "sign out error", "退出错误"),
OS_TENANT_CODE_HAS_ALREADY_EXISTS(10124, "os tenant code has already exists", "操作系统租户已存在"),
IP_IS_EMPTY(10125, "ip is empty", "IP地址不能为空"),
SCHEDULE_CRON_REALEASE_NEED_NOT_CHANGE(10126, "schedule release is already {0}", "调度配置上线错误[{0}]"),
CREATE_QUEUE_ERROR(10127, "create queue error", "创建队列错误"),
QUEUE_NOT_EXIST(10128, "queue {0} not exists", "队列ID[{0}]不存在"),
QUEUE_VALUE_EXIST(10129, "queue value {0} already exists", "队列值[{0}]已存在"),
QUEUE_NAME_EXIST(10130, "queue name {0} already exists", "队列名称[{0}]已存在"),
UPDATE_QUEUE_ERROR(10131, "update queue error", "更新队列信息错误"),
NEED_NOT_UPDATE_QUEUE(10132, "no content changes, no updates are required", "数据未变更,不需要更新队列信息"),
VERIFY_QUEUE_ERROR(10133, "verify queue error", "验证队列信息错误"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | NAME_NULL(10134, "name must be not null", "名称不能为空"),
NAME_EXIST(10135, "name {0} already exists", "名称[{0}]已存在"),
SAVE_ERROR(10136, "save error", "保存错误"),
DELETE_PROJECT_ERROR_DEFINES_NOT_NULL(10137, "please delete the process definitions in project first!", "请先删除全部工作流定义"),
BATCH_DELETE_PROCESS_INSTANCE_BY_IDS_ERROR(10117, "batch delete process instance by ids {0} error", "批量删除工作流实例错误"),
PREVIEW_SCHEDULE_ERROR(10139, "preview schedule error", "预览调度配置错误"),
PARSE_TO_CRON_EXPRESSION_ERROR(10140, "parse cron to cron expression error", "解析调度表达式错误"),
SCHEDULE_START_TIME_END_TIME_SAME(10141, "The start time must not be the same as the end", "开始时间不能和结束时间一样"),
DELETE_TENANT_BY_ID_FAIL(10142, "delete tenant by id fail, for there are {0} process instances in executing using it", "删除租户失败,有[{0}]个运行中的工作流实例正在使用"),
DELETE_TENANT_BY_ID_FAIL_DEFINES(10143, "delete tenant by id fail, for there are {0} process definitions using it", "删除租户失败,有[{0}]个工作流定义正在使用"),
DELETE_TENANT_BY_ID_FAIL_USERS(10144, "delete tenant by id fail, for there are {0} users using it", "删除租户失败,有[{0}]个用户正在使用"),
DELETE_WORKER_GROUP_BY_ID_FAIL(10145, "delete worker group by id fail, for there are {0} process instances in executing using it", "删除Worker分组失败,有[{0}]个运行中的工作流实例正在使用"),
QUERY_WORKER_GROUP_FAIL(10146, "query worker group fail ", "查询worker分组失败"),
DELETE_WORKER_GROUP_FAIL(10147, "delete worker group fail ", "删除worker分组失败"),
USER_DISABLED(10148, "The current user is disabled", "当前用户已停用"),
COPY_PROCESS_DEFINITION_ERROR(10149, "copy process definition from {0} to {1} error : {2}", "从{0}复制工作流到{1}错误 : {2}"),
MOVE_PROCESS_DEFINITION_ERROR(10150, "move process definition from {0} to {1} error : {2}", "从{0}移动工作流到{1}错误 : {2}"),
SWITCH_PROCESS_DEFINITION_VERSION_ERROR(10151, "Switch process definition version error", "切换工作流版本出错"),
SWITCH_PROCESS_DEFINITION_VERSION_NOT_EXIST_PROCESS_DEFINITION_ERROR(10152
, "Switch process definition version error: not exists process definition, [process definition id {0}]", "切换工作流版本出错:工作流不存在,[工作流id {0}]"),
SWITCH_PROCESS_DEFINITION_VERSION_NOT_EXIST_PROCESS_DEFINITION_VERSION_ERROR(10153
, "Switch process definition version error: not exists process definition version, [process definition id {0}] [version number {1}]", "切换工作流版本出错:工作流版本信息不存在,[工作流id {0}] [版本号 {1}]"),
QUERY_PROCESS_DEFINITION_VERSIONS_ERROR(10154, "query process definition versions error", "查询工作流历史版本信息出错"),
QUERY_PROCESS_DEFINITION_VERSIONS_PAGE_NO_OR_PAGE_SIZE_LESS_THAN_1_ERROR(10155
, "query process definition versions error: [page number:{0}] < 1 or [page size:{1}] < 1", "查询工作流历史版本出错:[pageNo:{0}] < 1 或 [pageSize:{1}] < 1"),
DELETE_PROCESS_DEFINITION_VERSION_ERROR(10156, "delete process definition version error", "删除工作流历史版本出错"),
QUERY_USER_CREATED_PROJECT_ERROR(10157, "query user created project error error", "查询用户创建的项目错误"),
PROCESS_DEFINITION_IDS_IS_EMPTY(10158, "process definition ids is empty", "工作流IDS不能为空"),
BATCH_COPY_PROCESS_DEFINITION_ERROR(10159, "batch copy process definition error", "复制工作流错误"),
BATCH_MOVE_PROCESS_DEFINITION_ERROR(10160, "batch move process definition error", "移动工作流错误"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | QUERY_WORKFLOW_LINEAGE_ERROR(10161, "query workflow lineage error", "查询血缘失败"),
QUERY_AUTHORIZED_AND_USER_CREATED_PROJECT_ERROR(10162, "query authorized and user created project error error", "查询授权的和用户创建的项目错误"),
DELETE_PROCESS_DEFINITION_BY_ID_FAIL(10163, "delete process definition by id fail, for there are {0} process instances in executing using it", "删除工作流定义失败,有[{0}]个运行中的工作流实例正在使用"),
CHECK_OS_TENANT_CODE_ERROR(10164, "Please enter the English os tenant code", "请输入英文操作系统租户"),
FORCE_TASK_SUCCESS_ERROR(10165, "force task success error", "强制成功任务实例错误"),
TASK_INSTANCE_STATE_OPERATION_ERROR(10166, "the status of task instance {0} is {1},Cannot perform force success operation", "任务实例[{0}]的状态是[{1}],无法执行强制成功操作"),
DATASOURCE_TYPE_NOT_EXIST(10167, "data source type not exist", "数据源类型不存在"),
PROCESS_DEFINITION_NAME_EXIST(10168, "process definition name {0} already exists", "工作流定义名称[{0}]已存在"),
DATASOURCE_DB_TYPE_ILLEGAL(10169, "datasource type illegal", "数据源类型参数不合法"),
DATASOURCE_PORT_ILLEGAL(10170, "datasource port illegal", "数据源端口参数不合法"),
DATASOURCE_OTHER_PARAMS_ILLEGAL(10171, "datasource other params illegal", "数据源其他参数不合法"),
DATASOURCE_NAME_ILLEGAL(10172, "datasource name illegal", "数据源名称不合法"),
DATASOURCE_HOST_ILLEGAL(10173, "datasource host illegal", "数据源HOST不合法"),
DELETE_WORKER_GROUP_NOT_EXIST(10174, "delete worker group not exist ", "删除worker分组不存在"),
CREATE_WORKER_GROUP_FORBIDDEN_IN_DOCKER(10175, "create worker group forbidden in docker ", "创建worker分组在docker中禁止"),
DELETE_WORKER_GROUP_FORBIDDEN_IN_DOCKER(10176, "delete worker group forbidden in docker ", "删除worker分组在docker中禁止"),
WORKER_ADDRESS_INVALID(10177, "worker address {0} invalid", "worker地址[{0}]无效"),
QUERY_WORKER_ADDRESS_LIST_FAIL(10178, "query worker address list fail ", "查询worker地址列表失败"),
UDF_FUNCTION_NOT_EXIST(20001, "UDF function not found", "UDF函数不存在"),
UDF_FUNCTION_EXISTS(20002, "UDF function already exists", "UDF函数已存在"),
RESOURCE_NOT_EXIST(20004, "resource not exist", "资源不存在"),
RESOURCE_EXIST(20005, "resource already exists", "资源已存在"),
RESOURCE_SUFFIX_NOT_SUPPORT_VIEW(20006, "resource suffix do not support online viewing", "资源文件后缀不支持查看"),
RESOURCE_SIZE_EXCEED_LIMIT(20007, "upload resource file size exceeds limit", "上传资源文件大小超过限制"),
RESOURCE_SUFFIX_FORBID_CHANGE(20008, "resource suffix not allowed to be modified", "资源文件后缀不支持修改"),
UDF_RESOURCE_SUFFIX_NOT_JAR(20009, "UDF resource suffix name must be jar", "UDF资源文件后缀名只支持[jar]"),
HDFS_COPY_FAIL(20010, "hdfs copy {0} -> {1} fail", "hdfs复制失败:[{0}] -> [{1}]"),
RESOURCE_FILE_EXIST(20011, "resource file {0} already exists in hdfs,please delete it or change name!", "资源文件[{0}]在hdfs中已存在,请删除或修改资源名"),
RESOURCE_FILE_NOT_EXIST(20012, "resource file {0} not exists in hdfs!", "资源文件[{0}]在hdfs中不存在"),
UDF_RESOURCE_IS_BOUND(20013, "udf resource file is bound by UDF functions:{0}", "udf函数绑定了资源文件[{0}]"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | RESOURCE_IS_USED(20014, "resource file is used by process definition", "资源文件被上线的流程定义使用了"),
PARENT_RESOURCE_NOT_EXIST(20015, "parent resource not exist", "父资源文件不存在"),
RESOURCE_NOT_EXIST_OR_NO_PERMISSION(20016, "resource not exist or no permission,please view the task node and remove error resource", "请检查任务节点并移除无权限或者已删除的资源"),
RESOURCE_IS_AUTHORIZED(20017, "resource is authorized to user {0},suffix not allowed to be modified", "资源文件已授权其他用户[{0}],后缀不允许修改"),
USER_NO_OPERATION_PERM(30001, "user has no operation privilege", "当前用户没有操作权限"),
USER_NO_OPERATION_PROJECT_PERM(30002, "user {0} is not has project {1} permission", "当前用户[{0}]没有[{1}]项目的操作权限"),
PROCESS_INSTANCE_NOT_EXIST(50001, "process instance {0} does not exist", "工作流实例[{0}]不存在"),
PROCESS_INSTANCE_EXIST(50002, "process instance {0} already exists", "工作流实例[{0}]已存在"),
PROCESS_DEFINE_NOT_EXIST(50003, "process definition {0} does not exist", "工作流定义[{0}]不存在"),
PROCESS_DEFINE_NOT_RELEASE(50004, "process definition {0} not on line", "工作流定义[{0}]不是上线状态"),
PROCESS_INSTANCE_ALREADY_CHANGED(50005, "the status of process instance {0} is already {1}", "工作流实例[{0}]的状态已经是[{1}]"),
PROCESS_INSTANCE_STATE_OPERATION_ERROR(50006, "the status of process instance {0} is {1},Cannot perform {2} operation", "工作流实例[{0}]的状态是[{1}],无法执行[{2}]操作"),
SUB_PROCESS_INSTANCE_NOT_EXIST(50007, "the task belong to process instance does not exist", "子工作流实例不存在"),
PROCESS_DEFINE_NOT_ALLOWED_EDIT(50008, "process definition {0} does not allow edit", "工作流定义[{0}]不允许修改"),
PROCESS_INSTANCE_EXECUTING_COMMAND(50009, "process instance {0} is executing the command, please wait ...", "工作流实例[{0}]正在执行命令,请稍等..."),
PROCESS_INSTANCE_NOT_SUB_PROCESS_INSTANCE(50010, "process instance {0} is not sub process instance", "工作流实例[{0}]不是子工作流实例"),
TASK_INSTANCE_STATE_COUNT_ERROR(50011, "task instance state count error", "查询各状态任务实例数错误"),
COUNT_PROCESS_INSTANCE_STATE_ERROR(50012, "count process instance state error", "查询各状态流程实例数错误"),
COUNT_PROCESS_DEFINITION_USER_ERROR(50013, "count process definition user error", "查询各用户流程定义数错误"),
START_PROCESS_INSTANCE_ERROR(50014, "start process instance error", "运行工作流实例错误"),
EXECUTE_PROCESS_INSTANCE_ERROR(50015, "execute process instance error", "操作工作流实例错误"),
CHECK_PROCESS_DEFINITION_ERROR(50016, "check process definition error", "工作流定义错误"),
QUERY_RECIPIENTS_AND_COPYERS_BY_PROCESS_DEFINITION_ERROR(50017, "query recipients and copyers by process definition error", "查询收件人和抄送人错误"),
DATA_IS_NOT_VALID(50017, "data {0} not valid", "数据[{0}]无效"),
DATA_IS_NULL(50018, "data {0} is null", "数据[{0}]不能为空"),
PROCESS_NODE_HAS_CYCLE(50019, "process node has cycle", "流程节点间存在循环依赖"),
PROCESS_NODE_S_PARAMETER_INVALID(50020, "process node {0} parameter invalid", "流程节点[{0}]参数无效"),
PROCESS_DEFINE_STATE_ONLINE(50021, "process definition {0} is already on line", "工作流定义[{0}]已上线"),
DELETE_PROCESS_DEFINE_BY_ID_ERROR(50022, "delete process definition by id error", "删除工作流定义错误"),
SCHEDULE_CRON_STATE_ONLINE(50023, "the status of schedule {0} is already on line", "调度配置[{0}]已上线"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | DELETE_SCHEDULE_CRON_BY_ID_ERROR(50024, "delete schedule by id error", "删除调度配置错误"),
BATCH_DELETE_PROCESS_DEFINE_ERROR(50025, "batch delete process definition error", "批量删除工作流定义错误"),
BATCH_DELETE_PROCESS_DEFINE_BY_IDS_ERROR(50026, "batch delete process definition by ids {0} error", "批量删除工作流定义[{0}]错误"),
TENANT_NOT_SUITABLE(50027, "there is not any tenant suitable, please choose a tenant available.", "没有合适的租户,请选择可用的租户"),
EXPORT_PROCESS_DEFINE_BY_ID_ERROR(50028, "export process definition by id error", "导出工作流定义错误"),
BATCH_EXPORT_PROCESS_DEFINE_BY_IDS_ERROR(50028, "batch export process definition by ids error", "批量导出工作流定义错误"),
IMPORT_PROCESS_DEFINE_ERROR(50029, "import process definition error", "导入工作流定义错误"),
PROCESS_DAG_IS_EMPTY(50030, "process dag can not be empty", "工作流dag不能为空"),
HDFS_NOT_STARTUP(60001, "hdfs not startup", "hdfs未启用"),
/**
* for monitor
*/
QUERY_DATABASE_STATE_ERROR(70001, "query database state error", "查询数据库状态错误"),
QUERY_ZOOKEEPER_STATE_ERROR(70002, "query zookeeper state error", "查询zookeeper状态错误"),
CREATE_ACCESS_TOKEN_ERROR(70010, "create access token error", "创建访问token错误"),
GENERATE_TOKEN_ERROR(70011, "generate token error", "生成token错误"),
QUERY_ACCESSTOKEN_LIST_PAGING_ERROR(70012, "query access token list paging error", "分页查询访问token列表错误"),
UPDATE_ACCESS_TOKEN_ERROR(70013, "update access token error", "更新访问token错误"),
DELETE_ACCESS_TOKEN_ERROR(70014, "delete access token error", "删除访问token错误"),
ACCESS_TOKEN_NOT_EXIST(70015, "access token not exist", "访问token不存在"),
COMMAND_STATE_COUNT_ERROR(80001, "task instance state count error", "查询各状态任务实例数错误"),
NEGTIVE_SIZE_NUMBER_ERROR(80002, "query size number error", "查询size错误"),
START_TIME_BIGGER_THAN_END_TIME_ERROR(80003, "start time bigger than end time error", "开始时间在结束时间之后错误"),
QUEUE_COUNT_ERROR(90001, "queue count error", "查询队列数据错误"),
KERBEROS_STARTUP_STATE(100001, "get kerberos startup state error", "获取kerberos启动状态错误"),
//plugin
PLUGIN_NOT_A_UI_COMPONENT(110001, "query plugin error, this plugin has no UI component", "查询插件错误,此插件无UI组件"),
QUERY_PLUGINS_RESULT_IS_NULL(110002, "query plugins result is null", "查询插件为空"),
QUERY_PLUGINS_ERROR(110003, "query plugins error", "查询插件错误"),
QUERY_PLUGIN_DETAIL_RESULT_IS_NULL(110004, "query plugin detail result is null", "查询插件详情结果为空"), |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java | UPDATE_ALERT_PLUGIN_INSTANCE_ERROR(110005, "update alert plugin instance error", "更新告警组和告警组插件实例错误"),
DELETE_ALERT_PLUGIN_INSTANCE_ERROR(110006, "delete alert plugin instance error", "删除告警组和告警组插件实例错误"),
GET_ALERT_PLUGIN_INSTANCE_ERROR(110007, "get alert plugin instance error", "获取告警组和告警组插件实例错误"),
CREATE_ALERT_PLUGIN_INSTANCE_ERROR(110008, "create alert plugin instance error", "创建告警组和告警组插件实例错误"),
QUERY_ALL_ALERT_PLUGIN_INSTANCE_ERROR(110009, "query all alert plugin instance error", "查询所有告警实例失败"),
PLUGIN_INSTANCE_ALREADY_EXIT(110010, "plugin instance already exit", "该告警插件实例已存在"),
LIST_PAGING_ALERT_PLUGIN_INSTANCE_ERROR(110011, "query plugin instance page error", "分页查询告警实例失败"),
DELETE_ALERT_PLUGIN_INSTANCE_ERROR_HAS_ALERT_GROUP_ASSOCIATED(110012, "failed to delete the alert instance, there is an alarm group associated with this alert instance",
"删除告警实例失败,存在与此告警实例关联的警报组"),
PROCESS_DEFINITION_VERSION_IS_USED(110013,"this process definition version is used","此工作流定义版本被使用");
private final int code;
private final String enMsg;
private final String zhMsg;
Status(int code, String enMsg, String zhMsg) {
this.code = code;
this.enMsg = enMsg;
this.zhMsg = zhMsg;
}
public int getCode() {
return this.code;
}
public String getMsg() {
if (Locale.SIMPLIFIED_CHINESE.getLanguage().equals(LocaleContextHolder.getLocale().getLanguage())) {
return this.zhMsg;
} else {
return this.enMsg;
}
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.User;
import java.util.Map;
/**
* project service
**/
public interface ProjectService { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | /**
* create project
*
* @param loginUser login user
* @param name project name
* @param desc description
* @return returns an error if it exists
*/
Map<String, Object> createProject(User loginUser, String name, String desc);
/**
* query project details by id
*
* @param projectId project id
* @return project detail information
*/
Map<String, Object> queryById(Integer projectId);
/**
* check project and authorization
*
* @param loginUser login user
* @param project project
* @param projectName project name
* @return true if the login user have permission to see the project
*/
Map<String, Object> checkProjectAndAuth(User loginUser, Project project, String projectName);
boolean hasProjectAndPerm(User loginUser, Project project, Map<String, Object> result);
/**
* admin can view all projects
*
* @param loginUser login user |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | * @param searchVal search value
* @param pageSize page size
* @param pageNo page number
* @return project list which the login user have permission to see
*/
Map<String, Object> queryProjectListPaging(User loginUser, Integer pageSize, Integer pageNo, String searchVal);
/**
* delete project by id
*
* @param loginUser login user
* @param projectId project id
* @return delete result code
*/
Map<String, Object> deleteProject(User loginUser, Integer projectId);
/**
* updateProcessInstance project
*
* @param loginUser login user
* @param projectId project id
* @param projectName project name
* @param desc description
* @return update result code
*/
Map<String, Object> update(User loginUser, Integer projectId, String projectName, String desc);
/**
* query unauthorized project
*
* @param loginUser login user
* @param userId user id
* @return the projects which user have not permission to see |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/ProjectService.java | */
Map<String, Object> queryUnauthorizedProject(User loginUser, Integer userId);
/**
* query authorized project
*
* @param loginUser login user
* @param userId user id
* @return projects which the user have permission to see, Except for items created by this user
*/
Map<String, Object> queryAuthorizedProject(User loginUser, Integer userId);
/**
* query authorized project
*
* @param loginUser login user
* @return projects which the user have permission to see, Except for items created by this user
*/
Map<String, Object> queryProjectCreatedByUser(User loginUser);
/**
* query all project list that have one or more process definitions.
*
* @return project list
*/
Map<String, Object> queryAllProjectList();
/**
* query authorized and user create project list by user id
* @param loginUser
* @return
*/
Map<String, Object> queryProjectCreatedAndAuthorizedByUser(User loginUser);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License. |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | */
package org.apache.dolphinscheduler.api.service.impl;
import static org.apache.dolphinscheduler.api.utils.CheckUtils.checkDesc;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.ProjectService;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition;
import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.ProjectUser;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectUserMapper;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* project service impl
**/
@Service |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | public class ProjectServiceImpl extends BaseServiceImpl implements ProjectService {
@Autowired
private ProjectMapper projectMapper;
@Autowired
private ProjectUserMapper projectUserMapper;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
/**
* create project
*
* @param loginUser login user
* @param name project name
* @param desc description
* @return returns an error if it exists
*/
@Override
public Map<String, Object> createProject(User loginUser, String name, String desc) {
Map<String, Object> result = new HashMap<>();
Map<String, Object> descCheck = checkDesc(desc);
if (descCheck.get(Constants.STATUS) != Status.SUCCESS) {
return descCheck;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | Project project = projectMapper.queryByName(name);
if (project != null) {
putMsg(result, Status.PROJECT_ALREADY_EXISTS, name);
return result;
}
Date now = new Date();
project = Project
.newBuilder()
.name(name)
.description(desc)
.userId(loginUser.getId())
.userName(loginUser.getUserName())
.createTime(now)
.updateTime(now)
.build();
if (projectMapper.insert(project) > 0) {
result.put(Constants.DATA_LIST, project.getId());
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.CREATE_PROJECT_ERROR);
}
return result;
}
/**
* query project details by id
*
* @param projectId project id
* @return project detail information
*/
@Override |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | public Map<String, Object> queryById(Integer projectId) {
Map<String, Object> result = new HashMap<>();
Project project = projectMapper.selectById(projectId);
if (project != null) {
result.put(Constants.DATA_LIST, project);
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.PROJECT_NOT_FOUNT, projectId);
}
return result;
}
/**
* check project and authorization
*
* @param loginUser login user
* @param project project
* @param projectName project name
* @return true if the login user have permission to see the project
*/
@Override
public Map<String, Object> checkProjectAndAuth(User loginUser, Project project, String projectName) {
Map<String, Object> result = new HashMap<>();
if (project == null) {
putMsg(result, Status.PROJECT_NOT_FOUNT, projectName);
} else if (!checkReadPermission(loginUser, project)) {
putMsg(result, Status.USER_NO_OPERATION_PROJECT_PERM, loginUser.getUserName(), projectName);
} else {
putMsg(result, Status.SUCCESS);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | return result;
}
@Override
public boolean hasProjectAndPerm(User loginUser, Project project, Map<String, Object> result) {
boolean checkResult = false;
if (project == null) {
putMsg(result, Status.PROJECT_NOT_FOUNT, "");
} else if (!checkReadPermission(loginUser, project)) {
putMsg(result, Status.USER_NO_OPERATION_PROJECT_PERM, loginUser.getUserName(), project.getName());
} else {
checkResult = true;
}
return checkResult;
}
/**
* admin can view all projects
*
* @param loginUser login user
* @param searchVal search value
* @param pageSize page size
* @param pageNo page number
* @return project list which the login user have permission to see
*/
@Override
public Map<String, Object> queryProjectListPaging(User loginUser, Integer pageSize, Integer pageNo, String searchVal) {
Map<String, Object> result = new HashMap<>();
PageInfo<Project> pageInfo = new PageInfo<>(pageNo, pageSize);
Page<Project> page = new Page<>(pageNo, pageSize);
int userId = loginUser.getUserType() == UserType.ADMIN_USER ? 0 : loginUser.getId();
IPage<Project> projectIPage = projectMapper.queryProjectListPaging(page, userId, searchVal); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | List<Project> projectList = projectIPage.getRecords();
if (userId != 0) {
for (Project project : projectList) {
project.setPerm(Constants.DEFAULT_ADMIN_PERMISSION);
}
}
pageInfo.setTotalCount((int) projectIPage.getTotal());
pageInfo.setLists(projectList);
result.put(Constants.COUNT, (int) projectIPage.getTotal());
result.put(Constants.DATA_LIST, pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* delete project by id
*
* @param loginUser login user
* @param projectId project id
* @return delete result code
*/
@Override
public Map<String, Object> deleteProject(User loginUser, Integer projectId) {
Map<String, Object> result = new HashMap<>();
Project project = projectMapper.selectById(projectId);
Map<String, Object> checkResult = getCheckResult(loginUser, project);
if (checkResult != null) {
return checkResult;
}
if (!hasPerm(loginUser, project.getUserId())) {
putMsg(result, Status.USER_NO_OPERATION_PERM); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | return result;
}
List<ProcessDefinition> processDefinitionList = processDefinitionMapper.queryAllDefinitionList(projectId);
if (!processDefinitionList.isEmpty()) {
putMsg(result, Status.DELETE_PROJECT_ERROR_DEFINES_NOT_NULL);
return result;
}
int delete = projectMapper.deleteById(projectId);
if (delete > 0) {
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.DELETE_PROJECT_ERROR);
}
return result;
}
/**
* get check result
*
* @param loginUser login user
* @param project project
* @return check result
*/
private Map<String, Object> getCheckResult(User loginUser, Project project) {
String projectName = project == null ? null : project.getName();
Map<String, Object> checkResult = checkProjectAndAuth(loginUser, project, projectName);
Status status = (Status) checkResult.get(Constants.STATUS);
if (status != Status.SUCCESS) {
return checkResult;
}
return null; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | }
/**
* updateProcessInstance project
*
* @param loginUser login user
* @param projectId project id
* @param projectName project name
* @param desc description
* @return update result code
*/
@Override
public Map<String, Object> update(User loginUser, Integer projectId, String projectName, String desc) {
Map<String, Object> result = new HashMap<>();
Map<String, Object> descCheck = checkDesc(desc);
if (descCheck.get(Constants.STATUS) != Status.SUCCESS) {
return descCheck;
}
Project project = projectMapper.selectById(projectId);
boolean hasProjectAndPerm = hasProjectAndPerm(loginUser, project, result);
if (!hasProjectAndPerm) {
return result;
}
Project tempProject = projectMapper.queryByName(projectName);
if (tempProject != null && tempProject.getId() != projectId) {
putMsg(result, Status.PROJECT_ALREADY_EXISTS, projectName);
return result;
}
project.setName(projectName);
project.setDescription(desc);
project.setUpdateTime(new Date()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | int update = projectMapper.updateById(project);
if (update > 0) {
putMsg(result, Status.SUCCESS);
} else {
putMsg(result, Status.UPDATE_PROJECT_ERROR);
}
return result;
}
/**
* query unauthorized project
*
* @param loginUser login user
* @param userId user id
* @return the projects which user have not permission to see
*/
@Override
public Map<String, Object> queryUnauthorizedProject(User loginUser, Integer userId) {
Map<String, Object> result = new HashMap<>();
if (loginUser.getId() != userId && isNotAdmin(loginUser, result)) {
return result;
}
/**
* query all project list except specified userId
*/
List<Project> projectList = projectMapper.queryProjectExceptUserId(userId);
List<Project> resultList = new ArrayList<>();
Set<Project> projectSet = null;
if (projectList != null && !projectList.isEmpty()) {
projectSet = new HashSet<>(projectList);
List<Project> authedProjectList = projectMapper.queryAuthedProjectListByUserId(userId); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | resultList = getUnauthorizedProjects(projectSet, authedProjectList);
}
result.put(Constants.DATA_LIST, resultList);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* get unauthorized project
*
* @param projectSet project set
* @param authedProjectList authed project list
* @return project list that authorization
*/
private List<Project> getUnauthorizedProjects(Set<Project> projectSet, List<Project> authedProjectList) {
List<Project> resultList;
Set<Project> authedProjectSet = null;
if (authedProjectList != null && !authedProjectList.isEmpty()) {
authedProjectSet = new HashSet<>(authedProjectList);
projectSet.removeAll(authedProjectSet);
}
resultList = new ArrayList<>(projectSet);
return resultList;
}
/**
* query authorized project
*
* @param loginUser login user
* @param userId user id
* @return projects which the user have permission to see, Except for items created by this user
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | @Override
public Map<String, Object> queryAuthorizedProject(User loginUser, Integer userId) {
Map<String, Object> result = new HashMap<>();
if (loginUser.getId() != userId && isNotAdmin(loginUser, result)) {
return result;
}
List<Project> projects = projectMapper.queryAuthedProjectListByUserId(userId);
result.put(Constants.DATA_LIST, projects);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query authorized project
*
* @param loginUser login user
* @return projects which the user have permission to see, Except for items created by this user
*/
@Override
public Map<String, Object> queryProjectCreatedByUser(User loginUser) {
Map<String, Object> result = new HashMap<>();
List<Project> projects = projectMapper.queryProjectCreatedByUser(loginUser.getId());
result.put(Constants.DATA_LIST, projects);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query authorized and user create project list by user
*
* @param loginUser login user
* @return |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | */
@Override
public Map<String, Object> queryProjectCreatedAndAuthorizedByUser(User loginUser) {
Map<String, Object> result = new HashMap<>();
List<Project> projects = null;
if (loginUser.getUserType() == UserType.ADMIN_USER) {
projects = projectMapper.selectList(null);
} else {
projects = projectMapper.queryProjectCreatedAndAuthorizedByUserId(loginUser.getId());
}
result.put(Constants.DATA_LIST, projects);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* check whether have read permission
*
* @param user user
* @param project project
* @return true if the user have permission to see the project, otherwise return false
*/
private boolean checkReadPermission(User user, Project project) {
int permissionId = queryPermission(user, project);
return (permissionId & Constants.READ_PERMISSION) != 0;
}
/**
* query permission id
*
* @param user user
* @param project project |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProjectServiceImpl.java | * @return permission
*/
private int queryPermission(User user, Project project) {
if (user.getUserType() == UserType.ADMIN_USER) {
return Constants.READ_PERMISSION;
}
if (project.getUserId() == user.getId()) {
return Constants.ALL_PERMISSIONS;
}
ProjectUser projectUser = projectUserMapper.queryProjectRelation(project.getId(), user.getId());
if (projectUser == null) {
return 0;
}
return projectUser.getPerm();
}
/**
* query all project list
*
* @return project list
*/
@Override
public Map<String, Object> queryAllProjectList() {
Map<String, Object> result = new HashMap<>();
List<Project> projects = projectMapper.queryAllProject();
result.put(Constants.DATA_LIST, projects);
putMsg(result, Status.SUCCESS);
return result;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service.impl;
import org.apache.dolphinscheduler.api.dto.resources.ResourceComponent;
import org.apache.dolphinscheduler.api.dto.resources.visitor.ResourceTreeVisitor; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.exceptions.ServiceException;
import org.apache.dolphinscheduler.api.service.UsersService;
import org.apache.dolphinscheduler.api.utils.CheckUtils;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.ResourceType;
import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
import org.apache.dolphinscheduler.common.utils.HadoopUtils;
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
import org.apache.dolphinscheduler.common.utils.StringUtils;
import org.apache.dolphinscheduler.dao.entity.AlertGroup;
import org.apache.dolphinscheduler.dao.entity.DatasourceUser;
import org.apache.dolphinscheduler.dao.entity.ProjectUser;
import org.apache.dolphinscheduler.dao.entity.Resource;
import org.apache.dolphinscheduler.dao.entity.ResourcesUser;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.dolphinscheduler.dao.entity.UDFUser;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.AlertGroupMapper;
import org.apache.dolphinscheduler.dao.mapper.DataSourceUserMapper;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectUserMapper;
import org.apache.dolphinscheduler.dao.mapper.ResourceMapper;
import org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper;
import org.apache.dolphinscheduler.dao.mapper.TenantMapper; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | import org.apache.dolphinscheduler.dao.mapper.UDFUserMapper;
import org.apache.dolphinscheduler.dao.mapper.UserMapper;
import org.apache.dolphinscheduler.dao.utils.ResourceProcessDefinitionUtils;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* users service impl
*/
@Service
public class UsersServiceImpl extends BaseServiceImpl implements UsersService {
private static final Logger logger = LoggerFactory.getLogger(UsersServiceImpl.class);
@Autowired
private UserMapper userMapper;
@Autowired
private TenantMapper tenantMapper; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | @Autowired
private ProjectUserMapper projectUserMapper;
@Autowired
private ResourceUserMapper resourceUserMapper;
@Autowired
private ResourceMapper resourceMapper;
@Autowired
private DataSourceUserMapper datasourceUserMapper;
@Autowired
private UDFUserMapper udfUserMapper;
@Autowired
private AlertGroupMapper alertGroupMapper;
@Autowired
private ProcessDefinitionMapper processDefinitionMapper;
/**
* create user, only system admin have permission
*
* @param loginUser login user
* @param userName user name
* @param userPassword user password
* @param email email
* @param tenantId tenant id
* @param phone phone
* @param queue queue
* @return create result code
* @throws Exception exception
*/
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String, Object> createUser(User loginUser, |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | String userName,
String userPassword,
String email,
int tenantId,
String phone,
String queue,
int state) throws IOException {
Map<String, Object> result = new HashMap<>();
String msg = this.checkUserParams(userName, userPassword, email, phone);
if (!StringUtils.isEmpty(msg)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, msg);
return result;
}
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
if (!checkTenantExists(tenantId)) {
putMsg(result, Status.TENANT_NOT_EXIST);
return result;
}
User user = createUser(userName, userPassword, email, tenantId, phone, queue, state);
Tenant tenant = tenantMapper.queryById(tenantId);
if (PropertyUtils.getResUploadStartupState()) {
if (!HadoopUtils.getInstance().exists(HadoopUtils.getHdfsTenantDir(tenant.getTenantCode()))) {
createTenantDirIfNotExists(tenant.getTenantCode());
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | String userPath = HadoopUtils.getHdfsUserDir(tenant.getTenantCode(), user.getId());
HadoopUtils.getInstance().mkdir(userPath);
}
putMsg(result, Status.SUCCESS);
return result;
}
@Override
@Transactional(rollbackFor = RuntimeException.class)
public User createUser(String userName,
String userPassword,
String email,
int tenantId,
String phone,
String queue,
int state) {
User user = new User();
Date now = new Date();
user.setUserName(userName);
user.setUserPassword(EncryptionUtils.getMd5(userPassword));
user.setEmail(email);
user.setTenantId(tenantId);
user.setPhone(phone);
user.setState(state);
user.setUserType(UserType.GENERAL_USER);
user.setCreateTime(now);
user.setUpdateTime(now);
if (StringUtils.isEmpty(queue)) {
queue = "";
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | user.setQueue(queue);
userMapper.insert(user);
return user;
}
/***
* create User for ldap login
*/
@Override
@Transactional(rollbackFor = Exception.class)
public User createUser(UserType userType, String userId, String email) {
User user = new User();
Date now = new Date();
user.setUserName(userId);
user.setEmail(email);
user.setUserType(userType);
user.setCreateTime(now);
user.setUpdateTime(now);
user.setQueue("");
userMapper.insert(user);
return user;
}
/**
* get user by user name
*
* @param userName user name
* @return exist user or null
*/ |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | @Override
public User getUserByUserName(String userName) {
return userMapper.queryByUserNameAccurately(userName);
}
/**
* query user by id
*
* @param id id
* @return user info
*/
@Override
public User queryUser(int id) {
return userMapper.selectById(id);
}
@Override
public List<User> queryUser(List<Integer> ids) {
if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>();
}
return userMapper.selectByIds(ids);
}
/**
* query user
*
* @param name name
* @return user info
*/
@Override
public User queryUser(String name) {
return userMapper.queryByUserNameAccurately(name); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
/**
* query user
*
* @param name name
* @param password password
* @return user info
*/
@Override
public User queryUser(String name, String password) {
String md5 = EncryptionUtils.getMd5(password);
return userMapper.queryUserByNamePassword(name, md5);
}
/**
* get user id by user name
*
* @param name user name
* @return if name empty 0, user not exists -1, user exist user id
*/
@Override
public int getUserIdByName(String name) {
int executorId = 0;
if (StringUtils.isNotEmpty(name)) {
User executor = queryUser(name);
if (null != executor) {
executorId = executor.getId();
} else {
executorId = -1;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
return executorId;
}
/**
* query user list
*
* @param loginUser login user
* @param pageNo page number
* @param searchVal search avlue
* @param pageSize page size
* @return user list page
*/
@Override
public Map<String, Object> queryUserList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) {
Map<String, Object> result = new HashMap<>();
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
Page<User> page = new Page<>(pageNo, pageSize);
IPage<User> scheduleList = userMapper.queryUserPaging(page, searchVal);
PageInfo<User> pageInfo = new PageInfo<>(pageNo, pageSize);
pageInfo.setTotalCount((int) scheduleList.getTotal());
pageInfo.setLists(scheduleList.getRecords());
result.put(Constants.DATA_LIST, pageInfo);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* updateProcessInstance user
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | *
* @param loginUser
* @param userId user id
* @param userName user name
* @param userPassword user password
* @param email email
* @param tenantId tennat id
* @param phone phone
* @param queue queue
* @return update result code
* @throws Exception exception
*/
@Override
public Map<String, Object> updateUser(User loginUser, int userId,
String userName,
String userPassword,
String email,
int tenantId,
String phone,
String queue,
int state) throws IOException {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false);
if (check(result, !hasPerm(loginUser, userId), Status.USER_NO_OPERATION_PERM)) {
return result;
}
User user = userMapper.selectById(userId);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
if (StringUtils.isNotEmpty(userName)) {
if (!CheckUtils.checkUserName(userName)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, userName);
return result;
}
User tempUser = userMapper.queryByUserNameAccurately(userName);
if (tempUser != null && tempUser.getId() != userId) {
putMsg(result, Status.USER_NAME_EXIST);
return result;
}
user.setUserName(userName);
}
if (StringUtils.isNotEmpty(userPassword)) {
if (!CheckUtils.checkPassword(userPassword)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, userPassword);
return result;
}
user.setUserPassword(EncryptionUtils.getMd5(userPassword));
}
if (StringUtils.isNotEmpty(email)) {
if (!CheckUtils.checkEmail(email)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, email);
return result;
}
user.setEmail(email);
}
if (StringUtils.isNotEmpty(phone) && !CheckUtils.checkPhone(phone)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, phone);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
user.setPhone(phone);
user.setQueue(queue);
user.setState(state);
Date now = new Date();
user.setUpdateTime(now);
if (user.getTenantId() != tenantId) {
Tenant oldTenant = tenantMapper.queryById(user.getTenantId());
Tenant newTenant = tenantMapper.queryById(tenantId);
if (newTenant != null) {
if (PropertyUtils.getResUploadStartupState() && oldTenant != null) {
String newTenantCode = newTenant.getTenantCode();
String oldResourcePath = HadoopUtils.getHdfsResDir(oldTenant.getTenantCode());
String oldUdfsPath = HadoopUtils.getHdfsUdfDir(oldTenant.getTenantCode());
if (HadoopUtils.getInstance().exists(oldResourcePath)) {
String newResourcePath = HadoopUtils.getHdfsResDir(newTenantCode);
String newUdfsPath = HadoopUtils.getHdfsUdfDir(newTenantCode);
List<Resource> fileResourcesList = resourceMapper.queryResourceList(
null, userId, ResourceType.FILE.ordinal());
if (CollectionUtils.isNotEmpty(fileResourcesList)) {
ResourceTreeVisitor resourceTreeVisitor = new ResourceTreeVisitor(fileResourcesList);
ResourceComponent resourceComponent = resourceTreeVisitor.visit();
copyResourceFiles(resourceComponent, oldResourcePath, newResourcePath);
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | List<Resource> udfResourceList = resourceMapper.queryResourceList(
null, userId, ResourceType.UDF.ordinal());
if (CollectionUtils.isNotEmpty(udfResourceList)) {
ResourceTreeVisitor resourceTreeVisitor = new ResourceTreeVisitor(udfResourceList);
ResourceComponent resourceComponent = resourceTreeVisitor.visit();
copyResourceFiles(resourceComponent, oldUdfsPath, newUdfsPath);
}
String oldUserPath = HadoopUtils.getHdfsUserDir(oldTenant.getTenantCode(), userId);
HadoopUtils.getInstance().delete(oldUserPath, true);
} else {
createTenantDirIfNotExists(oldTenant.getTenantCode());
}
if (HadoopUtils.getInstance().exists(HadoopUtils.getHdfsTenantDir(newTenant.getTenantCode()))) {
String newUserPath = HadoopUtils.getHdfsUserDir(newTenant.getTenantCode(), user.getId());
HadoopUtils.getInstance().mkdir(newUserPath);
} else {
createTenantDirIfNotExists(newTenant.getTenantCode());
}
}
}
user.setTenantId(tenantId);
}
userMapper.updateById(user);
putMsg(result, Status.SUCCESS);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
/**
* delete user
*
* @param loginUser login user
* @param id user id
* @return delete result code
* @throws Exception exception when operate hdfs
*/
@Override
public Map<String, Object> deleteUserById(User loginUser, int id) throws IOException {
Map<String, Object> result = new HashMap<>();
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM, id);
return result;
}
User tempUser = userMapper.selectById(id);
if (tempUser == null) {
putMsg(result, Status.USER_NOT_EXIST, id);
return result;
}
User user = userMapper.queryTenantCodeByUserId(id);
if (user != null) {
if (PropertyUtils.getResUploadStartupState()) {
String userPath = HadoopUtils.getHdfsUserDir(user.getTenantCode(), id);
if (HadoopUtils.getInstance().exists(userPath)) {
HadoopUtils.getInstance().delete(userPath, true); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
}
}
userMapper.deleteById(id);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* grant project
*
* @param loginUser login user
* @param userId user id
* @param projectIds project id array
* @return grant result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> grantProject(User loginUser, int userId, String projectIds) {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false);
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
User tempUser = userMapper.selectById(userId);
if (tempUser == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | projectUserMapper.deleteProjectRelation(0, userId);
if (check(result, StringUtils.isEmpty(projectIds), Status.SUCCESS)) {
return result;
}
String[] projectIdArr = projectIds.split(",");
for (String projectId : projectIdArr) {
Date now = new Date();
ProjectUser projectUser = new ProjectUser();
projectUser.setUserId(userId);
projectUser.setProjectId(Integer.parseInt(projectId));
projectUser.setPerm(7);
projectUser.setCreateTime(now);
projectUser.setUpdateTime(now);
projectUserMapper.insert(projectUser);
}
putMsg(result, Status.SUCCESS);
return result;
}
/**
* grant resource
*
* @param loginUser login user
* @param userId user id
* @param resourceIds resource id array
* @return grant result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> grantResources(User loginUser, int userId, String resourceIds) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | Map<String, Object> result = new HashMap<>();
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
User user = userMapper.selectById(userId);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
}
Set<Integer> needAuthorizeResIds = new HashSet<>();
if (StringUtils.isNotBlank(resourceIds)) {
String[] resourceFullIdArr = resourceIds.split(",");
for (String resourceFullId : resourceFullIdArr) {
String[] resourceIdArr = resourceFullId.split("-");
for (int i = 0; i <= resourceIdArr.length - 1; i++) {
int resourceIdValue = Integer.parseInt(resourceIdArr[i]);
needAuthorizeResIds.add(resourceIdValue);
}
}
}
List<Integer> resIds = resourceUserMapper.queryResourcesIdListByUserIdAndPerm(userId, Constants.AUTHORIZE_WRITABLE_PERM);
List<Resource> oldAuthorizedRes = CollectionUtils.isEmpty(resIds) ? new ArrayList<>() : resourceMapper.queryResourceListById(resIds);
Set<Integer> oldAuthorizedResIds = oldAuthorizedRes.stream().map(Resource::getId).collect(Collectors.toSet());
oldAuthorizedResIds.removeAll(needAuthorizeResIds);
if (CollectionUtils.isNotEmpty(oldAuthorizedResIds)) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | List<Map<String, Object>> list = processDefinitionMapper.listResourcesByUser(userId);
Map<Integer, Set<Integer>> resourceProcessMap = ResourceProcessDefinitionUtils.getResourceProcessDefinitionMap(list);
Set<Integer> resourceIdSet = resourceProcessMap.keySet();
resourceIdSet.retainAll(oldAuthorizedResIds);
if (CollectionUtils.isNotEmpty(resourceIdSet)) {
logger.error("can't be deleted,because it is used of process definition");
for (Integer resId : resourceIdSet) {
logger.error("resource id:{} is used of process definition {}", resId, resourceProcessMap.get(resId));
}
putMsg(result, Status.RESOURCE_IS_USED);
return result;
}
}
resourceUserMapper.deleteResourceUser(userId, 0);
if (check(result, StringUtils.isEmpty(resourceIds), Status.SUCCESS)) {
return result;
}
for (int resourceIdValue : needAuthorizeResIds) {
Resource resource = resourceMapper.selectById(resourceIdValue);
if (resource == null) {
putMsg(result, Status.RESOURCE_NOT_EXIST);
return result;
}
Date now = new Date();
ResourcesUser resourcesUser = new ResourcesUser();
resourcesUser.setUserId(userId);
resourcesUser.setResourcesId(resourceIdValue);
if (resource.isDirectory()) {
resourcesUser.setPerm(Constants.AUTHORIZE_READABLE_PERM); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | } else {
resourcesUser.setPerm(Constants.AUTHORIZE_WRITABLE_PERM);
}
resourcesUser.setCreateTime(now);
resourcesUser.setUpdateTime(now);
resourceUserMapper.insert(resourcesUser);
}
putMsg(result, Status.SUCCESS);
return result;
}
/**
* grant udf function
*
* @param loginUser login user
* @param userId user id
* @param udfIds udf id array
* @return grant result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> grantUDFFunction(User loginUser, int userId, String udfIds) {
Map<String, Object> result = new HashMap<>();
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
User user = userMapper.selectById(userId);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
udfUserMapper.deleteByUserId(userId);
if (check(result, StringUtils.isEmpty(udfIds), Status.SUCCESS)) {
return result;
}
String[] resourcesIdArr = udfIds.split(",");
for (String udfId : resourcesIdArr) {
Date now = new Date();
UDFUser udfUser = new UDFUser();
udfUser.setUserId(userId);
udfUser.setUdfId(Integer.parseInt(udfId));
udfUser.setPerm(7);
udfUser.setCreateTime(now);
udfUser.setUpdateTime(now);
udfUserMapper.insert(udfUser);
}
putMsg(result, Status.SUCCESS);
return result;
}
/**
* grant datasource
*
* @param loginUser login user
* @param userId user id
* @param datasourceIds data source id array
* @return grant result code
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> grantDataSource(User loginUser, int userId, String datasourceIds) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false);
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
User user = userMapper.selectById(userId);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userId);
return result;
}
datasourceUserMapper.deleteByUserId(userId);
if (check(result, StringUtils.isEmpty(datasourceIds), Status.SUCCESS)) {
return result;
}
String[] datasourceIdArr = datasourceIds.split(",");
for (String datasourceId : datasourceIdArr) {
Date now = new Date();
DatasourceUser datasourceUser = new DatasourceUser();
datasourceUser.setUserId(userId);
datasourceUser.setDatasourceId(Integer.parseInt(datasourceId));
datasourceUser.setPerm(7);
datasourceUser.setCreateTime(now);
datasourceUser.setUpdateTime(now);
datasourceUserMapper.insert(datasourceUser);
}
putMsg(result, Status.SUCCESS);
return result;
}
/** |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | * query user info
*
* @param loginUser login user
* @return user info
*/
@Override
public Map<String, Object> getUserInfo(User loginUser) {
Map<String, Object> result = new HashMap<>();
User user = null;
if (loginUser.getUserType() == UserType.ADMIN_USER) {
user = loginUser;
} else {
user = userMapper.queryDetailsById(loginUser.getId());
List<AlertGroup> alertGroups = alertGroupMapper.queryByUserId(loginUser.getId());
StringBuilder sb = new StringBuilder();
if (alertGroups != null && !alertGroups.isEmpty()) {
for (int i = 0; i < alertGroups.size() - 1; i++) {
sb.append(alertGroups.get(i).getGroupName() + ",");
}
sb.append(alertGroups.get(alertGroups.size() - 1));
user.setAlertGroup(sb.toString());
}
}
result.put(Constants.DATA_LIST, user);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query user list
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | * @param loginUser login user
* @return user list
*/
@Override
public Map<String, Object> queryAllGeneralUsers(User loginUser) {
Map<String, Object> result = new HashMap<>();
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
List<User> userList = userMapper.queryAllGeneralUser();
result.put(Constants.DATA_LIST, userList);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* query user list
*
* @param loginUser login user
* @return user list
*/
@Override
public Map<String, Object> queryUserList(User loginUser) {
Map<String, Object> result = new HashMap<>();
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
List<User> userList = userMapper.selectList(null);
result.put(Constants.DATA_LIST, userList); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | putMsg(result, Status.SUCCESS);
return result;
}
/**
* verify user name exists
*
* @param userName user name
* @return true if user name not exists, otherwise return false
*/
@Override
public Result<Object> verifyUserName(String userName) {
Result<Object> result = new Result<>();
User user = userMapper.queryByUserNameAccurately(userName);
if (user != null) {
putMsg(result, Status.USER_NAME_EXIST);
} else {
putMsg(result, Status.SUCCESS);
}
return result;
}
/**
* unauthorized user
*
* @param loginUser login user
* @param alertgroupId alert group id
* @return unauthorize result code
*/
@Override
public Map<String, Object> unauthorizedUser(User loginUser, Integer alertgroupId) {
Map<String, Object> result = new HashMap<>(); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
List<User> userList = userMapper.selectList(null);
List<User> resultUsers = new ArrayList<>();
Set<User> userSet = null;
if (userList != null && !userList.isEmpty()) {
userSet = new HashSet<>(userList);
List<User> authedUserList = userMapper.queryUserListByAlertGroupId(alertgroupId);
Set<User> authedUserSet = null;
if (authedUserList != null && !authedUserList.isEmpty()) {
authedUserSet = new HashSet<>(authedUserList);
userSet.removeAll(authedUserSet);
}
resultUsers = new ArrayList<>(userSet);
}
result.put(Constants.DATA_LIST, resultUsers);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* authorized user
*
* @param loginUser login user
* @param alertgroupId alert group id
* @return authorized result code
*/
@Override
public Map<String, Object> authorizedUser(User loginUser, Integer alertgroupId) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | Map<String, Object> result = new HashMap<>();
if (check(result, !isAdmin(loginUser), Status.USER_NO_OPERATION_PERM)) {
return result;
}
List<User> userList = userMapper.queryUserListByAlertGroupId(alertgroupId);
result.put(Constants.DATA_LIST, userList);
putMsg(result, Status.SUCCESS);
return result;
}
/**
* @param tenantId tenant id
* @return true if tenant exists, otherwise return false
*/
private boolean checkTenantExists(int tenantId) {
return tenantMapper.queryById(tenantId) != null;
}
/**
* @return if check failed return the field, otherwise return null
*/
private String checkUserParams(String userName, String password, String email, String phone) {
String msg = null;
if (!CheckUtils.checkUserName(userName)) {
msg = userName;
} else if (!CheckUtils.checkPassword(password)) {
msg = password;
} else if (!CheckUtils.checkEmail(email)) {
msg = email;
} else if (!CheckUtils.checkPhone(phone)) {
msg = phone; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | }
return msg;
}
/**
* copy resource files
*
* @param resourceComponent resource component
* @param srcBasePath src base path
* @param dstBasePath dst base path
* @throws IOException io exception
*/
private void copyResourceFiles(ResourceComponent resourceComponent, String srcBasePath, String dstBasePath) throws IOException {
List<ResourceComponent> components = resourceComponent.getChildren();
if (CollectionUtils.isNotEmpty(components)) {
for (ResourceComponent component : components) {
if (!HadoopUtils.getInstance().exists(String.format("%s/%s", srcBasePath, component.getFullName()))) {
logger.error("resource file: {} not exist,copy error", component.getFullName());
throw new ServiceException(Status.RESOURCE_NOT_EXIST);
}
if (!component.isDirctory()) {
HadoopUtils.getInstance().copy(String.format("%s/%s", srcBasePath, component.getFullName()), String.format("%s/%s", dstBasePath, component.getFullName()), false, true);
continue;
}
if (CollectionUtils.isEmpty(component.getChildren())) {
if (!HadoopUtils.getInstance().exists(String.format("%s/%s", dstBasePath, component.getFullName()))) {
HadoopUtils.getInstance().mkdir(String.format("%s/%s", dstBasePath, component.getFullName()));
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | } else {
copyResourceFiles(component, srcBasePath, dstBasePath);
}
}
}
}
/**
* register user, default state is 0, default tenant_id is 1, no phone, no queue
*
* @param userName user name
* @param userPassword user password
* @param repeatPassword repeat password
* @param email email
* @return register result code
* @throws Exception exception
*/
@Override
@Transactional(rollbackFor = RuntimeException.class)
public Map<String, Object> registerUser(String userName, String userPassword, String repeatPassword, String email) {
Map<String, Object> result = new HashMap<>();
String msg = this.checkUserParams(userName, userPassword, email, "");
if (!StringUtils.isEmpty(msg)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, msg);
return result;
}
if (!userPassword.equals(repeatPassword)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, "two passwords are not same");
return result;
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | User user = createUser(userName, userPassword, email, 1, "", "", Flag.NO.ordinal());
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, user);
return result;
}
/**
* activate user, only system admin have permission, change user state code 0 to 1
*
* @param loginUser login user
* @param userName user name
* @return create result code
*/
@Override
public Map<String, Object> activateUser(User loginUser, String userName) {
Map<String, Object> result = new HashMap<>();
result.put(Constants.STATUS, false);
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
if (!CheckUtils.checkUserName(userName)) {
putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, userName);
return result;
}
User user = userMapper.queryByUserNameAccurately(userName);
if (user == null) {
putMsg(result, Status.USER_NOT_EXIST, userName);
return result;
}
if (user.getState() != Flag.NO.ordinal()) { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | putMsg(result, Status.REQUEST_PARAMS_NOT_VALID_ERROR, userName);
return result;
}
user.setState(Flag.YES.ordinal());
Date now = new Date();
user.setUpdateTime(now);
userMapper.updateById(user);
User responseUser = userMapper.queryByUserNameAccurately(userName);
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, responseUser);
return result;
}
/**
* activate user, only system admin have permission, change users state code 0 to 1
*
* @param loginUser login user
* @param userNames user name
* @return create result code
*/
@Override
public Map<String, Object> batchActivateUser(User loginUser, List<String> userNames) {
Map<String, Object> result = new HashMap<>();
if (!isAdmin(loginUser)) {
putMsg(result, Status.USER_NO_OPERATION_PERM);
return result;
}
int totalSuccess = 0;
List<String> successUserNames = new ArrayList<>();
Map<String, Object> successRes = new HashMap<>();
int totalFailed = 0; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/UsersServiceImpl.java | List<Map<String, String>> failedInfo = new ArrayList<>();
Map<String, Object> failedRes = new HashMap<>();
for (String userName : userNames) {
Map<String, Object> tmpResult = activateUser(loginUser, userName);
if (tmpResult.get(Constants.STATUS) != Status.SUCCESS) {
totalFailed++;
Map<String, String> failedBody = new HashMap<>();
failedBody.put("userName", userName);
Status status = (Status) tmpResult.get(Constants.STATUS);
String errorMessage = MessageFormat.format(status.getMsg(), userName);
failedBody.put("msg", errorMessage);
failedInfo.add(failedBody);
} else {
totalSuccess++;
successUserNames.add(userName);
}
}
successRes.put("sum", totalSuccess);
successRes.put("userName", successUserNames);
failedRes.put("sum", totalFailed);
failedRes.put("info", failedInfo);
Map<String, Object> res = new HashMap<>();
res.put("success", successRes);
res.put("failed", failedRes);
putMsg(result, Status.SUCCESS);
result.put(Constants.DATA_LIST, res);
return result;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.controller;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.utils.JSONUtils;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import com.fasterxml.jackson.core.type.TypeReference;
/**
* project controller test
*/
public class ProjectControllerTest extends AbstractControllerTest { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | private static Logger logger = LoggerFactory.getLogger(ProjectControllerTest.class);
private String projectId;
@Before
public void before() throws Exception {
projectId = testCreateProject("project_test1", "the test project");
}
@After
public void after() throws Exception {
testDeleteProject(projectId);
}
private String testCreateProject(String projectName, String description) throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("projectName",projectName);
paramsMap.add("description",description);
MvcResult mvcResult = mockMvc.perform(post("/projects/create")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isCreated())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), new TypeReference<Result<String>>() {});
Assert.assertEquals(Status.SUCCESS.getCode(), result.getCode().intValue());
Assert.assertNotNull(result.getData());
logger.info("create project return result:{}", mvcResult.getResponse().getContentAsString()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | return (String)result.getData();
}
@Test
public void testUpdateProject() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("projectId", projectId);
paramsMap.add("projectName","project_test_update");
paramsMap.add("desc","the test project update");
MvcResult mvcResult = mockMvc.perform(post("/projects/update")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info("update project return result:{}", mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryProjectById() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("projectId", projectId);
MvcResult mvcResult = mockMvc.perform(get("/projects/query-by-id")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(), result.getCode().intValue()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | logger.info(mvcResult.getResponse().getContentAsString());
logger.info("query project by id :{}, return result:{}", projectId, mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryProjectListPaging() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("searchVal","test");
paramsMap.add("pageSize","2");
paramsMap.add("pageNo","2");
MvcResult mvcResult = mockMvc.perform(get("/projects/list-paging")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info("query list-paging project return result:{}", mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryUnauthorizedProject() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("userId","2");
MvcResult mvcResult = mockMvc.perform(get("/projects/unauth-project")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info("query unauth project return result:{}", mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryAuthorizedProject() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("userId",String.valueOf(user.getId()));
MvcResult mvcResult = mockMvc.perform(get("/projects/authed-project")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info("query authed project return result:{}", mvcResult.getResponse().getContentAsString());
}
@Test
public void testQueryAllProjectList() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
MvcResult mvcResult = mockMvc.perform(get("/projects/query-project-list")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info("query all project return result:{}", mvcResult.getResponse().getContentAsString());
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/controller/ProjectControllerTest.java | @Ignore
@Test
public void testImportProcessDefinition() throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("file","test");
MvcResult mvcResult = mockMvc.perform(post("/projects/import-definition")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.TEXT_PLAIN))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.IMPORT_PROCESS_DEFINE_ERROR.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}
private void testDeleteProject(String projectId) throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add("projectId", projectId);
MvcResult mvcResult = mockMvc.perform(get("/projects/delete")
.header(SESSION_ID, sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON_UTF8))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info("delete project return result:{}", mvcResult.getResponse().getContentAsString());
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.api.service;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.impl.ProjectServiceImpl;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
import org.apache.dolphinscheduler.dao.entity.ProcessDefinition; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | import org.apache.dolphinscheduler.dao.entity.Project;
import org.apache.dolphinscheduler.dao.entity.ProjectUser;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.ProcessDefinitionMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectUserMapper;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* project service test
**/
@RunWith(MockitoJUnitRunner.class)
public class ProjectServiceTest {
private static final Logger logger = LoggerFactory.getLogger(ProjectServiceTest.class);
@InjectMocks
private ProjectServiceImpl projectService; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | @Mock
private ProjectMapper projectMapper;
@Mock
private ProjectUserMapper projectUserMapper;
@Mock
private ProcessDefinitionMapper processDefinitionMapper;
private String projectName = "ProjectServiceTest";
private String userName = "ProjectServiceTest";
@Test
public void testCreateProject() {
User loginUser = getLoginUser();
loginUser.setId(1);
Map<String, Object> result = projectService.createProject(loginUser, projectName, getDesc());
logger.info(result.toString());
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
Mockito.when(projectMapper.queryByName(projectName)).thenReturn(getProject());
result = projectService.createProject(loginUser, projectName, projectName);
logger.info(result.toString());
Assert.assertEquals(Status.PROJECT_ALREADY_EXISTS, result.get(Constants.STATUS));
Mockito.when(projectMapper.insert(Mockito.any(Project.class))).thenReturn(1);
result = projectService.createProject(loginUser, "test", "test");
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
}
@Test
public void testQueryById() {
Map<String, Object> result = projectService.queryById(Integer.MAX_VALUE); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | Assert.assertEquals(Status.PROJECT_NOT_FOUNT, result.get(Constants.STATUS));
logger.info(result.toString());
Mockito.when(projectMapper.selectById(1)).thenReturn(getProject());
result = projectService.queryById(1);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
}
@Test
public void testCheckProjectAndAuth() {
Mockito.when(projectUserMapper.queryProjectRelation(1, 1)).thenReturn(getProjectUser());
User loginUser = getLoginUser();
Map<String, Object> result = projectService.checkProjectAndAuth(loginUser, null, projectName);
logger.info(result.toString());
Status status = (Status) result.get(Constants.STATUS);
Assert.assertEquals(Status.PROJECT_NOT_FOUNT, result.get(Constants.STATUS));
Project project = getProject();
project.setUserId(2);
result = projectService.checkProjectAndAuth(loginUser, project, projectName);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PROJECT_PERM, result.get(Constants.STATUS));
project.setUserId(1);
result = projectService.checkProjectAndAuth(loginUser, project, projectName);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
Map<String, Object> result2 = new HashMap<>();
result2 = projectService.checkProjectAndAuth(loginUser, null, projectName);
Assert.assertEquals(Status.PROJECT_NOT_FOUNT, result2.get(Constants.STATUS)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | Project project1 = getProject();
project1.setUserId(2);
result2 = projectService.checkProjectAndAuth(loginUser, project1, projectName);
Assert.assertEquals(Status.USER_NO_OPERATION_PROJECT_PERM, result2.get(Constants.STATUS));
project1.setUserId(1);
projectService.checkProjectAndAuth(loginUser, project1, projectName);
}
@Test
public void testHasProjectAndPerm() {
User loginUser = getLoginUser();
Project project = getProject();
Map<String, Object> result = new HashMap<>();
User tempUser = new User();
tempUser.setId(Integer.MAX_VALUE);
boolean checkResult = projectService.hasProjectAndPerm(tempUser, project, result);
logger.info(result.toString());
Assert.assertFalse(checkResult);
result = new HashMap<>();
project.setUserId(1);
checkResult = projectService.hasProjectAndPerm(loginUser, project, result);
logger.info(result.toString());
Assert.assertTrue(checkResult);
}
@Test
public void testQueryProjectListPaging() { |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | IPage<Project> page = new Page<>(1, 10);
page.setRecords(getList());
page.setTotal(1L);
Mockito.when(projectMapper.queryProjectListPaging(Mockito.any(Page.class), Mockito.eq(1), Mockito.eq(projectName))).thenReturn(page);
User loginUser = getLoginUser();
Map<String, Object> result = projectService.queryProjectListPaging(loginUser, 10, 1, projectName);
logger.info(result.toString());
PageInfo<Project> pageInfo = (PageInfo<Project>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(pageInfo.getLists()));
Mockito.when(projectMapper.queryProjectListPaging(Mockito.any(Page.class), Mockito.eq(0), Mockito.eq(projectName))).thenReturn(page);
loginUser.setUserType(UserType.ADMIN_USER);
result = projectService.queryProjectListPaging(loginUser, 10, 1, projectName);
logger.info(result.toString());
pageInfo = (PageInfo<Project>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(pageInfo.getLists()));
}
@Test
public void testDeleteProject() {
Mockito.when(projectMapper.selectById(1)).thenReturn(getProject());
User loginUser = getLoginUser();
Map<String, Object> result = projectService.deleteProject(loginUser, 12);
logger.info(result.toString());
Assert.assertEquals(Status.PROJECT_NOT_FOUNT, result.get(Constants.STATUS));
loginUser.setId(2);
result = projectService.deleteProject(loginUser, 1);
logger.info(result.toString()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | Assert.assertEquals(Status.USER_NO_OPERATION_PROJECT_PERM, result.get(Constants.STATUS));
Mockito.when(processDefinitionMapper.queryAllDefinitionList(1)).thenReturn(getProcessDefinitions());
loginUser.setUserType(UserType.ADMIN_USER);
result = projectService.deleteProject(loginUser, 1);
logger.info(result.toString());
Assert.assertEquals(Status.DELETE_PROJECT_ERROR_DEFINES_NOT_NULL, result.get(Constants.STATUS));
Mockito.when(projectMapper.deleteById(1)).thenReturn(1);
Mockito.when(processDefinitionMapper.queryAllDefinitionList(1)).thenReturn(new ArrayList<>());
result = projectService.deleteProject(loginUser, 1);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
}
@Test
public void testUpdate() {
User loginUser = getLoginUser();
Project project = getProject();
project.setId(2);
Mockito.when(projectMapper.queryByName(projectName)).thenReturn(project);
Mockito.when(projectMapper.selectById(1)).thenReturn(getProject());
Map<String, Object> result = projectService.update(loginUser, 12, projectName, "desc");
logger.info(result.toString());
Assert.assertEquals(Status.PROJECT_NOT_FOUNT, result.get(Constants.STATUS));
result = projectService.update(loginUser, 1, projectName, "desc");
logger.info(result.toString());
Assert.assertEquals(Status.PROJECT_ALREADY_EXISTS, result.get(Constants.STATUS)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | project.setUserId(1);
Mockito.when(projectMapper.updateById(Mockito.any(Project.class))).thenReturn(1);
result = projectService.update(loginUser, 1, "test", "desc");
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
}
@Test
public void testQueryAuthorizedProject() {
User loginUser = getLoginUser();
Mockito.when(projectMapper.queryAuthedProjectListByUserId(1)).thenReturn(getList());
Map<String, Object> result = projectService.queryAuthorizedProject(loginUser, 3);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
loginUser.setUserType(UserType.ADMIN_USER);
result = projectService.queryAuthorizedProject(loginUser, 1);
logger.info(result.toString());
List<Project> projects = (List<Project>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(projects));
loginUser.setUserType(UserType.GENERAL_USER);
result = projectService.queryAuthorizedProject(loginUser, loginUser.getId());
projects = (List<Project>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(projects));
}
@Test
public void testQueryCreatedProject() {
User loginUser = getLoginUser();
Mockito.when(projectMapper.queryProjectCreatedByUser(1)).thenReturn(getList()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | loginUser.setUserType(UserType.ADMIN_USER);
Map<String, Object> result = projectService.queryProjectCreatedByUser(loginUser);
logger.info(result.toString());
List<Project> projects = (List<Project>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(projects));
}
@Test
public void testQueryProjectCreatedAndAuthorizedByUser() {
Map<String, Object> result = null;
User loginUser = getLoginUser();
Mockito.when(projectMapper.queryProjectCreatedAndAuthorizedByUserId(1)).thenReturn(getList());
result = projectService.queryProjectCreatedAndAuthorizedByUser(loginUser);
List<Project> notAdminUserResult = (List<Project>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(notAdminUserResult));
loginUser.setUserType(UserType.ADMIN_USER);
Mockito.when(projectMapper.selectList(null)).thenReturn(getList());
result = projectService.queryProjectCreatedAndAuthorizedByUser(loginUser);
List<Project> projects = (List<Project>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(projects));
}
@Test
public void testQueryAllProjectList() {
Mockito.when(projectMapper.queryAllProject()).thenReturn(getList());
Map<String, Object> result = projectService.queryAllProjectList();
logger.info(result.toString());
List<Project> projects = (List<Project>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(projects));
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | @Test
public void testQueryUnauthorizedProject() {
Mockito.when(projectMapper.queryProjectExceptUserId(2)).thenReturn(getList());
User loginUser = new User();
loginUser.setUserType(UserType.ADMIN_USER);
Map<String, Object> result = projectService.queryUnauthorizedProject(loginUser, 2);
logger.info(result.toString());
List<Project> projects = (List<Project>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(projects));
}
private Project getProject() {
Project project = new Project();
project.setId(1);
project.setName(projectName);
project.setUserId(1);
return project;
}
private List<Project> getList() {
List<Project> list = new ArrayList<>();
list.add(getProject());
return list;
}
/**
* create admin user
*/
private User getLoginUser() {
User loginUser = new User();
loginUser.setUserType(UserType.GENERAL_USER);
loginUser.setUserName(userName); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProjectServiceTest.java | loginUser.setId(1);
return loginUser;
}
/**
* get project user
*/
private ProjectUser getProjectUser() {
ProjectUser projectUser = new ProjectUser();
projectUser.setProjectId(1);
projectUser.setUserId(1);
return projectUser;
}
private List<ProcessDefinition> getProcessDefinitions() {
List<ProcessDefinition> list = new ArrayList<>();
ProcessDefinition processDefinition = new ProcessDefinition();
processDefinition.setProjectId(1);
list.add(processDefinition);
return list;
}
private List<Integer> getProjectIds() {
return Collections.singletonList(1);
}
private String getDesc() {
return "projectUserMapper.deleteProjectRelation(projectId,userId)projectUserMappe"
+ ".deleteProjectRelation(projectId,userId)projectUserMappe"
+ "r.deleteProjectRelation(projectId,userId)projectUserMapper"
+ ".deleteProjectRelation(projectId,userId)projectUserMapper.deleteProjectRelation(projectId,userId)";
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | * limitations under the License.
*/
package org.apache.dolphinscheduler.api.service;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
import org.apache.dolphinscheduler.api.enums.Status;
import org.apache.dolphinscheduler.api.service.impl.UsersServiceImpl;
import org.apache.dolphinscheduler.api.utils.PageInfo;
import org.apache.dolphinscheduler.api.utils.Result;
import org.apache.dolphinscheduler.common.Constants;
import org.apache.dolphinscheduler.common.enums.ResourceType;
import org.apache.dolphinscheduler.common.enums.UserType;
import org.apache.dolphinscheduler.common.utils.CollectionUtils;
import org.apache.dolphinscheduler.common.utils.EncryptionUtils;
import org.apache.dolphinscheduler.dao.entity.AlertGroup;
import org.apache.dolphinscheduler.dao.entity.Resource;
import org.apache.dolphinscheduler.dao.entity.Tenant;
import org.apache.dolphinscheduler.dao.entity.User;
import org.apache.dolphinscheduler.dao.mapper.AlertGroupMapper;
import org.apache.dolphinscheduler.dao.mapper.DataSourceUserMapper;
import org.apache.dolphinscheduler.dao.mapper.ProjectUserMapper;
import org.apache.dolphinscheduler.dao.mapper.ResourceMapper;
import org.apache.dolphinscheduler.dao.mapper.ResourceUserMapper;
import org.apache.dolphinscheduler.dao.mapper.TenantMapper;
import org.apache.dolphinscheduler.dao.mapper.UDFUserMapper;
import org.apache.dolphinscheduler.dao.mapper.UserMapper;
import java.util.ArrayList;
import java.util.List;
import java.util.Map; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**
* users service test
*/
@RunWith(MockitoJUnitRunner.class)
public class UsersServiceTest {
private static final Logger logger = LoggerFactory.getLogger(UsersServiceTest.class);
@InjectMocks
private UsersServiceImpl usersService;
@Mock
private UserMapper userMapper;
@Mock
private TenantMapper tenantMapper;
@Mock
private ResourceMapper resourceMapper;
@Mock
private AlertGroupMapper alertGroupMapper;
@Mock |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | private DataSourceUserMapper datasourceUserMapper;
@Mock
private ProjectUserMapper projectUserMapper;
@Mock
private ResourceUserMapper resourceUserMapper;
@Mock
private UDFUserMapper udfUserMapper;
private String queueName = "UsersServiceTestQueue";
@Before
public void before() {
}
@After
public void after() {
}
@Test
public void testCreateUserForLdap() {
String userName = "user1";
String email = "[email protected]";
User user = usersService.createUser(UserType.ADMIN_USER, userName, email);
Assert.assertNotNull(user);
}
@Test
public void testCreateUser() {
User user = new User();
user.setUserType(UserType.ADMIN_USER);
String userName = "userTest0001~";
String userPassword = "userTest";
String email = "[email protected]";
int tenantId = Integer.MAX_VALUE;
String phone = "13456432345"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | int state = 1;
try {
Map<String, Object> result = usersService.createUser(user, userName, userPassword, email, tenantId, phone, queueName, state);
logger.info(result.toString());
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
userName = "userTest0001";
userPassword = "userTest000111111111111111";
result = usersService.createUser(user, userName, userPassword, email, tenantId, phone, queueName, state);
logger.info(result.toString());
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
userPassword = "userTest0001";
email = "1q.com";
result = usersService.createUser(user, userName, userPassword, email, tenantId, phone, queueName, state);
logger.info(result.toString());
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
email = "[email protected]";
phone = "2233";
result = usersService.createUser(user, userName, userPassword, email, tenantId, phone, queueName, state);
logger.info(result.toString());
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
phone = "13456432345";
result = usersService.createUser(user, userName, userPassword, email, tenantId, phone, queueName, state);
logger.info(result.toString());
Assert.assertEquals(Status.TENANT_NOT_EXIST, result.get(Constants.STATUS)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | Mockito.when(tenantMapper.queryById(1)).thenReturn(getTenant());
result = usersService.createUser(user, userName, userPassword, email, 1, phone, queueName, state);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
} catch (Exception e) {
logger.error(Status.CREATE_USER_ERROR.getMsg(), e);
Assert.assertTrue(false);
}
}
@Test
public void testQueryUser() {
String userName = "userTest0001";
String userPassword = "userTest0001";
when(userMapper.queryUserByNamePassword(userName, EncryptionUtils.getMd5(userPassword))).thenReturn(getGeneralUser());
User queryUser = usersService.queryUser(userName, userPassword);
logger.info(queryUser.toString());
Assert.assertTrue(queryUser != null);
}
@Test
public void testSelectByIds() {
List<Integer> ids = new ArrayList<>();
List<User> users = usersService.queryUser(ids);
Assert.assertTrue(users.isEmpty());
ids.add(1);
List<User> userList = new ArrayList<>();
userList.add(new User());
when(userMapper.selectByIds(ids)).thenReturn(userList);
List<User> userList1 = usersService.queryUser(ids);
Assert.assertFalse(userList1.isEmpty());
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | @Test
public void testGetUserIdByName() {
User user = new User();
user.setId(1);
user.setUserType(UserType.ADMIN_USER);
user.setUserName("test_user");
int userId = usersService.getUserIdByName("");
Assert.assertEquals(0, userId);
when(usersService.queryUser(user.getUserName())).thenReturn(null);
int userNotExistId = usersService.getUserIdByName(user.getUserName());
Assert.assertEquals(-1, userNotExistId);
when(usersService.queryUser(user.getUserName())).thenReturn(user);
int userExistId = usersService.getUserIdByName(user.getUserName());
Assert.assertEquals(user.getId(), userExistId);
}
@Test
public void testQueryUserList() {
User user = new User();
Map<String, Object> result = usersService.queryUserList(user);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
user.setUserType(UserType.ADMIN_USER);
when(userMapper.selectList(null)).thenReturn(getUserList());
result = usersService.queryUserList(user);
List<User> userList = (List<User>) result.get(Constants.DATA_LIST); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | Assert.assertTrue(userList.size() > 0);
}
@Test
public void testQueryUserListPage() {
User user = new User();
IPage<User> page = new Page<>(1, 10);
page.setRecords(getUserList());
when(userMapper.queryUserPaging(any(Page.class), eq("userTest"))).thenReturn(page);
Map<String, Object> result = usersService.queryUserList(user, "userTest", 1, 10);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
user.setUserType(UserType.ADMIN_USER);
result = usersService.queryUserList(user, "userTest", 1, 10);
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
PageInfo<User> pageInfo = (PageInfo<User>) result.get(Constants.DATA_LIST);
Assert.assertTrue(pageInfo.getLists().size() > 0);
}
@Test
public void testUpdateUser() {
String userName = "userTest0001";
String userPassword = "userTest0001";
try {
Map<String, Object> result = usersService.updateUser(getLoginUser(), 0,userName,userPassword,"[email protected]",1,"13457864543","queue", 1);
Assert.assertEquals(Status.USER_NOT_EXIST, result.get(Constants.STATUS));
logger.info(result.toString());
when(userMapper.selectById(1)).thenReturn(getUser()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | result = usersService.updateUser(getLoginUser(), 1,userName,userPassword,"[email protected]",1,"13457864543","queue", 1);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
} catch (Exception e) {
logger.error("update user error", e);
Assert.assertTrue(false);
}
}
@Test
public void testDeleteUserById() {
User loginUser = new User();
try {
when(userMapper.queryTenantCodeByUserId(1)).thenReturn(getUser());
when(userMapper.selectById(1)).thenReturn(getUser());
Map<String, Object> result = usersService.deleteUserById(loginUser, 3);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
loginUser.setUserType(UserType.ADMIN_USER);
result = usersService.deleteUserById(loginUser, 3);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NOT_EXIST, result.get(Constants.STATUS));
result = usersService.deleteUserById(loginUser, 1);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
} catch (Exception e) {
logger.error("delete user error", e);
Assert.assertTrue(false); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | }
}
@Test
public void testGrantProject() {
when(userMapper.selectById(1)).thenReturn(getUser());
User loginUser = new User();
String projectIds = "100000,120000";
Map<String, Object> result = usersService.grantProject(loginUser, 1, projectIds);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
loginUser.setUserType(UserType.ADMIN_USER);
result = usersService.grantProject(loginUser, 2, projectIds);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NOT_EXIST, result.get(Constants.STATUS));
when(projectUserMapper.deleteProjectRelation(Mockito.anyInt(), Mockito.anyInt())).thenReturn(1);
result = usersService.grantProject(loginUser, 1, projectIds);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
}
@Test
public void testGrantResources() {
String resourceIds = "100000,120000";
when(userMapper.selectById(1)).thenReturn(getUser());
User loginUser = new User();
Map<String, Object> result = usersService.grantResources(loginUser, 1, resourceIds);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | loginUser.setUserType(UserType.ADMIN_USER);
result = usersService.grantResources(loginUser, 2, resourceIds);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NOT_EXIST, result.get(Constants.STATUS));
when(resourceMapper.selectById(Mockito.anyInt())).thenReturn(getResource());
when(resourceUserMapper.deleteResourceUser(1, 0)).thenReturn(1);
result = usersService.grantResources(loginUser, 1, resourceIds);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
}
@Test
public void testGrantUDFFunction() {
String udfIds = "100000,120000";
when(userMapper.selectById(1)).thenReturn(getUser());
User loginUser = new User();
Map<String, Object> result = usersService.grantUDFFunction(loginUser, 1, udfIds);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
loginUser.setUserType(UserType.ADMIN_USER);
result = usersService.grantUDFFunction(loginUser, 2, udfIds);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NOT_EXIST, result.get(Constants.STATUS));
when(udfUserMapper.deleteByUserId(1)).thenReturn(1);
result = usersService.grantUDFFunction(loginUser, 1, udfIds);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | @Test
public void testGrantDataSource() {
String datasourceIds = "100000,120000";
when(userMapper.selectById(1)).thenReturn(getUser());
User loginUser = new User();
Map<String, Object> result = usersService.grantDataSource(loginUser, 1, datasourceIds);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
loginUser.setUserType(UserType.ADMIN_USER);
result = usersService.grantDataSource(loginUser, 2, datasourceIds);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NOT_EXIST, result.get(Constants.STATUS));
when(datasourceUserMapper.deleteByUserId(Mockito.anyInt())).thenReturn(1);
result = usersService.grantDataSource(loginUser, 1, datasourceIds);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
}
private User getLoginUser(){
User loginUser = new User();
loginUser.setId(1);
loginUser.setUserType(UserType.ADMIN_USER);
return loginUser;
}
@Test
public void getUserInfo() {
User loginUser = new User();
loginUser.setUserName("admin");
loginUser.setUserType(UserType.ADMIN_USER); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | Map<String, Object> result = usersService.getUserInfo(loginUser);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
User tempUser = (User) result.get(Constants.DATA_LIST);
Assert.assertEquals("admin", tempUser.getUserName());
loginUser.setUserType(null);
loginUser.setId(1);
when(userMapper.queryDetailsById(1)).thenReturn(getGeneralUser());
when(alertGroupMapper.queryByUserId(1)).thenReturn(getAlertGroups());
result = usersService.getUserInfo(loginUser);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
tempUser = (User) result.get(Constants.DATA_LIST);
Assert.assertEquals("userTest0001", tempUser.getUserName());
}
@Test
public void testQueryAllGeneralUsers() {
User loginUser = new User();
Map<String, Object> result = usersService.queryAllGeneralUsers(loginUser);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
loginUser.setUserType(UserType.ADMIN_USER);
when(userMapper.queryAllGeneralUser()).thenReturn(getUserList());
result = usersService.queryAllGeneralUsers(loginUser); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
List<User> userList = (List<User>) result.get(Constants.DATA_LIST);
Assert.assertTrue(CollectionUtils.isNotEmpty(userList));
}
@Test
public void testVerifyUserName() {
Result result = usersService.verifyUserName("admin89899");
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS.getMsg(), result.getMsg());
when(userMapper.queryByUserNameAccurately("userTest0001")).thenReturn(getUser());
result = usersService.verifyUserName("userTest0001");
logger.info(result.toString());
Assert.assertEquals(Status.USER_NAME_EXIST.getMsg(), result.getMsg());
}
@Test
public void testUnauthorizedUser() {
User loginUser = new User();
when(userMapper.selectList(null)).thenReturn(getUserList());
when(userMapper.queryUserListByAlertGroupId(2)).thenReturn(getUserList());
Map<String, Object> result = usersService.unauthorizedUser(loginUser, 2);
logger.info(result.toString());
loginUser.setUserType(UserType.ADMIN_USER);
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
result = usersService.unauthorizedUser(loginUser, 2);
logger.info(result.toString()); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
}
@Test
public void testAuthorizedUser() {
User loginUser = new User();
when(userMapper.queryUserListByAlertGroupId(2)).thenReturn(getUserList());
Map<String, Object> result = usersService.authorizedUser(loginUser, 2);
logger.info(result.toString());
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
loginUser.setUserType(UserType.ADMIN_USER);
result = usersService.authorizedUser(loginUser, 2);
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
List<User> userList = (List<User>) result.get(Constants.DATA_LIST);
logger.info(result.toString());
Assert.assertTrue(CollectionUtils.isNotEmpty(userList));
}
@Test
public void testRegisterUser() {
String userName = "userTest0002~";
String userPassword = "userTest";
String repeatPassword = "userTest";
String email = "[email protected]";
try {
Map<String, Object> result = usersService.registerUser(userName, userPassword, repeatPassword, email);
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
userName = "userTest0002";
userPassword = "userTest000111111111111111"; |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | result = usersService.registerUser(userName, userPassword, repeatPassword, email);
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
userPassword = "userTest0002";
email = "1q.com";
result = usersService.registerUser(userName, userPassword, repeatPassword, email);
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
email = "[email protected]";
repeatPassword = "userPassword";
result = usersService.registerUser(userName, userPassword, repeatPassword, email);
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
repeatPassword = "userTest0002";
result = usersService.registerUser(userName, userPassword, repeatPassword, email);
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
} catch (Exception e) {
Assert.assertTrue(false);
}
}
@Test
public void testActivateUser() {
User user = new User();
user.setUserType(UserType.GENERAL_USER);
String userName = "userTest0002~";
try {
Map<String, Object> result = usersService.activateUser(user, userName);
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS)); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | user.setUserType(UserType.ADMIN_USER);
result = usersService.activateUser(user, userName);
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
userName = "userTest10013";
result = usersService.activateUser(user, userName);
Assert.assertEquals(Status.USER_NOT_EXIST, result.get(Constants.STATUS));
userName = "userTest0001";
when(userMapper.queryByUserNameAccurately(userName)).thenReturn(getUser());
result = usersService.activateUser(user, userName);
Assert.assertEquals(Status.REQUEST_PARAMS_NOT_VALID_ERROR, result.get(Constants.STATUS));
when(userMapper.queryByUserNameAccurately(userName)).thenReturn(getDisabledUser());
result = usersService.activateUser(user, userName);
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
} catch (Exception e) {
Assert.assertTrue(false);
}
}
@Test
public void testBatchActivateUser() {
User user = new User();
user.setUserType(UserType.GENERAL_USER);
List<String> userNames = new ArrayList<>();
userNames.add("userTest0001");
userNames.add("userTest0002");
userNames.add("userTest0003~");
userNames.add("userTest0004"); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | try {
Map<String, Object> result = usersService.batchActivateUser(user, userNames);
Assert.assertEquals(Status.USER_NO_OPERATION_PERM, result.get(Constants.STATUS));
user.setUserType(UserType.ADMIN_USER);
when(userMapper.queryByUserNameAccurately("userTest0001")).thenReturn(getUser());
when(userMapper.queryByUserNameAccurately("userTest0002")).thenReturn(getDisabledUser());
result = usersService.batchActivateUser(user, userNames);
Map<String, Object> responseData = (Map<String, Object>) result.get(Constants.DATA_LIST);
Map<String, Object> successData = (Map<String, Object>) responseData.get("success");
int totalSuccess = (Integer) successData.get("sum");
Map<String, Object> failedData = (Map<String, Object>) responseData.get("failed");
int totalFailed = (Integer) failedData.get("sum");
Assert.assertEquals(1, totalSuccess);
Assert.assertEquals(3, totalFailed);
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
} catch (Exception e) {
Assert.assertTrue(false);
}
}
/**
* get disabled user
*/
private User getDisabledUser() {
User user = new User();
user.setUserType(UserType.GENERAL_USER);
user.setUserName("userTest0001");
user.setUserPassword("userTest0001");
user.setState(0); |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | return user;
}
/**
* get user
*/
private User getGeneralUser() {
User user = new User();
user.setUserType(UserType.GENERAL_USER);
user.setUserName("userTest0001");
user.setUserPassword("userTest0001");
return user;
}
private List<User> getUserList() {
List<User> userList = new ArrayList<>();
userList.add(getGeneralUser());
return userList;
}
/**
* get user
*/
private User getUser() {
User user = new User();
user.setUserType(UserType.ADMIN_USER);
user.setUserName("userTest0001");
user.setUserPassword("userTest0001");
user.setState(1);
return user;
}
/**
* get tenant |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,326 | [Bug][api-server] delete the user ,when query the project by join the table of t_ds_user will return null. | delete the user ,when query the project by join the table of t_ds_user will return null.
Suggested that [
from t_ds_project p
join t_ds_user u on p.user_id = u.id
]changed to [
from t_ds_project p
left join t_ds_user u on p.user_id = u.id
] | https://github.com/apache/dolphinscheduler/issues/5326 | https://github.com/apache/dolphinscheduler/pull/5394 | 6b8461e901de65000f4f8f34ebfe011946e787d3 | cbbe9c333c39a0163c100c5ced270f76301c97b3 | "2021-04-20T03:12:14Z" | java | "2021-04-29T06:50:05Z" | dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/UsersServiceTest.java | *
* @return tenant
*/
private Tenant getTenant() {
Tenant tenant = new Tenant();
tenant.setId(1);
return tenant;
}
/**
* get resource
*
* @return resource
*/
private Resource getResource() {
Resource resource = new Resource();
resource.setPid(-1);
resource.setUserId(1);
resource.setDescription("ResourcesServiceTest.jar");
resource.setAlias("ResourcesServiceTest.jar");
resource.setFullName("/ResourcesServiceTest.jar");
resource.setType(ResourceType.FILE);
return resource;
}
private List<AlertGroup> getAlertGroups() {
List<AlertGroup> alertGroups = new ArrayList<>();
AlertGroup alertGroup = new AlertGroup();
alertGroups.add(alertGroup);
return alertGroups;
}
} |
closed | apache/dolphinscheduler | https://github.com/apache/dolphinscheduler | 5,386 | [Bug][Alert] ERROR: relation "t_ds_plugin_define" does not exist | **To Reproduce**
Steps to reproduce the behavior, for example:
1. Run `docker-compose up -d`
2. Run `docker logs -f dolphinscheduler-alert`
3. See error
**Expected behavior**
Bug fixed
**Screenshots**
Alert logs:
```
[INFO] 2021-04-26 00:27:39.678 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[104] - Registering Alert Plugin 'DingTalk'
[INFO] 2021-04-26 00:27:39.681 org.apache.dolphinscheduler.alert.plugin.AlertPluginManager:[86] - -- Loaded Alert Plugin DingTalk --
[INFO] 2021-04-26 00:27:41.901 com.alibaba.druid.pool.DruidDataSource:[994] - {dataSource-1} inited
Exception in thread "main" java.lang.RuntimeException: load Alert Plugin Failed !
at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:104)
at org.apache.dolphinscheduler.alert.AlertServer.start(AlertServer.java:145)
at org.apache.dolphinscheduler.alert.AlertServer.main(AlertServer.java:161)
Caused by: org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist
Position: 23
### The error may exist in org/apache/dolphinscheduler/dao/mapper/PluginDefineMapper.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: select * from t_ds_plugin_define where plugin_name = ? and plugin_type = ?
### Cause: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist
Position: 23
; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist
Position: 23
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:239)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:74)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:440)
at com.sun.proxy.$Proxy11.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:223)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.executeForMany(MybatisMapperMethod.java:158)
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:76)
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:61)
at com.sun.proxy.$Proxy15.queryByNameAndType(Unknown Source)
at org.apache.dolphinscheduler.dao.PluginDao.addOrUpdatePluginDefine(PluginDao.java:67)
at org.apache.dolphinscheduler.alert.plugin.AlertPluginManager.installPlugin(AlertPluginManager.java:111)
at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:111)
at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugin(DolphinPluginLoader.java:99)
at org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader.loadPlugins(DolphinPluginLoader.java:85)
at org.apache.dolphinscheduler.alert.AlertServer.initPlugin(AlertServer.java:102)
... 2 more
Caused by: org.postgresql.util.PSQLException: ERROR: relation "t_ds_plugin_define" does not exist
Position: 23
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:143)
at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:132)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:497)
at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:64)
at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:63)
at com.sun.proxy.$Proxy23.query(Unknown Source)
at com.baomidou.mybatisplus.core.executor.MybatisSimpleExecutor.doQuery(MybatisSimpleExecutor.java:67)
at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:140)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:426)
... 14 more
End start alert-server.
2021-04-26 00:27:43,637 INFO exited: alert (exit status 0; expected)
```
**Which version of Dolphin Scheduler:**
-[dev]
**Additional context**
Add any other context about the problem here.
**Requirement or improvement**
- Please describe about your requirements or improvement suggestions.
| https://github.com/apache/dolphinscheduler/issues/5386 | https://github.com/apache/dolphinscheduler/pull/5387 | d45b27ce2e54c972e64d6b00b359643e34c1d2a8 | 0f3eed9d00e6b688342c7885b0d2fc2528481ce0 | "2021-04-25T16:30:21Z" | java | "2021-04-29T08:17:01Z" | dolphinscheduler-alert/src/main/java/org/apache/dolphinscheduler/alert/AlertServer.java | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.dolphinscheduler.alert;
import static org.apache.dolphinscheduler.alert.utils.Constants.ALERT_PROPERTIES_PATH;
import static org.apache.dolphinscheduler.common.Constants.ALERT_RPC_PORT;
import org.apache.dolphinscheduler.alert.plugin.AlertPluginManager;
import org.apache.dolphinscheduler.alert.processor.AlertRequestProcessor;
import org.apache.dolphinscheduler.alert.runner.AlertSender;
import org.apache.dolphinscheduler.alert.utils.Constants;
import org.apache.dolphinscheduler.common.plugin.DolphinPluginLoader;
import org.apache.dolphinscheduler.common.plugin.DolphinPluginManagerConfig;
import org.apache.dolphinscheduler.common.thread.Stopper;
import org.apache.dolphinscheduler.common.utils.PropertyUtils;
import org.apache.dolphinscheduler.dao.AlertDao;
import org.apache.dolphinscheduler.dao.DaoFactory; |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.