@nine-lab/nine-mu 0.1.17 → 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.
@@ -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) {
@@ -39,6 +39,85 @@ export class NineMuService {
39
39
  }
40
40
  }
41
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);
117
+ throw error;
118
+ }
119
+ }
120
+
42
121
  /**
43
122
  * 초기 경로 정보 로드
44
123
  */