获取一个合约工程的内容树。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String DescribeAntChainContractProjectContentTree

系统规定参数。取值:DescribeAntChainContractProjectContentTree

ProjectId String 2L9VK68g

项目ID

返回数据

名称 类型 示例值 描述
RequestId String A0DF307A-A44A-476F-99D8-BA4F205350BD

请求ID

Result Object

请求结果

ProjectVersion String 5

工程版本

ProjectDescription String description

工程描述

ProjectId String 2L9VK68g

工程ID

ProjectName String projectname

工程名称

Children Array of Object []

子文件

示例

请求示例

http(s)://[Endpoint]/?Action=DescribeAntChainContractProjectContentTree
&<公共请求参数>

正常返回示例

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "code" : "200",
  "data" : {
    "RequestId" : "A0DF307A-A44A-476F-99D8-BA4F205350BD",
    "Result" : {
      "ProjectName" : "projectname",
      "ProjectVersion" : "5",
      "ProjectId" : "2L9VK68g",
      "Children" : [ {
        "gmtModified" : 1563937111000,
        "children" : [ {
          "gmtModified" : 1563954481000,
          "children" : [ ],
          "name" : "ads",
          "id" : "5m91BL8Y",
          "gmtCreate" : 1563954481000,
          "directory" : false,
          "projectId" : "2L9VK68g",
          "content" : "",
          "parentId" : "bz9kr4X2"
        } ],
        "name" : "wenjianjia",
        "id" : "bz9kr4X2",
        "gmtCreate" : 1563937111000,
        "directory" : true,
        "projectId" : "2L9VK68g"
      }, {
        "gmtModified" : 1563937114000,
        "children" : [ ],
        "name" : "123",
        "id" : "broOrJ8k",
        "gmtCreate" : 1563869464000,
        "directory" : false,
        "projectId" : "2L9VK68g",
        "content" : ""
      }, {
        "gmtModified" : 1563860292000,
        "children" : [ ],
        "name" : "demo.sol",
        "id" : "1q8Bv68p",
        "gmtCreate" : 1562847564000,
        "directory" : false,
        "projectId" : "2L9VK68g",
        "content" : "pragma solidity ^0.4.23;\n// We have to specify which version of compiler this code will compile with, \n// version should be lower than (or equals to) the supported version showing on this tool.\ncontract Voting {\n    /* Solidity doesn't let you pass in an array of strings in the constructor (yet).\n    We will use an array of bytes32 instead to store the list of candidates with string type.\n    */\n    bytes32[] public candidateList;\n\n    FDGGFDGFDGFDGFDGFDGFDGFDGFDGFD\n    mapping (bytes32 => uint8) public votesReceived;\n\n    /* Counting for candidate counts and total votes for all candidates\n    */\n    uint256 public candidateCount;\n    uint256 public totalVotes;\n\n\n    /* Events which will help for logging and debugging\n    'identity' is like 'address' in original Solidity, length of 'identity' is 256 (bits).\n    */\n    event VOTE(bytes32 candidate, identity voterId);\n    event VALID(bool valid);\n\n\n    /* This is the constructor which will be called once when you\n    deploy the contract to the blockchain. When we deploy the contract,\n    we will pass an array of candidates who will be contesting in the election.\n    You can input a candidate name like: Mike , it will be converted to bytes32.\n    */\n    constructor(bytes32[] candidateNames) public {\n        candidateList = candidateNames;\n        candidateCount = candidateList.length;\n    }\n\n    // This function returns the total votes a candidate has received so far.\n    function totalVotesFor(bytes32 candidate) view public returns (uint8) {\n        require(validCandidate(candidate));\n        return votesReceived[candidate];\n    }\n\n    // This function increments the vote count for the specified candidate. \n    // This is equivalent to casting a vote.\n    function voteForCandidate(bytes32 candidate) public {\n        require(validCandidate(candidate));\n        votesReceived[candidate] += 1;\n        totalVotes += 1;\n    \n        emit VOTE(candidate, msg.sender);\n    }\n\n    // This function will help to check whether target candidate is in the candidateList.\n    function validCandidate(bytes32 candidate) view public returns (bool) {\n        for (uint i = 0; i < candidateList.length; i++) {\n            if (candidateList[i] == candidate) {\n            emit VALID(true);\n            return true;\n            }\n        }\n        emit VALID(false);\n        return false;\n    }\n}"
      }, {
        "gmtModified" : 1563954499000,
        "children" : [ ],
        "name" : "test",
        "id" : "GKX7KZX0",
        "gmtCreate" : 1563954499000,
        "directory" : false,
        "projectId" : "2L9VK68g",
        "content" : ""
      } ],
      "ProjectDescription" : ""
    }
  },
  "requestId" : "A0DF307A-A44A-476F-99D8-BA4F205350BD",
  "successResponse" : true
}