Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #57] Modify the field, synchronize the modification, and add the mapper method #58

Merged
merged 41 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
11d1668
refactor: add dependency of console module and move controllers into …
Lambert-Rao Jan 21, 2024
f81c0dd
fix: add logback config, fix application-dev.yml and move `</dependen…
Lambert-Rao Jan 21, 2024
d9cf419
FirstCommit
zzxxiansheng Jan 28, 2024
6bd0009
Merge remote-tracking branch 'eventmesh/dev' into dev
zzxxiansheng Jan 29, 2024
df369e7
remerge
zzxxiansheng Feb 1, 2024
1b82aad
Merge remote-tracking branch 'origin/dev' into dev
zzxxiansheng Feb 1, 2024
3391325
first improve
zzxxiansheng Feb 1, 2024
c7da0b9
Merge remote-tracking branch 'origin/dev' into dev
zzxxiansheng Feb 1, 2024
0b17293
second improve
zzxxiansheng Feb 1, 2024
22b8528
third improve
zzxxiansheng Feb 1, 2024
edb4005
fourth improve
zzxxiansheng Feb 1, 2024
c030859
fourth improve
zzxxiansheng Feb 1, 2024
a6b5caa
fourth improve
zzxxiansheng Feb 1, 2024
92b2953
Update and rename EventmeshConsoleApplication.java to EventMeshDashbo…
zzxxiansheng Feb 5, 2024
6dcb360
rename this starter class file to EventMeshDashboardApplication
zzxxiansheng Feb 5, 2024
7f5bf0d
rename this starter class file to EventMeshDashboardApplication
zzxxiansheng Feb 5, 2024
7f2e85b
change some resource file
zzxxiansheng Feb 5, 2024
b9718ed
improve name
zzxxiansheng Feb 5, 2024
b4ab687
improve name
zzxxiansheng Feb 5, 2024
bff80be
Modify the fields of the synchronized log table
zzxxiansheng Feb 5, 2024
e5765d0
improve name
zzxxiansheng Feb 5, 2024
390dd05
improve name
zzxxiansheng Feb 5, 2024
befb6ee
Merge remote-tracking branch 'origin/dev' into dev
Mar 3, 2024
ca26ec5
config basic function and config ,runtime,store,cluster sql
Mar 6, 2024
ab82d06
try to resolve build error
Mar 6, 2024
506023b
Merge branch 'apache:dev' into dev
zzxxiansheng Mar 6, 2024
886c754
Some changes in the specification
Mar 7, 2024
e6081f6
something rename
Mar 8, 2024
8b0db55
one sql update
Mar 8, 2024
3e01c42
tag something to do
Mar 8, 2024
5ff139b
Merge branch 'apache:dev' into dev
zzxxiansheng Mar 8, 2024
0601b9b
The distinction between state and status is_delete fields is unified,…
Mar 10, 2024
095eb24
Delete eventmesh-dashboard-console/src/main/java/org/apache/eventmesh…
zzxxiansheng Mar 10, 2024
dc6276e
Delete eventmesh-dashboard-console/src/main/java/org/apache/eventmesh…
zzxxiansheng Mar 10, 2024
7661186
improve something checkstyle error
Mar 10, 2024
92d11b8
Merge remote-tracking branch 'origin/dev' into dev
Mar 10, 2024
eb3fe52
try to solve something sql test error
Mar 10, 2024
d4efd94
try to resolve something test error
Mar 10, 2024
0044f3c
try to resolve something test error
Mar 10, 2024
a2dd306
Merge remote-tracking branch 'eventmesh/dev' into dev
Mar 10, 2024
545e91e
something is_delete(error) change to status (#3)
zzxxiansheng Mar 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.eventmesh.dashboard.console.entity.cluster;

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;

import lombok.AllArgsConstructor;
Expand All @@ -26,7 +28,7 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
public class ClusterEntity {
public class ClusterEntity extends BaseEntity {

private Long id;

Expand All @@ -50,7 +52,11 @@ public class ClusterEntity {

private Integer runState;

private Integer status;

private Timestamp createTime;

private Timestamp updateTime;

private Integer storeType;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.eventmesh.dashboard.console.entity.config;

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;

import lombok.AllArgsConstructor;
Expand All @@ -26,7 +28,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Data
public class ConfigEntity {
public class ConfigEntity extends BaseEntity {

private Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.eventmesh.dashboard.console.entity.group;

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;

import lombok.AllArgsConstructor;
Expand All @@ -26,7 +28,8 @@
@NoArgsConstructor
@AllArgsConstructor
@Data
public class GroupEntity {
public class GroupEntity extends BaseEntity {

private Long id;

private Long clusterId;
Expand All @@ -45,6 +48,6 @@ public class GroupEntity {

private Timestamp updateTime;


private Integer status;

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.eventmesh.dashboard.console.entity.groupmember;

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;

import lombok.AllArgsConstructor;
Expand All @@ -26,7 +28,8 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GroupMemberEntity {
public class GroupMemberEntity extends BaseEntity {

private Long id;

private Long clusterId;
Expand All @@ -43,5 +46,5 @@ public class GroupMemberEntity {

private Timestamp updateTime;


private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class HealthCheckResultEntity extends BaseEntity {

private String resultDesc;

@Schema(description = "status of a health check, 0: failed, 1: passed, 2: doing check, 3: out of time")
private Integer status;
@Schema(description = "state of a health check, 0: failed, 1: passed, 2: doing check, 3: out of time")
private Integer state;

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.eventmesh.dashboard.console.entity.log;

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;

import lombok.AllArgsConstructor;
Expand All @@ -26,7 +28,7 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LogEntity {
public class LogEntity extends BaseEntity {

private Long id;

Expand All @@ -36,7 +38,7 @@ public class LogEntity {

private String targetType;

private Integer status;
private Integer state;

private String content;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.eventmesh.dashboard.console.entity.runtime;

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;

import lombok.AllArgsConstructor;
Expand All @@ -26,7 +28,7 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RuntimeEntity {
public class RuntimeEntity extends BaseEntity {

private Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
package org.apache.eventmesh.dashboard.console.entity.storage;


import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;

import lombok.AllArgsConstructor;
Expand All @@ -27,7 +29,7 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
public class StoreEntity {
public class StoreEntity extends BaseEntity {

private Long id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.apache.eventmesh.dashboard.console.entity.topic;

import org.apache.eventmesh.dashboard.console.entity.base.BaseEntity;

import java.sql.Timestamp;

import lombok.AllArgsConstructor;
Expand All @@ -26,7 +28,8 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
public class TopicEntity {
public class TopicEntity extends BaseEntity {

private Long id;

private Long clusterId;
Expand All @@ -47,4 +50,5 @@ public class TopicEntity {

private Timestamp updateTime;

private Integer status;
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private void addToResultList(CheckResult result, ArrayList<HealthCheckResultEnti
newEntity.setType(HealthCheckType.toNumber(result.getConfig().getHealthCheckResourceType()));
newEntity.setTypeId(result.getConfig().getInstanceId());
newEntity.setResultDesc(result.getResultDesc());
newEntity.setStatus(result.getStatus().getNumber());
newEntity.setState(result.getStatus().getNumber());

resultList.add(newEntity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ public Object logStart(ProceedingJoinPoint joinPoint) throws Throwable {
Object proceed = null;
try {
proceed = joinPoint.proceed();
logEntity.setStatus(2);
logEntity.setState(2);
logEntity.setResult(Objects.isNull(proceed) ? "" : proceed.toString());
return proceed;
} catch (Throwable e) {
logEntity.setStatus(3);
logEntity.setState(3);
throw new RuntimeException(e);
} finally {
logEntity.setResult(proceed.toString());
Expand All @@ -97,7 +97,7 @@ public LogEntity productLoEntity(EmLog declaredAnnotation, ProceedingJoinPoint j
logEntity.setContent(model.toString());
logEntity.setOperationType(declaredAnnotation.OprType());
logEntity.setTargetType(declaredAnnotation.OprTarget());
logEntity.setStatus(1);
logEntity.setState(1);
logEntity.setCreateTime(new Timestamp(System.currentTimeMillis()));
return logEntity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,28 @@

import java.util.List;


/**
* Mybatis Mapper for the table of client.
*/
@Mapper
public interface ClientMapper {

@Select("select * from client where status=1")
List<ClientEntity> selectAll();

@Select({
"<script>",
" INSERT INTO client (cluster_id, name, platform, language, pid, host, port, protocol, status,",
" config_ids, description) VALUES ",
" <foreach collection='list' item='c' index='index' separator=','>",
" (#{c.clusterId}, #{c.name}, #{c.platform},#{c.language}, #{c.pid}, #{c.host}, #{c.port}, #{c.protocol},",
" #{c.status}, #{c.configIds}, #{c.description})",
" </foreach>",
"</script>"})
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
void batchInsert(List<ClientEntity> clientEntityList);

@Select("SELECT * FROM `client` WHERE `id` = #{id}")
ClientEntity selectById(ClientEntity clientEntity);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,28 @@
@Mapper
public interface ClusterMapper {

@Select("SELECT * FROM cluster WHERE is_delete=0")
@Select("SELECT * FROM cluster WHERE status=1")
List<ClusterEntity> selectAllCluster();

@Select("SELECT * FROM cluster WHERE id=#{id} AND is_delete=0")
@Insert({
"<script>",
" INSERT INTO cluster (name, register_name_list, bootstrap_servers, eventmesh_version, client_properties, jmx_properties,",
"reg_properties, description, auth_type,run_state, store_type) VALUES ",
" <foreach collection='list' item='c' index='index' separator=','>",
" (#{c.name}, #{c.registerNameList}, #{c.bootstrapServers}, #{c.eventmeshVersion}, #{c.clientProperties}, #{c.jmxProperties}, ",
" #{c.regProperties}, #{c.description}, #{c.authType}, #{c.runState},#{c.storeType})",
" </foreach>",
"</script>"})
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
void batchInsert(List<ClusterEntity> clusterEntities);

@Select("SELECT * FROM cluster WHERE id=#{id} AND status=1")
ClusterEntity selectClusterById(ClusterEntity cluster);

@Insert("INSERT INTO cluster (name, register_name_list, bootstrap_servers, eventmesh_version, client_properties, "
+ "jmx_properties, reg_properties, description, auth_type, run_state) VALUES (#{name},#{registerNameList},"
+ "#{bootstrapServers},#{eventmeshVersion},#{clientProperties},#{jmxProperties},#{regProperties},#{description},#{authType},#{runState})")
+ "jmx_properties, reg_properties, description, auth_type, run_state,store_type) VALUES (#{name},#{registerNameList},"
+ "#{bootstrapServers},#{eventmeshVersion},#{clientProperties},#{jmxProperties},#{regProperties},#{description},#{authType},"
+ "#{runState},#{storeType})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
void addCluster(ClusterEntity cluster);

Expand All @@ -52,7 +65,7 @@ public interface ClusterMapper {
+ "register_name_list=#{registerNameList} WHERE id=#{id}")
void updateClusterById(ClusterEntity cluster);

@Delete("UPDATE cluster SET is_delete=1 WHERE id=#{id}")
@Delete("UPDATE cluster SET status=0 WHERE id=#{id}")
void deleteClusterById(ClusterEntity clusterEntity);

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,30 @@
@Mapper
public interface ConfigMapper {

@Insert("INSERT INTO config (cluster_id, business_type, instance_type, instance_id, config_name,"
+ " config_value, start_version,eventmesh_version, description, edit,end_version,is_default,is_modify) VALUE "
@Select("SELECT * FROM config WHERE status=1")
List<ConfigEntity> selectAll();

@Insert({
"<script>",
" INSERT INTO config (cluster_id, business_type, instance_type, instance_id, config_name, config_value, start_version,",
" eventmesh_version,end_version, diff_type, description, edit, is_default, is_modify) VALUES ",
" <foreach collection='list' item='c' index='index' separator=','>",
" (#{c.clusterId}, #{c.businessType}, #{c.instanceType}, #{c.instanceId},#{c.configName},",
" #{c.configValue}, #{c.startVersion}, #{c.eventmeshVersion},#{c.endVersion},#{c.diffType},#{c.description},",
" #{c.edit},#{c.isDefault},#{c.isModify})",
" </foreach>",
"</script>"})
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
void batchInsert(List<ConfigEntity> configEntityList);

@Insert("INSERT INTO config (cluster_id, business_type, instance_type, instance_id, config_name, config_value, start_version, "
+ "status, is_default, end_version, diff_type, description, edit, is_modify, eventmesh_version) VALUE "
+ "(#{clusterId},#{businessType},#{instanceType},#{instanceId},#{configName},"
+ "#{configValue},#{startVersion},#{eventmeshVersion},#{description},#{edit},#{endVersion},#{isDefault},#{isModify})")
+ "#{configValue},#{startVersion},#{status},#{isDefault},#{endVersion},#{diffType},#{description},#{edit},#{isModify},#{eventmeshVersion})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
Integer addConfig(ConfigEntity configEntity);

@Update("UPDATE config SET status=2 WHERE id=#{id}")
@Update("UPDATE config SET status=0 WHERE id=#{id}")
Integer deleteConfig(ConfigEntity configEntity);

@Update("UPDATE config SET config_value=#{configValue} WHERE status=1 AND edit=2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ public List<ConnectionEntity> selectByClusterIdSinkTypeAndSinkIdAndCreateTimeRan
"</script>"})
void batchEndConnectionById(List<ConnectionEntity> connectionEntityList);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
@Mapper
public interface ConnectorMapper {

@Select("SELECT * FROM connector WHERE status=1")
ConnectorEntity selectAll();

@Select("SELECT * FROM connector WHERE id = #{id}")
ConnectorEntity selectById(ConnectorEntity connectorEntity);

Expand Down
Loading
Loading