com.diboot.devtools.v2.O0O00OOOO0O0OO00 Maven / Gradle / Ivy
The newest version!
/**
* Copyright (c) dibo.ltd, https://www.dibo.ltd, https://www.diboot.com
*
* ---- 版权声明 ----
* Diboot相关商标、软件著作权、专利等全部知识产权隶属于苏州帝博信息技术有限公司。
* Diboot devtools 非开源项目,如您有devtools相关定制化需求,请至官网(https://www.dibo.ltd)联系帝博信息商务。
*
* 《中华人民共和国刑法》规定:破坏计算机信息系统罪,处五年以下有期徒刑或者拘役;后果特别严重的,处五年以上有期徒刑。
* 侵犯知识产权罪:处三年以下有期徒刑、拘役或管制,并处罚金;情节特别严重的,处三年以上七年以下有期徒刑,并处罚金。
*
* 任何尝试破解、破坏devtools、侵犯diboot知识产权的行为,我们将不惜一切代价追究到底!
*
*/
package com.diboot.devtools.v2;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.diboot.core.service.DictionaryServiceExtProvider;
import com.diboot.core.util.*;
import com.diboot.core.vo.JsonResult;
import com.diboot.core.vo.LabelValue;
import io.swagger.v3.oas.annotations.Hidden;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.stream.Collectors;
@Hidden
@Slf4j
@RestController
@RequestMapping("/diboot/devtools/db")
@Deprecated()
public class O0O00OOOO0O0OO00 {
private static final String ll1l1l1l11lll = OOO0OO00O00O00OO.l11llll1ll11ll1("YXhpcw==");
private static final String ll11llllllll1 = OOO0OO00O00O00OO.l11llll1ll11ll1("c2VyaWVzTmFtZQ==");
private static final String ll1111ll1ll11 = OOO0OO00O00O00OO.l11llll1ll11ll1("Y291bnQ=");
@Autowired
private O0O00OO000O00000 llll1111lllll;
@Autowired
private O0O0000O00O00O0O ll111ll11l11l;
@Autowired(required = false)
private DictionaryServiceExtProvider ll1lll11l11ll;
@O0O0OO0O00O00O00
@GetMapping({ "/kwd/{columnName}", "/kwd/" })
@Deprecated()
public JsonResult ll1l11l1111l1l1(@PathVariable(value = "columnName", required = false) String lll1l1l11ll1) throws Exception {
if (V.isEmpty(lll1l1l11ll1)) {
return JsonResult.OK();
}
boolean l11llllll1l1 = OOOO0O0OO0OO0000.llll11lllll1l1l().ll111111ll1l111(lll1l1l11ll1);
return JsonResult.OK(l11llllll1l1);
}
@O0O0OO0O00O00O00
@GetMapping("/rot")
@Deprecated()
public JsonResult l111l1l111ll1l1() throws Exception {
if (OOOO0O0OO0OO0000.llll11lllll1l1l().lll11111l1l1ll1()) {
List l1lll1l11lll = new ArrayList<>(O0OOO00OO0OOOO0O.llll1l111ll111.size());
for (String l1l11l1ll1ll : O0OOO00OO0OOOO0O.llll1l111ll111) {
l1lll1l11lll.add(l1l11l1ll1ll.toUpperCase());
}
return JsonResult.OK(l1lll1l11lll);
}
return JsonResult.OK(O0OOO00OO0OOOO0O.llll1l111ll111);
}
@O0O0OO0O00O00O00
@GetMapping("/tp")
@Deprecated()
public JsonResult getDbType() throws Exception {
return JsonResult.OK(ContextHelper.getDatabaseType());
}
@O0O0OO0O00O00O00
@GetMapping("/tbls")
@Deprecated()
public JsonResult ll1l1ll111l1l11(HttpServletRequest lll1lll1lll1) {
List lll111l1l1ll = llll1111lllll.l1lll1ll1ll11ll(true);
return JsonResult.OK(lll111l1l1ll);
}
@O0O0OO0O00O00O00
@GetMapping("/edttbls")
@Deprecated()
public JsonResult ll1111l111lllll(HttpServletRequest l11lll1ll11l) {
List l1l11ll11ll1 = llll1111lllll.l1lll1ll1ll11ll(false);
return JsonResult.OK(l1l11ll11ll1);
}
@O0O0OO0O00O00O00
@GetMapping("/rltn/{tableName}")
@Deprecated()
public JsonResult ll1llll111ll11l(@PathVariable("tableName") String lll11l1ll1ll) {
O00O00OOO0OOOO0O ll1l1lll11l1 = new O00O00OOO0OOOO0O();
List l111ll1ll11l = llll1111lllll.l1ll11111ll1l11(lll11l1ll1ll);
if (V.isEmpty(l111ll1ll11l)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6I635Y+W5YiX5L+h5oGv5aSx6LSl"));
}
List ll1l1llll1ll = new ArrayList<>();
List l111l11l11ll = new ArrayList<>();
List l1ll1l1l1l1l = new ArrayList<>();
for (O000000O0O0OO000 ll1ll1lll1ll : l111ll1ll11l) {
if (ll1ll1lll1ll.getColumnExt() == null || !"T".equals(ll1ll1lll1ll.getColumnExt().getRefType())) {
continue;
}
boolean l111111111ll = OOO0OOO0O0OO00O0.lll1ll111l111ll(ll1ll1lll1ll);
if (!l111111111ll) {
continue;
}
OOO00OO00000O00O l1ll11l1l1l1 = ll1ll1lll1ll.getReferenceField();
O00000O0OOO0O0OO ll111ll1l111 = llll1111lllll.l1l111llll1llll(l1ll11l1l1l1.getRefTable());
OOOO0OO0000OO000 ll11111l11l1 = new OOOO0OO0000OO000();
ll11111l11l1.setRefTableInfo(ll111ll1l111).setReferenceField(l1ll11l1l1l1);
ll1l1llll1ll.add(ll11111l11l1);
List ll1111llll11 = llll1111lllll.l1ll11111ll1l11(l1ll11l1l1l1.getRefTable());
if (V.isEmpty(ll1111llll11)) {
continue;
}
boolean l1lll11l1111 = ll1111llll11.stream().anyMatch(l1lll111l1ll -> {
return l1lll111l1ll.getColumnExt() != null && V.equals(l1lll111l1ll.getTableName(), l1lll111l1ll.getColumnExt().getRefTable());
});
if (l1lll11l1111) {
l111l11l11ll.add(ll11111l11l1);
}
}
List ll11l11ll11l = ll111ll11l11l.getEntityList(Wrappers.lambdaQuery().eq(O0O00OO00O0O0OO0::getRefType, "T").eq(O0O00OO00O0O0OO0::getRefTable, lll11l1ll1ll));
if (V.notEmpty(ll11l11ll11l)) {
List lll11l1llll1 = ll11l11ll11l.stream().map(O0O00OO00O0O0OO0::getTableName).distinct().collect(Collectors.toList());
if (V.notEmpty(lll11l1llll1)) {
for (String l1l11ll11l11 : lll11l1llll1) {
List l1ll1111111l = llll1111lllll.l1ll11111ll1l11(l1l11ll11l11);
for (O000000O0O0OO000 ll1ll1lll1ll : l1ll1111111l) {
if (ll1ll1lll1ll.getColumnExt() == null || !"T".equals(ll1ll1lll1ll.getColumnExt().getRefType())) {
continue;
}
if (lll11l1ll1ll.equals(ll1ll1lll1ll.getColumnExt().getRefTable())) {
O00000O0OOO0O0OO ll111ll1l111 = llll1111lllll.l1l111llll1llll(l1l11ll11l11);
OOO0OOO0O0OO00O0.lll1ll111l111ll(ll1ll1lll1ll);
OOO00OO00000O00O l1ll11l1l1l1 = ll1ll1lll1ll.getReferenceField();
OOOO0OO0000OO000 ll11111l11l1 = new OOOO0OO0000OO000();
ll11111l11l1.setRefTableInfo(ll111ll1l111).setReferenceField(l1ll11l1l1l1);
l1ll1l1l1l1l.add(ll11111l11l1);
break;
}
}
}
}
}
ll1l1lll11l1.setRefs(ll1l1llll1ll).setTreeRefs(l111l11l11ll).setRefChildren(l1ll1l1l1l1l);
return JsonResult.OK(ll1l1lll11l1);
}
@O0O0OO0O00O00O00
@GetMapping("/trtbls")
@Deprecated()
public JsonResult lllll111llll1ll() {
List l1lllll11lll = ll111ll11l11l.ll1l1ll1ll1ll1l();
if (V.isEmpty(l1lllll11lll)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6L+Y5rKh5pyJ56ym5ZCI5p2h5Lu255qE5a6e5L2T5YiX6KGo5Y+v5L6b6YCJ5oup"));
}
List ll11l111ll1l = l1lllll11lll.stream().filter(ll1ll111l111 -> {
return V.equals(ll1ll111l111.getTableName(), ll1ll111l111.getRefTable());
}).collect(Collectors.toList());
if (V.isEmpty(ll11l111ll1l)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6L+Y5rKh5pyJ56ym5ZCI5p2h5Lu255qE5a6e5L2T5YiX6KGo5Y+v5L6b6YCJ5oup"));
}
List l111lll11ll1 = llll1111lllll.l1lll1ll1ll11ll(true);
List ll111111111l = BeanUtils.collectToList(l111lll11ll1, O00000O0OOO0O0OO::getTableName);
ll11l111ll1l = ll11l111ll1l.stream().filter(ll1ll111l111 -> {
return ll111111111l.contains(ll1ll111l111.getTableName());
}).collect(Collectors.toList());
if (V.isEmpty(ll11l111ll1l)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6L+Y5rKh5pyJ56ym5ZCI5p2h5Lu255qE5a6e5L2T5YiX6KGo5Y+v5L6b6YCJ5oup"));
}
List l11111l1l1l1 = BeanUtils.collectToList(ll11l111ll1l, O0O00OO00O0O0OO0::getTableName);
List ll1l11l1lll1 = l111lll11ll1.stream().filter(l1111lll11ll -> {
return l11111l1l1l1.contains(l1111lll11ll.getTableName());
}).collect(Collectors.toList());
if (V.isEmpty(ll1l11l1lll1)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6L+Y5rKh5pyJ56ym5ZCI5p2h5Lu255qE5a6e5L2T5YiX6KGo5Y+v5L6b6YCJ5oup"));
}
return JsonResult.OK(ll1l11l1lll1);
}
@O0O0OO0O00O00O00
@GetMapping("/trlsttbls")
@Deprecated()
public JsonResult l11ll111lll1l1l() {
List l11l1l11l1l1 = ll111ll11l11l.ll1l1ll1ll1ll1l();
if (V.isEmpty(l11l1l11l1l1)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6L+Y5rKh5pyJ56ym5ZCI5p2h5Lu255qE5a6e5L2T5YiX6KGo5Y+v5L6b6YCJ5oup"));
}
List ll111lllll1l = l11l1l11l1l1.stream().filter(l1lllllll1ll -> {
return V.equals(l1lllllll1ll.getTableName(), l1lllllll1ll.getRefTable());
}).collect(Collectors.toList());
if (V.isEmpty(ll111lllll1l)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6L+Y5rKh5pyJ56ym5ZCI5p2h5Lu255qE5a6e5L2T5YiX6KGo5Y+v5L6b6YCJ5oup"));
}
List ll1111111lll = BeanUtils.collectToList(ll111lllll1l, O0O00OO00O0O0OO0::getTableName);
List l1l111ll1lll = l11l1l11l1l1.stream().filter(l1lllllll1ll -> {
return !V.equals(l1lllllll1ll.getTableName(), l1lllllll1ll.getRefTable()) && ll1111111lll.contains(l1lllllll1ll.getRefTable());
}).collect(Collectors.toList());
if (V.isEmpty(l1l111ll1lll)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6L+Y5rKh5pyJ56ym5ZCI5p2h5Lu255qE5a6e5L2T5YiX6KGo5Y+v5L6b6YCJ5oup"));
}
List lll1ll1ll111 = llll1111lllll.l1lll1ll1ll11ll(true);
List ll1l1l1l1111 = BeanUtils.collectToList(lll1ll1ll111, O00000O0OOO0O0OO::getTableName);
ll111lllll1l = ll111lllll1l.stream().filter(l1lllllll1ll -> {
return ll1l1l1l1111.contains(l1lllllll1ll.getTableName());
}).collect(Collectors.toList());
l1l111ll1lll = l1l111ll1lll.stream().filter(l1lllllll1ll -> {
return ll1l1l1l1111.contains(l1lllllll1ll.getTableName());
}).collect(Collectors.toList());
if (V.isEmpty(ll111lllll1l) || V.isEmpty(l1l111ll1lll)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6L+Y5rKh5pyJ56ym5ZCI5p2h5Lu255qE5a6e5L2T5YiX6KGo5Y+v5L6b6YCJ5oup"));
}
List l11111l1ll1l = BeanUtils.collectToList(ll111lllll1l, O0O00OO00O0O0OO0::getTableName);
Map> lll11lll11ll = BeanUtils.convertToStringKeyObjectListMap(l1l111ll1lll, BeanUtils.convertToFieldName(O0O00OO00O0O0OO0::getRefTable));
List llll111lll1l = lll1ll1ll111.stream().filter(ll11lllll111 -> {
return l11111l1ll1l.contains(ll11lllll111.getTableName());
}).collect(Collectors.toList());
List ll11l1lll11l = new ArrayList<>();
for (O00000O0OOO0O0OO ll1l11ll1ll1 : llll111lll1l) {
List ll1lll1l11l1 = lll11lll11ll.get(ll1l11ll1ll1.getTableName());
if (V.isEmpty(ll1lll1l11l1)) {
continue;
}
List l11lll1ll1l1 = BeanUtils.collectToList(ll1lll1l11l1, O0O00OO00O0O0OO0::getTableName);
ll1l11ll1ll1.setChildren(lll1ll1ll111.stream().filter(ll11lllll111 -> {
return l11lll1ll1l1.contains(ll11lllll111.getTableName());
}).collect(Collectors.toList()));
ll11l1lll11l.add(ll1l11ll1ll1);
}
if (V.isEmpty(ll11l1lll11l)) {
return JsonResult.FAIL_OPERATION(OOO0OO00O00O00OO.l11llll1ll11ll1("6L+Y5rKh5pyJ56ym5ZCI5p2h5Lu255qE5a6e5L2T5YiX6KGo5Y+v5L6b6YCJ5oup"));
}
return JsonResult.OK(ll11l1lll11l);
}
@O0O0OO0O00O00O00
@GetMapping("/cols/{table}")
@Deprecated()
public JsonResult llllll1l1l1ll11(@PathVariable("table") String l1lll1ll11ll) {
try {
List l11llll111l1 = llll1111lllll.l1ll11111ll1l11(l1lll1ll11ll);
for (O000000O0O0OO000 l1l1ll1lll11 : l11llll111l1) {
if (l1l1ll1lll11.getColumnExt() != null && l1l1ll1lll11.getColumnExt().isRefTreeStruct() && V.notEmpty(l1l1ll1lll11.getColumnExt().getRefTable())) {
List l1llllllll11 = llll1111lllll.l1l1111ll11lll1(l1l1ll1lll11.getColumnExt().getRefTable());
if (l1llllllll11 != null && l1llllllll11.size() > 0) {
for (O000000O0O0OO000 l1llllll1lll : l1llllllll11) {
if (l1llllll1lll.isPrimaryKey()) {
l1l1ll1lll11.getColumnExt().setRefPrimaryFieldName(l1llllll1lll.getFieldName());
break;
}
}
}
}
}
return JsonResult.OK(l11llll111l1);
} catch (Exception e) {
log.error(OOO0OO00O00O00OO.l11llll1ll11ll1("6I635Y+W6KGo57uT5p6E5aSx6LSlOiB7fQ=="), e.getMessage());
return JsonResult.FAIL_OPERATION("获取" + l1lll1ll11ll + OOO0OO00O00O00OO.l11llll1ll11ll1("6KGo55qE6KGo57uT5p6E5aSx6LSl"));
}
}
@O0O0OO0O00O00O00
@GetMapping("/idx/{table}")
@Deprecated()
public JsonResult l11ll1l1llllll1(@PathVariable("table") String ll1l111111l1) {
try {
List lllllll1111l = llll1111lllll.llllll111l1ll11(ll1l111111l1);
return JsonResult.OK(lllllll1111l);
} catch (Exception e) {
log.error(OOO0OO00O00O00OO.l11llll1ll11ll1("6I635Y+W6KGo5L+h5oGv5aSx6LSlOiB7fQ=="), e.getMessage());
return JsonResult.FAIL_OPERATION("获取" + ll1l111111l1 + OOO0OO00O00O00OO.l11llll1ll11ll1("6KGo55qE6KGo5L+h5oGv5aSx6LSl"));
}
}
@O0O0OO0O00O00O00
@GetMapping("/rfcolfld/{table}")
@Deprecated()
public JsonResult ll11l1lll1l11ll(@PathVariable("table") String ll1l1l1ll1ll) {
try {
Map ll11l1ll1l1l = llll1111lllll.llll11l111l11l1(ll1l1l1ll1ll);
return JsonResult.OK(ll11l1ll1l1l);
} catch (Exception e) {
log.error(OOO0OO00O00O00OO.l11llll1ll11ll1("6I635Y+W6KGo57uT5p6E5aSx6LSlOiB7fQ=="), e.getMessage());
return JsonResult.FAIL_OPERATION("获取" + ll1l1l1ll1ll + OOO0OO00O00O00OO.l11llll1ll11ll1("6KGo55qE6KGo57uT5p6E5aSx6LSl"));
}
}
@O0O0OO0O00O00O00
@GetMapping("/exmpdt/{tableName}")
@Deprecated()
public JsonResult lllll1l111lll1l(@PathVariable("tableName") String l1l1l111lll1) throws Exception {
try {
List