chiraggahujaa / metaverse-workspace

Metaverse Workspace
0 stars 0 forks source link

Space Elements #4

Open chiraggahujaa opened 2 days ago

chiraggahujaa commented 2 days ago

API for :

  1. Get a single space
  2. Add elements to space
  3. Delete element from that space
  4. See all elements
chiraggahujaa commented 2 days ago
  1. Get a space result should be :
    
    "dimensions": "100x200",
    "elements": [{
           id: 1,
           element: {
           "id": "chair1",
           "imageUrl": "https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcRCRca3wAR4zjPPTzeIY9rSwbbqB6bB2hVkoTXN4eerXOIkJTG1GpZ9ZqSGYafQPToWy_JTcmV5RHXsAsWQC3tKnMlH_CsibsSZ5oJtbakq&usqp=CAE",
           "static": false,
           "height": 1,
           "width": 1
           }
           x: 20,
           y: 20
       }, {
           id: 2,
         element: {
           "id": "chair2",
           "imageUrl": "https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcRCRca3wAR4zjPPTzeIY9rSwbbqB6bB2hVkoTXN4eerXOIkJTG1GpZ9ZqSGYafQPToWy_JTcmV5RHXsAsWQC3tKnMlH_CsibsSZ5oJtbakq&usqp=CAE",
           "static": false,
           "height": 1,
           "width": 1
           }
           x: 18,
           y: 20
       }, {
           id: 3,
         element: {
           "id": "table1",
           "imageUrl": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS5El5F7QtBVHhSpkQMSzPSDoiQWl3Q7fRG3w&s",
           "static": true,
           "height": 1,
           "width": 1          
           }
           x: 19,
           y: 20
       }
    ]
    }```
chiraggahujaa commented 2 days ago
  1. Add elements payload : { "elementId": "chair1", "spaceId": "123", "x": 50, "y": 20 }

  2. Delete elements should take id of space and element

  3. See all elements results :

    {
    "elements": [{
           id: "chair1",
           imageUrl: "https://encrypted-tbn0.gstatic.com/shopping?q=tbn:ANd9GcRCRca3wAR4zjPPTzeIY9rSwbbqB6bB2hVkoTXN4eerXOIkJTG1GpZ9ZqSGYafQPToWy_JTcmV5RHXsAsWQC3tKnMlH_CsibsSZ5oJtbakq&usqp=CAE",
           width: 20,
           height: 20,
           static: true
       }]
    }