72 lines
2.0 KiB
Markdown
72 lines
2.0 KiB
Markdown
|
|
pvfUtility WebApi
|
|||
|
|
介绍
|
|||
|
|
pvfUtility 2020开始 一项重大的更新就是提供了HTTP接口进行自动化操作
|
|||
|
|
|
|||
|
|
这使得第三方工具可以利用http rest api进行文件读写
|
|||
|
|
|
|||
|
|
只需在软件内打开pvf,就能通过第三方工具进行下一步的操作
|
|||
|
|
|
|||
|
|
|
|||
|
|
获取pvfUtility版本号
|
|||
|
|
插件作者可以以版本来来确定用户当前使用的pvfUtility是否适用某些API接口
|
|||
|
|
请求类型:GET
|
|||
|
|
http://localhost:/Api/PvfUtiltiy/getVersion
|
|||
|
|
返回结果
|
|||
|
|
//注:使用此接口pvfUtility版本号需大于2022.9.30.2
|
|||
|
|
{"Data":"2022.9.30.3","IsError":false,"Msg":null}
|
|||
|
|
|
|||
|
|
|
|||
|
|
获取nut文件列表
|
|||
|
|
请求类型:GET
|
|||
|
|
http://localhost:/Api/PvfUtiltiy/GetFileList?dirName=sqr&returnType=0&fileType=nut
|
|||
|
|
解释:dirName=equipment(目录名称)
|
|||
|
|
fileType=.equ(文件后缀名) 注:使用fileType pvfUtility版本号必须大于:2022.08.08.2
|
|||
|
|
|
|||
|
|
返回结果示例(returnType=1)
|
|||
|
|
{
|
|||
|
|
"Data": [
|
|||
|
|
"sqr/arad_cashshop.nut",
|
|||
|
|
"sqr/hair_avagacha.nut",
|
|||
|
|
"sqr/neck_avagacha.nut",
|
|||
|
|
"sqr/belt_avagacha.nut"
|
|||
|
|
],
|
|||
|
|
"IsError": false,
|
|||
|
|
"Msg": null
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
批量获取nut文件内容
|
|||
|
|
请求类型:POST
|
|||
|
|
http://localhost:/Api/PvfUtiltiy/GetFileContents
|
|||
|
|
请求参数
|
|||
|
|
{"FileList":["sqr/arad_cashshop.nut","sqr/neck_avagacha.nut"],"UseCompatibleDecompiler":false,"EncodingType":Null}
|
|||
|
|
|
|||
|
|
解释
|
|||
|
|
UseCompatibleDecompiler=是否使用兼容性反编译器
|
|||
|
|
注:使用encodingType参数 pvfUtility版本号需大于2022.12.3.1,
|
|||
|
|
//encodingType:仅适用于文本文件,默认使用UTF8
|
|||
|
|
//TW=中国台湾
|
|||
|
|
//CN=中国大陆
|
|||
|
|
//KR=韩国
|
|||
|
|
//JP=日本
|
|||
|
|
//UTF8
|
|||
|
|
//Unicode
|
|||
|
|
|
|||
|
|
|
|||
|
|
返回结果示例(注:文件内容为utf-8编码)
|
|||
|
|
{
|
|||
|
|
{"Data":{"FileContentData":{"sqr/arad_cashshop.nut":"\r\nlocal a = 0;\r\n","sqr/neck_avagacha.nut":"\r\nlocal b = 1;\r\n"}},"IsError":false,"Msg":null}
|
|||
|
|
|
|||
|
|
|
|||
|
|
上传新的文件内容
|
|||
|
|
新增或覆盖文件内容
|
|||
|
|
|
|||
|
|
请求类型:POST
|
|||
|
|
http://localhost:/Api/PvfUtiltiy/ImportFile?filePath=[文件路径]
|
|||
|
|
请求参数(文本内容):
|
|||
|
|
文件内容
|
|||
|
|
|
|||
|
|
返回结果
|
|||
|
|
{"IsError":false,"Msg":null}
|
|||
|
|
|