Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

关于JSmod2的web api

MagicLu(Chang Cun Lu) edited this page Aug 23, 2019 · 3 revisions

JSmod2的web端口(http协议)默认为19136,默认api路径为localhost:19136/multi/查询语句

查询语句的语法:

根属性是root

root:"取值两个值Server或者Map"

如果Server就是从Server找到方法,如果Map就从Map找方法,两个作用域

get:"Get方法后面的名字,如getValue那么就是Value"

set:"Set方法后面名字,如SetValue那么后面就是Value"

do:"方法名,如doSomething"

getList:"返回数组或List的方法名,一般和get一样省略List"

get和set以及do,getList都有属性

values:[一个数组,里面可以包含基本类型,也可以是api类型,api类型获得值和前面规则一样]

getList有几个属性

index: 0/1/2...可以得到第几个元素

by: 数组类型,可以通过属性和值找到对象(如果有by则不需要index)

当是map时,通过getList也可以获得

index: 值(基本类型和api类型都可以)

当获取到值时,通过"属性值"继续到下一层

例子(伪代码) { root : Map, Map:{ getList:players, index: 0 players:{ get:health } } }

伪代码例子就是找Map对象,然后得到一个players(players是里面的一个属性)数组,然后找到数组中name为xiaoming的Player.对象,然后从这个对象找到health最后返回

插件式api

同时需要导入SpringBoot Framework

package cn.magiclu.plugin
@Service
public class WebService{
//....
}

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /