Procházet zdrojové kódy

front and back in one folder

Allison Ziegler před 6 roky
rodič
revize
a8cdfb004e
43 změnil soubory, kde provedl 154 přidání a 0 odebrání
  1. binární
      .DS_Store
  2. binární
      client-ionic/.DS_Store
  3. binární
      server-springboot/.DS_Store
  4. 0
    0
      server-springboot/ReadMe.md
  5. 0
    0
      server-springboot/mvnw
  6. 0
    0
      server-springboot/mvnw.cmd
  7. 0
    0
      server-springboot/pom.xml
  8. 0
    0
      server-springboot/src/.DS_Store
  9. 0
    0
      server-springboot/src/main/.DS_Store
  10. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Config/WebSocketConfig.java
  11. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Controller/PostController.java
  12. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Controller/UserController.java
  13. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Exception/ResourceNotFoundException.java
  14. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Model/AuditModel.java
  15. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Model/Post.java
  16. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Model/User.java
  17. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Repository/PostRepository.java
  18. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Repository/UsersRepository.java
  19. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Service/PostService.java
  20. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/Service/UserService.java
  21. 0
    0
      server-springboot/src/main/java/com/ziplinegreen/vault/VaultApplication.java
  22. 0
    0
      server-springboot/src/main/resources/.DS_Store
  23. 0
    0
      server-springboot/src/main/resources/application.properties
  24. 0
    0
      server-springboot/src/main/resources/static/app.js
  25. 0
    0
      server-springboot/src/main/resources/static/index.html
  26. 0
    0
      server-springboot/src/test/java/com/ziplinegreen/vault/VaultApplicationTests.java
  27. 23
    0
      server-springboot/target/classes/application.properties
  28. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Config/WebSocketConfig.class
  29. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Controller/PostController.class
  30. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Controller/UserController.class
  31. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Exception/ResourceNotFoundException.class
  32. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Model/AuditModel.class
  33. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Model/Post.class
  34. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Model/User.class
  35. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Repository/PostRepository.class
  36. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Repository/UserRepository.class
  37. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Service/PostService.class
  38. binární
      server-springboot/target/classes/com/ziplinegreen/vault/Service/UserService.class
  39. binární
      server-springboot/target/classes/com/ziplinegreen/vault/VaultApplication.class
  40. 76
    0
      server-springboot/target/classes/static/app.js
  41. 55
    0
      server-springboot/target/classes/static/index.html
  42. binární
      server-springboot/target/test-classes/com/ziplinegreen/vault/VaultApplicationTests.class
  43. 0
    0
      server-springboot/test.txt

binární
.DS_Store Zobrazit soubor


binární
client-ionic/.DS_Store Zobrazit soubor


binární
server-springboot/.DS_Store Zobrazit soubor


ReadMe.md → server-springboot/ReadMe.md Zobrazit soubor


mvnw → server-springboot/mvnw Zobrazit soubor


mvnw.cmd → server-springboot/mvnw.cmd Zobrazit soubor


pom.xml → server-springboot/pom.xml Zobrazit soubor


src/.DS_Store → server-springboot/src/.DS_Store Zobrazit soubor


src/main/.DS_Store → server-springboot/src/main/.DS_Store Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Config/WebSocketConfig.java → server-springboot/src/main/java/com/ziplinegreen/vault/Config/WebSocketConfig.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Controller/PostController.java → server-springboot/src/main/java/com/ziplinegreen/vault/Controller/PostController.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Controller/UserController.java → server-springboot/src/main/java/com/ziplinegreen/vault/Controller/UserController.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Exception/ResourceNotFoundException.java → server-springboot/src/main/java/com/ziplinegreen/vault/Exception/ResourceNotFoundException.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Model/AuditModel.java → server-springboot/src/main/java/com/ziplinegreen/vault/Model/AuditModel.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Model/Post.java → server-springboot/src/main/java/com/ziplinegreen/vault/Model/Post.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Model/User.java → server-springboot/src/main/java/com/ziplinegreen/vault/Model/User.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Repository/PostRepository.java → server-springboot/src/main/java/com/ziplinegreen/vault/Repository/PostRepository.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Repository/UsersRepository.java → server-springboot/src/main/java/com/ziplinegreen/vault/Repository/UsersRepository.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Service/PostService.java → server-springboot/src/main/java/com/ziplinegreen/vault/Service/PostService.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/Service/UserService.java → server-springboot/src/main/java/com/ziplinegreen/vault/Service/UserService.java Zobrazit soubor


src/main/java/com/ziplinegreen/vault/VaultApplication.java → server-springboot/src/main/java/com/ziplinegreen/vault/VaultApplication.java Zobrazit soubor


src/main/resources/.DS_Store → server-springboot/src/main/resources/.DS_Store Zobrazit soubor


src/main/resources/application.properties → server-springboot/src/main/resources/application.properties Zobrazit soubor


src/main/resources/static/app.js → server-springboot/src/main/resources/static/app.js Zobrazit soubor


src/main/resources/static/index.html → server-springboot/src/main/resources/static/index.html Zobrazit soubor


src/test/java/com/ziplinegreen/vault/VaultApplicationTests.java → server-springboot/src/test/java/com/ziplinegreen/vault/VaultApplicationTests.java Zobrazit soubor


+ 23
- 0
server-springboot/target/classes/application.properties Zobrazit soubor

@@ -0,0 +1,23 @@
1
+# H2
2
+spring.h2.console.enabled=true
3
+spring.h2.console.path=/h2
4
+
5
+# Datasource
6
+spring.datasource.url=jdbc:h2:file:~/test
7
+spring.datasource.username=sa
8
+spring.datasource.password=
9
+spring.datasource.driver-class-name=org.h2.Driver
10
+
11
+
12
+#spring.datasource.url=jdbc:mysql://localhost:3306/zipLine?useSSL=false
13
+#spring.datasource.username=root
14
+#spring.datasource.password=Calcifer1650
15
+#
16
+## The SQL dialect makes Hibernate generate better SQL for the chosen database
17
+#spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5InnoDBDialect
18
+#
19
+## Hibernate ddl auto (create, create-drop, validate, update)
20
+#spring.jpa.hibernate.ddl-auto = update
21
+#
22
+#logging.level.org.hibernate.SQL=DEBUG
23
+#logging.level.org.hibernate.type=TRACE

binární
server-springboot/target/classes/com/ziplinegreen/vault/Config/WebSocketConfig.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Controller/PostController.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Controller/UserController.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Exception/ResourceNotFoundException.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Model/AuditModel.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Model/Post.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Model/User.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Repository/PostRepository.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Repository/UserRepository.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Service/PostService.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/Service/UserService.class Zobrazit soubor


binární
server-springboot/target/classes/com/ziplinegreen/vault/VaultApplication.class Zobrazit soubor


+ 76
- 0
server-springboot/target/classes/static/app.js Zobrazit soubor

@@ -0,0 +1,76 @@
1
+var stompClient = null;
2
+
3
+function setConnected(connected) {
4
+    $('#connect').prop("disabled", connected);
5
+    $('#disconnect').prop("disabled", !connected);
6
+    if (connected) {
7
+        $("#conversation").show();
8
+    }
9
+    else {
10
+        $("#conversation").hide();
11
+    }
12
+    $("#messages").html("");
13
+}
14
+
15
+function connect() {
16
+    var socket = new SockJS('/vault-socket');
17
+    stompClient = Stomp.over(socket);
18
+    stompClient.connect({}, function (frame) {
19
+        setConnected(true);
20
+        console.log('Connected: ' + frame);
21
+        stompClient.subscribe('/topic/posts', function (greeting) {
22
+            showGreeting(JSON.parse(greeting.body).message, JSON.parse(greeting.body).userName);
23
+            //showGreeting()
24
+        });
25
+    });
26
+}
27
+
28
+function disconnect() {
29
+    if (stompClient !== null) {
30
+        stompClient.disconnect();
31
+    }
32
+    setConnected(false);
33
+    console.log("Disconnected");
34
+}
35
+
36
+var userId = 1;
37
+var userPostUrl = "/app/posts/1";
38
+
39
+function user1() {
40
+    $('#user1').prop("disabled", true);
41
+    $('#user2').prop("disabled", false);
42
+    userId = 1;
43
+}
44
+
45
+function user2() {
46
+    $('#user1').prop("disabled", false);
47
+    $('#user2').prop("disabled", true);
48
+    userId = 2;
49
+    userPostUrl = "/app/posts/2";
50
+}
51
+
52
+// function sendName() {
53
+//     stompClient.send("/app/posts/1", {}, JSON.stringify({'id': '','message': $("#message").val(),'userId': '1'}));
54
+// }
55
+
56
+
57
+
58
+function sendName() {
59
+
60
+    stompClient.send(userPostUrl, {}, JSON.stringify({'id': '','message': $("#message").val(),'userId': userId}))
61
+}
62
+
63
+function showGreeting(message, userName) {
64
+    $("#messages").append("<tr><td>" + userName + ": " + message + "</td></tr>");
65
+}
66
+
67
+$(function () {
68
+    $("form").on('submit', function (e) {
69
+        e.preventDefault();
70
+    });
71
+    $( "#connect" ).click(function() { connect(); });
72
+    $( "#disconnect" ).click(function() { disconnect(); });
73
+    $( "#send" ).click(function() { sendName(); });
74
+    $( "#user1" ).click(function() { user1(); });
75
+    $( "#user2" ).click(function() { user2(); })
76
+});

+ 55
- 0
server-springboot/target/classes/static/index.html Zobrazit soubor

@@ -0,0 +1,55 @@
1
+<!DOCTYPE html>
2
+<html>
3
+<head>
4
+    <title>Hello WebSocket</title>
5
+    <link href="/webjars/bootstrap/css/bootstrap.min.css" rel="stylesheet">
6
+    <!--<link href="/main.css" rel="stylesheet">-->
7
+    <script src="/webjars/jquery/jquery.min.js"></script>
8
+    <script src="/webjars/sockjs-client/sockjs.min.js"></script>
9
+    <script src="/webjars/stomp-websocket/stomp.min.js"></script>
10
+    <script src="./app.js"></script>
11
+</head>
12
+<body>
13
+<noscript><h2 style="color: #ff0000">Seems your browser doesn't support Javascript! Websocket relies on Javascript being
14
+    enabled. Please enable
15
+    Javascript and reload this page!</h2></noscript>
16
+<div id="main-content" class="container">
17
+    <div class="row">
18
+        <div class="col-md-6">
19
+            <form class="form-inline">
20
+                <div class="form-group">
21
+                    <label for="connect">WebSocket connection:</label>
22
+                    <button id="connect" class="btn btn-default" type="submit">Connect</button>
23
+                    <button id="disconnect" class="btn btn-default" type="submit" disabled="disabled">Disconnect
24
+                    </button>
25
+                    <button id="user1" class="btn btn-default" type="submit" disabled="disabled">User 1</button>
26
+                    <button id="user2" class="btn btn-default" type="submit">User 2</button>
27
+                </div>
28
+            </form>
29
+        </div>
30
+        <div class="col-md-6">
31
+            <form class="form-inline">
32
+                <div class="form-group">
33
+                    <label for="message">Message?</label>
34
+                    <input type="text" id="message" class="form-control" placeholder="What is your message...">
35
+                </div>
36
+                <button id="send" class="btn btn-default" type="submit">Send</button>
37
+            </form>
38
+        </div>
39
+    </div>
40
+    <div class="row">
41
+        <div class="col-md-12">
42
+            <table id="conversation" class="table table-striped">
43
+                <thead>
44
+                <tr>
45
+                    <th>Messages</th>
46
+                </tr>
47
+                </thead>
48
+                <tbody id="messages">
49
+                </tbody>
50
+            </table>
51
+        </div>
52
+    </div>
53
+</div>
54
+</body>
55
+</html>

binární
server-springboot/target/test-classes/com/ziplinegreen/vault/VaultApplicationTests.class Zobrazit soubor


test.txt → server-springboot/test.txt Zobrazit soubor