Skip to content

Commit

Permalink
🎨fixed style
Browse files Browse the repository at this point in the history
  • Loading branch information
stelin committed Jul 3, 2023
1 parent a562986 commit cbe86a4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author stelin [email protected]
* @since 1.0.4
*/
public class PostgresqlClient extends AbstractJdbcHikariClient{
public class PostgresqlClient extends AbstractJdbcHikariClient {
private final LogProperties.PostgresqlProperties postgresqlProperties;

public PostgresqlClient(LogProperties.PostgresqlProperties postgresqlProperties) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author stelin [email protected]
* @since 1.0.4
*/
public class PostgresqlDAOImpl extends JdbcDAOImpl{
public class PostgresqlDAOImpl extends JdbcDAOImpl {
public PostgresqlDAOImpl(AbstractJdbcHikariClient jdbcHikariClient) {
super(jdbcHikariClient);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

/**
Expand Down Expand Up @@ -105,7 +104,8 @@ public class AdminUser {
@Column(name = "`create_time`")
private Long createTime;

public List<Long> getRoleIdsByJson(){
return JsonUtil.decode(this.roleIds, new TypeReference<List<Long>>(){});
public List<Long> getRoleIdsByJson() {
return JsonUtil.decode(this.roleIds, new TypeReference<List<Long>>() {
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cbe86a4

Please sign in to comment.