Commit bae0b47e by xmh

简化部署

1 parent 1d7cee14
......@@ -61,6 +61,7 @@
</dependencies>
<build>
<finalName>fanxing-code</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
......
package com.viontech.fanxing.code.controller.web;
import com.viontech.fanxing.code.base.BaseExample;
import com.viontech.fanxing.code.controller.base.DictCodeBaseController;
import com.viontech.fanxing.code.model.DictCode;
import com.viontech.fanxing.code.model.DictCodeExample;
import com.viontech.fanxing.code.vo.DictCodeVo;
import com.viontech.fanxing.code.base.BaseExample;
import com.viontech.fanxing.code.base.BaseMapper;
import com.viontech.keliu.util.JsonMessageUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Controller
@RequestMapping("/dictCodes")
@Slf4j
public class DictCodeController extends DictCodeBaseController {
@Override
protected BaseExample getExample(DictCodeVo dictCodeVo, int type) {
DictCodeExample dictCodeExample = (DictCodeExample)super.getExample(dictCodeVo,type);
DictCodeExample dictCodeExample = (DictCodeExample) super.getExample(dictCodeVo, type);
return dictCodeExample;
}
@GetMapping("/tree")
@ResponseBody
public Object getTreeCode(@RequestParam Long cateId) {
DictCodeExample dictCodeExample = new DictCodeExample();
dictCodeExample.createCriteria().andCateIdEqualTo(cateId);
Map<Long, DictCodeVo> map = getService().selectByExample(dictCodeExample).stream().map(DictCodeVo::new).collect(Collectors.toMap(DictCode::getId, x -> x, (x, y) -> x));
List<DictCodeVo> result = new ArrayList<>();
for (Map.Entry<Long, DictCodeVo> entry : map.entrySet()) {
DictCodeVo value = entry.getValue();
if (value.getParentId() == null) {
result.add(value);
} else {
DictCodeVo parent = map.get(value.getParentId());
if (parent != null) {
if (parent.getChildren() == null) {
parent.setChildren(new ArrayList<>());
}
parent.getChildren().add(value);
}
}
}
return JsonMessageUtil.getSuccessJsonMsg(result);
}
}
\ No newline at end of file
......@@ -3,8 +3,12 @@ package com.viontech.fanxing.code.vo;
import com.viontech.fanxing.code.model.DictCode;
import com.viontech.fanxing.code.vobase.DictCodeVoBase;
import java.util.List;
public class DictCodeVo extends DictCodeVoBase {
private List<DictCodeVo> children;
public DictCodeVo() {
super();
}
......@@ -12,4 +16,12 @@ public class DictCodeVo extends DictCodeVoBase {
public DictCodeVo(DictCode dictCode) {
super(dictCode);
}
public List<DictCodeVo> getChildren() {
return children;
}
public void setChildren(List<DictCodeVo> children) {
this.children = children;
}
}
\ No newline at end of file
......@@ -44,3 +44,6 @@ pagehelper:
reasonable: true
supportMethodsArguments: true
params: count=countByExample
vion:
redisson:
path: F:\myIDEAworkspace\jt\fanxing3\fanxing-commons\src\main\resources\redisson.yml
......@@ -9,6 +9,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
/**
......@@ -27,9 +29,11 @@ public class RedissonConfig {
}
@Bean(destroyMethod = "shutdown")
public RedissonClient redisson(@Value("classpath:/redisson.yml") Resource configFile) throws IOException {
Config config = Config.fromYAML(configFile.getInputStream());
public RedissonClient redisson(@Value("${vion.redisson.path}") String path) throws IOException {
try (FileInputStream inputStream = new FileInputStream(path)) {
Config config = Config.fromYAML(inputStream);
return Redisson.create(config);
}
}
}
......@@ -34,6 +34,7 @@
</dependencies>
<build>
<finalName>fanxing-forward</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
......
......@@ -36,3 +36,6 @@ spring:
default-property-inclusion: non_null
logging:
config: classpath:logback-${spring.profiles.active}.xml
vion:
redisson:
path: F:\myIDEAworkspace\jt\fanxing3\fanxing-commons\src\main\resources\redisson.yml
\ No newline at end of file
......@@ -35,6 +35,7 @@
<build>
<finalName>fanxing-gateway</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
......
......@@ -47,3 +47,8 @@ spring:
default-property-inclusion: non_null
logging:
config: classpath:logback-${spring.profiles.active}.xml
vion:
authorization:
enable: false
redisson:
path: F:\myIDEAworkspace\jt\fanxing3\fanxing-commons\src\main\resources\redisson.yml
\ No newline at end of file
......@@ -34,6 +34,7 @@
</dependencies>
<build>
<finalName>fanxing-ops</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
......
......@@ -36,3 +36,6 @@ spring:
default-property-inclusion: non_null
logging:
config: classpath:logback-${spring.profiles.active}.xml
vion:
redisson:
path: F:\myIDEAworkspace\jt\fanxing3\fanxing-commons\src\main\resources\redisson.yml
\ No newline at end of file
......@@ -34,6 +34,7 @@
</dependencies>
<build>
<finalName>fanxing-query</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
......
......@@ -36,3 +36,6 @@ spring:
default-property-inclusion: non_null
logging:
config: classpath:logback-${spring.profiles.active}.xml
vion:
redisson:
path: F:\myIDEAworkspace\jt\fanxing3\fanxing-commons\src\main\resources\redisson.yml
\ No newline at end of file
......@@ -35,6 +35,7 @@
<build>
<finalName>fanxing-task-manager</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
......
......@@ -36,3 +36,6 @@ spring:
default-property-inclusion: non_null
logging:
config: classpath:logback-${spring.profiles.active}.xml
vion:
redisson:
path: F:\myIDEAworkspace\jt\fanxing3\fanxing-commons\src\main\resources\redisson.yml
......@@ -36,6 +36,7 @@
<build>
<finalName>fanxing-task-scheduling</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
......
......@@ -33,3 +33,6 @@ spring:
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
logging:
config: classpath:logback-${spring.profiles.active}.xml
vion:
redisson:
path: F:\myIDEAworkspace\jt\fanxing3\fanxing-commons\src\main\resources\redisson.yml
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!