Skip to content

fix: Add app_i field to the t_component_library table #219

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -651,6 +651,7 @@ create table `t_component_library`
`id` int not null auto_increment comment '主键id',
`version` varchar(255) not null comment '版本',
`name` varchar(255) not null comment '名称',
`app_id` int comment '关联应用id',
`package` varchar(255) not null comment '包名',
`registry` varchar(255) comment '注册',
`framework` varchar(255) not null comment '技术栈',
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/resources/sql/h2/update_all_tables_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ ALTER TABLE t_platform MODIFY tenant_id varchar(60) NULL;
ALTER TABLE t_platform_history MODIFY tenant_id varchar(60) NULL;
ALTER TABLE t_task_record MODIFY tenant_id varchar(60) NULL;
ALTER TABLE t_user MODIFY tenant_id varchar(60) NULL;

ALTER TABLE t_component_library ADD app_id int NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ create table `t_component_library`
`id` int not null auto_increment comment '主键id',
`version` varchar(255) not null comment '版本',
`name` varchar(255) not null comment '名称',
`app_id` int comment '关联应用id',
`package` varchar(255) not null comment '包名',
`registry` varchar(255) comment '注册',
`framework` varchar(255) not null comment '技术栈',
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/resources/sql/mysql/update_all_tables_ddl.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ ALTER TABLE t_platform MODIFY tenant_id varchar(60) NULL;
ALTER TABLE t_platform_history MODIFY tenant_id varchar(60) NULL;
ALTER TABLE t_task_record MODIFY tenant_id varchar(60) NULL;
ALTER TABLE t_user MODIFY tenant_id varchar(60) NULL;

ALTER TABLE t_component_library ADD app_id int NULL;
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void insertFill(MetaObject metaObject) {
this.setFieldValByName("createdBy", loginUserContext.getLoginUserId(), metaObject);
this.setFieldValByName("lastUpdatedBy", loginUserContext.getLoginUserId(), metaObject);
this.setFieldValByName("platformId", loginUserContext.getPlatformId(), metaObject);
fillStrategy(metaObject, "tenantId", loginUserContext.getTenantId());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ public class ComponentLibrary extends BaseEntity {
@Schema(name = "name", description = "名称")
private String name;

@Schema(name = "appId", description = "关联应用id")
private Integer appId;

@JsonProperty("package")
@Schema(name = "package", description = "包名")
private String packageName;
Expand Down
13 changes: 12 additions & 1 deletion base/src/main/resources/mappers/ComponentLibraryMapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<!-- 通用查询列 -->
<sql id="Base_Column_List">
id
, version, `name`, package, registry, framework, description, script, css, bundle, dependencies, `others`, thumbnail, `public`, is_started, is_official, is_default, created_by, last_updated_by, created_time, last_updated_time,
, version, `name`, app_id, package, registry, framework, description, script, css, bundle, dependencies, `others`, thumbnail, `public`, is_started, is_official, is_default, created_by, last_updated_by, created_time, last_updated_time,
tenant_id, renter_id, site_id
</sql>

Expand All @@ -19,6 +19,9 @@
<if test="name!=null and name!=''">
AND `name` = #{name}
</if>
<if test="appId!=null">
AND app_id = #{appId}
</if>
<if test="packageName!=null and packageName!=''">
AND package = #{packageName}
</if>
Expand Down Expand Up @@ -89,6 +92,9 @@
<if test="name!=null and name!=''">
`name` = #{name},
</if>
<if test="appId!=null">
app_id = #{appId},
</if>
<if test="packageName!=null and packageName!=''">
`package` = #{packageName},
</if>
Expand Down Expand Up @@ -156,6 +162,7 @@
<id column="id" property="id"/>
<result column="version" property="version"/>
<result column="name" property="name"/>
<result column="app_id" property="appId"/>
<result column="package" property="packageName"/>
<result column="registry" property="registry"/>
<result column="description" property="description"/>
Expand Down Expand Up @@ -218,6 +225,7 @@
CL.id,
CL.version,
CL.`name`,
CL.app_id,
CL.package,
CL.registry,
CL.framework,
Expand Down Expand Up @@ -282,6 +290,7 @@
CL.id,
CL.version,
CL.`name`,
Cl.app_id,
CL.package,
CL.registry,
CL.framework,
Expand Down Expand Up @@ -372,6 +381,7 @@
INSERT INTO t_component_library ( id
, version
, `name`
, app_id
, package
, registry
, framework
Expand All @@ -396,6 +406,7 @@
VALUES ( #{id}
, #{version}
, #{name}
, #{appId}
, #{packageName}
, #{registry}
, #{framework}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void testInsertFill() throws NoSuchFieldException, IllegalAccessException {
when(param.hasSetter("tenantId")).thenReturn(true);
TestUtil.setPrivateValue(myMetaObjectHandler, "loginUserContext", new MockUserContext());
myMetaObjectHandler.insertFill(param);
verify(param, times(5)).hasSetter(anyString());
verify(param, times(6)).hasSetter(anyString());
}

@Test
Expand Down
Loading