locked
How To Craete ASP.NET Web API to Return JSON RRS feed

  • Question

  • User-341459723 posted

    Can u help me for this application 

    There is a shopping mall with 8 vehicle gates (8 entrance and 8 exit) .

    ## Inputs

    * `Plate number` - A string of Alpha Numerics.
    * `Entrance Timestamp` - A Unix timestamp.
    * `INOUTAgentMACID` - A string of integers.
    * `OUTAgentMACID` - A string of Integers.


    ## Output

    Your ASP demo App should focus on loading these inputs, processing them according to the above mentioned 

    The output should be API which focusses around each Platenumber. For each Plate number, we want to know the answers for the following questions.

    1. Activity Log JSON. [Mentioned below]
      2. Session Log JSON. [Mentioned below]
      3. Analytics.JSON. [Mentioned below]

    The format of the JSON output file should be similar to this structure:

     

    ```

    <%-- Activity.json --%>

    {

                    "102123": {

                                    "Type": "IN",

                                    "OUTAgentMACID": "00-14-22-01-23-45",

                                    "PlateNumber": {

                                                    "Image": "/poll/data/date0/img.png",

                                                    "Number": "ABC1234",

                                                    "TimeStamp": 5901291

                                    }

                    },

                    "102124": {

                                    "Type": "OUT",

                                    "OUTAgentMACID": "00-14-22-01-31-45",

                                    "PlateNumber": {

                                                    "Image": "/poll/data/date0/img1.png",

                                                    "Number": "ABC1234",

                                                    "TimeStamp": 5991291

                                    }

                    },

                    "102125": {

                                    "Type": "IN",

                                    "INAgentMACID": "00-14-22-01-63-45",

                                    "PlateNumber": {

                                                    "Image": "/poll/data/date1/img2.png",

                                                    "Number": "ABC1234",

                                                    "TimeStamp": 6001239

                                    }

                    }

    }

     

    In the above Json the auto inceremented value 102123 is the sessionID

     

    <%-- Session.json --%>

    {

                    {

                    "SessionID":102123,

                    "Platenumber":"ABCD1234",

                    "Intime":53808092,

                    "Outtime": NA,

                    "INAgentMACID":"00-24-22-01-23-45",

                    "OUTAgentMACID":"00-64-22-01-23-45",

                    "Status": "ongoing"        

                    },

                    {

                    "SessionID":102222,

                    "Platenumber":"ABFD1234",

                    "Intime":53808032,

                    "Outtime": 53808032,

                    "INAgentMACID":"00-24-32-01-23-45",

                    "OUTAgentMACID":"00-64-27-01-23-45",

                    "Status": "Ended"           

                    }

    }

     

    <%-- Analytics.json --%>

     

    {

                    "Date":"DDMMYYY",

                    "TotalSessions":"209",

                    "OngoingSessions":"59",

                    "FinishedSessions":"150"

    }

    • **Logging** - Your code should include logs, logging to `STDOUT`. Logging is essential in debugging a system running in production. Logs at the `INFO` level should include decisions your program is making, while the `DEBUG` level can be anything that adds more context to the decision.

    There following requirements need to be meet:

    Generate a random `Activity.json` with 100 entries and produce the `session.json` and `Analytics.json`

    Your submission must run on Windows.

    Monday, March 25, 2019 7:47 AM

Answers

All replies