From cbe86a44ce1986a8269ef7863d9dac052c800528 Mon Sep 17 00:00:00 2001 From: stelin <794774870@qq.com> Date: Mon, 3 Jul 2023 21:14:28 +0800 Subject: [PATCH] :art:fixed style --- .../openjob/server/log/client/PostgresqlClient.java | 2 +- .../openjob/server/log/dao/impl/OracleDAOImpl.java | 12 ++++++++++++ .../server/log/dao/impl/PostgresqlDAOImpl.java | 2 +- .../server/repository/entity/AdminPermission.java | 5 ++--- .../openjob/server/repository/entity/AdminUser.java | 8 ++++---- .../scheduler/scheduler/JobInstanceScheduler.java | 2 +- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/client/PostgresqlClient.java b/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/client/PostgresqlClient.java index a8d365f8..ed511db2 100644 --- a/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/client/PostgresqlClient.java +++ b/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/client/PostgresqlClient.java @@ -9,7 +9,7 @@ * @author stelin swoft@qq.com * @since 1.0.4 */ -public class PostgresqlClient extends AbstractJdbcHikariClient{ +public class PostgresqlClient extends AbstractJdbcHikariClient { private final LogProperties.PostgresqlProperties postgresqlProperties; public PostgresqlClient(LogProperties.PostgresqlProperties postgresqlProperties) { diff --git a/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/dao/impl/OracleDAOImpl.java b/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/dao/impl/OracleDAOImpl.java index c27ccc7c..fe816b1c 100644 --- a/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/dao/impl/OracleDAOImpl.java +++ b/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/dao/impl/OracleDAOImpl.java @@ -64,6 +64,12 @@ protected String getDeleteSql() { return "delete from \"processor_log\" where \"time\" < ?"; } + /** + * Get insert id + * + * @return Long + * @throws Exception Exception + */ public Long getInsertId() throws Exception { Long id = this.idLinkedQueue.poll(); if (Objects.nonNull(id)) { @@ -73,6 +79,12 @@ public Long getInsertId() throws Exception { return nextIds(); } + /** + * Next ids. + * + * @return Long + * @throws Exception Exception + */ public synchronized Long nextIds() throws Exception { PreparedStatement ps = null; try (Connection connection = this.jdbcHikariClient.getConnection()) { diff --git a/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/dao/impl/PostgresqlDAOImpl.java b/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/dao/impl/PostgresqlDAOImpl.java index cf2cd5a1..f847dbd9 100644 --- a/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/dao/impl/PostgresqlDAOImpl.java +++ b/openjob-server/openjob-server-log/src/main/java/io/openjob/server/log/dao/impl/PostgresqlDAOImpl.java @@ -6,7 +6,7 @@ * @author stelin swoft@qq.com * @since 1.0.4 */ -public class PostgresqlDAOImpl extends JdbcDAOImpl{ +public class PostgresqlDAOImpl extends JdbcDAOImpl { public PostgresqlDAOImpl(AbstractJdbcHikariClient jdbcHikariClient) { super(jdbcHikariClient); } diff --git a/openjob-server/openjob-server-repository/src/main/java/io/openjob/server/repository/entity/AdminPermission.java b/openjob-server/openjob-server-repository/src/main/java/io/openjob/server/repository/entity/AdminPermission.java index d1495fe6..12429ba7 100644 --- a/openjob-server/openjob-server-repository/src/main/java/io/openjob/server/repository/entity/AdminPermission.java +++ b/openjob-server/openjob-server-repository/src/main/java/io/openjob/server/repository/entity/AdminPermission.java @@ -7,7 +7,6 @@ import lombok.Setter; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; -import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import javax.persistence.Column; @@ -35,7 +34,7 @@ public class AdminPermission { @Id @Column(name = "`id`") @GeneratedValue(strategy = GenerationType.AUTO, generator = "native") - @GenericGenerator(name = "native", strategy = "native",parameters = {@Parameter(name = "sequence_name", value = "admin_permission_id")}) + @GenericGenerator(name = "native", strategy = "native", parameters = {@Parameter(name = "sequence_name", value = "admin_permission_id")}) private Long id; /** @@ -105,7 +104,7 @@ public class AdminPermission { @Column(name = "`create_time`") private Long createTime; - public MenuMeta getMetaByJson(){ + public MenuMeta getMetaByJson() { return JsonUtil.decode(this.meta, MenuMeta.class); } } diff --git a/openjob-server/openjob-server-repository/src/main/java/io/openjob/server/repository/entity/AdminUser.java b/openjob-server/openjob-server-repository/src/main/java/io/openjob/server/repository/entity/AdminUser.java index ba048a07..252b015c 100644 --- a/openjob-server/openjob-server-repository/src/main/java/io/openjob/server/repository/entity/AdminUser.java +++ b/openjob-server/openjob-server-repository/src/main/java/io/openjob/server/repository/entity/AdminUser.java @@ -7,7 +7,6 @@ import lombok.Setter; import org.hibernate.annotations.GenericGenerator; import org.hibernate.annotations.Parameter; -import org.hibernate.annotations.Type; import org.hibernate.annotations.TypeDef; import javax.persistence.Column; @@ -36,7 +35,7 @@ public class AdminUser { @Id @Column(name = "`id`") @GeneratedValue(strategy = GenerationType.AUTO, generator = "native") - @GenericGenerator(name = "native", strategy = "native",parameters = {@Parameter(name = "sequence_name", value = "admin_user_id")}) + @GenericGenerator(name = "native", strategy = "native", parameters = {@Parameter(name = "sequence_name", value = "admin_user_id")}) private Long id; /** @@ -105,7 +104,8 @@ public class AdminUser { @Column(name = "`create_time`") private Long createTime; - public List getRoleIdsByJson(){ - return JsonUtil.decode(this.roleIds, new TypeReference>(){}); + public List getRoleIdsByJson() { + return JsonUtil.decode(this.roleIds, new TypeReference>() { + }); } } diff --git a/openjob-server/openjob-server-scheduler/src/main/java/io/openjob/server/scheduler/scheduler/JobInstanceScheduler.java b/openjob-server/openjob-server-scheduler/src/main/java/io/openjob/server/scheduler/scheduler/JobInstanceScheduler.java index a3741d45..b0809e3d 100644 --- a/openjob-server/openjob-server-scheduler/src/main/java/io/openjob/server/scheduler/scheduler/JobInstanceScheduler.java +++ b/openjob-server/openjob-server-scheduler/src/main/java/io/openjob/server/scheduler/scheduler/JobInstanceScheduler.java @@ -57,7 +57,7 @@ public JobInstanceStopResponseDTO stop(JobInstanceStopRequestDTO stopRequest) { // Worker offline Worker byAddress = this.workerDAO.getByAddress(jobInstance.getWorkerAddress()); - if (WorkerStatusEnum.OFFLINE.getStatus().equals(byAddress.getStatus())){ + if (WorkerStatusEnum.OFFLINE.getStatus().equals(byAddress.getStatus())) { jobInstanceStopResponseDTO.setType(0); return jobInstanceStopResponseDTO; }