Market

The Market API allows you to interact to buy and sell resources or workers on the market. The market is almost only player driven by the exception. T0 workers are sometime listed on the market by the system.

  Show all workers listed on the market
  /market/workers
  @GET
  Show all specify workers listed on the market
  /market/workers/{workerName}
  @GET  
  Allow you to buy a worker on the market.
  /market/workers/buy  
  @POST
    {
      "listingID":"The id of the worker on the market"
    } 
  Allow you to sell a worker on the market.
  The worker's status need to be "Waiting for Order"
  /market/workers/sell
  @POST
    {
      "workerID":"The id of the worker to sell",
      "price": Integer
    } 

  Exemple:
    {
      "workerID":"dae29e6e-d522-4518-b1b3-049fa7e85a71",
      "price": 100
    } 
  Show all resources listed on the market
  /market/resources 
  @GET
  Show all specify resources listed on the market
  /market/resources/{resourceName}
  @GET 
  Allow you to buy a worker on the market.
  /market/resources/buy  
  @POST
    {
      "listingID":"The id of the listing on the market"
    } 
  Allow you to sell a worker on the market.
  The worker's status need to be "Waiting for Order"
  /market/resources/sell
  @POST
    {
      "resourceName":"The name of the resource to sell",
      "quantity" : Integer,
      "price": Integer //IS THE PRICE PER UNIT NOT THE TOTAL
    } 

  Exemple:
    {
      "resourceName":"Iron",
      "quantity" : 45,
      "price": 10
    }