Commit bae0b47e by xmh

简化部署

1 parent 1d7cee14
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>fanxing-code</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
package com.viontech.fanxing.code.controller.web; 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.controller.base.DictCodeBaseController;
import com.viontech.fanxing.code.model.DictCode; import com.viontech.fanxing.code.model.DictCode;
import com.viontech.fanxing.code.model.DictCodeExample; import com.viontech.fanxing.code.model.DictCodeExample;
import com.viontech.fanxing.code.vo.DictCodeVo; import com.viontech.fanxing.code.vo.DictCodeVo;
import com.viontech.fanxing.code.base.BaseExample; import com.viontech.keliu.util.JsonMessageUtil;
import com.viontech.fanxing.code.base.BaseMapper; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller; 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.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 @Controller
@RequestMapping("/dictCodes") @RequestMapping("/dictCodes")
@Slf4j
public class DictCodeController extends DictCodeBaseController { public class DictCodeController extends DictCodeBaseController {
@Override @Override
protected BaseExample getExample(DictCodeVo dictCodeVo, int type) { protected BaseExample getExample(DictCodeVo dictCodeVo, int type) {
DictCodeExample dictCodeExample = (DictCodeExample)super.getExample(dictCodeVo,type); DictCodeExample dictCodeExample = (DictCodeExample) super.getExample(dictCodeVo, type);
return dictCodeExample; 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 \ No newline at end of file
...@@ -3,8 +3,12 @@ package com.viontech.fanxing.code.vo; ...@@ -3,8 +3,12 @@ package com.viontech.fanxing.code.vo;
import com.viontech.fanxing.code.model.DictCode; import com.viontech.fanxing.code.model.DictCode;
import com.viontech.fanxing.code.vobase.DictCodeVoBase; import com.viontech.fanxing.code.vobase.DictCodeVoBase;
import java.util.List;
public class DictCodeVo extends DictCodeVoBase { public class DictCodeVo extends DictCodeVoBase {
private List<DictCodeVo> children;
public DictCodeVo() { public DictCodeVo() {
super(); super();
} }
...@@ -12,4 +16,12 @@ public class DictCodeVo extends DictCodeVoBase { ...@@ -12,4 +16,12 @@ public class DictCodeVo extends DictCodeVoBase {
public DictCodeVo(DictCode dictCode) { public DictCodeVo(DictCode dictCode) {
super(dictCode); super(dictCode);
} }
public List<DictCodeVo> getChildren() {
return children;
}
public void setChildren(List<DictCodeVo> children) {
this.children = children;
}
} }
\ No newline at end of file \ No newline at end of file
...@@ -44,3 +44,6 @@ pagehelper: ...@@ -44,3 +44,6 @@ pagehelper:
reasonable: true reasonable: true
supportMethodsArguments: true supportMethodsArguments: true
params: count=countByExample 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; ...@@ -9,6 +9,8 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.Resource; import org.springframework.core.io.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
/** /**
...@@ -27,9 +29,11 @@ public class RedissonConfig { ...@@ -27,9 +29,11 @@ public class RedissonConfig {
} }
@Bean(destroyMethod = "shutdown") @Bean(destroyMethod = "shutdown")
public RedissonClient redisson(@Value("classpath:/redisson.yml") Resource configFile) throws IOException { public RedissonClient redisson(@Value("${vion.redisson.path}") String path) throws IOException {
Config config = Config.fromYAML(configFile.getInputStream()); try (FileInputStream inputStream = new FileInputStream(path)) {
Config config = Config.fromYAML(inputStream);
return Redisson.create(config); return Redisson.create(config);
} }
}
} }
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>fanxing-forward</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -36,3 +36,6 @@ spring: ...@@ -36,3 +36,6 @@ spring:
default-property-inclusion: non_null default-property-inclusion: non_null
logging: logging:
config: classpath:logback-${spring.profiles.active}.xml 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 \ No newline at end of file
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<build> <build>
<finalName>fanxing-gateway</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -47,3 +47,8 @@ spring: ...@@ -47,3 +47,8 @@ spring:
default-property-inclusion: non_null default-property-inclusion: non_null
logging: logging:
config: classpath:logback-${spring.profiles.active}.xml 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 \ No newline at end of file
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>fanxing-ops</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -36,3 +36,6 @@ spring: ...@@ -36,3 +36,6 @@ spring:
default-property-inclusion: non_null default-property-inclusion: non_null
logging: logging:
config: classpath:logback-${spring.profiles.active}.xml 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 \ No newline at end of file
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
</dependencies> </dependencies>
<build> <build>
<finalName>fanxing-query</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -36,3 +36,6 @@ spring: ...@@ -36,3 +36,6 @@ spring:
default-property-inclusion: non_null default-property-inclusion: non_null
logging: logging:
config: classpath:logback-${spring.profiles.active}.xml 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 \ No newline at end of file
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
<build> <build>
<finalName>fanxing-task-manager</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -36,3 +36,6 @@ spring: ...@@ -36,3 +36,6 @@ spring:
default-property-inclusion: non_null default-property-inclusion: non_null
logging: logging:
config: classpath:logback-${spring.profiles.active}.xml 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 @@ ...@@ -36,6 +36,7 @@
<build> <build>
<finalName>fanxing-task-scheduling</finalName>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
......
...@@ -33,3 +33,6 @@ spring: ...@@ -33,3 +33,6 @@ spring:
exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
logging: logging:
config: classpath:logback-${spring.profiles.active}.xml 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 \ 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!