Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
finished
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Oct 28, 2019
1 parent 08da623 commit 8c6991d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
Binary file modified bin/jar/Ara-Server.jar
Binary file not shown.
15 changes: 6 additions & 9 deletions src/main/java/com/andromeda/araserver/store/Main.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.andromeda.araserver.store;

import com.andromeda.araserver.util.OutputModel;
import com.andromeda.araserver.util.SqlModel;
import com.google.gson.Gson;

import java.sql.*;
Expand All @@ -11,14 +10,13 @@ public class Main {
public String GetStoreContent() throws SQLException {
Gson gson = new Gson();
Connection c = null;
ArrayList<OutputModel> outputModelArrayList = new ArrayList<OutputModel>();
ArrayList<OutputModel> outputModelArrayList = new ArrayList<>();
try {
c = getConnection();
// add(c);
c.close();
} catch (SQLException e) {
e.printStackTrace();
}
assert c != null;
Statement stmt = c.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM COMPANY;");
// I dont know how this works but it does 😀
Expand All @@ -32,7 +30,6 @@ public String GetStoreContent() throws SQLException {
outputModelArrayList.add(new OutputModel(name, endtxt,link,"", "", outText));
System.out.println();
}
outputModelArrayList.add(new OutputModel("Custom skills coming soon", "stay tune","", "","", ""));


return gson.toJson(outputModelArrayList);
Expand All @@ -48,10 +45,10 @@ private static Connection getConnection() throws SQLException {
void add(Connection c) throws SQLException {
Statement stmt = c.createStatement();
String sql;
sql = "INSERT INTO COMPANY(ID, NAME, INFO, LINK, PRE, SUF, ACTIONMAIN) VALUES (0, 'Wi-Fi on or off', 'turn on and off Wi-Fi','',turn on wifi,' ---\n" +
" - action: \"WIFI\"\n" +
" arg1: \"TERM\"\n" +
" arg2: \"\"',)";
sql = "INSERT INTO COMPANY(ID, NAME, INFO, LINK, PRE, SUF, ACTIONMAIN) VALUES (0, 'toggle WI-FI', 'switch your Wi-Fi settings','','turn on wifi','', '---"+
" - action: !WIFI!" +
" arg1: !TERM!" +
" arg2: !!')";

stmt.executeUpdate(sql);
stmt.close();
Expand Down

0 comments on commit 8c6991d

Please sign in to comment.