commit
f63ad619c5
@ -0,0 +1,127 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>org.example</groupId>
|
||||||
|
<artifactId>HomeBot</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
|
<name>HomeBot</name>
|
||||||
|
<!-- FIXME change it to the project's website -->
|
||||||
|
<url>http://www.example.com</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>jitpack.io</id>
|
||||||
|
<url>https://jitpack.io</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.11</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.json</groupId>
|
||||||
|
<artifactId>json</artifactId>
|
||||||
|
<version>20230618</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.demidko</groupId>
|
||||||
|
<artifactId>aot</artifactId>
|
||||||
|
<version>2022.11.28</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- хз-->
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-numbers-core</artifactId>
|
||||||
|
<version>1.1</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- хз-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-math3</artifactId>
|
||||||
|
<version>3.6.1</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.12.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||||
|
<plugins>
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<!-- Build an executable JAR -->
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addClasspath>true</addClasspath>
|
||||||
|
<classpathPrefix>lib/</classpathPrefix>
|
||||||
|
<mainClass>org.example.App</mainClass>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
</plugin>
|
||||||
|
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>2.22.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.0.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>2.5.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>2.8.2</version>
|
||||||
|
</plugin>
|
||||||
|
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
|
<version>3.7.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -0,0 +1,3 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Main-Class: org.example.App
|
||||||
|
|
@ -0,0 +1,22 @@
|
|||||||
|
package org.pavlik.bot;
|
||||||
|
|
||||||
|
import org.example.App;
|
||||||
|
|
||||||
|
|
||||||
|
public class BotDialog {
|
||||||
|
public String lastName, firstName, userName, userId;
|
||||||
|
public boolean is_admin = false;
|
||||||
|
public String transportId;
|
||||||
|
public MessageAdapter adapter;
|
||||||
|
public boolean zdorova;
|
||||||
|
public boolean answName;
|
||||||
|
public String lastCmd;
|
||||||
|
public int cmdStage=0;
|
||||||
|
public double summ=0.0;
|
||||||
|
|
||||||
|
|
||||||
|
public BotDialog (MessageAdapter adapter) {
|
||||||
|
this.adapter = adapter;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package org.pavlik.bot;
|
||||||
|
|
||||||
|
import java.util.Deque;
|
||||||
|
|
||||||
|
public interface MessageAdapter {
|
||||||
|
String sendMessage(String chatId, String text);
|
||||||
|
|
||||||
|
Deque<MessageObj> getUpdates(String offset);
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
package org.pavlik.bot;
|
||||||
|
|
||||||
|
public class MessageObj {
|
||||||
|
public String text;
|
||||||
|
public String message_id;
|
||||||
|
public Long update_id;
|
||||||
|
public boolean is_command=false;
|
||||||
|
public String user_id;
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
package org.pavlik.helpers;
|
||||||
|
|
||||||
|
public class FileHelper {
|
||||||
|
}
|
@ -0,0 +1,37 @@
|
|||||||
|
import org.apache.http.HttpResponse;
|
||||||
|
import org.pavlik.helpers.RestHelper;
|
||||||
|
//package org.pavlik.helpers;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
/*RestHelper Rest = new RestHelper(
|
||||||
|
"client-keystore3.jks",
|
||||||
|
"JKS",
|
||||||
|
"123321",
|
||||||
|
"2",
|
||||||
|
"truststore.jks",
|
||||||
|
"JKS",
|
||||||
|
"123321");*/
|
||||||
|
|
||||||
|
RestHelper Rest = new RestHelper(
|
||||||
|
"client1.p12",
|
||||||
|
"PKCS12",
|
||||||
|
"123321",
|
||||||
|
null
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
String queryUrl = "https://192.168.200.10/index.php?kokoko=1";
|
||||||
|
String queryBody = "{\"k\":\"val\"}";
|
||||||
|
HashMap<String,String> queryHeaders = new HashMap<>();
|
||||||
|
queryHeaders.put("CONTENT-TYPE","text/plain2; charset=UTF-8");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HttpResponse resp = Rest.queryPostRaw(queryUrl,queryBody,queryHeaders);
|
||||||
|
String respBody = Rest.getRespBody(resp);
|
||||||
|
System.out.println(respBody);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Main-Class: org.example.App
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
https://github.com/AKuznetsov/russianmorphology
|
@ -0,0 +1,20 @@
|
|||||||
|
package org.example;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unit test for simple App.
|
||||||
|
*/
|
||||||
|
public class AppTest
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Rigorous Test :-)
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void shouldAnswerWithTrue()
|
||||||
|
{
|
||||||
|
assertTrue( true );
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue