From 816dec28eeab5e39cca46f3ff9727896215d7f02 Mon Sep 17 00:00:00 2001 From: daoge_cmd <3523206925@qq.com> Date: Wed, 20 Nov 2024 16:55:30 +0800 Subject: [PATCH] docs: update README.md --- README.md | 13 +++++++------ src/main/java/org/allaymc/remotecommand/Config.java | 3 +++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2e5a875..e67a1d9 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,17 @@ # RemoteCommand -Execute server command through HTTP interface. +Execute server command through http interface. This plugin is used in allay official test server to add support for auto update. -# Configuration - -TODO - # Http API -TODO +Let's say you set http server port to 19133, then the base url is `http://localhost:19133/remotecommand`. +Please note that only POST method is allowed! + +Parameters: +- `token` The token you set in `config.yml`. +- `command` The command you want to execute. ## License diff --git a/src/main/java/org/allaymc/remotecommand/Config.java b/src/main/java/org/allaymc/remotecommand/Config.java index 3b0328f..b0abbe9 100644 --- a/src/main/java/org/allaymc/remotecommand/Config.java +++ b/src/main/java/org/allaymc/remotecommand/Config.java @@ -1,6 +1,7 @@ package org.allaymc.remotecommand; import eu.okaeri.configs.OkaeriConfig; +import eu.okaeri.configs.annotation.Comment; import eu.okaeri.configs.annotation.CustomKey; import lombok.Getter; import lombok.experimental.Accessors; @@ -12,7 +13,9 @@ @Getter @Accessors(fluent = true) public class Config extends OkaeriConfig { + @Comment("The token used to verify the request. Do not share it to other!") private String token = RandomStringUtils.randomAlphanumeric(32); + @Comment("The port of the http server") @CustomKey("http-server-port") private int httpServerPort = 19133; }