mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
Maa HTTP Server
This commit is contained in:
@@ -1,18 +1,38 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("java")
|
||||
kotlin("jvm") version "1.6.10"
|
||||
kotlin("plugin.serialization") version "1.6.10"
|
||||
id("io.spring.dependency-management") version "1.0.10.RELEASE"
|
||||
id("org.springframework.boot") version "2.4.0-SNAPSHOT"
|
||||
}
|
||||
|
||||
version = "1.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://repo.spring.io/milestone") }
|
||||
maven { url = uri("https://repo.spring.io/snapshot") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
//JNA
|
||||
implementation("net.java.dev.jna:jna:5.11.0")
|
||||
implementation("org.springframework.boot:spring-boot-starter-web")
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.3")
|
||||
implementation( "org.jetbrains.kotlin:kotlin-reflect:1.6.10")
|
||||
implementation(kotlin("stdlib-jdk8"))
|
||||
}
|
||||
|
||||
tasks.getByName<Test>("test") {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
val compileKotlin: KotlinCompile by tasks
|
||||
compileKotlin.kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
val compileTestKotlin: KotlinCompile by tasks
|
||||
compileTestKotlin.kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
|
||||
@@ -1,2 +1,16 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url = uri("https://repo.spring.io/milestone") }
|
||||
maven { url = uri("https://repo.spring.io/snapshot") }
|
||||
gradlePluginPortal()
|
||||
}
|
||||
resolutionStrategy {
|
||||
eachPlugin {
|
||||
if (requested.id.id == "org.springframework.boot") {
|
||||
useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
rootProject.name = "Maaj"
|
||||
|
||||
|
||||
5
src/Java/Maaj/src/main/java/com/iguigui/maaj/Starter.kt
Normal file
5
src/Java/Maaj/src/main/java/com/iguigui/maaj/Starter.kt
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.iguigui.maaj
|
||||
|
||||
fun main() {
|
||||
println("Hello world !")
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.iguigui.maaj;
|
||||
package com.iguigui.maaj.easySample;
|
||||
|
||||
import com.sun.jna.Native;
|
||||
import com.sun.jna.Pointer;
|
||||
@@ -8,7 +8,7 @@ import java.util.Scanner;
|
||||
public class MaaJavaSample {
|
||||
|
||||
/**
|
||||
* Maa的Java调用实例实现,项目需依赖JNA库。
|
||||
* Maa的Java调用实例实现,最简示例仅需依赖第三方JNA库。
|
||||
* 仅在Windows下进行过测试,未在Linux下测试过(相信强大的Linux用户自己可以解决问题!
|
||||
*
|
||||
* --------特别提醒----------
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.iguigui.maaj;
|
||||
package com.iguigui.maaj.easySample;
|
||||
|
||||
import com.sun.jna.Pointer;
|
||||
import com.sun.jna.win32.StdCallLibrary;
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.iguigui.maaj.service
|
||||
|
||||
import com.iguigui.maaj.easySample.MeoAssistant
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.stereotype.Component
|
||||
import org.springframework.stereotype.Service
|
||||
import java.util.concurrent.atomic.AtomicBoolean
|
||||
|
||||
@Service
|
||||
class MaaService {
|
||||
|
||||
lateinit var meoAssistant: MeoAssistant
|
||||
|
||||
var initFlag: AtomicBoolean = AtomicBoolean(false)
|
||||
|
||||
fun loadSource() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user