update:初始化中添加系统app的数据

V0.5.x
tangfudong 2023-12-20 11:29:33 +08:00
parent ce6988f9e3
commit 24d4b28628
3 changed files with 16 additions and 2 deletions

9
data/init/sys_app.json Normal file
View File

@ -0,0 +1,9 @@
[
{
"id": 1,
"appId": "wx5eebdd2bab2d805c",
"appSecret": "a92c69537573141d06a59a5c814dd02c",
"appType": "1",
"remark": "智能家居小程序"
}
]

View File

@ -66,7 +66,7 @@ public class TbSysApp extends TenantModel implements TenantAware {
* *
*/ */
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private String REMARK; private String remark;
} }

View File

@ -39,7 +39,6 @@ import cc.iotkit.temporal.IDbStructureData;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.hibernate.exception.DataException;
import org.springframework.beans.factory.SmartInitializingSingleton; import org.springframework.beans.factory.SmartInitializingSingleton;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
@ -160,6 +159,9 @@ public class ExampleDataInit implements SmartInitializingSingleton {
@Autowired @Autowired
private ISysUserRoleData sysUserRoleData; private ISysUserRoleData sysUserRoleData;
@Autowired
private ISysAppData sysAppData;
@Override @Override
public void afterSingletonsInstantiated() { public void afterSingletonsInstantiated() {
//等redis实例化后再执行 //等redis实例化后再执行
@ -291,6 +293,9 @@ public class ExampleDataInit implements SmartInitializingSingleton {
initData("sys_user_role", sysUserRoleData, new TypeReference<List<SysUserRole>>() { initData("sys_user_role", sysUserRoleData, new TypeReference<List<SysUserRole>>() {
}); });
initData("sys_app", sysAppData, new TypeReference<List<SysApp>>() {
});
} }
private <T> T initData(String name, ICommonData service, TypeReference<T> type) { private <T> T initData(String name, ICommonData service, TypeReference<T> type) {