DCore Application Case: Rating Content

Keywords: network

Scoring and Feedback

After purchasing the content, you can score it by adding information to the comments.

METHODS:

leave_rating_and_comment-Score and comment on content

void leave_rating_and_comment(string consumer,
                              string URI,
                              uint64_t rating,
                              string comment,
                              bool broadcast);

Parameters:

  • consumer - Scoring consumer
  • URI - Unified Resource Identifier for Content
  • rating - Scoring. The options provided are 1-5, where 5 represents the maximum and the maximum equals the best score value.
  • Comment - The maximum length of a comment is 100 characters
  • Broadcast Transaction Information on the Network in the State of Broadcast - true

Examples are given to illustrate:

leave_rating_and_comment ronald "ipfs:QmbEMGa2xKcq2T4kDhjWA92aGRAS5eh7irPbcQGd6dijPv" 3 "" true

Result:

leave_rating_and_comment ronald "ipfs:QmbEMGa2xKcq2T4kDhjWA92aGRAS5eh7irPbcQGd6dijPv" 3 "" true
null

API Developer Documentation for Scoring and Evaluation

Show Scoring and Feedback

Use the following method to obtain a feedback form for the specified content.

Method Explanation:
search_feedback - Search in User Feedback

vector<rating_object_ex> search_feedback(const string& user,
                                         const string& URI,
                                         const string& id,
                                         uint32_t count) const;

Parameters:

  • user - Author giving feedback
  • URI - Unified Resource Identifier for Content Target Items
  • ID - This ID is created when purchasing content, and you intend to start searching for purchasing targets from it
  • count - Maximum number of graspable feedback

Return value:

  • Find feedback.

Examples are given to illustrate:

search_feedback "" "ipfs:QmbEMGa2xKcq2T4kDhjWA92aGRAS5eh7irPbcQGd6dijPv" "" 1

Respond:

[{
    "id": "2.12.10",
    "consumer": "1.2.18",
    "URI": "ipfs:QmPeUDhUwuE5GyBCfKRnvYbnAFkJy5tZsc66Br9q5fC9WW",
    "synopsis": "{\"content_type_id\":\"0\",\"title\":\"pub10\",\"description\":\"10\"}",
    "price": {
      "amount": 0,
      "asset_id": "1.3.0"
    },
    "paid_price_before_exchange": {
      "amount": 100000000,
      "asset_id": "1.3.0"
    },
    "paid_price_after_exchange": {
      "amount": 100000000,
      "asset_id": "1.3.0"
    },
    "seeders_answered": [
      "1.2.16",
      "1.2.17"
    ],
    "size": 1,
    "rating": 3,
    "comment": "My thoughts, cokolveeeeeek",
    "expiration_time": "2018-02-15T14:19:55",
    "pubKey": {
      "s": "3398805210386417935659085342997301774661754175089581995591046947463280571859128574508785989129943525087773479778688676124243911952000486510467516111177374."
    },
    "key_particles": [{
        "C1": {
          "s": "4730495964088102863481086931352588725438836281298049151157894088843250827108215403351413412083972123346919215336243741564359356403705458821440673650234719."
        },
        "D1": {
          "s": "6368979732194225890750024605297344654612766559073680060805207127978861940996481109426678444471439618971162236475165721894047335715486167813435682042159993."
        }
      },{
        "C1": {
          "s": "1809809520611446425413566075467645796356667394533640508655655307978980141418364895888659074557843373369254826809769869930149887514237139410215166761230763."
        },
        "D1": {
          "s": "10744080555769203028989095373028482227029097140915548357994120606641455681270049985696763698654666346852762243081013307044988846709403139829971512431733102."
        }
      }
    ],
    "expired": false,
    "delivered": true,
    "expiration_or_delivery_time": "2018-02-14T14:20:00",
    "rated_or_commented": true,
    "created": "2018-02-14T12:55:35",
    "region_code_from": 1,
    "author": "peters"
  }
]

API Developer Documents for Search Feedback

Posted by waygood on Tue, 08 Oct 2019 07:33:36 -0700