|
|
@@ -1,14 +1,19 @@
|
|
1
|
1
|
package midware.controller;
|
|
2
|
2
|
|
|
3
|
3
|
import com.alibaba.fastjson2.JSON;
|
|
|
4
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
4
|
5
|
import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
|
|
|
6
|
+import midware.entity.database.rep.Relation;
|
|
5
|
7
|
import midware.entity.input.CodeInput;
|
|
6
|
8
|
import midware.model.AjaxResult;
|
|
7
|
9
|
import midware.service.eslclient.EslCommon;
|
|
|
10
|
+import midware.service.rep.IRelationService;
|
|
8
|
11
|
import midware.util.annotation.Anonymous;
|
|
9
|
12
|
import midware.util.helper.CodeHelper;
|
|
10
|
13
|
import midware.util.helper.IpHelper;
|
|
11
|
14
|
import midware.util.helper.SecretHelper;
|
|
|
15
|
+import midware.util.helper.StringHelper;
|
|
|
16
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
12
|
17
|
import org.springframework.web.bind.annotation.*;
|
|
13
|
18
|
import org.springframework.web.multipart.MultipartFile;
|
|
14
|
19
|
|
|
|
@@ -18,12 +23,15 @@ import java.io.IOException;
|
|
18
|
23
|
import java.io.PrintWriter;
|
|
19
|
24
|
import java.nio.file.Paths;
|
|
20
|
25
|
import java.text.SimpleDateFormat;
|
|
|
26
|
+import java.time.LocalDateTime;
|
|
21
|
27
|
import java.util.*;
|
|
22
|
28
|
|
|
23
|
29
|
@Anonymous
|
|
24
|
30
|
@RestController
|
|
25
|
31
|
@RequestMapping()
|
|
26
|
32
|
public class HomeController extends BaseController {
|
|
|
33
|
+ @Autowired
|
|
|
34
|
+ private IRelationService relationService;
|
|
27
|
35
|
|
|
28
|
36
|
@GetMapping("/")
|
|
29
|
37
|
public AjaxResult Info() {
|
|
|
@@ -110,4 +118,29 @@ public class HomeController extends BaseController {
|
|
110
|
118
|
+ "and table_name = {0} order by ordinal_position", input.getTableName());
|
|
111
|
119
|
CodeHelper.GetCode(response, table, columns, input.getPackageName(), input.getControllerName());
|
|
112
|
120
|
}
|
|
|
121
|
+
|
|
|
122
|
+ @GetMapping("/getCaller")
|
|
|
123
|
+ public String getCaller(Relation input) {
|
|
|
124
|
+
|
|
|
125
|
+ if(StringHelper.isEmpty(input.getCallee())){
|
|
|
126
|
+ return "";
|
|
|
127
|
+ }
|
|
|
128
|
+
|
|
|
129
|
+ LambdaQueryWrapper<Relation> qw = new LambdaQueryWrapper<>();
|
|
|
130
|
+
|
|
|
131
|
+ qw.eq( Relation::getCallee, input.getCallee());
|
|
|
132
|
+
|
|
|
133
|
+ // 设置查询条件:Limitdate > 当前时间
|
|
|
134
|
+ qw.ge(Relation::getLimitdate, LocalDateTime.now());
|
|
|
135
|
+
|
|
|
136
|
+
|
|
|
137
|
+ Relation model= relationService.getEntity(qw);
|
|
|
138
|
+
|
|
|
139
|
+ if (model != null) {
|
|
|
140
|
+
|
|
|
141
|
+ return model.getCaller() ;
|
|
|
142
|
+ } else {
|
|
|
143
|
+ return "";
|
|
|
144
|
+ }
|
|
|
145
|
+ }
|
|
113
|
146
|
}
|