Sfoglia il codice sorgente

added spring annotations to certain classes

William Simkins 6 anni fa
parent
commit
0ffb6b4cb8

+ 3
- 0
src/main/java/Controllers/CommentController.java Vedi File

@@ -1,5 +1,8 @@
1 1
 package Controllers;
2 2
 
3
+import org.springframework.web.bind.annotation.RestController;
4
+
5
+@RestController
3 6
 public class CommentController {
4 7
 
5 8
     public String postComment(int id){

+ 3
- 0
src/main/java/Controllers/MessageController.java Vedi File

@@ -1,5 +1,8 @@
1 1
 package Controllers;
2 2
 
3
+import org.springframework.web.bind.annotation.RestController;
4
+
5
+@RestController
3 6
 public class MessageController {
4 7
 
5 8
     public String sendMessage(int id){

+ 3
- 0
src/main/java/Controllers/TopicsController.java Vedi File

@@ -1,5 +1,8 @@
1 1
 package Controllers;
2 2
 
3
+import org.springframework.web.bind.annotation.RestController;
4
+
5
+@RestController
3 6
 public interface TopicsController {
4 7
 
5 8
     public String getDescription();

+ 3
- 0
src/main/java/Controllers/User.java Vedi File

@@ -1,5 +1,8 @@
1 1
 package Controllers;
2 2
 
3
+import org.springframework.web.bind.annotation.RestController;
4
+
5
+@RestController
3 6
 public abstract class User {
4 7
     private int id;
5 8
     private String name;

+ 3
- 0
src/main/java/Model/Console.java Vedi File

@@ -1,6 +1,9 @@
1 1
 package Model;
2 2
 
3 3
 public class Console {
4
+
5
+    public String print(){return null; }
6
+
4 7
     public String getStringInput(){
5 8
         return null;
6 9
     }

+ 2
- 0
src/main/java/Model/NewAccountCreator.java Vedi File

@@ -1,5 +1,7 @@
1 1
 package Model;
2 2
 
3
+import Controllers.User;
4
+
3 5
 public class NewAccountCreator extends User {
4 6
 
5 7
     public NewAccountCreator(int id, String name, String username, String password, String email) {

+ 6
- 2
src/main/java/View/MainApplication.java Vedi File

@@ -1,7 +1,11 @@
1 1
 package View;
2 2
 
3
-public class MainApplication {
4
-    public static void main(String args){
3
+import org.springframework.boot.SpringApplication;
4
+import org.springframework.boot.autoconfigure.SpringBootApplication;
5 5
 
6
+@SpringBootApplication
7
+public class MainApplication {
8
+    public static void main(String[] args){
9
+        SpringApplication.run(MainApplication.class, args);
6 10
     }
7 11
 }