Skip to content

StringChar

接收若干个整数(整数范围:0~255),返回这些整数所对应的 ASCII 码字符组成的字符串。

Lua字符串的字节下标是从 1 开始的

业务属性

属性含义说明输入限定示例值
enable是否启用该控件,未启用时不编译是否编译选择值启用
name控件返回值命名控件输出值变量名常量StringChar
text与控件关联的文本设计页控件显示常量StringChar
input输入参数多个输入值时以,分割常量/流程变量#{ip1},97

使用示例

输入单个参数

参数输入:97

img_4.png

输出控件返回StringChardata属性为:

json
{
  "data": "#{stringChar}"
}
{
  "data": "#{stringChar}"
}
img_5.png

使用curl请求接口:

$ curl http://localhost:6636/api/stringChar
$ curl http://localhost:6636/api/stringChar

接口返回:

json
{
    "data": "a"
}
{
    "data": "a"
}

输入多个参数

参数输入:#{body.p1},#{body.p2},#{body.p3}

img_6.png

多个输入参数之间使用英文,进行隔开

使用curl请求接口:

$ curl http://localhost:6636/api/stringChar -d "{ \"p1\": 97, \"p2\": 98, \"p3\": 99 }"
$ curl http://localhost:6636/api/stringChar -d "{ \"p1\": 97, \"p2\": 98, \"p3\": 99 }"

接口返回:

json
{
    "data": "abc"
}
{
    "data": "abc"
}