@nine-lab/nine-mu 0.1.16 â 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nine-mu.js +26350 -27
- package/dist/nine-mu.js.map +1 -1
- package/dist/nine-mu.umd.js +1 -1
- package/dist/nine-mu.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/NineChat.js +24 -5
- package/src/components/NineDiff.js +532 -0
- package/src/components/NineDiffContainer.js +63 -0
- package/src/components/NineDiffPopup.js +0 -0
- package/src/index.js +7 -5
- package/src/services/NineMuService.js +83 -4
- package/vite.config.js +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nine, trace } from '@nine-lab/nine-util';
|
|
1
|
+
import { nine, trace, api } from '@nine-lab/nine-util';
|
|
2
2
|
|
|
3
3
|
export class NineMuService {
|
|
4
4
|
constructor(connectorUrl) {
|
|
@@ -13,9 +13,9 @@ export class NineMuService {
|
|
|
13
13
|
*/
|
|
14
14
|
async generate(command, targets, currentRoutes) {
|
|
15
15
|
try {
|
|
16
|
-
trace.log(
|
|
16
|
+
trace.log(`ęłľě ěě: "${command}" [ëě: ${targets.join(', ')}]`);
|
|
17
17
|
|
|
18
|
-
const response = await fetch(`${this.connectorUrl}/api/
|
|
18
|
+
const response = await fetch(`${this.connectorUrl}/api/mu/generate`, {
|
|
19
19
|
method: 'POST',
|
|
20
20
|
headers: { 'Content-Type': 'application/json' },
|
|
21
21
|
body: JSON.stringify({
|
|
@@ -34,7 +34,86 @@ export class NineMuService {
|
|
|
34
34
|
|
|
35
35
|
return result;
|
|
36
36
|
} catch (error) {
|
|
37
|
-
trace.error("
|
|
37
|
+
trace.error("NineMu Service Error:", error);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#getSourcePath = (menuUrl) => {
|
|
43
|
+
return null;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
async generateAll(command) {
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async generateAll_BAK(command, targets, currentRoutes) {
|
|
51
|
+
/**
|
|
52
|
+
api.post("/nine-mu/source/read", { menuUrl : "/admin/payment/order-list", feProjectName: pkg.name }).then((res) => {
|
|
53
|
+
trace.log(res);
|
|
54
|
+
}); */
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
trace.log(`ęłľě ěě: "${command}" [ëě: ${targets.join(', ')}]`);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* return {
|
|
61
|
+
* package: packageName,
|
|
62
|
+
* namespace: namespace,
|
|
63
|
+
* baseClass: fileName,
|
|
64
|
+
* //resultType: this.#parent.config.basePackage.split(".").slice(0, -1).join(".") + ".core.utils.CamelCaseMap",
|
|
65
|
+
* resultType: "com.ninelab.ai.util.CamelCaseMap",
|
|
66
|
+
* mybatis: `${cleaned.split(".").slice(0, -1).join("/")}/${fileName}Mapper.xml`,
|
|
67
|
+
* //javascript: `${javascript}.jsx`,
|
|
68
|
+
* //javascriptFrom: `${javascriptFrom}.jsx`,
|
|
69
|
+
* //javascriptTo: `${javascriptTo}.jsx`,
|
|
70
|
+
* classFrom: classFrom,
|
|
71
|
+
* classTo: classTo,
|
|
72
|
+
* activeIndex: activeIndex,
|
|
73
|
+
* emptyIndex: emptyIndex,
|
|
74
|
+
* mybatisPullPath: `${this.#parent.settings.beProjectName}/src/main/resources/mapper/${cleaned.split(".").slice(0, -1).join("/")}/${fileName}Mapper.xml`,
|
|
75
|
+
* controllerPullPath: `${this.#parent.settings.beProjectName}/src/main/java/${packageName.replaceAll(".", "/")}/controller/${fileName}Controller.java`,
|
|
76
|
+
* servicePullPath: `${this.#parent.settings.beProjectName}/src/main/java/${packageName.replaceAll(".", "/")}/service/${fileName}Service.java`,
|
|
77
|
+
* //javascriptPullPath: `${this.#parent.settings.feProjectName}${javascript}.jsx`,
|
|
78
|
+
* javascriptFrom: `${this.#parent.settings.feProjectName}/src/views/${javascriptFrom}.jsx`,
|
|
79
|
+
* javascriptTo: `${this.#parent.settings.feProjectName}/src/views/${javascriptTo}.jsx`,
|
|
80
|
+
* };
|
|
81
|
+
*/
|
|
82
|
+
const srcPath = this.#getSourcePath("/admin/payment/order-list");
|
|
83
|
+
const srcPath1 = {
|
|
84
|
+
mybatis : "",
|
|
85
|
+
servicePullPath : "",
|
|
86
|
+
controllerPullPath : "",
|
|
87
|
+
javascriptFrom : "",
|
|
88
|
+
javascriptTo : "",
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
trace.log(srcPath);
|
|
92
|
+
const src = await api.post("/nine-ai/source/read", srcPath);
|
|
93
|
+
trace.log(src);
|
|
94
|
+
|
|
95
|
+
const response = await fetch(`${this.connectorUrl}/api/mu/generateAll`, {
|
|
96
|
+
method: 'POST',
|
|
97
|
+
headers: { 'Content-Type': 'application/json' },
|
|
98
|
+
body: JSON.stringify({
|
|
99
|
+
//command,
|
|
100
|
+
//targets,
|
|
101
|
+
projectType: 'spring-react',
|
|
102
|
+
//currentRoutes
|
|
103
|
+
})
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
trace.log(response);
|
|
107
|
+
|
|
108
|
+
const result = await response.json();
|
|
109
|
+
|
|
110
|
+
if (!result.success) {
|
|
111
|
+
throw new Error(result.error || "ěě¤ ěěą ě¤ ěë˛ ě¤ëĽę° ë°ěíěľëë¤.");
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return result;
|
|
115
|
+
} catch (error) {
|
|
116
|
+
trace.error("NineMu Service Error:", error);
|
|
38
117
|
throw error;
|
|
39
118
|
}
|
|
40
119
|
}
|
package/vite.config.js
CHANGED