fuweng11 commented on code in PR #10254: URL: https://github.com/apache/inlong/pull/10254#discussion_r1611082575
########## inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql: ########## @@ -957,4 +957,35 @@ CREATE TABLE IF NOT EXISTS `cluster_config` -- ---------------------------- +-- ---------------------------- +-- Table structure for schedule_config +-- ---------------------------- +CREATE TABLE IF NOT EXISTS `schedule_config` +( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Incremental primary key', + `group_id` varchar(256) NOT NULL COMMENT 'Inlong group id, undeleted ones cannot be repeated', Review Comment: `inlong_group_id` ########## inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/schedule/ScheduleInfoRequest.java: ########## @@ -0,0 +1,76 @@ +/* + * 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.inlong.manager.pojo.schedule; + +import org.apache.inlong.manager.common.validation.UpdateValidation; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotNull; + +import java.sql.Timestamp; + +@Data +@ApiModel("Schedule request") +public class ScheduleInfoRequest { + + @ApiModelProperty(value = "Primary key") + @NotNull(groups = UpdateValidation.class) + private Integer id; + + @ApiModelProperty("Inlong Group ID") + @NotNull + private String groupId; Review Comment: inlongGroupId ########## inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/schedule/ScheduleServiceImpl.java: ########## @@ -0,0 +1,156 @@ +/* + * 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.inlong.manager.service.schedule; + +import org.apache.inlong.manager.common.consts.InlongConstants; +import org.apache.inlong.manager.common.enums.ErrorCodeEnum; +import org.apache.inlong.manager.common.enums.ScheduleStatus; +import org.apache.inlong.manager.common.exceptions.BusinessException; +import org.apache.inlong.manager.common.util.CommonBeanUtils; +import org.apache.inlong.manager.common.util.Preconditions; +import org.apache.inlong.manager.dao.entity.InlongGroupEntity; +import org.apache.inlong.manager.dao.entity.ScheduleEntity; +import org.apache.inlong.manager.dao.mapper.InlongGroupEntityMapper; +import org.apache.inlong.manager.dao.mapper.ScheduleEntityMapper; +import org.apache.inlong.manager.pojo.schedule.ScheduleInfo; +import org.apache.inlong.manager.pojo.schedule.ScheduleInfoRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Objects; + +@Service +public class ScheduleServiceImpl implements ScheduleService { + + private static Logger LOGGER = LoggerFactory.getLogger(ScheduleServiceImpl.class); + + @Autowired + private InlongGroupEntityMapper groupMapper; + @Autowired + private ScheduleEntityMapper scheduleEntityMapper; + + @Override + public int save(ScheduleInfoRequest request, String operator) { + LOGGER.debug("begin to save schedule info, scheduleInfo: {}, operator: {}", request, operator); + Preconditions.expectNotNull(request, "schedule info request can't be null"); Review Comment: `request` is always not null.No verification required here. ########## inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/schedule/ScheduleInfo.java: ########## @@ -0,0 +1,82 @@ +/* + * 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.inlong.manager.pojo.schedule; + +import org.apache.inlong.manager.common.validation.UpdateValidation; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotNull; + +import java.sql.Timestamp; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +@ApiModel("Schedule response") +public class ScheduleInfo { + + @ApiModelProperty(value = "Primary key") + @NotNull(groups = UpdateValidation.class) + private Integer id; + + @ApiModelProperty("Inlong Group ID") + @NotNull + private String groupId; Review Comment: inlongGroupId ########## inlong-manager/manager-web/sql/apache_inlong_manager.sql: ########## @@ -1021,4 +1021,34 @@ CREATE TABLE IF NOT EXISTS `cluster_config` DEFAULT CHARSET = utf8mb4 COMMENT = 'cluster_config'; -- ---------------------------- +-- ---------------------------- +-- Table structure for schedule_config +-- ---------------------------- +CREATE TABLE IF NOT EXISTS `schedule_config` +( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Incremental primary key', + `group_id` varchar(256) NOT NULL COMMENT 'Inlong group id, undeleted ones cannot be repeated', Review Comment: Ditto. ########## inlong-manager/manager-web/sql/changes-1.13.0.sql: ########## @@ -26,3 +26,33 @@ USE `apache_inlong_manager`; ALTER TABLE `inlong_cluster_node` ADD COLUMN `username` varchar(256) DEFAULT NULL COMMENT 'username for ssh'; ALTER TABLE `inlong_cluster_node` ADD COLUMN `password` varchar(256) DEFAULT NULL COMMENT 'password for ssh'; ALTER TABLE `inlong_cluster_node` ADD COLUMN `ssh_port` int(11) DEFAULT NULL COMMENT 'ssh port'; + +-- ---------------------------- +-- Table structure for schedule_config +-- ---------------------------- +CREATE TABLE IF NOT EXISTS `schedule_config` +( + `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Incremental primary key', + `group_id` varchar(256) NOT NULL COMMENT 'Inlong group id, undeleted ones cannot be repeated', Review Comment: Ditto. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
