ide-assi 0.633.0 → 0.635.0

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.
@@ -202742,6 +202742,161 @@ console.log(el, href, title);
202742
202742
  return returnSrc;
202743
202743
  };
202744
202744
 
202745
+ #modifyDetailSource = async (userPrompt, apply, progressMessageInstance) => {
202746
+
202747
+ const el = ninegrid.querySelector("nx-side-menu-item.active");
202748
+ if (!el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
202749
+
202750
+ const href = el.getAttribute("href");
202751
+ const title = el.getAttribute("title");
202752
+
202753
+ //console.log(el, href, title);
202754
+
202755
+ const srcPath = this.#getSourcePath(href);
202756
+ console.log(srcPath);
202757
+
202758
+ const src = await api.post("/api/source/read", srcPath);
202759
+
202760
+ const where = await this.#where(`${title}에서 ${userPrompt}`, [{url: href, title: title}], await this.#getTableList());
202761
+ //this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
202762
+ progressMessageInstance.updateProgress('prepare2', 'completed');
202763
+
202764
+ console.log(where);
202765
+
202766
+ //const srcPath = this.#getSourcePath(where.menu.url);
202767
+ console.log(srcPath);
202768
+
202769
+ const columnInfo = await this.#getColumnInfo(where.table);
202770
+
202771
+ let mybatisXmlSource;
202772
+ if (apply.mybatis) {
202773
+ mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/U.BuildMyBatisMapper.txt", "mybatis.xml", {
202774
+ userPrompt: userPrompt,
202775
+ originSrc: src.mybatis,
202776
+ resultType: srcPath.resultType,
202777
+ namespace: srcPath.namespace,
202778
+ tableDefinitions: JSON.stringify(columnInfo),
202779
+ });
202780
+ //this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
202781
+ progressMessageInstance.updateProgress('mybatis', 'completed');
202782
+ }
202783
+ else {
202784
+ mybatisXmlSource = src.mybatis;
202785
+ }
202786
+
202787
+ let serviceSrc;
202788
+ if (apply.service) {
202789
+ serviceSrc = await this.#generateTmplFile("/prompts/meta/U.BuildService.txt", "service.java", {
202790
+ userPrompt: userPrompt,
202791
+ originSrc: src.service,
202792
+ baseClass: srcPath.baseClass,
202793
+ myBatisPath: srcPath.mybatis,
202794
+ namespace: srcPath.namespace,
202795
+ package: srcPath.package + ".service",
202796
+ mybatisXmlSource: mybatisXmlSource,
202797
+ });
202798
+ //this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
202799
+ progressMessageInstance.updateProgress('service', 'completed');
202800
+ }
202801
+ else {
202802
+ serviceSrc = src.service;
202803
+ }
202804
+
202805
+ let controllerSrc;
202806
+ if (apply.controller) {
202807
+ controllerSrc = await this.#generateTmplFile("/prompts/meta/U.BuildController.txt", "controller.java", {
202808
+ userPrompt: userPrompt,
202809
+ originSrc: src.controller,
202810
+ baseClass: srcPath.baseClass,
202811
+ menuUrl: where.menu.url,
202812
+ package: srcPath.package + ".controller",
202813
+ serviceSource: serviceSrc,
202814
+ });
202815
+ //this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
202816
+ progressMessageInstance.updateProgress('controller', 'completed');
202817
+ }
202818
+ else {
202819
+ controllerSrc = src.controller;
202820
+ }
202821
+
202822
+ console.log("=---------", src.javascript2);
202823
+
202824
+ let jsSrcFrom;
202825
+ let jsSrcTo;
202826
+ if (apply.javascript) {
202827
+ jsSrcTo = await this.#generateTmplFile("/prompts/meta/detail/4.BuildReactJsx_Detail.txt", "reactTo.jsx", {
202828
+ userPrompt: userPrompt,
202829
+ mybatis: srcPath.mybatis,
202830
+ originSrc: src.javascriptFrom,
202831
+ menuUrl: where.menu.url,
202832
+ menuName: where.menu.name,
202833
+ baseClass: srcPath.baseClass,
202834
+ classFrom: srcPath.classFrom,
202835
+ classTo: srcPath.classTo,
202836
+ index: srcPath.index,
202837
+ mybatisXmlSource: mybatisXmlSource,
202838
+ controllerSource: controllerSrc,
202839
+ tableDefinitions: JSON.stringify(columnInfo),
202840
+ });
202841
+ //this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
202842
+ progressMessageInstance.updateProgress('javascript', 'completed');
202843
+ }
202844
+ else {
202845
+ jsSrcTo = src.javascriptTo;
202846
+ }
202847
+
202848
+ //await this.#generateRealFile(srcPath, apply);
202849
+
202850
+ const returnSrc = [];
202851
+
202852
+ const mapping = {
202853
+ mybatis: {
202854
+ path: srcPath.mybatisPullPath,
202855
+ src: mybatisXmlSource,
202856
+ },
202857
+ service: {
202858
+ path: srcPath.servicePullPath,
202859
+ src: serviceSrc,
202860
+ },
202861
+ controller: {
202862
+ path: srcPath.controllerPullPath,
202863
+ src: controllerSrc,
202864
+ },
202865
+ javascript: {
202866
+ path: srcPath.javascriptToPullPath,
202867
+ src: jsSrcTo,
202868
+ },
202869
+ javascript2: {
202870
+ path: srcPath.javascriptFromPullPath,
202871
+ src: jsSrcFrom,
202872
+ },
202873
+ };
202874
+
202875
+ //console.log(srcPath.javascriptToPullPath, jsSrcTo);
202876
+
202877
+ if (apply.javascript) {
202878
+ apply.javascript2 = true;
202879
+ }
202880
+
202881
+ //console.log(apply);
202882
+
202883
+ for (const key in apply) {
202884
+ if (apply[key]) {
202885
+ returnSrc.push({
202886
+ [key]: {
202887
+ asis: src[key],
202888
+ tobe: mapping[key].src,
202889
+ tobePath: mapping[key].path,
202890
+ }
202891
+ });
202892
+ }
202893
+ }
202894
+
202895
+ console.log(returnSrc);
202896
+
202897
+ return returnSrc;
202898
+ };
202899
+
202745
202900
  generateSourceClient = async (userPrompt, apply) => {
202746
202901
 
202747
202902
  this.#createModel();
@@ -202832,7 +202987,15 @@ console.log(el, href, title);
202832
202987
  return await this.#generateDetailSource(userPrompt, apply, progressMessageInstance);
202833
202988
  }
202834
202989
  else if (what === "U1") {
202835
- return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202990
+ // .list-wrapper 또는 .detail-wrapper-* 중에서 .active 클래스를 가진 첫 번째 요소를 찾습니다.
202991
+ const el = document.querySelector(".list-wrapper.active");
202992
+ console.log("================", el);
202993
+ if (el) {
202994
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202995
+ }
202996
+ else {
202997
+ return await this.#modifyDetailSource(userPrompt, apply, progressMessageInstance);
202998
+ }
202836
202999
  }
202837
203000
  }
202838
203001
 
@@ -202738,6 +202738,161 @@ console.log(el, href, title);
202738
202738
  return returnSrc;
202739
202739
  };
202740
202740
 
202741
+ #modifyDetailSource = async (userPrompt, apply, progressMessageInstance) => {
202742
+
202743
+ const el = ninegrid.querySelector("nx-side-menu-item.active");
202744
+ if (!el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
202745
+
202746
+ const href = el.getAttribute("href");
202747
+ const title = el.getAttribute("title");
202748
+
202749
+ //console.log(el, href, title);
202750
+
202751
+ const srcPath = this.#getSourcePath(href);
202752
+ console.log(srcPath);
202753
+
202754
+ const src = await api.post("/api/source/read", srcPath);
202755
+
202756
+ const where = await this.#where(`${title}에서 ${userPrompt}`, [{url: href, title: title}], await this.#getTableList());
202757
+ //this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
202758
+ progressMessageInstance.updateProgress('prepare2', 'completed');
202759
+
202760
+ console.log(where);
202761
+
202762
+ //const srcPath = this.#getSourcePath(where.menu.url);
202763
+ console.log(srcPath);
202764
+
202765
+ const columnInfo = await this.#getColumnInfo(where.table);
202766
+
202767
+ let mybatisXmlSource;
202768
+ if (apply.mybatis) {
202769
+ mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/U.BuildMyBatisMapper.txt", "mybatis.xml", {
202770
+ userPrompt: userPrompt,
202771
+ originSrc: src.mybatis,
202772
+ resultType: srcPath.resultType,
202773
+ namespace: srcPath.namespace,
202774
+ tableDefinitions: JSON.stringify(columnInfo),
202775
+ });
202776
+ //this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
202777
+ progressMessageInstance.updateProgress('mybatis', 'completed');
202778
+ }
202779
+ else {
202780
+ mybatisXmlSource = src.mybatis;
202781
+ }
202782
+
202783
+ let serviceSrc;
202784
+ if (apply.service) {
202785
+ serviceSrc = await this.#generateTmplFile("/prompts/meta/U.BuildService.txt", "service.java", {
202786
+ userPrompt: userPrompt,
202787
+ originSrc: src.service,
202788
+ baseClass: srcPath.baseClass,
202789
+ myBatisPath: srcPath.mybatis,
202790
+ namespace: srcPath.namespace,
202791
+ package: srcPath.package + ".service",
202792
+ mybatisXmlSource: mybatisXmlSource,
202793
+ });
202794
+ //this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
202795
+ progressMessageInstance.updateProgress('service', 'completed');
202796
+ }
202797
+ else {
202798
+ serviceSrc = src.service;
202799
+ }
202800
+
202801
+ let controllerSrc;
202802
+ if (apply.controller) {
202803
+ controllerSrc = await this.#generateTmplFile("/prompts/meta/U.BuildController.txt", "controller.java", {
202804
+ userPrompt: userPrompt,
202805
+ originSrc: src.controller,
202806
+ baseClass: srcPath.baseClass,
202807
+ menuUrl: where.menu.url,
202808
+ package: srcPath.package + ".controller",
202809
+ serviceSource: serviceSrc,
202810
+ });
202811
+ //this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
202812
+ progressMessageInstance.updateProgress('controller', 'completed');
202813
+ }
202814
+ else {
202815
+ controllerSrc = src.controller;
202816
+ }
202817
+
202818
+ console.log("=---------", src.javascript2);
202819
+
202820
+ let jsSrcFrom;
202821
+ let jsSrcTo;
202822
+ if (apply.javascript) {
202823
+ jsSrcTo = await this.#generateTmplFile("/prompts/meta/detail/4.BuildReactJsx_Detail.txt", "reactTo.jsx", {
202824
+ userPrompt: userPrompt,
202825
+ mybatis: srcPath.mybatis,
202826
+ originSrc: src.javascriptFrom,
202827
+ menuUrl: where.menu.url,
202828
+ menuName: where.menu.name,
202829
+ baseClass: srcPath.baseClass,
202830
+ classFrom: srcPath.classFrom,
202831
+ classTo: srcPath.classTo,
202832
+ index: srcPath.index,
202833
+ mybatisXmlSource: mybatisXmlSource,
202834
+ controllerSource: controllerSrc,
202835
+ tableDefinitions: JSON.stringify(columnInfo),
202836
+ });
202837
+ //this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
202838
+ progressMessageInstance.updateProgress('javascript', 'completed');
202839
+ }
202840
+ else {
202841
+ jsSrcTo = src.javascriptTo;
202842
+ }
202843
+
202844
+ //await this.#generateRealFile(srcPath, apply);
202845
+
202846
+ const returnSrc = [];
202847
+
202848
+ const mapping = {
202849
+ mybatis: {
202850
+ path: srcPath.mybatisPullPath,
202851
+ src: mybatisXmlSource,
202852
+ },
202853
+ service: {
202854
+ path: srcPath.servicePullPath,
202855
+ src: serviceSrc,
202856
+ },
202857
+ controller: {
202858
+ path: srcPath.controllerPullPath,
202859
+ src: controllerSrc,
202860
+ },
202861
+ javascript: {
202862
+ path: srcPath.javascriptToPullPath,
202863
+ src: jsSrcTo,
202864
+ },
202865
+ javascript2: {
202866
+ path: srcPath.javascriptFromPullPath,
202867
+ src: jsSrcFrom,
202868
+ },
202869
+ };
202870
+
202871
+ //console.log(srcPath.javascriptToPullPath, jsSrcTo);
202872
+
202873
+ if (apply.javascript) {
202874
+ apply.javascript2 = true;
202875
+ }
202876
+
202877
+ //console.log(apply);
202878
+
202879
+ for (const key in apply) {
202880
+ if (apply[key]) {
202881
+ returnSrc.push({
202882
+ [key]: {
202883
+ asis: src[key],
202884
+ tobe: mapping[key].src,
202885
+ tobePath: mapping[key].path,
202886
+ }
202887
+ });
202888
+ }
202889
+ }
202890
+
202891
+ console.log(returnSrc);
202892
+
202893
+ return returnSrc;
202894
+ };
202895
+
202741
202896
  generateSourceClient = async (userPrompt, apply) => {
202742
202897
 
202743
202898
  this.#createModel();
@@ -202828,7 +202983,15 @@ console.log(el, href, title);
202828
202983
  return await this.#generateDetailSource(userPrompt, apply, progressMessageInstance);
202829
202984
  }
202830
202985
  else if (what === "U1") {
202831
- return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202986
+ // .list-wrapper 또는 .detail-wrapper-* 중에서 .active 클래스를 가진 첫 번째 요소를 찾습니다.
202987
+ const el = document.querySelector(".list-wrapper.active");
202988
+ console.log("================", el);
202989
+ if (el) {
202990
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
202991
+ }
202992
+ else {
202993
+ return await this.#modifyDetailSource(userPrompt, apply, progressMessageInstance);
202994
+ }
202832
202995
  }
202833
202996
  }
202834
202997
 
@@ -872,6 +872,161 @@ console.log(el, href, title);
872
872
  return returnSrc;
873
873
  };
874
874
 
875
+ #modifyDetailSource = async (userPrompt, apply, progressMessageInstance) => {
876
+
877
+ const el = ninegrid.querySelector("nx-side-menu-item.active");
878
+ if (!el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
879
+
880
+ const href = el.getAttribute("href");
881
+ const title = el.getAttribute("title");
882
+
883
+ //console.log(el, href, title);
884
+
885
+ const srcPath = this.#getSourcePath(href);
886
+ console.log(srcPath);
887
+
888
+ const src = await api.post("/api/source/read", srcPath);
889
+
890
+ const where = await this.#where(`${title}에서 ${userPrompt}`, [{url: href, title: title}], await this.#getTableList());
891
+ //this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
892
+ progressMessageInstance.updateProgress('prepare2', 'completed');
893
+
894
+ console.log(where);
895
+
896
+ //const srcPath = this.#getSourcePath(where.menu.url);
897
+ console.log(srcPath);
898
+
899
+ const columnInfo = await this.#getColumnInfo(where.table);
900
+
901
+ let mybatisXmlSource;
902
+ if (apply.mybatis) {
903
+ mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/U.BuildMyBatisMapper.txt", "mybatis.xml", {
904
+ userPrompt: userPrompt,
905
+ originSrc: src.mybatis,
906
+ resultType: srcPath.resultType,
907
+ namespace: srcPath.namespace,
908
+ tableDefinitions: JSON.stringify(columnInfo),
909
+ });
910
+ //this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
911
+ progressMessageInstance.updateProgress('mybatis', 'completed');
912
+ }
913
+ else {
914
+ mybatisXmlSource = src.mybatis;
915
+ }
916
+
917
+ let serviceSrc;
918
+ if (apply.service) {
919
+ serviceSrc = await this.#generateTmplFile("/prompts/meta/U.BuildService.txt", "service.java", {
920
+ userPrompt: userPrompt,
921
+ originSrc: src.service,
922
+ baseClass: srcPath.baseClass,
923
+ myBatisPath: srcPath.mybatis,
924
+ namespace: srcPath.namespace,
925
+ package: srcPath.package + ".service",
926
+ mybatisXmlSource: mybatisXmlSource,
927
+ });
928
+ //this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
929
+ progressMessageInstance.updateProgress('service', 'completed');
930
+ }
931
+ else {
932
+ serviceSrc = src.service;
933
+ }
934
+
935
+ let controllerSrc;
936
+ if (apply.controller) {
937
+ controllerSrc = await this.#generateTmplFile("/prompts/meta/U.BuildController.txt", "controller.java", {
938
+ userPrompt: userPrompt,
939
+ originSrc: src.controller,
940
+ baseClass: srcPath.baseClass,
941
+ menuUrl: where.menu.url,
942
+ package: srcPath.package + ".controller",
943
+ serviceSource: serviceSrc,
944
+ });
945
+ //this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
946
+ progressMessageInstance.updateProgress('controller', 'completed');
947
+ }
948
+ else {
949
+ controllerSrc = src.controller;
950
+ }
951
+
952
+ console.log("=---------", src.javascript2);
953
+
954
+ let jsSrcFrom;
955
+ let jsSrcTo;
956
+ if (apply.javascript) {
957
+ jsSrcTo = await this.#generateTmplFile("/prompts/meta/detail/4.BuildReactJsx_Detail.txt", "reactTo.jsx", {
958
+ userPrompt: userPrompt,
959
+ mybatis: srcPath.mybatis,
960
+ originSrc: src.javascriptFrom,
961
+ menuUrl: where.menu.url,
962
+ menuName: where.menu.name,
963
+ baseClass: srcPath.baseClass,
964
+ classFrom: srcPath.classFrom,
965
+ classTo: srcPath.classTo,
966
+ index: srcPath.index,
967
+ mybatisXmlSource: mybatisXmlSource,
968
+ controllerSource: controllerSrc,
969
+ tableDefinitions: JSON.stringify(columnInfo),
970
+ });
971
+ //this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
972
+ progressMessageInstance.updateProgress('javascript', 'completed');
973
+ }
974
+ else {
975
+ jsSrcTo = src.javascriptTo;
976
+ }
977
+
978
+ //await this.#generateRealFile(srcPath, apply);
979
+
980
+ const returnSrc = [];
981
+
982
+ const mapping = {
983
+ mybatis: {
984
+ path: srcPath.mybatisPullPath,
985
+ src: mybatisXmlSource,
986
+ },
987
+ service: {
988
+ path: srcPath.servicePullPath,
989
+ src: serviceSrc,
990
+ },
991
+ controller: {
992
+ path: srcPath.controllerPullPath,
993
+ src: controllerSrc,
994
+ },
995
+ javascript: {
996
+ path: srcPath.javascriptToPullPath,
997
+ src: jsSrcTo,
998
+ },
999
+ javascript2: {
1000
+ path: srcPath.javascriptFromPullPath,
1001
+ src: jsSrcFrom,
1002
+ },
1003
+ };
1004
+
1005
+ //console.log(srcPath.javascriptToPullPath, jsSrcTo);
1006
+
1007
+ if (apply.javascript) {
1008
+ apply.javascript2 = true;
1009
+ }
1010
+
1011
+ //console.log(apply);
1012
+
1013
+ for (const key in apply) {
1014
+ if (apply[key]) {
1015
+ returnSrc.push({
1016
+ [key]: {
1017
+ asis: src[key],
1018
+ tobe: mapping[key].src,
1019
+ tobePath: mapping[key].path,
1020
+ }
1021
+ });
1022
+ }
1023
+ }
1024
+
1025
+ console.log(returnSrc);
1026
+
1027
+ return returnSrc;
1028
+ };
1029
+
875
1030
  generateSourceClient = async (userPrompt, apply) => {
876
1031
 
877
1032
  this.#createModel();
@@ -966,7 +1121,15 @@ console.log(el, href, title);
966
1121
  return await this.#generateDetailSource(userPrompt, apply, progressMessageInstance);
967
1122
  }
968
1123
  else if (what === "U1") {
969
- return await this.#modifySource(userPrompt, apply, progressMessageInstance);
1124
+ // .list-wrapper 또는 .detail-wrapper-* 중에서 .active 클래스를 가진 첫 번째 요소를 찾습니다.
1125
+ const el = document.querySelector(".list-wrapper.active");
1126
+ console.log("================", el);
1127
+ if (el) {
1128
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
1129
+ }
1130
+ else {
1131
+ return await this.#modifyDetailSource(userPrompt, apply, progressMessageInstance);
1132
+ }
970
1133
  }
971
1134
  }
972
1135
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ide-assi",
3
3
  "type": "module",
4
- "version": "0.633.0",
4
+ "version": "0.635.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {
@@ -872,6 +872,161 @@ console.log(el, href, title);
872
872
  return returnSrc;
873
873
  };
874
874
 
875
+ #modifyDetailSource = async (userPrompt, apply, progressMessageInstance) => {
876
+
877
+ const el = ninegrid.querySelector("nx-side-menu-item.active");
878
+ if (!el) throw new Error("관련 메뉴를 찾을 수 없습니다.");
879
+
880
+ const href = el.getAttribute("href");
881
+ const title = el.getAttribute("title");
882
+
883
+ //console.log(el, href, title);
884
+
885
+ const srcPath = this.#getSourcePath(href);
886
+ console.log(srcPath);
887
+
888
+ const src = await api.post("/api/source/read", srcPath);
889
+
890
+ const where = await this.#where(`${title}에서 ${userPrompt}`, [{url: href, title: title}], await this.#getTableList());
891
+ //this.#parent.addMessage("대상 메뉴와 테이블을 찾았습니다.");
892
+ progressMessageInstance.updateProgress('prepare2', 'completed');
893
+
894
+ console.log(where);
895
+
896
+ //const srcPath = this.#getSourcePath(where.menu.url);
897
+ console.log(srcPath);
898
+
899
+ const columnInfo = await this.#getColumnInfo(where.table);
900
+
901
+ let mybatisXmlSource;
902
+ if (apply.mybatis) {
903
+ mybatisXmlSource = await this.#generateTmplFile("/prompts/meta/U.BuildMyBatisMapper.txt", "mybatis.xml", {
904
+ userPrompt: userPrompt,
905
+ originSrc: src.mybatis,
906
+ resultType: srcPath.resultType,
907
+ namespace: srcPath.namespace,
908
+ tableDefinitions: JSON.stringify(columnInfo),
909
+ });
910
+ //this.#parent.addMessage("MyBatis 소스파일을 생성했습니다.");
911
+ progressMessageInstance.updateProgress('mybatis', 'completed');
912
+ }
913
+ else {
914
+ mybatisXmlSource = src.mybatis;
915
+ }
916
+
917
+ let serviceSrc;
918
+ if (apply.service) {
919
+ serviceSrc = await this.#generateTmplFile("/prompts/meta/U.BuildService.txt", "service.java", {
920
+ userPrompt: userPrompt,
921
+ originSrc: src.service,
922
+ baseClass: srcPath.baseClass,
923
+ myBatisPath: srcPath.mybatis,
924
+ namespace: srcPath.namespace,
925
+ package: srcPath.package + ".service",
926
+ mybatisXmlSource: mybatisXmlSource,
927
+ });
928
+ //this.#parent.addMessage("Java(Service) 소스파일을 생성했습니다.");
929
+ progressMessageInstance.updateProgress('service', 'completed');
930
+ }
931
+ else {
932
+ serviceSrc = src.service;
933
+ }
934
+
935
+ let controllerSrc;
936
+ if (apply.controller) {
937
+ controllerSrc = await this.#generateTmplFile("/prompts/meta/U.BuildController.txt", "controller.java", {
938
+ userPrompt: userPrompt,
939
+ originSrc: src.controller,
940
+ baseClass: srcPath.baseClass,
941
+ menuUrl: where.menu.url,
942
+ package: srcPath.package + ".controller",
943
+ serviceSource: serviceSrc,
944
+ });
945
+ //this.#parent.addMessage("Java(Controller) 소스파일을 생성했습니다.");
946
+ progressMessageInstance.updateProgress('controller', 'completed');
947
+ }
948
+ else {
949
+ controllerSrc = src.controller;
950
+ }
951
+
952
+ console.log("=---------", src.javascript2);
953
+
954
+ let jsSrcFrom;
955
+ let jsSrcTo;
956
+ if (apply.javascript) {
957
+ jsSrcTo = await this.#generateTmplFile("/prompts/meta/detail/4.BuildReactJsx_Detail.txt", "reactTo.jsx", {
958
+ userPrompt: userPrompt,
959
+ mybatis: srcPath.mybatis,
960
+ originSrc: src.javascriptFrom,
961
+ menuUrl: where.menu.url,
962
+ menuName: where.menu.name,
963
+ baseClass: srcPath.baseClass,
964
+ classFrom: srcPath.classFrom,
965
+ classTo: srcPath.classTo,
966
+ index: srcPath.index,
967
+ mybatisXmlSource: mybatisXmlSource,
968
+ controllerSource: controllerSrc,
969
+ tableDefinitions: JSON.stringify(columnInfo),
970
+ });
971
+ //this.#parent.addMessage("Jsx(React) 소스파일을 생성했습니다.");
972
+ progressMessageInstance.updateProgress('javascript', 'completed');
973
+ }
974
+ else {
975
+ jsSrcTo = src.javascriptTo;
976
+ }
977
+
978
+ //await this.#generateRealFile(srcPath, apply);
979
+
980
+ const returnSrc = [];
981
+
982
+ const mapping = {
983
+ mybatis: {
984
+ path: srcPath.mybatisPullPath,
985
+ src: mybatisXmlSource,
986
+ },
987
+ service: {
988
+ path: srcPath.servicePullPath,
989
+ src: serviceSrc,
990
+ },
991
+ controller: {
992
+ path: srcPath.controllerPullPath,
993
+ src: controllerSrc,
994
+ },
995
+ javascript: {
996
+ path: srcPath.javascriptToPullPath,
997
+ src: jsSrcTo,
998
+ },
999
+ javascript2: {
1000
+ path: srcPath.javascriptFromPullPath,
1001
+ src: jsSrcFrom,
1002
+ },
1003
+ };
1004
+
1005
+ //console.log(srcPath.javascriptToPullPath, jsSrcTo);
1006
+
1007
+ if (apply.javascript) {
1008
+ apply.javascript2 = true;
1009
+ }
1010
+
1011
+ //console.log(apply);
1012
+
1013
+ for (const key in apply) {
1014
+ if (apply[key]) {
1015
+ returnSrc.push({
1016
+ [key]: {
1017
+ asis: src[key],
1018
+ tobe: mapping[key].src,
1019
+ tobePath: mapping[key].path,
1020
+ }
1021
+ });
1022
+ }
1023
+ }
1024
+
1025
+ console.log(returnSrc);
1026
+
1027
+ return returnSrc;
1028
+ };
1029
+
875
1030
  generateSourceClient = async (userPrompt, apply) => {
876
1031
 
877
1032
  this.#createModel();
@@ -966,7 +1121,15 @@ console.log(el, href, title);
966
1121
  return await this.#generateDetailSource(userPrompt, apply, progressMessageInstance);
967
1122
  }
968
1123
  else if (what === "U1") {
969
- return await this.#modifySource(userPrompt, apply, progressMessageInstance);
1124
+ // .list-wrapper 또는 .detail-wrapper-* 중에서 .active 클래스를 가진 첫 번째 요소를 찾습니다.
1125
+ const el = document.querySelector(".list-wrapper.active");
1126
+ console.log("================", el);
1127
+ if (el) {
1128
+ return await this.#modifySource(userPrompt, apply, progressMessageInstance);
1129
+ }
1130
+ else {
1131
+ return await this.#modifyDetailSource(userPrompt, apply, progressMessageInstance);
1132
+ }
970
1133
  }
971
1134
  }
972
1135