This is an automated email from the ASF dual-hosted git repository. benjobs pushed a commit to branch ddl in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
commit b9105dc3d47fd48af50a17d59eb4a87cc6f2e360 Author: benjobs <[email protected]> AuthorDate: Mon Feb 26 14:42:29 2024 +0800 [Improve] mysql ddl "on update current_timestamp" compatibility improvement --- .../main/assembly/script/schema/mysql-schema.sql | 26 +++++----- .../main/assembly/script/upgrade/mysql/2.0.0.sql | 2 +- .../main/assembly/script/upgrade/mysql/2.1.0.sql | 6 +-- .../console/core/controller/SettingController.java | 7 --- .../console/core/entity/FlinkCluster.java | 2 +- .../streampark/console/core/entity/FlinkSql.java | 1 + .../streampark/console/core/entity/Variable.java | 4 +- .../core/service/impl/ApplicationServiceImpl.java | 8 ++- .../core/service/impl/FlinkEnvServiceImpl.java | 1 + .../core/service/impl/ProjectServiceImpl.java | 2 + .../core/service/impl/SqlCompleteServiceImpl.java | 2 +- .../core/service/impl/VariableServiceImpl.java | 5 ++ .../core/service/impl/YarnQueueServiceImpl.java | 5 ++ .../system/controller/AccessTokenController.java | 2 +- .../streampark/console/system/entity/SysLog.java | 57 ---------------------- .../console/system/service/AccessTokenService.java | 3 +- .../service/impl/AccessTokenServiceImpl.java | 4 +- .../system/service/impl/MemberServiceImpl.java | 3 +- .../system/service/impl/MenuServiceImpl.java | 1 + .../system/service/impl/RoleServiceImpl.java | 1 + .../system/service/impl/TeamServiceImpl.java | 2 +- .../system/service/impl/UserServiceImpl.java | 2 + .../core/service/AccessTokenServiceTest.java | 2 +- .../src/api/flink/setting/index.ts | 2 - 24 files changed, 55 insertions(+), 95 deletions(-) diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/schema/mysql-schema.sql b/streampark-console/streampark-console-service/src/main/assembly/script/schema/mysql-schema.sql index ac63175c2..209bfcce4 100644 --- a/streampark-console/streampark-console-service/src/main/assembly/script/schema/mysql-schema.sql +++ b/streampark-console/streampark-console-service/src/main/assembly/script/schema/mysql-schema.sql @@ -197,7 +197,7 @@ create table `t_flink_project` ( `description` varchar(255) collate utf8mb4_general_ci default null, `build_state` tinyint default -1, `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', primary key (`id`) using btree, index `inx_team` (`team_id`) using btree ) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci; @@ -252,7 +252,7 @@ create table `t_menu` ( `display` tinyint collate utf8mb4_general_ci not null default 1 comment 'whether the menu is displayed', `order_num` int default null comment 'sort', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', primary key (`menu_id`) using btree ) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci; @@ -284,7 +284,7 @@ create table `t_team` ( `team_name` varchar(64) collate utf8mb4_general_ci not null comment 'team name', `description` varchar(255) collate utf8mb4_general_ci default null, `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', primary key (`id`) using btree, unique key `team_name_idx` (`team_name`) using btree ) engine = innodb default charset = utf8mb4 collate = utf8mb4_general_ci; @@ -302,7 +302,7 @@ create table `t_variable` ( `team_id` bigint collate utf8mb4_general_ci not null comment 'team id', `desensitization` tinyint not null default 0 comment '0 is no desensitization, 1 is desensitization, if set to desensitization, it will be replaced by * when displayed', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', primary key (`id`) using btree, unique key `un_team_vcode_inx` (`team_id`,`variable_code`) using btree ) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci; @@ -315,7 +315,7 @@ create table `t_role` ( `role_id` bigint not null auto_increment comment 'user id', `role_name` varchar(64) collate utf8mb4_general_ci not null comment 'role name', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', `description` varchar(255) collate utf8mb4_general_ci default null comment 'description', primary key (`role_id`) using btree ) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci; @@ -365,7 +365,7 @@ create table `t_user` ( `last_team_id` bigint default null comment 'last team id', `status` char(1) collate utf8mb4_general_ci not null comment 'status 0:locked 1:active', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', `last_login_time` datetime default null comment 'last login time', `sex` char(1) collate utf8mb4_general_ci default null comment 'gender 0:male 1:female 2:confidential', `avatar` varchar(128) collate utf8mb4_general_ci default null comment 'avatar', @@ -385,7 +385,7 @@ create table `t_member` ( `user_id` bigint not null comment 'user id', `role_id` bigint not null comment 'role id', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', primary key (`id`) using btree, unique key `un_user_team_role_inx` (`user_id`,`team_id`,`role_id`) using btree ) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci; @@ -405,7 +405,7 @@ create table `t_app_build_pipe`( `steps_status_ts` text, `error` text, `build_result` text, - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', primary key (`app_id`) using btree ) engine = innodb auto_increment=100000 default charset = utf8mb4 collate = utf8mb4_general_ci; @@ -453,7 +453,7 @@ create table `t_access_token` ( `description` varchar(255) character set utf8mb4 collate utf8mb4_general_ci default null comment 'description', `status` tinyint default null comment '1:enable,0:disable', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', primary key (`id`) using btree ) engine=innodb auto_increment=100000 default charset=utf8mb4 collate=utf8mb4_general_ci; @@ -474,7 +474,7 @@ create table `t_alert_config` ( `http_callback_params` text collate utf8mb4_general_ci comment 'http callback params', `lark_params` text collate utf8mb4_general_ci comment 'lark params', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', index `inx_alert_user` (`user_id`) using btree ) engine = innodb default charset = utf8mb4 collate = utf8mb4_general_ci; @@ -488,8 +488,8 @@ CREATE TABLE `t_external_link` ( `badge_name` varchar(64) collate utf8mb4_general_ci default null, `badge_color` varchar(64) collate utf8mb4_general_ci default null, `link_url` varchar(255) collate utf8mb4_general_ci default null, - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'create time', - `modify_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'modify time' + `create_time` datetime not null default current_timestamp COMMENT 'create time', + `modify_time` datetime not null default current_timestamp COMMENT 'modify time' ) engine = innodb default charset=utf8mb4 collate=utf8mb4_general_ci; -- ---------------------------- @@ -502,7 +502,7 @@ create table `t_yarn_queue` ( `queue_label` varchar(128) collate utf8mb4_general_ci not null comment 'queue label expression', `description` varchar(255) collate utf8mb4_general_ci default null comment 'description of the queue label', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', unique key `unq_team_id_queue_label` (`team_id`, `queue_label`) using btree ) engine = innodb default charset = utf8mb4 collate = utf8mb4_general_ci; diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.0.0.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.0.0.sql index de4e88c82..8c0b66e60 100644 --- a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.0.0.sql +++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.0.0.sql @@ -33,7 +33,7 @@ create table `t_alert_config` ( `http_callback_params` text collate utf8mb4_general_ci comment 'http callback params', `lark_params` text collate utf8mb4_general_ci comment 'lark params', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', index `inx_user_id` (`user_id`) using btree ) engine = innodb default charset = utf8mb4 collate = utf8mb4_general_ci; diff --git a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.0.sql b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.0.sql index c744b30eb..4957ac68b 100644 --- a/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.0.sql +++ b/streampark-console/streampark-console-service/src/main/assembly/script/upgrade/mysql/2.1.0.sql @@ -27,8 +27,8 @@ CREATE TABLE `t_external_link` ( `badge_name` varchar(64) collate utf8mb4_general_ci default null, `badge_color` varchar(64) collate utf8mb4_general_ci default null, `link_url` varchar(255) collate utf8mb4_general_ci default null, - `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'create time', - `modify_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'modify time' + `create_time` datetime not null default current_timestamp COMMENT 'create time', + `modify_time` datetime not null default current_timestamp COMMENT 'modify time' ) engine = innodb default charset=utf8mb4 collate=utf8mb4_general_ci; drop table if exists `t_yarn_queue`; @@ -38,7 +38,7 @@ create table `t_yarn_queue` ( `queue_label` varchar(128) collate utf8mb4_general_ci not null comment 'queue and label expression', `description` varchar(255) collate utf8mb4_general_ci default null comment 'description of the queue label', `create_time` datetime not null default current_timestamp comment 'create time', - `modify_time` datetime not null default current_timestamp on update current_timestamp comment 'modify time', + `modify_time` datetime not null default current_timestamp comment 'modify time', unique key `unq_team_id_queue_label` (`team_id`, `queue_label`) using btree ) engine = innodb default charset = utf8mb4 collate = utf8mb4_general_ci; diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SettingController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SettingController.java index 5fb9cd14d..82f463696 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SettingController.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/SettingController.java @@ -62,13 +62,6 @@ public class SettingController { return RestResponse.success(setting); } - @Operation(summary = "Get streampark address") - @PostMapping("weburl") - public RestResponse webUrl() { - String url = settingService.getStreamParkAddress(); - return RestResponse.success(url == null ? null : url.trim()); - } - @Operation(summary = "Update setting") @PostMapping("update") @RequiresPermissions("setting:update") diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java index c16403419..ba3a38be4 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkCluster.java @@ -103,7 +103,7 @@ public class FlinkCluster implements Serializable { private Integer clusterState; - private Date createTime = new Date(); + private Date createTime; @JsonIgnore public FlinkK8sRestExposedType getK8sRestExposedTypeEnum() { diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSql.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSql.java index c0ca2fbd6..5b732d77d 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSql.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/FlinkSql.java @@ -55,6 +55,7 @@ public class FlinkSql { private Integer candidate; private Date createTime; + private transient boolean effective = false; /** sql diff */ private transient boolean sqlDifference = false; diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Variable.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Variable.java index 7257228b0..5953cf28a 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Variable.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/entity/Variable.java @@ -62,9 +62,9 @@ public class Variable implements Serializable { private Boolean desensitization; - private transient Date createTime; + private Date createTime; - private transient Date modifyTime; + private Date modifyTime; public void dataMasking() { if (desensitization) { diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java index b63194c5a..8e387013a 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ApplicationServiceImpl.java @@ -786,7 +786,10 @@ public class ApplicationServiceImpl extends ServiceImpl<ApplicationMapper, Appli appParam.setState(FlinkAppState.ADDED.getValue()); appParam.setRelease(ReleaseState.NEED_RELEASE.get()); appParam.setOptionState(OptionState.NONE.getValue()); + // createTime & modifyTime appParam.setCreateTime(new Date()); + appParam.setModifyTime(new Date()); + appParam.setDefaultModeIngress(settingService.getIngressModeDefault()); boolean success = validateQueueIfNeeded(appParam); @@ -880,9 +883,12 @@ public class ApplicationServiceImpl extends ServiceImpl<ApplicationMapper, Appli newApp.setState(FlinkAppState.ADDED.getValue()); newApp.setRelease(ReleaseState.NEED_RELEASE.get()); newApp.setOptionState(OptionState.NONE.getValue()); - newApp.setCreateTime(new Date()); newApp.setHotParams(oldApp.getHotParams()); + // createTime & modifyTime + newApp.setCreateTime(new Date()); + newApp.setModifyTime(new Date()); + newApp.setJar(oldApp.getJar()); newApp.setJarCheckSum(oldApp.getJarCheckSum()); newApp.setTags(oldApp.getTags()); diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkEnvServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkEnvServiceImpl.java index 2e638c7d3..e83bd65bb 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkEnvServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/FlinkEnvServiceImpl.java @@ -43,6 +43,7 @@ public class FlinkEnvServiceImpl extends ServiceImpl<FlinkEnvMapper, FlinkEnv> implements FlinkEnvService { @Autowired private FlinkClusterService flinkClusterService; + @Autowired private ApplicationService applicationService; /** diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java index c7b66435c..4b75cacad 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/ProjectServiceImpl.java @@ -101,6 +101,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> RestResponse response = RestResponse.success(); if (count == 0) { project.setCreateTime(new Date()); + project.setModifyTime(new Date()); boolean status = save(project); if (status) { return response.message("Add project successfully").data(true); @@ -132,6 +133,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> project.setPom(projectParam.getPom()); project.setDescription(projectParam.getDescription()); project.setBuildArgs(projectParam.getBuildArgs()); + project.setModifyTime(new Date()); if (project.isSshRepositoryUrl()) { project.setUserName(null); } else { diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SqlCompleteServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SqlCompleteServiceImpl.java index 5ce506db8..f01b5df58 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SqlCompleteServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/SqlCompleteServiceImpl.java @@ -56,7 +56,7 @@ public class SqlCompleteServiceImpl implements SqlCompleteService { @Override public List<String> getComplete(String sql) { - if (sql.length() > 0 && BLACK_SET.contains(sql.charAt(sql.length() - 1))) { + if (!sql.isEmpty() && BLACK_SET.contains(sql.charAt(sql.length() - 1))) { return new ArrayList<>(); } String[] temp = sql.split("\\s"); diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/VariableServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/VariableServiceImpl.java index 61af7eaaa..d701d85fb 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/VariableServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/VariableServiceImpl.java @@ -46,6 +46,7 @@ import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.regex.Matcher; @@ -78,6 +79,8 @@ public class VariableServiceImpl extends ServiceImpl<VariableMapper, Variable> throw new ApiAlertException("Sorry, the variable code already exists."); } variable.setCreatorId(serviceHelper.getUserId()); + variable.setCreateTime(new Date()); + variable.setModifyTime(new Date()); this.save(variable); } @@ -130,6 +133,8 @@ public class VariableServiceImpl extends ServiceImpl<VariableMapper, Variable> if (!findVariable.getVariableCode().equals(variable.getVariableCode())) { throw new ApiAlertException("Sorry, the variable code cannot be updated."); } + + variable.setModifyTime(new Date()); this.baseMapper.updateById(variable); // endregion diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/YarnQueueServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/YarnQueueServiceImpl.java index 5cafab958..2fd0fafbb 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/YarnQueueServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/service/impl/YarnQueueServiceImpl.java @@ -48,6 +48,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Nonnull; +import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -121,6 +122,8 @@ public class YarnQueueServiceImpl extends ServiceImpl<YarnQueueMapper, YarnQueue public boolean createYarnQueue(YarnQueue yarnQueue) { ResponseResult<String> checkResponse = checkYarnQueue(yarnQueue); ApiAlertException.throwIfFalse(checkResponse.getStatus() == 0, checkResponse.getMsg()); + yarnQueue.setCreateTime(new Date()); + yarnQueue.setModifyTime(new Date()); return save(yarnQueue); } @@ -150,8 +153,10 @@ public class YarnQueueServiceImpl extends ServiceImpl<YarnQueueMapper, YarnQueue checkNotReferencedByFlinkClusters(queueFromDB.getQueueLabel(), "updating"); + queueFromDB.setModifyTime(new Date()); queueFromDB.setDescription(yarnQueue.getDescription()); queueFromDB.setQueueLabel(yarnQueue.getQueueLabel()); + updateById(queueFromDB); } diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/AccessTokenController.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/AccessTokenController.java index fbd647658..4d905d418 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/AccessTokenController.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/controller/AccessTokenController.java @@ -81,7 +81,7 @@ public class AccessTokenController { String expireTime, @RequestParam(required = false) String description) throws InternalException { - return accessTokenService.generateToken(userId, expireTime, description); + return accessTokenService.create(userId, expireTime, description); } @Operation(summary = "Verify current user token") diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/entity/SysLog.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/entity/SysLog.java deleted file mode 100644 index 8a0360998..000000000 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/entity/SysLog.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.streampark.console.system.entity; - -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Getter; -import lombok.Setter; - -import java.io.Serializable; -import java.util.Date; - -@Getter -@Setter -@TableName("t_log") -public class SysLog implements Serializable { - - private static final long serialVersionUID = 1L; - - @TableId(type = IdType.AUTO) - private Long id; - - private String username; - - private String operation; - - private Long time; - - private String method; - - private String params; - - private String ip; - - private Date createTime; - - private transient String createTimeFrom; - private transient String createTimeTo; - - private String location; -} diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/AccessTokenService.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/AccessTokenService.java index c2611ac6c..12a78b6d2 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/AccessTokenService.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/AccessTokenService.java @@ -27,8 +27,7 @@ import com.baomidou.mybatisplus.extension.service.IService; public interface AccessTokenService extends IService<AccessToken> { - RestResponse generateToken(Long userId, String expireTime, String description) - throws InternalException; + RestResponse create(Long userId, String expireTime, String description) throws InternalException; boolean deleteToken(Long id); diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/AccessTokenServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/AccessTokenServiceImpl.java index 83bf64efe..121d087ba 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/AccessTokenServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/AccessTokenServiceImpl.java @@ -56,7 +56,7 @@ public class AccessTokenServiceImpl extends ServiceImpl<AccessTokenMapper, Acces @Autowired private UserService userService; @Override - public RestResponse generateToken(Long userId, String expireTime, String description) { + public RestResponse create(Long userId, String expireTime, String description) { User user = userService.getById(userId); if (Objects.isNull(user)) { return RestResponse.success().put("code", 0).message("user not available"); @@ -75,6 +75,7 @@ public class AccessTokenServiceImpl extends ServiceImpl<AccessTokenMapper, Acces accessToken.setDescription(description); accessToken.setExpireTime(DateUtils.stringToDate(jwtToken.getExpireAt())); accessToken.setCreateTime(new Date()); + accessToken.setModifyTime(new Date()); accessToken.setStatus(AccessToken.STATUS_ENABLE); this.save(accessToken); @@ -122,6 +123,7 @@ public class AccessTokenServiceImpl extends ServiceImpl<AccessTokenMapper, Acces AccessToken updateObj = new AccessToken(); updateObj.setStatus(status); updateObj.setId(tokenId); + updateObj.setModifyTime(new Date()); return RestResponse.success(this.updateById(updateObj)); } diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/MemberServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/MemberServiceImpl.java index 0ec6a73e5..c5aad26ed 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/MemberServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/MemberServiceImpl.java @@ -145,7 +145,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme member.setId(null); member.setUserId(user.getUserId()); member.setCreateTime(new Date()); - member.setModifyTime(team.getCreateTime()); + member.setModifyTime(new Date()); this.save(member); } @@ -177,6 +177,7 @@ public class MemberServiceImpl extends ServiceImpl<MemberMapper, Member> impleme new ApiAlertException( String.format("The roleId [%s] not found", member.getRoleId()))); oldMember.setRoleId(member.getRoleId()); + oldMember.setModifyTime(new Date()); updateById(oldMember); } } diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/MenuServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/MenuServiceImpl.java index fef5064d2..a8d8e64aa 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/MenuServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/MenuServiceImpl.java @@ -129,6 +129,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me @Transactional(rollbackFor = Exception.class) public void createMenu(Menu menu) { menu.setCreateTime(new Date()); + menu.setModifyTime(new Date()); setMenu(menu); this.save(menu); } diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/RoleServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/RoleServiceImpl.java index bc8459c05..38887faee 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/RoleServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/RoleServiceImpl.java @@ -72,6 +72,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro @Override public void createRole(Role role) { role.setCreateTime(new Date()); + role.setModifyTime(new Date()); this.save(role); String[] menuIds = role.getMenuId().split(StringPool.COMMA); diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/TeamServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/TeamServiceImpl.java index 966bab4d8..cdbbcca27 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/TeamServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/TeamServiceImpl.java @@ -86,7 +86,7 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements Te team.getTeamName())); team.setId(null); team.setCreateTime(new Date()); - team.setModifyTime(team.getCreateTime()); + team.setModifyTime(new Date()); this.save(team); } diff --git a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java index 35cf49dd4..e5c6a5992 100644 --- a/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java +++ b/streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/system/service/impl/UserServiceImpl.java @@ -94,6 +94,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us @Transactional(rollbackFor = Exception.class) public void createUser(User user) { user.setCreateTime(new Date()); + user.setModifyTime(new Date()); String salt = ShaHashUtils.getRandomSalt(); String password = ShaHashUtils.encrypt(salt, user.getPassword()); user.setSalt(salt); @@ -131,6 +132,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us String password = ShaHashUtils.encrypt(salt, userParam.getPassword()); user.setSalt(salt); user.setPassword(password); + user.setModifyTime(new Date()); this.baseMapper.updateById(user); } diff --git a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/AccessTokenServiceTest.java b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/AccessTokenServiceTest.java index cdcaa2341..b885053dd 100644 --- a/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/AccessTokenServiceTest.java +++ b/streampark-console/streampark-console-service/src/test/java/org/apache/streampark/console/core/service/AccessTokenServiceTest.java @@ -43,7 +43,7 @@ public class AccessTokenServiceTest extends SpringTestBase { void testCrudToken() throws Exception { Long mockUserId = 100000L; String expireTime = "9999-01-01 00:00:00"; - RestResponse restResponse = accessTokenService.generateToken(mockUserId, expireTime, ""); + RestResponse restResponse = accessTokenService.create(mockUserId, expireTime, ""); Assertions.assertNotNull(restResponse); Assertions.assertInstanceOf(AccessToken.class, restResponse.get("data")); diff --git a/streampark-console/streampark-console-webapp/src/api/flink/setting/index.ts b/streampark-console/streampark-console-webapp/src/api/flink/setting/index.ts index f8bb300e8..4cc0579c4 100644 --- a/streampark-console/streampark-console-webapp/src/api/flink/setting/index.ts +++ b/streampark-console/streampark-console-webapp/src/api/flink/setting/index.ts @@ -19,10 +19,8 @@ import { defHttp } from '/@/utils/http/axios'; enum SETTING_APi { GET = '/flink/setting/get', - WEB_URL = '/flink/setting/weburl', ALL = '/flink/setting/all', CHECK_HADOOP = '/flink/setting/checkHadoop', - SYNC = '/flink/setting/sync', UPDATE = '/flink/setting/update', } /**
