Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jeecg
jeecg-boot
提交
7f847c97
J
jeecg-boot
项目概览
jeecg
/
jeecg-boot
上一次同步 3 年多
通知
865
Star
24375
Fork
84
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jeecg-boot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7f847c97
编写于
2月 21, 2021
作者:
JEECG低代码平台
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
删除jeecg-cloud-example例子模块,测试示例重构到jeecg-cloud-system-start中---
上级
fa2c5ecb
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
68 addition
and
289 deletion
+68
-289
jeecg-boot/jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/cloud/controller/JcloudDemoController.java
...g/modules/demo/cloud/controller/JcloudDemoController.java
+48
-0
jeecg-boot/jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/cloud/provider/JcloudDemoProvider.java
...jeecg/modules/demo/cloud/provider/JcloudDemoProvider.java
+5
-5
jeecg-boot/jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/cloud/service/JcloudDemoService.java
...g/jeecg/modules/demo/cloud/service/JcloudDemoService.java
+2
-2
jeecg-boot/jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/cloud/service/impl/JcloudDemoServiceImpl.java
...odules/demo/cloud/service/impl/JcloudDemoServiceImpl.java
+13
-0
jeecg-boot/jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/handler/DemoJobHandler.java
...n/java/org/jeecg/modules/demo/handler/DemoJobHandler.java
+0
-234
jeecg-boot/jeecg-cloud-module/jeecg-cloud-example/src/main/java/org/jeecg/cloud/demo/test/controller/JeecgDemoController.java
...jeecg/cloud/demo/test/controller/JeecgDemoController.java
+0
-48
未找到文件。
jeecg-boot/jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/cloud/controller/JcloudDemoController.java
0 → 100644
浏览文件 @
7f847c97
//package org.jeecg.modules.demo.cloud.controller;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.jeecg.common.api.vo.Result;
//import org.jeecg.common.system.api.ISysBaseAPI;
//import org.jeecg.common.system.vo.DictModel;
//import org.springframework.web.bind.annotation.GetMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import java.util.List;
//
///**
// *
// */
//@Slf4j
//@Api(tags = "Cloud示例")
//@RestController
//@RequestMapping("/test")
//public class JcloudDemoController {
//
//
// @Resource
// private ISysBaseAPI sysBaseAPI;
//
// /**
// * 测试
// *
// * @return
// */
// @GetMapping("/remote")
// @ApiOperation(value = "测试feign", notes = "测试feign")
// public Result remoteDict() {
//// try{
//// //睡5秒,网关Hystrix3秒超时,会触发熔断降级操作
//// Thread.sleep(5000);
//// }catch (Exception e){
//// e.printStackTrace();
//// }
// List<DictModel> list = sysBaseAPI.queryAllDict();
// return Result.OK(list);
// }
//
//
//}
jeecg-boot/jeecg-
cloud-module/jeecg-cloud-example/src/main/java/org/jeecg/cloud/demo/test/provider/Jeecg
DemoProvider.java
→
jeecg-boot/jeecg-
boot-module-demo/src/main/java/org/jeecg/modules/demo/cloud/provider/Jcloud
DemoProvider.java
浏览文件 @
7f847c97
package
org.jeecg.
cloud.demo.test
.provider
;
package
org.jeecg.
modules.demo.cloud
.provider
;
import
org.jeecg.cloud.demo.test.service.JeecgDemoService
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.modules.demo.cloud.service.JcloudDemoService
;
import
org.springframework.web.bind.annotation.GetMapping
;
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.RequestParam
;
...
@@ -14,14 +14,14 @@ import javax.annotation.Resource;
...
@@ -14,14 +14,14 @@ import javax.annotation.Resource;
*/
*/
@RestController
@RestController
@RequestMapping
(
"/test"
)
@RequestMapping
(
"/test"
)
public
class
J
eecg
DemoProvider
{
public
class
J
cloud
DemoProvider
{
@Resource
@Resource
private
J
eecgDemoService
jeecg
DemoService
;
private
J
cloudDemoService
jcloud
DemoService
;
@GetMapping
(
"/getMessage"
)
@GetMapping
(
"/getMessage"
)
public
Result
<
String
>
getMessage
(
@RequestParam
String
name
)
{
public
Result
<
String
>
getMessage
(
@RequestParam
String
name
)
{
return
j
eecg
DemoService
.
getMessage
(
name
);
return
j
cloud
DemoService
.
getMessage
(
name
);
}
}
}
}
jeecg-boot/jeecg-
cloud-module/jeecg-cloud-example/src/main/java/org/jeecg/cloud/demo/test/service/Jeecg
DemoService.java
→
jeecg-boot/jeecg-
boot-module-demo/src/main/java/org/jeecg/modules/demo/cloud/service/Jcloud
DemoService.java
浏览文件 @
7f847c97
package
org.jeecg.
cloud.demo.test
.service
;
package
org.jeecg.
modules.demo.cloud
.service
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.api.vo.Result
;
public
interface
J
eecg
DemoService
{
public
interface
J
cloud
DemoService
{
Result
<
String
>
getMessage
(
String
name
);
Result
<
String
>
getMessage
(
String
name
);
}
}
jeecg-boot/jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/cloud/service/impl/JcloudDemoServiceImpl.java
0 → 100644
浏览文件 @
7f847c97
package
org.jeecg.modules.demo.cloud.service.impl
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.modules.demo.cloud.service.JcloudDemoService
;
import
org.springframework.stereotype.Service
;
@Service
public
class
JcloudDemoServiceImpl
implements
JcloudDemoService
{
@Override
public
Result
<
String
>
getMessage
(
String
name
)
{
return
Result
.
OK
(
"Hello,"
+
name
);
}
}
jeecg-boot/jeecg-boot-module-demo/src/main/java/org/jeecg/modules/demo/handler/DemoJobHandler.java
已删除
100644 → 0
浏览文件 @
fa2c5ecb
//
//package org.jeecg.modules.demo.handler;
//
//
//import com.xxl.job.core.biz.model.ReturnT;
//import com.xxl.job.core.handler.IJobHandler;
//import com.xxl.job.core.handler.annotation.XxlJob;
//import com.xxl.job.core.log.XxlJobLogger;
//import com.xxl.job.core.util.ShardingUtil;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//
//import java.io.BufferedInputStream;
//import java.io.BufferedReader;
//import java.io.DataOutputStream;
//import java.io.InputStreamReader;
//import java.net.HttpURLConnection;
//import java.net.URL;
//import java.util.Arrays;
//
//
///**
// * xxl-job定时任务测试
// */
//@Component
//@Slf4j
//public class DemoJobHandler {
//
//
// /**
// * 简单任务
// *
// * @param params
// * @return
// */
//
// @XxlJob(value = "demoJob")
// public ReturnT<String> demoJobHandler(String params) {
// log.info("我是定时任务,我执行了...............................");
// return ReturnT.SUCCESS;
// }
//
// /**
// * 2、分片广播任务
// */
//
// @XxlJob("shardingJobHandler")
// public ReturnT<String> shardingJobHandler(String param) throws Exception {
//
// // 分片参数
// ShardingUtil.ShardingVO shardingVO = ShardingUtil.getShardingVo();
// XxlJobLogger.log("分片参数:当前分片序号 = {}, 总分片数 = {}", shardingVO.getIndex(), shardingVO.getTotal());
//
// // 业务逻辑
// for (int i = 0; i < shardingVO.getTotal(); i++) {
// if (i == shardingVO.getIndex()) {
// XxlJobLogger.log("第 {} 片, 命中分片开始处理", i);
// } else {
// XxlJobLogger.log("第 {} 片, 忽略", i);
// }
// }
//
// return ReturnT.SUCCESS;
// }
//
//
// /**
// * 3、命令行任务
// */
//
// @XxlJob("commandJobHandler")
// public ReturnT<String> commandJobHandler(String param) throws Exception {
// String command = param;
// int exitValue = -1;
//
// BufferedReader bufferedReader = null;
// try {
// // command process
// Process process = Runtime.getRuntime().exec(command);
// BufferedInputStream bufferedInputStream = new BufferedInputStream(process.getInputStream());
// bufferedReader = new BufferedReader(new InputStreamReader(bufferedInputStream));
//
// // command log
// String line;
// while ((line = bufferedReader.readLine()) != null) {
// XxlJobLogger.log(line);
// }
//
// // command exit
// process.waitFor();
// exitValue = process.exitValue();
// } catch (Exception e) {
// XxlJobLogger.log(e);
// } finally {
// if (bufferedReader != null) {
// bufferedReader.close();
// }
// }
//
// if (exitValue == 0) {
// return IJobHandler.SUCCESS;
// } else {
// return new ReturnT<String>(IJobHandler.FAIL.getCode(), "command exit value(" + exitValue + ") is failed");
// }
// }
//
//
// /**
// * 4、跨平台Http任务
// * 参数示例:
// * "url: http://www.baidu.com\n" +
// * "method: get\n" +
// * "data: content\n";
// */
//
// @XxlJob("httpJobHandler")
// public ReturnT<String> httpJobHandler(String param) throws Exception {
//
// // param parse
// if (param == null || param.trim().length() == 0) {
// XxlJobLogger.log("param[" + param + "] invalid.");
// return ReturnT.FAIL;
// }
// String[] httpParams = param.split("\n");
// String url = null;
// String method = null;
// String data = null;
// for (String httpParam : httpParams) {
// if (httpParam.startsWith("url:")) {
// url = httpParam.substring(httpParam.indexOf("url:") + 4).trim();
// }
// if (httpParam.startsWith("method:")) {
// method = httpParam.substring(httpParam.indexOf("method:") + 7).trim().toUpperCase();
// }
// if (httpParam.startsWith("data:")) {
// data = httpParam.substring(httpParam.indexOf("data:") + 5).trim();
// }
// }
//
// // param valid
// if (url == null || url.trim().length() == 0) {
// XxlJobLogger.log("url[" + url + "] invalid.");
// return ReturnT.FAIL;
// }
// if (method == null || !Arrays.asList("GET", "POST").contains(method)) {
// XxlJobLogger.log("method[" + method + "] invalid.");
// return ReturnT.FAIL;
// }
//
// // request
// HttpURLConnection connection = null;
// BufferedReader bufferedReader = null;
// try {
// // connection
// URL realUrl = new URL(url);
// connection = (HttpURLConnection) realUrl.openConnection();
//
// // connection setting
// connection.setRequestMethod(method);
// connection.setDoOutput(true);
// connection.setDoInput(true);
// connection.setUseCaches(false);
// connection.setReadTimeout(5 * 1000);
// connection.setConnectTimeout(3 * 1000);
// connection.setRequestProperty("connection", "Keep-Alive");
// connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
// connection.setRequestProperty("Accept-Charset", "application/json;charset=UTF-8");
//
// // do connection
// connection.connect();
//
// // data
// if (data != null && data.trim().length() > 0) {
// DataOutputStream dataOutputStream = new DataOutputStream(connection.getOutputStream());
// dataOutputStream.write(data.getBytes("UTF-8"));
// dataOutputStream.flush();
// dataOutputStream.close();
// }
//
// // valid StatusCode
// int statusCode = connection.getResponseCode();
// if (statusCode != 200) {
// throw new RuntimeException("Http Request StatusCode(" + statusCode + ") Invalid.");
// }
//
// // result
// bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
// StringBuilder result = new StringBuilder();
// String line;
// while ((line = bufferedReader.readLine()) != null) {
// result.append(line);
// }
// String responseMsg = result.toString();
//
// XxlJobLogger.log(responseMsg);
// return ReturnT.SUCCESS;
// } catch (Exception e) {
// XxlJobLogger.log(e);
// return ReturnT.FAIL;
// } finally {
// try {
// if (bufferedReader != null) {
// bufferedReader.close();
// }
// if (connection != null) {
// connection.disconnect();
// }
// } catch (Exception e2) {
// XxlJobLogger.log(e2);
// }
// }
//
// }
//
//
// /**
// * 5、生命周期任务示例:任务初始化与销毁时,支持自定义相关逻辑;
// */
//
// @XxlJob(value = "demoJobHandler2", init = "init", destroy = "destroy")
// public ReturnT<String> demoJobHandler2(String param) throws Exception {
// XxlJobLogger.log("XXL-JOB, Hello World.");
// return ReturnT.SUCCESS;
// }
//
// public void init() {
// log.info("init");
// }
//
// public void destroy() {
// log.info("destory");
// }
//}
//
jeecg-boot/jeecg-cloud-module/jeecg-cloud-example/src/main/java/org/jeecg/cloud/demo/test/controller/JeecgDemoController.java
已删除
100644 → 0
浏览文件 @
fa2c5ecb
package
org.jeecg.cloud.demo.test.controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.jeecg.common.api.vo.Result
;
import
org.jeecg.common.system.api.ISysBaseAPI
;
import
org.jeecg.common.system.vo.DictModel
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
*
*/
@Slf4j
@Api
(
tags
=
"jeecg-demo"
)
@RestController
@RequestMapping
(
"/test"
)
public
class
JeecgDemoController
{
@Resource
private
ISysBaseAPI
sysBaseAPI
;
/**
* 测试
*
* @return
*/
@GetMapping
(
"/demo"
)
@ApiOperation
(
value
=
"测试方法"
,
notes
=
"测试方法"
)
public
Result
mockChange2
()
{
// try{
// //睡5秒,网关Hystrix3秒超时,会触发熔断降级操作
// Thread.sleep(5000);
// }catch (Exception e){
// e.printStackTrace();
// }
List
<
DictModel
>
list
=
sysBaseAPI
.
queryAllDict
();
return
Result
.
OK
(
list
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录