Skip to content

API Doc

李大狗 edited this page Dec 31, 2021 · 11 revisions

Tai Shang World Generator

API

/tai_shang_world_generator/api/v1/gen_map

接口定义:生成随机地图数据

标题 描述
接口路径 /tai_shang_world_generator/api/v1/gen_map
Method POST
Content-Type application/json

Query Params:

Key Type Value Required
source string a_block Y

Post表单参数:

Key Type Value Required
block_number int Y
rule string RuleA Y

例如:

POST http://124.251.110.212:4001/tai_shang_world_generator/api/v1/gen_map?source=a_block

传入数据:

{
    "block_number": 22793130,
    "rule": "RuleA"
}

返回内容:

{
    "error_code": 0,
    "error_msg": "success",
    "result": {
        "ele_description": {
            "object": [
                31,
                40
            ],
            "sprite": [
                41,
                55
            ],
            "unwalkable": [
                1
            ],
            "walkable": [
                0
            ]
        },
        "map": [
            [
                1,
                0,
                48,
                40,
                0,
                0,
                38,
                1,
                0,
                0,
                0,
                0,
                40,
                0,
                44,
                0,
                0,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1
            ],
            [
                0,
                0,
                43,
                45,
                0,
                0,
                0,
                0,
                34,
                0,
                0,
                0,
                31,
                0,
                0,
                0,
                0,
                0,
                48,
                0,
                0,
                1,
                0,
                0,
                54,
                0,
                0,
                0,
                0,
                1,
                0,
                54
            ],
            [
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                41,
                43,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                38,
                53,
                0,
                0,
                0,
                0,
                0,
                1,
                37,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                55,
                31
            ],
            [
                0,
                0,
                0,
                0,
                46,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                36,
                32
            ],
            [
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                38,
                0,
                0,
                0,
                0,
                31,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                39,
                0,
                0,
                0
            ],
            [
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                40,
                45,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                1,
                0,
                0,
                0,
                53,
                0,
                0,
                0,
                32,
                0,
                1,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                38,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                48,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                42,
                0,
                0,
                0,
                53,
                0,
                0,
                0,
                0,
                38,
                0,
                0,
                0,
                1,
                48,
                0,
                1
            ],
            [
                38,
                0,
                1,
                1,
                0,
                0,
                1,
                44,
                1,
                0,
                0,
                0,
                50,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                35,
                1,
                0,
                0,
                0,
                52,
                32,
                38,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                37,
                0,
                0,
                0,
                0,
                0,
                1,
                1,
                50,
                1,
                0,
                0,
                43,
                0,
                0,
                0,
                0,
                1,
                36,
                0,
                1,
                0
            ],
            [
                0,
                0,
                1,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                45,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                54,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                1,
                0,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                37,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                31
            ],
            [
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                50,
                51,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                46,
                0,
                55,
                0,
                1,
                0,
                0,
                1,
                0,
                0
            ],
            [
                0,
                0,
                31,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                32,
                0,
                0,
                48,
                1,
                0,
                0,
                1,
                1,
                0,
                0,
                0
            ],
            [
                40,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                48,
                40,
                0,
                0,
                0,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                1,
                35,
                0,
                0,
                32,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                53,
                0,
                37,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                37,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                44,
                0,
                0,
                1,
                52
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                38,
                0,
                1,
                0,
                1,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                43,
                32,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                1,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                52,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                40,
                1,
                0,
                0,
                0,
                0,
                1,
                0
            ],
            [
                0,
                0,
                0,
                42,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                37,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                41,
                0,
                0,
                0,
                0,
                0,
                0,
                44,
                0,
                0,
                0,
                0,
                38,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                1,
                0,
                32,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                52,
                0,
                0,
                34,
                52,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                1,
                47,
                0
            ],
            [
                0,
                1,
                1,
                53,
                0,
                0,
                1,
                1,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                1,
                46,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                32,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                46,
                45,
                1,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                33,
                0,
                0,
                1,
                0,
                0,
                0,
                0
            ],
            [
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                51,
                1,
                0,
                1,
                1,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                33,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                54,
                0,
                0,
                0,
                54,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                1
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                43,
                0,
                0,
                1,
                0,
                1,
                0,
                0,
                0,
                35,
                0,
                0,
                34,
                1,
                0,
                1,
                1,
                0,
                42,
                0,
                0
            ],
            [
                0,
                0,
                1,
                0,
                0,
                1,
                0,
                1,
                0,
                0,
                0,
                1,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                49,
                0,
                0,
                0,
                0,
                0,
                35,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                1,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                55,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0
            ],
            [
                47,
                48,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                1,
                0,
                32,
                0,
                0,
                0,
                0,
                39,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                1,
                0,
                0,
                0,
                35,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                38,
                0,
                0,
                42,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                49,
                0,
                0,
                0,
                0,
                43,
                0,
                0,
                1,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                55,
                49,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                33,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                32,
                0,
                0,
                0,
                0,
                0,
                49,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                33,
                0,
                0,
                48
            ],
            [
                0,
                0,
                0,
                0,
                0,
                44,
                0,
                0,
                0,
                0,
                42,
                0,
                42,
                1,
                0,
                0,
                1,
                1,
                0,
                0,
                37,
                1,
                0,
                0,
                54,
                51,
                0,
                0,
                41,
                1,
                0,
                0
            ],
            [
                0,
                0,
                0,
                1,
                1,
                35,
                0,
                0,
                0,
                0,
                33,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                46,
                0,
                0,
                0,
                1,
                0,
                0,
                1,
                36,
                40,
                0,
                0,
                0,
                0,
                43,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0
            ],
            [
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                34,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                55,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                36,
                0,
                0,
                54,
                0
            ],
            [
                0,
                0,
                0,
                0,
                1,
                38,
                55,
                0,
                0,
                0,
                0,
                0,
                0,
                39,
                0,
                31,
                0,
                0,
                0,
                50,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                37
            ],
            [
                0,
                0,
                0,
                0,
                0,
                45,
                0,
                0,
                0,
                0,
                42,
                0,
                0,
                1,
                0,
                0,
                0,
                43,
                0,
                0,
                0,
                0,
                0,
                43,
                0,
                0,
                0,
                0,
                0,
                1,
                1,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                55,
                55,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                55,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                55
            ],
            [
                0,
                0,
                45,
                0,
                31,
                0,
                0,
                55,
                0,
                0,
                44,
                0,
                0,
                0,
                49,
                0,
                0,
                44,
                1,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                48,
                0,
                0,
                0
            ],
            [
                1,
                0,
                35,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                42,
                0,
                0,
                0,
                1,
                0,
                0,
                43,
                31,
                42,
                50
            ],
            [
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                34,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                1,
                0,
                46,
                1,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                51,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                54,
                0,
                0,
                0,
                0,
                0,
                0,
                47,
                0
            ],
            [
                0,
                0,
                0,
                0,
                33,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                41,
                1,
                0,
                0,
                0,
                0,
                0,
                53,
                0,
                0,
                0,
                0,
                44,
                39
            ],
            [
                0,
                0,
                36,
                0,
                0,
                0,
                0,
                1,
                1,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                34,
                0,
                0,
                33,
                0,
                0,
                0,
                0,
                0,
                43,
                1
            ],
            [
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                53,
                0,
                0,
                0,
                0,
                44,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0
            ],
            [
                1,
                0,
                53,
                0,
                0,
                0,
                0,
                0,
                39,
                0,
                54,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                32,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                53
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                55,
                0,
                0,
                0,
                1,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                53
            ],
            [
                0,
                0,
                0,
                52,
                0,
                0,
                1,
                0,
                0,
                0,
                34,
                52,
                0,
                1,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                44,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                55,
                1
            ],
            [
                0,
                0,
                1,
                0,
                0,
                0,
                1,
                1,
                0,
                31,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                34,
                1,
                0,
                0,
                0,
                0,
                0,
                49,
                0,
                0,
                37,
                0
            ],
            [
                38,
                1,
                0,
                0,
                0,
                52,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                36,
                1,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                42,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                1,
                1,
                0,
                0,
                55,
                0,
                1,
                0,
                0,
                1,
                0,
                0
            ],
            [
                0,
                50,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                40,
                0,
                0,
                50,
                0,
                0,
                0,
                0,
                0,
                49,
                0,
                0,
                0,
                0,
                40,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                1,
                0,
                0
            ],
            [
                34,
                0,
                43,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                45,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                37,
                0,
                0,
                0,
                0,
                53,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                47,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                1,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                46,
                0,
                0,
                0,
                0,
                0,
                0,
                47,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                1
            ],
            [
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                1,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                44,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                46,
                0
            ],
            [
                47,
                55,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                38,
                0,
                0,
                54,
                0,
                0,
                0
            ],
            [
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                1,
                1,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                44,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                1
            ],
            [
                1,
                1,
                42,
                44,
                0,
                1,
                0,
                0,
                1,
                0,
                0,
                31,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                53
            ],
            [
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                1,
                0,
                0,
                0,
                0,
                0,
                0,
                34,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0,
                0
            ]
        ],
        "type": "ice"
    }
}

/tai_shang_world_generator/api/v1/mint

接口定义:生成随机地图数据

标题 描述
接口路径 /tai_shang_world_generator/api/v1/mint
Method POST
Content-Type application/json

Query Params:

Key Type Value Required
coupon_id string afbf78b685e82cb7385922d5ccd1a841 Y

Post表单参数:

Key Type Value Required
block_number int Y
rule string RuleA Y
source string a_block Y

例如:

POST http://localhost:4000/tai_shang_world_generator/api/v1/mint?coupon_id=afbf78b685e82cb7385922d5ccd1a841

传入参数

{
    "block_number": 22793130,
    "rule": "RuleA",
    "source": "a_block"
}

返回内容:

{
    "error_code": 0,
    "error_msg": "success",
    "result": {
        "token_info": {
            "contract_addr": "0x01",
            "minter_name": "leeduckgo",
            "token_id": 1,
            "tx_id": "0x0"
        }
    }
}

/tai_shang_world_generator/api/v1/get_last_block_num

接口定义:获取块高

标题 描述
接口路径 /tai_shang_world_generator/api/v1/get_last_block_num
Method GET
Content-Type application/json

例如:

GET http://124.251.110.212:4001/tai_shang_world_generator/api/v1/get_last_block_num

返回内容:

{
  "error_code": 0,
  "error_msg": "success",
  "result": {
    "last_block_num": 23066865
  }
}
Clone this wiki locally