From 9f58660b70438074c230bd108572680f8bda95bd Mon Sep 17 00:00:00 2001 From: esoe Date: Thu, 12 May 2022 09:06:31 +0300 Subject: [PATCH] connect --- .../diagrams/src/anyreport.puml | 1 - {doc => docs/diagrams/src}/package.puml | 0 {doc => docs/diagrams/src}/use-case.puml | 0 pom.xml | 7 +- .../java/ru/egspt/{moodle => }/Access.java | 4 +- .../ru/egspt/{moodle => }/AccessPane.java | 5 +- src/main/java/ru/egspt/{moodle => }/App.java | 4 +- src/main/java/ru/egspt/{moodle => }/Base.java | 4 +- .../ru/egspt/{moodle => }/BaseControls.java | 2 +- src/main/java/ru/egspt/Data.java | 4 + src/main/java/ru/egspt/moodle/Data.java | 4 - src/test/java/ru/egspt/AppTest.java | 18 -- target/checkstyle-cachefile | 3 + target/checkstyle-checker.xml | 175 ++++++++++++++++++ target/checkstyle-result.xml | 122 ++++++++++++ target/classes/ru/egspt/Access.class | Bin 0 -> 1074 bytes target/classes/ru/egspt/AccessPane.class | Bin 0 -> 3897 bytes target/classes/ru/egspt/App.class | Bin 0 -> 1382 bytes target/classes/ru/egspt/Base.class | Bin 0 -> 2701 bytes target/classes/ru/egspt/BaseControls.class | Bin 0 -> 1585 bytes target/classes/ru/egspt/Data.class | Bin 0 -> 255 bytes 21 files changed, 320 insertions(+), 33 deletions(-) rename doc/class-diagram.puml => docs/diagrams/src/anyreport.puml (96%) rename {doc => docs/diagrams/src}/package.puml (100%) rename {doc => docs/diagrams/src}/use-case.puml (100%) rename src/main/java/ru/egspt/{moodle => }/Access.java (86%) rename src/main/java/ru/egspt/{moodle => }/AccessPane.java (94%) rename src/main/java/ru/egspt/{moodle => }/App.java (87%) rename src/main/java/ru/egspt/{moodle => }/Base.java (95%) rename src/main/java/ru/egspt/{moodle => }/BaseControls.java (93%) create mode 100644 src/main/java/ru/egspt/Data.java delete mode 100644 src/main/java/ru/egspt/moodle/Data.java delete mode 100644 src/test/java/ru/egspt/AppTest.java create mode 100644 target/checkstyle-cachefile create mode 100644 target/checkstyle-checker.xml create mode 100644 target/checkstyle-result.xml create mode 100644 target/classes/ru/egspt/Access.class create mode 100644 target/classes/ru/egspt/AccessPane.class create mode 100644 target/classes/ru/egspt/App.class create mode 100644 target/classes/ru/egspt/Base.class create mode 100644 target/classes/ru/egspt/BaseControls.class create mode 100644 target/classes/ru/egspt/Data.class diff --git a/doc/class-diagram.puml b/docs/diagrams/src/anyreport.puml similarity index 96% rename from doc/class-diagram.puml rename to docs/diagrams/src/anyreport.puml index 47ab336..001d23a 100644 --- a/doc/class-diagram.puml +++ b/docs/diagrams/src/anyreport.puml @@ -152,5 +152,4 @@ package moodle-anyreport{ TagModel --> TagControls TagModel --> UserListModel } - @enduml \ No newline at end of file diff --git a/doc/package.puml b/docs/diagrams/src/package.puml similarity index 100% rename from doc/package.puml rename to docs/diagrams/src/package.puml diff --git a/doc/use-case.puml b/docs/diagrams/src/use-case.puml similarity index 100% rename from doc/use-case.puml rename to docs/diagrams/src/use-case.puml diff --git a/pom.xml b/pom.xml index 83d98b7..2b8382d 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - ru.egspt.moodle + ru.egspt moodle-anyreport 0.1 @@ -21,6 +21,11 @@ 5 + + mysql + mysql-connector-java + 8.0.28 + org.junit.jupiter junit-jupiter-api diff --git a/src/main/java/ru/egspt/moodle/Access.java b/src/main/java/ru/egspt/Access.java similarity index 86% rename from src/main/java/ru/egspt/moodle/Access.java rename to src/main/java/ru/egspt/Access.java index 0c1b75f..f08ecd1 100644 --- a/src/main/java/ru/egspt/moodle/Access.java +++ b/src/main/java/ru/egspt/Access.java @@ -1,4 +1,4 @@ -package main.java.ru.egspt.moodle; +package ru.egspt; public class Access { private String link; private String login; @@ -7,7 +7,7 @@ public class Access { * @param link the link to set */ public void setLink(String link) { - this.link = link; + this.link = "jdbc:MySQL://" + link + ":3306/moodle"; } /** * @return the link diff --git a/src/main/java/ru/egspt/moodle/AccessPane.java b/src/main/java/ru/egspt/AccessPane.java similarity index 94% rename from src/main/java/ru/egspt/moodle/AccessPane.java rename to src/main/java/ru/egspt/AccessPane.java index 1887e03..2970f7c 100644 --- a/src/main/java/ru/egspt/moodle/AccessPane.java +++ b/src/main/java/ru/egspt/AccessPane.java @@ -1,4 +1,4 @@ -package main.java.ru.egspt.moodle; +package ru.egspt; import javax.swing.JPanel; import java.awt.Color; import javax.swing.JButton; @@ -32,9 +32,10 @@ public class AccessPane extends JPanel { this.add(passField); this.add(linkLabel); this.add(linkField); - this.add(connButton); //настройка кнопки connButton + this.add(connButton); connButton.addActionListener(e -> BaseControls.ConnectToServer(base, this)); + //настройка кнопки отключения от базы this.add(DisconnButton); DisconnButton.addActionListener(e -> BaseControls.DisconnectFromServer(base)); TitledBorder border = new TitledBorder(new LineBorder(Color.black), "connection to mysql", TitledBorder.CENTER, TitledBorder.CENTER); diff --git a/src/main/java/ru/egspt/moodle/App.java b/src/main/java/ru/egspt/App.java similarity index 87% rename from src/main/java/ru/egspt/moodle/App.java rename to src/main/java/ru/egspt/App.java index 145021c..cebb408 100644 --- a/src/main/java/ru/egspt/moodle/App.java +++ b/src/main/java/ru/egspt/App.java @@ -1,4 +1,5 @@ -package main.java.ru.egspt.moodle; +package ru.egspt; + import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.WindowConstants; @@ -20,7 +21,6 @@ public class App extends JPanel{ mainframe.add(this); mainframe.setSize(640, 480); mainframe.setVisible(true); - //mainframe.setExtendedState(mainframe.MAXIMIZED_BOTH); } public static void main( String[] args ) { diff --git a/src/main/java/ru/egspt/moodle/Base.java b/src/main/java/ru/egspt/Base.java similarity index 95% rename from src/main/java/ru/egspt/moodle/Base.java rename to src/main/java/ru/egspt/Base.java index 8936ea7..da85056 100644 --- a/src/main/java/ru/egspt/moodle/Base.java +++ b/src/main/java/ru/egspt/Base.java @@ -1,4 +1,4 @@ -package main.java.ru.egspt.moodle; +package ru.egspt; import java.sql.Connection; import java.sql.DriverManager; @@ -7,7 +7,7 @@ public class Base { private Access access = new Access(); //request //response - Base(){ + public Base(){ getAccess().setLink("link"); getAccess().setLogin("login"); getAccess().setPassword("password"); diff --git a/src/main/java/ru/egspt/moodle/BaseControls.java b/src/main/java/ru/egspt/BaseControls.java similarity index 93% rename from src/main/java/ru/egspt/moodle/BaseControls.java rename to src/main/java/ru/egspt/BaseControls.java index 8c4d304..f72f40f 100644 --- a/src/main/java/ru/egspt/moodle/BaseControls.java +++ b/src/main/java/ru/egspt/BaseControls.java @@ -1,4 +1,4 @@ -package main.java.ru.egspt.moodle; +package ru.egspt; public class BaseControls { // diff --git a/src/main/java/ru/egspt/Data.java b/src/main/java/ru/egspt/Data.java new file mode 100644 index 0000000..5f80edf --- /dev/null +++ b/src/main/java/ru/egspt/Data.java @@ -0,0 +1,4 @@ +package ru.egspt; +public class Data { + +} diff --git a/src/main/java/ru/egspt/moodle/Data.java b/src/main/java/ru/egspt/moodle/Data.java deleted file mode 100644 index fada8c9..0000000 --- a/src/main/java/ru/egspt/moodle/Data.java +++ /dev/null @@ -1,4 +0,0 @@ -package main.java.ru.egspt.moodle; -public class Data { - -} diff --git a/src/test/java/ru/egspt/AppTest.java b/src/test/java/ru/egspt/AppTest.java deleted file mode 100644 index b6e3083..0000000 --- a/src/test/java/ru/egspt/AppTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package ru.egspt; - -import org.junit.jupiter.api.Test; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -/** - * Unit test for simple App. - */ -class AppTest { - /** - * Rigorous Test. - */ - @Test - void testApp() { - assertEquals(1, 1); - } -} diff --git a/target/checkstyle-cachefile b/target/checkstyle-cachefile new file mode 100644 index 0000000..8338d3a --- /dev/null +++ b/target/checkstyle-cachefile @@ -0,0 +1,3 @@ +#Wed May 11 16:06:06 MSK 2022 +module-resource*?\:checkstyle/suppressions.xml=3B4ADFBFB42AA213119FAA5299E87F0537A02AFD +configuration*?=9FACA937F0890BA0B556BC18568485F706CFAEA2 diff --git a/target/checkstyle-checker.xml b/target/checkstyle-checker.xml new file mode 100644 index 0000000..5f4800f --- /dev/null +++ b/target/checkstyle-checker.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/target/checkstyle-result.xml b/target/checkstyle-result.xml new file mode 100644 index 0000000..5951f20 --- /dev/null +++ b/target/checkstyle-result.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/target/classes/ru/egspt/Access.class b/target/classes/ru/egspt/Access.class new file mode 100644 index 0000000000000000000000000000000000000000..a0b813beca190f8348137d008a5a043e930ecdab GIT binary patch literal 1074 zcmZ{i*>2NN5QhJg#daN+rfHhcQkFIaoTRObinvHnB|zdTY)uu3OUJQ-gKI~&1LCbf zqOAlH55PkqW}LJ^j=4G8%>47s%=!K2$1ebn@kmBSU?rFs_Aner#xu*Z!%#*}pg1x= znTBh6L*q?2uM#I&xwu&vUKOJ6e1G6l@nvjl*g=i@6#3KM36%Bvf=GJ_0{1oKAyJvb zt1=ZXm>bRJx(1oe3Y(|hFOdE1Yyj-CuR&p#0=Znh3#eUx5?J<2hkIU_&isJ8gl&q+ z($B~u!>Q?%;T-W!LbS`|LDQqPKsSSSL3_S&3GG|#c7s+ae#~Hn&f3%gMXb_|W{fpj zIrs!Qk_R>$KT&>Ps$Ak`^8%ZtJG5Nj-Z^&XifZhsVuK=CwK9#Isgg#F%PU(5D3e literal 0 HcmV?d00001 diff --git a/target/classes/ru/egspt/AccessPane.class b/target/classes/ru/egspt/AccessPane.class new file mode 100644 index 0000000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^36Ys6>q`2ar0nsF=2OW-W~CL`kuxWa}uazxr=|Ab~F2FR&4nN?LX$snGS zkaDiOr0CJtvNInMEau#BR>?A}7` z4POr6OFq|CIh64gmx-oC40<+zuU3CI`b;IG2Jv;)hNxzbPeOPeZK4#vAu2g6mfw=` zZNc+9SV70taV4kQy}DtkPfV$%BDg~c^@|^OX0jp_bAko4WdnFw+XDP?;d|XT+>MCo zs#QkWd_i5wjEpJ!4@rnuvq-6F%Q@(TAT)l%Lih<@3E-#9MMWBWjjU}Nx+UXh_&F<< zYth6*#-M6Ws|@_WIzMarWhF0KM`HBeQ^94H^-+}KzgL8FQ^qe5=8gR)0NwVPMyBXE zG-%|^QMFGK-Pu&~6&IDpg6lC1+pa=Q~GsdhCZeclqUy+YXwWwvMjY&0;a$%#O zGR~YD=B$hrye45&rnDvDZJ*lQD)u!!<0qBun66s;Q-(2_o7#Y_%9^G^acFi*Ef@d) z4?UN+*Y&@M*y16)#4&R^0(M2S^#Y67mSZo39;YXLy z%Sm^*PfR%5y@Zoz#iYGB=_pR(#mV8~q`Nptx|0QZ=v+n$Si*p?am?R7#@!)zcLitD zD@dnr;;B58@K}9)9^uim~#mqrx!PONN|)WRxdD{ z=cI-~fC&|w_qhgTPrx@Q;gh(?9VWg)IbN;&z=q0m8+z`pRz9|Yaw9I`Q@-bydC59P z@bC(rP3Q5M)JRWXSy1e@XfA+OL*yQS20P~yO^Z! zl#+B0|0@7JEcWAkWuIWW`mhg=5$2PGwV%m4g@^FC8&%BnjPEivqM45P0Jkzh-^UM# z;6A4EhlIbjxkj|UAM;V3i1usfjNQVIOTIm<+g;l&lo9Cr$>Z!*`~o%2Awd^qs0*oj znz>PJCRzcUP!>JEK=B$ZvarF5t6?40;tl*3zjJ55$DiHq)$ literal 0 HcmV?d00001 diff --git a/target/classes/ru/egspt/App.class b/target/classes/ru/egspt/App.class new file mode 100644 index 0000000000000000000000000000000000000000..e5cb5d487fb1756b2b2322addf3a81db7a865e7f GIT binary patch literal 1382 zcmZuwTXWM!7(MHl$QDX$C&W#-1VbV9rPwX>ZVKemlu#GaNheHT`mjlsppGqhB)OD6 zQTotnr!)Nv{Rt%yo8l7Q`y~H^{*q45%ASNUj7D1Rx92w0Po=|12F;1 zYgN>i-wZ0V&8C64z}UC)JNbRZzh^sJm21n=QFVd%y7ZMmsBdy#y`VDhHkz)ZoS<5GT~H^Vw(us-2$;SKR&C#o{KxaR zbT5+H*`g;K%D`K%HavR^sehHt3&vJU&`&lEnyd9x(y$9h= z*y;Tgc6-0+{D|Z49EY9WkNiF*fM60o=l}10YGT7qKdgaam+xP>a=C0`9-kRl;2Dal zIcV3yqTUgssVk^EdfP|zXUW1@nELMv3va+=&!o4-Gdlj7mT{k@bKg@<*JE4E6}RPW zs6|^J_XH1eS?l5yxrTUaV;p%m_(xeJIL7(M`^4{I&gO^`9Mi=PtYR0VYaOI_ka@&d z4CDNcMm#3-4kN|9BaB)7984g~nb4L8d{-lWAWN>vwc-e1nO(D%^ z0-2XsvwN&;$$+&%4>2m8?P6waEZ;$~RvK>OT&dW`yEjXj*n^Dtw~g~9ihQsyax^M@ zJTjdkt+soTX3y{{>oT%^(t)6fV<_N5N+$6UJ|0MaLyVT5+QuhiSK65CLa;}l*Gg?% q<$G;kF3V1XBncd6RVOGhO`+UNQd6kmOJdTLxK4S&=LY97EdLMtt5N*` literal 0 HcmV?d00001 diff --git a/target/classes/ru/egspt/Base.class b/target/classes/ru/egspt/Base.class new file mode 100644 index 0000000000000000000000000000000000000000..5bc01a9e7376d79a20b19ffca31ea42983da7878 GIT binary patch literal 2701 zcmbtWTXR!Y6#jO4Ica*@LQ<}Z9;9F!Xo66##d2x6X$okuauM`2J%&J+jP19RrOD8}8Z<>}1Z)XOfr4?mFp`LL^q)#wk@n6k^>ytB}LkPPAM$e@`}f)5H$ErC=1DQi?Vv z(_PI*r#n(|v-wPa&uAEyLQ}4g$>wF*J0^C?val=@V;H+Ro3x9?hXr?BT;4U&EiSEe zxf0l!2tk}nQxjv3d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