Skip to content
Snippets Groups Projects
Commit e2269137 authored by lijianfei's avatar lijianfei
Browse files

Merge branch 'xiaqihang' into 'master'

Xiaqihang

See merge request ddd-template!10
parents 93e67da9 69841507
Branches master
1 merge request!10Xiaqihang
Pipeline #64392 failed with stage
......@@ -153,6 +153,12 @@
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
<!--基础数据 -->
<dependency>
<groupId>com.seasky</groupId>
<artifactId>base-data-api</artifactId>
<version>2.0.1-SNAPSHOT</version>
</dependency>
<!-- 数据库 JDBC -->
<!--seata-->
<dependency>
......@@ -324,6 +330,11 @@
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
<resource>
<targetPath>/ROOT/src/main/resources/json/</targetPath>
<directory>src/main/resources/json/</directory>
<include>registerApplication.json</include>
</resource>
</resources>
</configuration>
</plugin>
......
package com.seasky.dddtemplate.domain.service;
import com.alibaba.fastjson.JSONArray;
import com.seasky.base.data.api.IApplicationController;
import com.seasky.base.data.dto.application.ApplicationCmd;
import com.seasky.core.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.util.ResourceUtils;
import java.io.*;
/**
* @author xiaqihang
* @date 2021/12/15 10:35
*/
@Slf4j
public class RegisterApplicationServiceImpl implements ApplicationRunner {
@Autowired
IApplicationController iApplication;
@Override
public void run(ApplicationArguments args) throws Exception {
log.info("----------开始注册基础数据应用和相关配置----------");
File jsonFile = ResourceUtils.getFile("src/main/resources/json/registerApplication.json");
FileReader fileReader = new FileReader(jsonFile);
Reader reader = new InputStreamReader(new FileInputStream(jsonFile),"utf-8");
int ch;
StringBuffer sb = new StringBuffer();
while ((ch = reader.read()) != -1) {
sb.append((char) ch);
}
fileReader.close();
reader.close();
String jsonStr = sb.toString();
ApplicationCmd applicationCmd = JSONArray.parseObject(jsonStr, ApplicationCmd.class);
// applicationCmd.setVersion(serviceVersion);
// applicationCmd.setRecognizeId(applicationName);
Result<Integer> integerResult = iApplication.registerApplication(applicationCmd);
log.info("注册结果:"+integerResult);
}
}
{
"applicationType": "INNER",
"enabled": "YES",
"id": 1423509196690710529,
"menuList": [
{
"applicationId": 1423509196690710529,
"code": "000000",
"enabled": "YES",
"functionList": [
{
"code": "000000",
"id": 1423509197328244731,
"menuId": 1423509197198221311,
"name": "浏览",
"url": ""
}
],
"id": 1423509197198221311,
"isNewWindow": "NO",
"name": "微门户",
"parentId": 0,
"registerMenu": "YES",
"withUserId": "NO"
},
{
"applicationId": 1423509196690710529,
"code": "SBD_000",
"enabled": "YES",
"functionList": [
{
"code": "000000",
"id": 1426088154741366786,
"menuId": 1426088154577788929,
"name": "浏览",
"url": ""
},
{
"code": "000003",
"id": 1432154090418233345,
"menuId": 1426088154577788929,
"name": "登录查询",
"url": "**/loginCtrl/**"
},
{
"code": "000004",
"id": 1432154219720237058,
"menuId": 1426088154577788929,
"name": "菜单管理",
"url": "**/menuCtrl/**"
},
{
"code": "000005",
"id": 1432154544812351489,
"menuId": 1426088154577788929,
"name": "流程管理",
"url": "**/processCtrl/**"
},
{
"code": "000006",
"id": 1432154727176495106,
"menuId": 1426088154577788929,
"name": "汇总查询",
"url": "**/User/**"
}
],
"id": 1426088154577788929,
"isNewWindow": "NO",
"name": "教委财务",
"parentId": 1423509197198221311,
"redirectUrl": "",
"registerMenu": "YES",
"routingUrl": "",
"urlParameter": "",
"withUserId": "NO"
},
{
"applicationId": 1423509196690710529,
"code": "SBD_002",
"enabled": "YES",
"functionList": [
{
"code": "000000",
"id": 1432151665447821314,
"menuId": 1432151665301020674,
"name": "浏览",
"url": ""
},
{
"code": "000002",
"id": 1432153711810994178,
"menuId": 1432151665301020674,
"name": "薪资查询",
"url": "*/Salary/**"
}
],
"id": 1432151665301020674,
"isNewWindow": "NO",
"name": "薪资查询",
"parentId": 1426088154577788929,
"registerMenu": "YES",
"withUserId": "NO"
},
{
"applicationId": 1423509196690710529,
"code": "SBD_001",
"enabled": "YES",
"functionList": [
{
"code": "000000",
"id": 1432151974169567234,
"menuId": 1432151974005989378,
"name": "浏览",
"url": ""
},
{
"code": "000001",
"id": 1432152525926064129,
"menuId": 1432151974005989378,
"name": "项目管理",
"url": "*/Project/**"
}
],
"id": 1432151974005989378,
"isNewWindow": "NO",
"name": "项目查询",
"parentId": 1426088154577788929,
"registerMenu": "YES",
"withUserId": "NO"
}
],
"name": "微门户",
"organizationList": [
{
"applicationId": 1423509196690710529,
"code": "000000",
"enabled": "NO",
"id": 1438424540454612993,
"isDefault": "NO",
"name": "微门户",
"parentId": 0,
"userIdList": []
}
],
"recognizeId": "micro-portal",
"roleList": [
{
"applicationId": 1423509196690710529,
"enable": "YES",
"functionIds": [
1423509197328244731,
1426088154741366786,
1432154090418233345,
1432154544812351489,
1432154219720237058,
1432154727176495106,
1432151665447821314,
1432153711810994178,
1432151974169567234,
1432152525926064129
],
"id": 1432180562247835650,
"isDefault": "NO",
"name": "默认"
}
],
"useDefault": "YES",
"version": "0.0.9-SNAPSHOT"
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment