Browse Source

front and back in one folder

Allison Ziegler 6 years ago
parent
commit
a8cdfb004e
43 changed files with 154 additions and 0 deletions
  1. BIN
      .DS_Store
  2. BIN
      client-ionic/.DS_Store
  3. BIN
      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
      server-springboot/target/classes/com/ziplinegreen/vault/Config/WebSocketConfig.class
  29. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Controller/PostController.class
  30. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Controller/UserController.class
  31. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Exception/ResourceNotFoundException.class
  32. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Model/AuditModel.class
  33. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Model/Post.class
  34. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Model/User.class
  35. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Repository/PostRepository.class
  36. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Repository/UserRepository.class
  37. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Service/PostService.class
  38. BIN
      server-springboot/target/classes/com/ziplinegreen/vault/Service/UserService.class
  39. BIN
      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
      server-springboot/target/test-classes/com/ziplinegreen/vault/VaultApplicationTests.class
  43. 0
    0
      server-springboot/test.txt

BIN
.DS_Store View File


BIN
client-ionic/.DS_Store View File


BIN
server-springboot/.DS_Store View File


ReadMe.md → server-springboot/ReadMe.md View File


mvnw → server-springboot/mvnw View File


mvnw.cmd → server-springboot/mvnw.cmd View File


pom.xml → server-springboot/pom.xml View File


src/.DS_Store → server-springboot/src/.DS_Store View File


src/main/.DS_Store → server-springboot/src/main/.DS_Store View File


src/main/java/com/ziplinegreen/vault/Config/WebSocketConfig.java → server-springboot/src/main/java/com/ziplinegreen/vault/Config/WebSocketConfig.java View File


src/main/java/com/ziplinegreen/vault/Controller/PostController.java → server-springboot/src/main/java/com/ziplinegreen/vault/Controller/PostController.java View File


src/main/java/com/ziplinegreen/vault/Controller/UserController.java → server-springboot/src/main/java/com/ziplinegreen/vault/Controller/UserController.java View File


src/main/java/com/ziplinegreen/vault/Exception/ResourceNotFoundException.java → server-springboot/src/main/java/com/ziplinegreen/vault/Exception/ResourceNotFoundException.java View File


src/main/java/com/ziplinegreen/vault/Model/AuditModel.java → server-springboot/src/main/java/com/ziplinegreen/vault/Model/AuditModel.java View File


src/main/java/com/ziplinegreen/vault/Model/Post.java → server-springboot/src/main/java/com/ziplinegreen/vault/Model/Post.java View File


src/main/java/com/ziplinegreen/vault/Model/User.java → server-springboot/src/main/java/com/ziplinegreen/vault/Model/User.java View File


src/main/java/com/ziplinegreen/vault/Repository/PostRepository.java → server-springboot/src/main/java/com/ziplinegreen/vault/Repository/PostRepository.java View File


src/main/java/com/ziplinegreen/vault/Repository/UsersRepository.java → server-springboot/src/main/java/com/ziplinegreen/vault/Repository/UsersRepository.java View File


src/main/java/com/ziplinegreen/vault/Service/PostService.java → server-springboot/src/main/java/com/ziplinegreen/vault/Service/PostService.java View File


src/main/java/com/ziplinegreen/vault/Service/UserService.java → server-springboot/src/main/java/com/ziplinegreen/vault/Service/UserService.java View File


src/main/java/com/ziplinegreen/vault/VaultApplication.java → server-springboot/src/main/java/com/ziplinegreen/vault/VaultApplication.java View File


src/main/resources/.DS_Store → server-springboot/src/main/resources/.DS_Store View File


src/main/resources/application.properties → server-springboot/src/main/resources/application.properties View File


src/main/resources/static/app.js → server-springboot/src/main/resources/static/app.js View File


src/main/resources/static/index.html → server-springboot/src/main/resources/static/index.html View File


src/test/java/com/ziplinegreen/vault/VaultApplicationTests.java → server-springboot/src/test/java/com/ziplinegreen/vault/VaultApplicationTests.java View File


+ 23
- 0
server-springboot/target/classes/application.properties View File

@@ -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
server-springboot/target/classes/com/ziplinegreen/vault/Config/WebSocketConfig.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Controller/PostController.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Controller/UserController.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Exception/ResourceNotFoundException.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Model/AuditModel.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Model/Post.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Model/User.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Repository/PostRepository.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Repository/UserRepository.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Service/PostService.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/Service/UserService.class View File


BIN
server-springboot/target/classes/com/ziplinegreen/vault/VaultApplication.class View File


+ 76
- 0
server-springboot/target/classes/static/app.js View File

@@ -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 View File

@@ -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
server-springboot/target/test-classes/com/ziplinegreen/vault/VaultApplicationTests.class View File


test.txt → server-springboot/test.txt View File