From 355480cba3db43b2ede018d286e9e89619784e64 Mon Sep 17 00:00:00 2001 From: TrupleCPU Date: Sat, 30 Aug 2025 09:58:40 +0800 Subject: [PATCH 1/5] feat: implemented springboot activity --- Amaya_Springboot_Activity/HELP.md | 25 ++++++++++++++++++ .../target/classes/application.properties | 1 + .../com/example/demo/DemoApplication.class | Bin 0 -> 733 bytes .../demo/controller/StudentController.class | Bin 0 -> 3857 bytes .../com/example/demo/model/Student.class | Bin 0 -> 1187 bytes .../demo/services/StudentService.class | Bin 0 -> 732 bytes .../services/impl/StudentServiceImpl.class | Bin 0 -> 2730 bytes .../compile/default-compile/createdFiles.lst | 0 .../compile/default-compile/inputFiles.lst | 5 ++++ .../default-testCompile/createdFiles.lst | 0 .../default-testCompile/inputFiles.lst | 1 + .../example/demo/DemoApplicationTests.class | Bin 0 -> 531 bytes 12 files changed, 32 insertions(+) create mode 100644 Amaya_Springboot_Activity/HELP.md create mode 100644 Amaya_Springboot_Activity/target/classes/application.properties create mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/DemoApplication.class create mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/controller/StudentController.class create mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/model/Student.class create mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/services/StudentService.class create mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/services/impl/StudentServiceImpl.class create mode 100644 Amaya_Springboot_Activity/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 Amaya_Springboot_Activity/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 Amaya_Springboot_Activity/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst create mode 100644 Amaya_Springboot_Activity/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst create mode 100644 Amaya_Springboot_Activity/target/test-classes/com/example/demo/DemoApplicationTests.class diff --git a/Amaya_Springboot_Activity/HELP.md b/Amaya_Springboot_Activity/HELP.md new file mode 100644 index 0000000..b9e56e8 --- /dev/null +++ b/Amaya_Springboot_Activity/HELP.md @@ -0,0 +1,25 @@ +# Getting Started + +### Reference Documentation +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.5.5/maven-plugin) +* [Create an OCI image](https://docs.spring.io/spring-boot/3.5.5/maven-plugin/build-image.html) +* [Spring Web](https://docs.spring.io/spring-boot/3.5.5/reference/web/servlet.html) +* [Spring Boot DevTools](https://docs.spring.io/spring-boot/3.5.5/reference/using/devtools.html) + +### Guides +The following guides illustrate how to use some features concretely: + +* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) +* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) +* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/) + +### Maven Parent overrides + +Due to Maven's design, elements are inherited from the parent POM to the project POM. +While most of the inheritance is fine, it also inherits unwanted elements like `` and `` from the parent. +To prevent this, the project POM contains empty overrides for these elements. +If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides. + diff --git a/Amaya_Springboot_Activity/target/classes/application.properties b/Amaya_Springboot_Activity/target/classes/application.properties new file mode 100644 index 0000000..2109a44 --- /dev/null +++ b/Amaya_Springboot_Activity/target/classes/application.properties @@ -0,0 +1 @@ +spring.application.name=demo diff --git a/Amaya_Springboot_Activity/target/classes/com/example/demo/DemoApplication.class b/Amaya_Springboot_Activity/target/classes/com/example/demo/DemoApplication.class new file mode 100644 index 0000000000000000000000000000000000000000..699eb17e2ba433d7afbb69f5ace4222b27b03ff2 GIT binary patch literal 733 zcmah{OHbQC5dJnKID}9jP#!In3a5|*d*c#>M1y)V4-u3edRjY+S+IAb^_udxdIE9i z59p6V%o-%DDpD=aLVWwT9^;eZesx-7<$GgJfB#l zlPfDS`ODZ_9vS2Kuyj@`sf#T%L(~o5CmEz7&-*_so}u$#{oQaHa%{Ad_l^&YzEVkH zMU=`)3v&B#pP@c5W67`>DlJcoERy!p=Q4Cc6N_{ttn&7ov+k}{&ae~y@AV!z6N+B3 z)}1!=h~mN~gtamyOglJ{?%Isch3CpiONp(aDQqmiD?i=pKWy)LrWiIa3hh)TM=DqT z#abIzZiDI%rxI1JKorgpV31Gu^>XzmaYi2NZMjs-U2DD4ORsOH`&{CA=!<)8?fUz z{t5knzd~mm6hHV`{Y{MHvoG0hNsxun51HM2_nvc}^PK0Nd-K=dzx@ti5%)4kpeKc7 z7QN^b7`&%GP?frB)RfiAJy~@G`sQ>)cNPSC#`7B)>_Iw(Ocr~Q6*ys9HN|dPx>4J- z)P{U$TKAPL$7w3-(r%iDEiW04?rhVG?Wj)67C1Lv%$H)C9a}QB?WLAp*Q8ZQV*vY7 z7|db_If0W^v!TeZ)JC%|6-_owrD__EW!CG`Qp!$ClZLY#&Isgef37U82YOW&X(w>H z)ZxYUzuSt=6>Ucmqe2EFcrAs|EMCVO0;gWugTO#dI*avsfRd!-#`7hQ`Ie*Cm6C2d zg}pd{gDD)!;!PYT(pR8NAXy=S0`ud(_efm}v5Vj(JeI`~9QBb0u$Q)rn!xd>>yl~I z=y)fS)uyAHhFYhOV|XWp<5`@*IP>jXB9PYYHA~v8o2Ru~doaP3L9{W$bjCK#mZ43% z1(?d>B&G#2s-^`i1eV4-%h@nB8J3aQI;ypMf$RI-EKcD)f&NxgQym$)U++luMc!hC zJCns(%rG2*%1F53j&ONWa*lhnO^I)yk%s;2E$*|1+|X^kQkRPc*-~BV-3`}uw^gKS z*vh6_bxdnpQ9}b|vE`T#bxUdm%4eDE3G6HBhP=^gRHSuNrF&MTWLDMshHB~VIG9X2 zTRP(@ovi%Z&SaQLsz0W@xjJ3eYX*CXMI3kITh2vf>29#OPMEu;uuxcFv@>0iJ(Lxt zq8nP2xGU0GQJYP+LYnnHQ0pxMOe?nEc1TR2v!Gp_cj=$>n9#Y~1|$2}+iU`& zamv@a_Km>N-4YLj?b7;8S3oHnKe2I>|NLvDp|1Myxnw^c$jA=)N z9N%tTe%X??;~v>0bjWX>MPt*n8eS_BxZNR&7xDBmeIe;?1PaFwymKnt`TwH&QjOmt z)>;u}``eu%5codtbXzpEi{3fFRKzWT)eiKrISD$Rcj%WL_m1XuwAt87@PX_!wM^M; zSyg#icaMP4^0RlWY4=cn-g(n)5Au!}xuQ`t-H)p7rk>b#uq73>sS9L_h9Rxxx@y~! zZD?=g0?7-^057`$d#QVc#a}un0JWdA?`; z1z5lZjs$OmAE3uGp66=Ucz6hZ{EF1X&**=Q;V0Oiz>l1cx;hqdH5|BF^wunS=mzL$ znZJv-A#7aY+YwymRo%t-Jw5gCIq3$Ne2lkNrXJ(%M;P?OPWb_c#CODy%ZK5UUM4vt zX_`kGlNiJlFPVx5Wz2UOK%sM7!BvJ$<0y)_#*o)(=jQIulsL1(nLQ9s@n(wGyc-<# z3Yxk9FWhWbyJWJ45BV+SlDy6rUguE`(z;3nZka}g@Mpjtlba0jN9mjKFpv7{L(C&Y zdXqi_Bt<&&k$e;)+2H3kry-J$JtUvt(*Vg6BI)JaY@6U4CrR)R7~0LL_m$Ku=aWA3 z`;#G9pX^c3%^WFPAlVmi7)zx7q6hwrA0h-l8xYR0UK$BnP2(1+@1e~AZZoxHqzLY} z62FB-INUBmI^h*zC;iXD^gj>NzvC66-xaK12%m(rp~}7`xvt9c0STw)4?Q9Sp0abZ z&(T;c#u+XcaE>Ie3)`R)YusA;tK|Jli^l;ii2Slcl4x&X;i{Ap3zee ds`QY6<}J(>$F0WyW;|#|Ks9e1-{SR`FB1QlJ literal 0 HcmV?d00001 diff --git a/Amaya_Springboot_Activity/target/classes/com/example/demo/model/Student.class b/Amaya_Springboot_Activity/target/classes/com/example/demo/model/Student.class new file mode 100644 index 0000000000000000000000000000000000000000..09abf42324bcca8d73bc24361a50f40c48589884 GIT binary patch literal 1187 zcmaKreQ(lG6vm%h3JfT0LqIom>_s=I(SCrLC1%D%f^!Lm{|nr(P6`VYZj z`~ZF^<8xYG7GS2yed~FC_nhanfBydZ4d4w<(l8K9!n6=aLSgIL{o*=3x8HR>wyt$M zP)NM?`d)CR5UW(1DQqB>MA||Imcm|p;5+)O>)-UW)6xFG@dq8k1EU!?huEG>j3^<=wmK!ZG%t}qJOY%H|6f3I?iAXVGMoBk_YwLHO zcw$Xme_v50FDLj9L|b!-2MsmBMd8Yl-EECC5~1U zfQNX*orre`6|v82;+%^jw#ySF?Uxf|?HzN1?FFn924!Fpl|mLdJ_TkaaGR$DOyRPU ztmX1zn0G8(N#-VYxz5HI0KNjh8Oi1`o^XsxF+yS7zD4pIUm9f0O3AM+6g=_M=f>*>*4hf}jpO`z9m^vk{#QFPi zQaHrX9BV`Z`vqIFj6Edw=pL+mE-EyeSTS1R*?R1q9!J?86MJ$GR(d$cM!kDZxPjw; Dx=g5& literal 0 HcmV?d00001 diff --git a/Amaya_Springboot_Activity/target/classes/com/example/demo/services/StudentService.class b/Amaya_Springboot_Activity/target/classes/com/example/demo/services/StudentService.class new file mode 100644 index 0000000000000000000000000000000000000000..28e7fe096cf953e08ab0ebbd122a73abb8581d20 GIT binary patch literal 732 zcma)4%TB{E5S$H^&_YXTdHextFXY0l2&p|Fkb;WHjhl(BkjhD_#HrxdIPd{{6k_wB zAmz}W?A;yDjCc3z`{NV96z4W9!pKh|N4<$?sg)yDlsK76SD~*m$1}N9vGJ?e5)S#ON?k7XaKzBM)JL&x Y#~9S9wpF65^bjY1$by7$S}L6V09(G!7XSbN literal 0 HcmV?d00001 diff --git a/Amaya_Springboot_Activity/target/classes/com/example/demo/services/impl/StudentServiceImpl.class b/Amaya_Springboot_Activity/target/classes/com/example/demo/services/impl/StudentServiceImpl.class new file mode 100644 index 0000000000000000000000000000000000000000..0ef971f462ee1f896373d7903d077e860e9d1a04 GIT binary patch literal 2730 zcma)8T~iZR7=BKIEC~xpP(G{*Sfxn-;|HyjP%WSoXb6W2#?6N6MX&l7 zdgX8MLT4&!o$2(VV`uuCoKBy!yM%tG{{AsJNOD>E(6T00()Hsr6}NGRIHd~x7(aqjO%;7R zj&MjOn^G~28TJb~rnLekp4qRL>u<)f4K_>|_b{vA3l(#iuiF@20PC$ktY{|def9`C zu{D|NOBE?BG8ct;x$0v5RI#j#T~e_ud4p`&qV8;2`DM*!TRFN-c5}6@aV)@l zkqc}2yiZPGI(m|x*hvAhE4|ZJVBqB7wv40YcGw|)727JMyyoatMk@_UPr`f;h8_AN z7L?nunx>6s8NIE3cQvGqt?>lQa0BJ^Swo&+J$`V_O>Py8V4c9l zk+(SQ&)g5-LDSRV(<uRHFY;xvRUol@+5fh2l%7J zNvt5~!5rRX-pqTM%=^dd8-M{eo2a1LK&_1>)ET-n@hEsI^pxMkGnqJs`l-^&oiSAR z_Qwq@GwdWL<8m&tJe7PRGs7*UL^x&iNEWVOs9l(eWavan%j+_Wr5%YlC8igd zM5JS3mCqMs&D|>!?MDA{KVfJmMmsrokr5LT_HRq=R3^u&P~ Date: Sat, 30 Aug 2025 10:07:37 +0800 Subject: [PATCH 2/5] Delete Amaya_Springboot_Activity directory --- Amaya_Springboot_Activity/HELP.md | 25 ------------------ .../target/classes/application.properties | 1 - .../com/example/demo/DemoApplication.class | Bin 733 -> 0 bytes .../demo/controller/StudentController.class | Bin 3857 -> 0 bytes .../com/example/demo/model/Student.class | Bin 1187 -> 0 bytes .../demo/services/StudentService.class | Bin 732 -> 0 bytes .../services/impl/StudentServiceImpl.class | Bin 2730 -> 0 bytes .../compile/default-compile/createdFiles.lst | 0 .../compile/default-compile/inputFiles.lst | 5 ---- .../default-testCompile/createdFiles.lst | 0 .../default-testCompile/inputFiles.lst | 1 - .../example/demo/DemoApplicationTests.class | Bin 531 -> 0 bytes 12 files changed, 32 deletions(-) delete mode 100644 Amaya_Springboot_Activity/HELP.md delete mode 100644 Amaya_Springboot_Activity/target/classes/application.properties delete mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/DemoApplication.class delete mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/controller/StudentController.class delete mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/model/Student.class delete mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/services/StudentService.class delete mode 100644 Amaya_Springboot_Activity/target/classes/com/example/demo/services/impl/StudentServiceImpl.class delete mode 100644 Amaya_Springboot_Activity/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst delete mode 100644 Amaya_Springboot_Activity/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst delete mode 100644 Amaya_Springboot_Activity/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst delete mode 100644 Amaya_Springboot_Activity/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst delete mode 100644 Amaya_Springboot_Activity/target/test-classes/com/example/demo/DemoApplicationTests.class diff --git a/Amaya_Springboot_Activity/HELP.md b/Amaya_Springboot_Activity/HELP.md deleted file mode 100644 index b9e56e8..0000000 --- a/Amaya_Springboot_Activity/HELP.md +++ /dev/null @@ -1,25 +0,0 @@ -# Getting Started - -### Reference Documentation -For further reference, please consider the following sections: - -* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) -* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/3.5.5/maven-plugin) -* [Create an OCI image](https://docs.spring.io/spring-boot/3.5.5/maven-plugin/build-image.html) -* [Spring Web](https://docs.spring.io/spring-boot/3.5.5/reference/web/servlet.html) -* [Spring Boot DevTools](https://docs.spring.io/spring-boot/3.5.5/reference/using/devtools.html) - -### Guides -The following guides illustrate how to use some features concretely: - -* [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) -* [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) -* [Building REST services with Spring](https://spring.io/guides/tutorials/rest/) - -### Maven Parent overrides - -Due to Maven's design, elements are inherited from the parent POM to the project POM. -While most of the inheritance is fine, it also inherits unwanted elements like `` and `` from the parent. -To prevent this, the project POM contains empty overrides for these elements. -If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides. - diff --git a/Amaya_Springboot_Activity/target/classes/application.properties b/Amaya_Springboot_Activity/target/classes/application.properties deleted file mode 100644 index 2109a44..0000000 --- a/Amaya_Springboot_Activity/target/classes/application.properties +++ /dev/null @@ -1 +0,0 @@ -spring.application.name=demo diff --git a/Amaya_Springboot_Activity/target/classes/com/example/demo/DemoApplication.class b/Amaya_Springboot_Activity/target/classes/com/example/demo/DemoApplication.class deleted file mode 100644 index 699eb17e2ba433d7afbb69f5ace4222b27b03ff2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 733 zcmah{OHbQC5dJnKID}9jP#!In3a5|*d*c#>M1y)V4-u3edRjY+S+IAb^_udxdIE9i z59p6V%o-%DDpD=aLVWwT9^;eZesx-7<$GgJfB#l zlPfDS`ODZ_9vS2Kuyj@`sf#T%L(~o5CmEz7&-*_so}u$#{oQaHa%{Ad_l^&YzEVkH zMU=`)3v&B#pP@c5W67`>DlJcoERy!p=Q4Cc6N_{ttn&7ov+k}{&ae~y@AV!z6N+B3 z)}1!=h~mN~gtamyOglJ{?%Isch3CpiONp(aDQqmiD?i=pKWy)LrWiIa3hh)TM=DqT z#abIzZiDI%rxI1JKorgpV31Gu^>XzmaYi2NZMjs-U2DD4ORsOH`&{CA=!<)8?fUz z{t5knzd~mm6hHV`{Y{MHvoG0hNsxun51HM2_nvc}^PK0Nd-K=dzx@ti5%)4kpeKc7 z7QN^b7`&%GP?frB)RfiAJy~@G`sQ>)cNPSC#`7B)>_Iw(Ocr~Q6*ys9HN|dPx>4J- z)P{U$TKAPL$7w3-(r%iDEiW04?rhVG?Wj)67C1Lv%$H)C9a}QB?WLAp*Q8ZQV*vY7 z7|db_If0W^v!TeZ)JC%|6-_owrD__EW!CG`Qp!$ClZLY#&Isgef37U82YOW&X(w>H z)ZxYUzuSt=6>Ucmqe2EFcrAs|EMCVO0;gWugTO#dI*avsfRd!-#`7hQ`Ie*Cm6C2d zg}pd{gDD)!;!PYT(pR8NAXy=S0`ud(_efm}v5Vj(JeI`~9QBb0u$Q)rn!xd>>yl~I z=y)fS)uyAHhFYhOV|XWp<5`@*IP>jXB9PYYHA~v8o2Ru~doaP3L9{W$bjCK#mZ43% z1(?d>B&G#2s-^`i1eV4-%h@nB8J3aQI;ypMf$RI-EKcD)f&NxgQym$)U++luMc!hC zJCns(%rG2*%1F53j&ONWa*lhnO^I)yk%s;2E$*|1+|X^kQkRPc*-~BV-3`}uw^gKS z*vh6_bxdnpQ9}b|vE`T#bxUdm%4eDE3G6HBhP=^gRHSuNrF&MTWLDMshHB~VIG9X2 zTRP(@ovi%Z&SaQLsz0W@xjJ3eYX*CXMI3kITh2vf>29#OPMEu;uuxcFv@>0iJ(Lxt zq8nP2xGU0GQJYP+LYnnHQ0pxMOe?nEc1TR2v!Gp_cj=$>n9#Y~1|$2}+iU`& zamv@a_Km>N-4YLj?b7;8S3oHnKe2I>|NLvDp|1Myxnw^c$jA=)N z9N%tTe%X??;~v>0bjWX>MPt*n8eS_BxZNR&7xDBmeIe;?1PaFwymKnt`TwH&QjOmt z)>;u}``eu%5codtbXzpEi{3fFRKzWT)eiKrISD$Rcj%WL_m1XuwAt87@PX_!wM^M; zSyg#icaMP4^0RlWY4=cn-g(n)5Au!}xuQ`t-H)p7rk>b#uq73>sS9L_h9Rxxx@y~! zZD?=g0?7-^057`$d#QVc#a}un0JWdA?`; z1z5lZjs$OmAE3uGp66=Ucz6hZ{EF1X&**=Q;V0Oiz>l1cx;hqdH5|BF^wunS=mzL$ znZJv-A#7aY+YwymRo%t-Jw5gCIq3$Ne2lkNrXJ(%M;P?OPWb_c#CODy%ZK5UUM4vt zX_`kGlNiJlFPVx5Wz2UOK%sM7!BvJ$<0y)_#*o)(=jQIulsL1(nLQ9s@n(wGyc-<# z3Yxk9FWhWbyJWJ45BV+SlDy6rUguE`(z;3nZka}g@Mpjtlba0jN9mjKFpv7{L(C&Y zdXqi_Bt<&&k$e;)+2H3kry-J$JtUvt(*Vg6BI)JaY@6U4CrR)R7~0LL_m$Ku=aWA3 z`;#G9pX^c3%^WFPAlVmi7)zx7q6hwrA0h-l8xYR0UK$BnP2(1+@1e~AZZoxHqzLY} z62FB-INUBmI^h*zC;iXD^gj>NzvC66-xaK12%m(rp~}7`xvt9c0STw)4?Q9Sp0abZ z&(T;c#u+XcaE>Ie3)`R)YusA;tK|Jli^l;ii2Slcl4x&X;i{Ap3zee ds`QY6<}J(>$F0WyW;|#|Ks9e1-{SR`FB1QlJ diff --git a/Amaya_Springboot_Activity/target/classes/com/example/demo/model/Student.class b/Amaya_Springboot_Activity/target/classes/com/example/demo/model/Student.class deleted file mode 100644 index 09abf42324bcca8d73bc24361a50f40c48589884..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1187 zcmaKreQ(lG6vm%h3JfT0LqIom>_s=I(SCrLC1%D%f^!Lm{|nr(P6`VYZj z`~ZF^<8xYG7GS2yed~FC_nhanfBydZ4d4w<(l8K9!n6=aLSgIL{o*=3x8HR>wyt$M zP)NM?`d)CR5UW(1DQqB>MA||Imcm|p;5+)O>)-UW)6xFG@dq8k1EU!?huEG>j3^<=wmK!ZG%t}qJOY%H|6f3I?iAXVGMoBk_YwLHO zcw$Xme_v50FDLj9L|b!-2MsmBMd8Yl-EECC5~1U zfQNX*orre`6|v82;+%^jw#ySF?Uxf|?HzN1?FFn924!Fpl|mLdJ_TkaaGR$DOyRPU ztmX1zn0G8(N#-VYxz5HI0KNjh8Oi1`o^XsxF+yS7zD4pIUm9f0O3AM+6g=_M=f>*>*4hf}jpO`z9m^vk{#QFPi zQaHrX9BV`Z`vqIFj6Edw=pL+mE-EyeSTS1R*?R1q9!J?86MJ$GR(d$cM!kDZxPjw; Dx=g5& diff --git a/Amaya_Springboot_Activity/target/classes/com/example/demo/services/StudentService.class b/Amaya_Springboot_Activity/target/classes/com/example/demo/services/StudentService.class deleted file mode 100644 index 28e7fe096cf953e08ab0ebbd122a73abb8581d20..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 732 zcma)4%TB{E5S$H^&_YXTdHextFXY0l2&p|Fkb;WHjhl(BkjhD_#HrxdIPd{{6k_wB zAmz}W?A;yDjCc3z`{NV96z4W9!pKh|N4<$?sg)yDlsK76SD~*m$1}N9vGJ?e5)S#ON?k7XaKzBM)JL&x Y#~9S9wpF65^bjY1$by7$S}L6V09(G!7XSbN diff --git a/Amaya_Springboot_Activity/target/classes/com/example/demo/services/impl/StudentServiceImpl.class b/Amaya_Springboot_Activity/target/classes/com/example/demo/services/impl/StudentServiceImpl.class deleted file mode 100644 index 0ef971f462ee1f896373d7903d077e860e9d1a04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2730 zcma)8T~iZR7=BKIEC~xpP(G{*Sfxn-;|HyjP%WSoXb6W2#?6N6MX&l7 zdgX8MLT4&!o$2(VV`uuCoKBy!yM%tG{{AsJNOD>E(6T00()Hsr6}NGRIHd~x7(aqjO%;7R zj&MjOn^G~28TJb~rnLekp4qRL>u<)f4K_>|_b{vA3l(#iuiF@20PC$ktY{|def9`C zu{D|NOBE?BG8ct;x$0v5RI#j#T~e_ud4p`&qV8;2`DM*!TRFN-c5}6@aV)@l zkqc}2yiZPGI(m|x*hvAhE4|ZJVBqB7wv40YcGw|)727JMyyoatMk@_UPr`f;h8_AN z7L?nunx>6s8NIE3cQvGqt?>lQa0BJ^Swo&+J$`V_O>Py8V4c9l zk+(SQ&)g5-LDSRV(<uRHFY;xvRUol@+5fh2l%7J zNvt5~!5rRX-pqTM%=^dd8-M{eo2a1LK&_1>)ET-n@hEsI^pxMkGnqJs`l-^&oiSAR z_Qwq@GwdWL<8m&tJe7PRGs7*UL^x&iNEWVOs9l(eWavan%j+_Wr5%YlC8igd zM5JS3mCqMs&D|>!?MDA{KVfJmMmsrokr5LT_HRq=R3^u&P~ Date: Sat, 30 Aug 2025 10:29:37 +0800 Subject: [PATCH 3/5] feat: implemented springboot activity --- Amaya_SpringBoot_Activity/.gitattributes | 2 + Amaya_SpringBoot_Activity/.gitignore | 33 +++ .../.mvn/wrapper/maven-wrapper.properties | 19 ++ Amaya_SpringBoot_Activity/mvnw | 259 ++++++++++++++++++ Amaya_SpringBoot_Activity/mvnw.cmd | 149 ++++++++++ Amaya_SpringBoot_Activity/pom.xml | 60 ++++ .../com/example/demo/DemoApplication.java | 13 + .../demo/controller/StudentController.java | 61 +++++ .../java/com/example/demo/model/Student.java | 40 +++ .../example/demo/services/StudentService.java | 18 ++ .../services/impl/StudentServiceImpl.java | 72 +++++ .../src/main/resources/application.properties | 1 + .../example/demo/DemoApplicationTests.java | 13 + 13 files changed, 740 insertions(+) create mode 100644 Amaya_SpringBoot_Activity/.gitattributes create mode 100644 Amaya_SpringBoot_Activity/.gitignore create mode 100644 Amaya_SpringBoot_Activity/.mvn/wrapper/maven-wrapper.properties create mode 100755 Amaya_SpringBoot_Activity/mvnw create mode 100644 Amaya_SpringBoot_Activity/mvnw.cmd create mode 100644 Amaya_SpringBoot_Activity/pom.xml create mode 100644 Amaya_SpringBoot_Activity/src/main/java/com/example/demo/DemoApplication.java create mode 100644 Amaya_SpringBoot_Activity/src/main/java/com/example/demo/controller/StudentController.java create mode 100644 Amaya_SpringBoot_Activity/src/main/java/com/example/demo/model/Student.java create mode 100644 Amaya_SpringBoot_Activity/src/main/java/com/example/demo/services/StudentService.java create mode 100644 Amaya_SpringBoot_Activity/src/main/java/com/example/demo/services/impl/StudentServiceImpl.java create mode 100644 Amaya_SpringBoot_Activity/src/main/resources/application.properties create mode 100644 Amaya_SpringBoot_Activity/src/test/java/com/example/demo/DemoApplicationTests.java diff --git a/Amaya_SpringBoot_Activity/.gitattributes b/Amaya_SpringBoot_Activity/.gitattributes new file mode 100644 index 0000000..3b41682 --- /dev/null +++ b/Amaya_SpringBoot_Activity/.gitattributes @@ -0,0 +1,2 @@ +/mvnw text eol=lf +*.cmd text eol=crlf diff --git a/Amaya_SpringBoot_Activity/.gitignore b/Amaya_SpringBoot_Activity/.gitignore new file mode 100644 index 0000000..667aaef --- /dev/null +++ b/Amaya_SpringBoot_Activity/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/Amaya_SpringBoot_Activity/.mvn/wrapper/maven-wrapper.properties b/Amaya_SpringBoot_Activity/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 0000000..12fbe1e --- /dev/null +++ b/Amaya_SpringBoot_Activity/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +wrapperVersion=3.3.2 +distributionType=only-script +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.11/apache-maven-3.9.11-bin.zip diff --git a/Amaya_SpringBoot_Activity/mvnw b/Amaya_SpringBoot_Activity/mvnw new file mode 100755 index 0000000..19529dd --- /dev/null +++ b/Amaya_SpringBoot_Activity/mvnw @@ -0,0 +1,259 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Apache Maven Wrapper startup batch script, version 3.3.2 +# +# Optional ENV vars +# ----------------- +# JAVA_HOME - location of a JDK home dir, required when download maven via java source +# MVNW_REPOURL - repo url base for downloading maven distribution +# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output +# ---------------------------------------------------------------------------- + +set -euf +[ "${MVNW_VERBOSE-}" != debug ] || set -x + +# OS specific support. +native_path() { printf %s\\n "$1"; } +case "$(uname)" in +CYGWIN* | MINGW*) + [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")" + native_path() { cygpath --path --windows "$1"; } + ;; +esac + +# set JAVACMD and JAVACCMD +set_java_home() { + # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched + if [ -n "${JAVA_HOME-}" ]; then + if [ -x "$JAVA_HOME/jre/sh/java" ]; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACCMD="$JAVA_HOME/jre/sh/javac" + else + JAVACMD="$JAVA_HOME/bin/java" + JAVACCMD="$JAVA_HOME/bin/javac" + + if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then + echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2 + echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2 + return 1 + fi + fi + else + JAVACMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v java + )" || : + JAVACCMD="$( + 'set' +e + 'unset' -f command 2>/dev/null + 'command' -v javac + )" || : + + if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then + echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2 + return 1 + fi + fi +} + +# hash string like Java String::hashCode +hash_string() { + str="${1:-}" h=0 + while [ -n "$str" ]; do + char="${str%"${str#?}"}" + h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296)) + str="${str#?}" + done + printf %x\\n $h +} + +verbose() { :; } +[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; } + +die() { + printf %s\\n "$1" >&2 + exit 1 +} + +trim() { + # MWRAPPER-139: + # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds. + # Needed for removing poorly interpreted newline sequences when running in more + # exotic environments such as mingw bash on Windows. + printf "%s" "${1}" | tr -d '[:space:]' +} + +# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties +while IFS="=" read -r key value; do + case "${key-}" in + distributionUrl) distributionUrl=$(trim "${value-}") ;; + distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;; + esac +done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties" +[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties" + +case "${distributionUrl##*/}" in +maven-mvnd-*bin.*) + MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ + case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in + *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;; + :Darwin*x86_64) distributionPlatform=darwin-amd64 ;; + :Darwin*arm64) distributionPlatform=darwin-aarch64 ;; + :Linux*x86_64*) distributionPlatform=linux-amd64 ;; + *) + echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2 + distributionPlatform=linux-amd64 + ;; + esac + distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip" + ;; +maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;; +*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;; +esac + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}" +distributionUrlName="${distributionUrl##*/}" +distributionUrlNameMain="${distributionUrlName%.*}" +distributionUrlNameMain="${distributionUrlNameMain%-bin}" +MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}" +MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")" + +exec_maven() { + unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || : + exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD" +} + +if [ -d "$MAVEN_HOME" ]; then + verbose "found existing MAVEN_HOME at $MAVEN_HOME" + exec_maven "$@" +fi + +case "${distributionUrl-}" in +*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;; +*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;; +esac + +# prepare tmp dir +if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then + clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; } + trap clean HUP INT TERM EXIT +else + die "cannot create temp dir" +fi + +mkdir -p -- "${MAVEN_HOME%/*}" + +# Download and Install Apache Maven +verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +verbose "Downloading from: $distributionUrl" +verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +# select .zip or .tar.gz +if ! command -v unzip >/dev/null; then + distributionUrl="${distributionUrl%.zip}.tar.gz" + distributionUrlName="${distributionUrl##*/}" +fi + +# verbose opt +__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR='' +[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v + +# normalize http auth +case "${MVNW_PASSWORD:+has-password}" in +'') MVNW_USERNAME='' MVNW_PASSWORD='' ;; +has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;; +esac + +if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then + verbose "Found wget ... using wget" + wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl" +elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then + verbose "Found curl ... using curl" + curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl" +elif set_java_home; then + verbose "Falling back to use Java to download" + javaSource="$TMP_DOWNLOAD_DIR/Downloader.java" + targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName" + cat >"$javaSource" <<-END + public class Downloader extends java.net.Authenticator + { + protected java.net.PasswordAuthentication getPasswordAuthentication() + { + return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() ); + } + public static void main( String[] args ) throws Exception + { + setDefault( new Downloader() ); + java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() ); + } + } + END + # For Cygwin/MinGW, switch paths to Windows format before running javac and java + verbose " - Compiling Downloader.java ..." + "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java" + verbose " - Running Downloader.java ..." + "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")" +fi + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +if [ -n "${distributionSha256Sum-}" ]; then + distributionSha256Result=false + if [ "$MVN_CMD" = mvnd.sh ]; then + echo "Checksum validation is not supported for maven-mvnd." >&2 + echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + elif command -v sha256sum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + elif command -v shasum >/dev/null; then + if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then + distributionSha256Result=true + fi + else + echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2 + echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2 + exit 1 + fi + if [ $distributionSha256Result = false ]; then + echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2 + echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2 + exit 1 + fi +fi + +# unzip and move +if command -v unzip >/dev/null; then + unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip" +else + tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar" +fi +printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url" +mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME" + +clean || : +exec_maven "$@" diff --git a/Amaya_SpringBoot_Activity/mvnw.cmd b/Amaya_SpringBoot_Activity/mvnw.cmd new file mode 100644 index 0000000..249bdf3 --- /dev/null +++ b/Amaya_SpringBoot_Activity/mvnw.cmd @@ -0,0 +1,149 @@ +<# : batch portion +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Apache Maven Wrapper startup batch script, version 3.3.2 +@REM +@REM Optional ENV vars +@REM MVNW_REPOURL - repo url base for downloading maven distribution +@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven +@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output +@REM ---------------------------------------------------------------------------- + +@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0) +@SET __MVNW_CMD__= +@SET __MVNW_ERROR__= +@SET __MVNW_PSMODULEP_SAVE=%PSModulePath% +@SET PSModulePath= +@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @( + IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B) +) +@SET PSModulePath=%__MVNW_PSMODULEP_SAVE% +@SET __MVNW_PSMODULEP_SAVE= +@SET __MVNW_ARG0_NAME__= +@SET MVNW_USERNAME= +@SET MVNW_PASSWORD= +@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*) +@echo Cannot start maven from wrapper >&2 && exit /b 1 +@GOTO :EOF +: end batch / begin powershell #> + +$ErrorActionPreference = "Stop" +if ($env:MVNW_VERBOSE -eq "true") { + $VerbosePreference = "Continue" +} + +# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties +$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl +if (!$distributionUrl) { + Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties" +} + +switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) { + "maven-mvnd-*" { + $USE_MVND = $true + $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip" + $MVN_CMD = "mvnd.cmd" + break + } + default { + $USE_MVND = $false + $MVN_CMD = $script -replace '^mvnw','mvn' + break + } +} + +# apply MVNW_REPOURL and calculate MAVEN_HOME +# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/ +if ($env:MVNW_REPOURL) { + $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" } + $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')" +} +$distributionUrlName = $distributionUrl -replace '^.*/','' +$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$','' +$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain" +if ($env:MAVEN_USER_HOME) { + $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain" +} +$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join '' +$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME" + +if (Test-Path -Path "$MAVEN_HOME" -PathType Container) { + Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME" + Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" + exit $? +} + +if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) { + Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl" +} + +# prepare tmp dir +$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile +$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir" +$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null +trap { + if ($TMP_DOWNLOAD_DIR.Exists) { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } + } +} + +New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null + +# Download and Install Apache Maven +Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..." +Write-Verbose "Downloading from: $distributionUrl" +Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName" + +$webclient = New-Object System.Net.WebClient +if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) { + $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD) +} +[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 +$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null + +# If specified, validate the SHA-256 sum of the Maven distribution zip file +$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum +if ($distributionSha256Sum) { + if ($USE_MVND) { + Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." + } + Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash + if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) { + Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property." + } +} + +# unzip and move +Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null +Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null +try { + Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null +} catch { + if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) { + Write-Error "fail to move MAVEN_HOME" + } +} finally { + try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null } + catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" } +} + +Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD" diff --git a/Amaya_SpringBoot_Activity/pom.xml b/Amaya_SpringBoot_Activity/pom.xml new file mode 100644 index 0000000..1597474 --- /dev/null +++ b/Amaya_SpringBoot_Activity/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.5.5 + + + com.example + demo + 0.0.1-SNAPSHOT + demo + Demo project for Spring Boot + + + + + + + + + + + + + + + 21 + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/DemoApplication.java b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/DemoApplication.java new file mode 100644 index 0000000..64b538a --- /dev/null +++ b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/DemoApplication.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class DemoApplication { + + public static void main(String[] args) { + SpringApplication.run(DemoApplication.class, args); + } + +} diff --git a/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/controller/StudentController.java b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/controller/StudentController.java new file mode 100644 index 0000000..f4cdc2e --- /dev/null +++ b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/controller/StudentController.java @@ -0,0 +1,61 @@ +package com.example.demo.controller; + +import java.util.List; +import java.util.Optional; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.example.demo.model.Student; +import com.example.demo.services.impl.StudentServiceImpl; + +@RestController +@RequestMapping({"/api"}) +public class StudentController { + @Autowired + private StudentServiceImpl studentServiceImpl; + + public StudentController() { + } + + @GetMapping({"/students"}) + public ResponseEntity> getAllStudents() { + return ResponseEntity.status(200).body(this.studentServiceImpl.getAllStudents()); + } + + @GetMapping({"/students/{id}"}) + public ResponseEntity getStudentById(@PathVariable Long id) { + Optional student = this.studentServiceImpl.getStudentById(id); + return student.isPresent() ? ResponseEntity.status(200).body(student) : ResponseEntity.status(404).body("Student not found."); + } + + @PostMapping({"/students"}) + public ResponseEntity addStudent(@RequestBody Student student) { + return ResponseEntity.status(201).body(this.studentServiceImpl.addStudent(student)); + } + + @PutMapping({"students/{id}"}) + public ResponseEntity updateInformation(@PathVariable Long id, @RequestBody Student student) { + Optional stud = this.studentServiceImpl.getStudentById(id); + if (!stud.isPresent()) { + return ResponseEntity.status(404).body("Student not found."); + } else { + Student updatedStudent = this.studentServiceImpl.updateStudent(id, student); + return ResponseEntity.status(200).body(updatedStudent); + } + } + + @DeleteMapping({"/students/{id}"}) + public ResponseEntity deleteStudent(@PathVariable Long id) { + boolean foundAndDeleted = this.studentServiceImpl.deleteStudent(id); + return foundAndDeleted ? ResponseEntity.status(200).body("Student deleted.") : ResponseEntity.status(404).body("Student not found."); + } +} diff --git a/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/model/Student.java b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/model/Student.java new file mode 100644 index 0000000..9e7a597 --- /dev/null +++ b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/model/Student.java @@ -0,0 +1,40 @@ +package com.example.demo.model; + +public class Student { + private long pkStudentID; + private String name; + private String course; + + public Student() { + } + + public Student(long pkStudentID, String name, String course) { + this.pkStudentID = pkStudentID; + this.name = name; + this.course = course; + } + + public long getPkStudentID() { + return this.pkStudentID; + } + + public String getName() { + return this.name; + } + + public String getCourse() { + return this.course; + } + + public void setPkStudentID(long pkStudentID) { + this.pkStudentID = pkStudentID; + } + + public void setName(String name) { + this.name = name; + } + + public void setCourse(String course) { + this.course = course; + } +} diff --git a/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/services/StudentService.java b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/services/StudentService.java new file mode 100644 index 0000000..5933115 --- /dev/null +++ b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/services/StudentService.java @@ -0,0 +1,18 @@ +package com.example.demo.services; + +import java.util.List; +import java.util.Optional; + +import com.example.demo.model.Student; + +public interface StudentService { + List getAllStudents(); + + Optional getStudentById(Long id); + + Student addStudent(Student student); + + Student updateStudent(Long id, Student student); + + boolean deleteStudent(Long id); +} \ No newline at end of file diff --git a/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/services/impl/StudentServiceImpl.java b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/services/impl/StudentServiceImpl.java new file mode 100644 index 0000000..a8d2608 --- /dev/null +++ b/Amaya_SpringBoot_Activity/src/main/java/com/example/demo/services/impl/StudentServiceImpl.java @@ -0,0 +1,72 @@ +package com.example.demo.services.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import org.springframework.stereotype.Service; + +import com.example.demo.model.Student; +import com.example.demo.services.StudentService; + +@Service +public class StudentServiceImpl implements StudentService { + private Map studentDB = new HashMap(); + private Long pkStudentId = 1L; + + public StudentServiceImpl() { + } + + @Override + public List getAllStudents() { + return new ArrayList<>(this.studentDB.values()); + } + + @Override + public Optional getStudentById(Long id) { + return Optional.ofNullable((Student)this.studentDB.get(id)); + } + + @Override + public Student addStudent(Student student) { + if (student.getPkStudentID() == 0L) { + Long var2 = this.pkStudentId; + this.pkStudentId = this.pkStudentId + 1L; + student.setPkStudentID(var2); + } + + this.studentDB.put(student.getPkStudentID(), student); + return student; + } + + @Override + public Student updateStudent(Long id, Student student) { + Student existingStudent = (Student)this.studentDB.get(id); + if (existingStudent == null) { + return null; + } else { + if (student.getName() != null && !existingStudent.getName().equals(student.getName())) { + existingStudent.setName(student.getName()); + } + + if (student.getCourse() != null && !existingStudent.getCourse().equals(student.getCourse())) { + existingStudent.setCourse(student.getCourse()); + } + + return existingStudent; + } + } + + @Override + public boolean deleteStudent(Long id) { + Student student = (Student)this.studentDB.get(id); + if (student != null) { + this.studentDB.remove(id); + return true; + } else { + return false; + } + } +} diff --git a/Amaya_SpringBoot_Activity/src/main/resources/application.properties b/Amaya_SpringBoot_Activity/src/main/resources/application.properties new file mode 100644 index 0000000..2109a44 --- /dev/null +++ b/Amaya_SpringBoot_Activity/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.application.name=demo diff --git a/Amaya_SpringBoot_Activity/src/test/java/com/example/demo/DemoApplicationTests.java b/Amaya_SpringBoot_Activity/src/test/java/com/example/demo/DemoApplicationTests.java new file mode 100644 index 0000000..2778a6a --- /dev/null +++ b/Amaya_SpringBoot_Activity/src/test/java/com/example/demo/DemoApplicationTests.java @@ -0,0 +1,13 @@ +package com.example.demo; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class DemoApplicationTests { + + @Test + void contextLoads() { + } + +} From 70ecab15388da4c8bb53e9382f116ce4b0218800 Mon Sep 17 00:00:00 2001 From: TrupleCPU Date: Sat, 30 Aug 2025 10:41:19 +0800 Subject: [PATCH 4/5] feat: implemented springboot activity --- .gitignore | 1 + Amaya_SpringBoot_Activity/.gitignore | 1 + 2 files changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2f7896d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/Amaya_SpringBoot_Activity/.gitignore b/Amaya_SpringBoot_Activity/.gitignore index 667aaef..55d87fd 100644 --- a/Amaya_SpringBoot_Activity/.gitignore +++ b/Amaya_SpringBoot_Activity/.gitignore @@ -31,3 +31,4 @@ build/ ### VS Code ### .vscode/ +target/ From 8e89d06400508f4e24954dc3d86d95696ec70321 Mon Sep 17 00:00:00 2001 From: Janssen Carl Amaya <126572562+TrupleCpu@users.noreply.github.com> Date: Sat, 30 Aug 2025 18:49:13 +0800 Subject: [PATCH 5/5] update: pom.xml --- Amaya_SpringBoot_Activity/pom.xml | 116 +++++++++++++++--------------- 1 file changed, 59 insertions(+), 57 deletions(-) diff --git a/Amaya_SpringBoot_Activity/pom.xml b/Amaya_SpringBoot_Activity/pom.xml index 1597474..fb828ad 100644 --- a/Amaya_SpringBoot_Activity/pom.xml +++ b/Amaya_SpringBoot_Activity/pom.xml @@ -1,60 +1,62 @@ - - 4.0.0 - - org.springframework.boot - spring-boot-starter-parent - 3.5.5 - - - com.example - demo - 0.0.1-SNAPSHOT - demo - Demo project for Spring Boot - - - - - - - - - - - - - - - 21 - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-devtools - runtime - true - - - org.springframework.boot - spring-boot-starter-test - test - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 3.5.5 + + + + com.example + demo + 0.0.1-SNAPSHOT + demo + Demo project for Spring Boot + + + 17 + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-devtools + runtime + true + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + ${java.version} + ${java.version} + + + + + org.springframework.boot + spring-boot-maven-plugin + + +