Hi Travel Interface

Keywords: Mobile JDBC Database

Catalog

User registration

User login

Add point (token required)

Get Points

Add information (requires permissions)

File upload

Get information

         Give the thumbs-up

comment

Number of information to get points

For token, the following information may be returned for some that require token

         Remove favors

Get my information

Use user name to get user information

        Get comments

Upload pictures

Upload video or audio

         Get comments

Get a response

Reply to comments

Get Authentication Code

Verification code

Mobile Phone Verify Change Password

User upload Avatar

User registration

  1. url:/user/register

  2. Parameters:

    • Username username
    • Account account (11 digits of mobile number)
    • Password password
  3. Return:

    • Success:
      {
          "status": 0,
          "message": "login was successful"
      }
      
    • Failure: First case:
      {
          "status": 1,
          "message": "The account has been registered"
      }
      
      Second case (rarely encountered):
      {
          "status": 2,
          "message": "unknown error"
      }
      
      Third case:
      {
          "status": 3,
          "message": "Mobile Phone Authentication Code Error"
      }

User login

  • url:/user/login
  • Parameters:
    • Account account
    • Password password
  • Success:
    {
        "status": 0,
        "data": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MiwidHlwZSI6InVzZXIiLCJleHAiOjE1MTkxMzI2MTQsImlhdCI6MTUxODUyNzgxNCwidXNlcm5hbWUiOiLmmJ_mrabogIUifQ.QS_DD4aBQM9KCs7v5TbxWq5tamZhibb1tjMdPDiuYCM",
        "message": "Login Successful!"
    }
    
  • Failure:
    • First case
      {
          "status": 1,
          "message": "user does not exist!"
      }
      
    • Second case
      {
          "status": 2,
          "message": "Password error!"
      }
      
    • Third case (rarely encountered)
      {
          "status": 3,
          "message": "Establish token error!"
      }
      
  • Note: After successful login, you need to save the contents of the data. For some links that require user privileges to complete, you need to set the contents of the data in the request header.The content in the data is token.
    • key token
    • Content in value data

 

 

Add point (token required)

  • url:/point/addPoint
  • Parameters:
    • Name of the name point
    • Longitude longitude
    • Latitude latitude
  • Return:
    • Success:
      {
          "status": 0,
          "message": "Added Successfully"
      }
      
    • Failure:
      {
          "status": 1,
          "message": "Failed to add"
      }
      
      {
          "status": 2,
          "message": "This point already exists"
      }
      
      • First case
      • Second case:

Get Points

  • url:/none/getPoints
  • Parameters:
    • Longitude longitude
    • Latitude latitude
    • range Range int
  • Return:

* A little bit around

{
    "status": 0,
    "data": [
        {
            "id": 6,
            "name": "xingping",
            "longitude": 108.4392,
            "latitude": 34.25896,
            "createAt": "Feb 13, 2018 11:58:43 PM",
            "createBy": 2
        },
        {
            "id": 7,
            "name": "nothing",
            "longitude": 108.43917,
            "latitude": 34.25908,
            "createAt": "Feb 14, 2018 4:09:31 PM",
            "createBy": 2
        },
        {
            "id": 8,
            "name": "nothing",
            "longitude": 108.4391,
            "latitude": 34.259,
            "createAt": "Feb 14, 2018 4:09:40 PM",
            "createBy": 2
        },
        {
            "id": 9,
            "name": "nothing",
            "longitude": 108.43915,
            "latitude": 34.25905,
            "createAt": "Feb 14, 2018 4:09:48 PM",
            "createBy": 2
        }
    ]
}

No point around

{
    "status": 1,
    "message": "No point"
}

 

 

Add information (requires permissions)

  • url:/addMessage/{pointId}

  • Parameters:
    • id of pointId point
    • Content of content information
  • Return:
    {
        "status": 0,
        "message": "Added Successfully"
    }
    
    {
        "status": 1,
        "message": "Failed to add"
    }
    
    • Success
    • fail

File upload

  • url:/upload/{pointId}
  • Parameters:
    • id of pointId point
    • Type type
      • 1 Photo
      • 2 Audio
      • 3 Video
    • File file
  • Return
    {
        "status": 0,
        "message": "File uploaded successfully"
    }
    
    {
        "status": 1,
        "message": "File content is empty"
    }
    
    {
        "status": 2,
        "message": "File upload error"
    }
    
    {
        "status": 3,
        "message": "File upload failed"
    }
    
    • Success
    • fail

Get information

  • url:/none/getMessage/{pointId}
  • Parameters:
    • pointId
    • type
  • Return
    • Message
      {
          "status": 0,
          "data": [
              {
                  "id": 4,
                  "pointId": 6,
                  "type": 0,
                  "username": "Star Warfighter",
                  "content": "It's a nice day today",
                  "remarkCount": 0,
                  "clickCount": 0,
                  "createAt": "Feb 14, 2018 4:12:30 PM",
                  "isClick": false
              },
              {
                  "id": 6,
                  "pointId": 6,
                  "type": 0,
                  "username": "Star Warfighter",
                  "content": "Maybe tomorrow's weather will be fine too",
                  "remarkCount": 0,
                  "clickCount": 0,
                  "createAt": "Feb 14, 2018 4:13:56 PM",
                  "isClick": false
              }
          ]
      }
      
      {
          "status": 0,
          "data": [
              {
                  "id": 7,
                  "pointId": 6,
                  "type": 1,
                  "username": "Star Warfighter",
                  "content": "/photo/2018021468910.png",
                  "remarkCount": 0,
                  "clickCount": 0,
                  "createAt": "Feb 14, 2018 4:16:39 PM",
                  "isClick": false
              }
          ]
      }
      
    • no message
      {
          "status": 1,
          "message": "no message"
      }
      
  • Description: When a message is received with and without token in two states, and when a message is received with token and the user points in favor of it, isClick returns false instead of false.

Give the thumbs-up

  • url:/click
  • Parameters:
    • type
      • 1 is a compliment to the point
      • 2 Comments
    • id of infoOrRemarkId information or comment
  • Return:
    • Success:
      {
          "status": 0,
          "message": "Comment on Success"
      }
      
    • fail
      {
          "status": 1,
          "message": "Praise Failed"
      }
      

comment

  • url:/remark/{infoId}
  • Parameters:
    • The id of the message for the infoId comment
    • topicId
      • 0 is a comment
      • 1 is a reply
    • Content content
    • The toId parameter is not required and must be used when commenting on a reply without this parameter, which is the id of the reuser
  • Return

Success

{
    "status": 0,
    "message": "Comment Success"
}

fail

{
    "status": 1,
    "message": "Comment Failed"
}

 

Number of information to get points

 

  • url:/none/getItems/{pointId}
  • parameter
    • pointId
  • Return
{
    "status": 0,
    "data": {
        "pointId": 7,
        "mesCount": 0,
        "phoCount": 0,
        "audCount": 0,
        "vidCount": 0
    }
}

For token, the following information may be returned for some that require token

Need without token

{
    "status": -1,
    "message": "Not logged in"
}

token expires and needs to be logged in again

{
    "status": -2,
    "message": "Logon Expiration"
}

Logon exception, may already be logged on elsewhere

{
    "status": -3,
    "message": "Logon Exception"
}

 

Remove favors

url:/unclick

  • Method: POST

  • token: need

  • Parameters:

  • Type: 0Info 1 Comment 2

  • id of infoOrRemarkId information or comment

  • Return:

    +Success:
         ```
         {
             "status": 0,
             "message": "cancel favor success"
         }
         ```
     +Failure
         ```
         {
             "status": 1,
             "message": "Cancel compliment failed"
         }
         ```

Get my information

  • url:/me
  • token:Need
  • Return:
{
    "status": 0,
    "data": {
        "id": 3,
        "username": "xiaoming",
        "account": "12345678910"
    }
}

Use user name to get user information

  • url:/user
  • Parameter: username: Username
  • Method: POST
  • Return:
   {
    "status": 0,
    "data": {
        "id": 2,
        "username": "Star Warfighter",
        "account": "13572011907"
    }
}
   ```

Get comments

  • url:/none/getRemarks
  • Parameters:
  • id of infoId message
  • pageNo Page Number
  • Page Size Page Size
  • Return
  • Success
{
    {
    "status": 0,
    "data": [
        {
            "id": 1,
            "topicId": 0,
            "content": "It's a nice day today",
            "createAt": "2018-05-17 20:57:49",
            "fromUser": {
                "id": 2,
                "username": "Star Warfighter",
                "account": "13572011907"
            },
            "clickCount": 0,
            "click": false
        },
        {
            "id": 2,
            "topicId": 1,
            "content": "Yes, the weather is fine",
            "createAt": "2018-05-17 21:09:46",
            "fromUser": {
                "id": 2,
                "username": "Star Warfighter",
                "account": "13572011907"
            },
            "toUser": {
                "id": 3,
                "username": "woxin",
                "account": "1293141942"
            },
            "clickCount": 0,
            "click": false
        }
    ]
}
{
    "status": 1,
    "message": "no message"
}

Upload pictures

  • url:/qiniuupload/{pointId}
  • token:Need
  • Method: POST
  • Parameters:
    • title: title of the picture
    • file: Picture Uploaded
  1. Parameters:

    • Success:
    {
        "status": 0,
        "data":"Return the image of Qiniuyun url"
        "message": "File uploaded successfully"
    }
    
    • fail
    {
        "status": 1,
        "message": "File content is empty"
    }
    
    {
        "status": 2,
        "message": "File upload error"
    }
    
    {
        "status": 3,
        "message": "File upload failed"
    }
    
    {
        "status": -1,
        "message": "File upload Qiniuyun has an exception!"
    }
    ```

Upload video or audio

  • url: /upload/{infoId}
  • Method: POST
  • Parameters:
    • type + 2 audio + 3 video
    • File file
    • Tile is not required, but when uploading a video it is required
    • Return
      • Success
      {
          "status": 0,
          "message": "File uploaded successfully"
      }
      
      • fail
      {
          "status": 1,
          "message": "File content is empty"
      }
      
      {
          "status": 2,
          "message": "File upload error"
      }
      
      {
          "status": 3,
          "message": "File upload failed"
      }
      
      {
         "status": 4,
      	"message": "Illegal type"
      }
      
      {
         "status": 5,
      	"message": "Invalid title"
      }

 

Get comments

  • url:/none/getRemarks
  • Parameters:
    • id of infoId message
    • pageNo Page Number
    • Page Size Page Size
  • Return
    • Success
{
    "status": 0,
    "data": [
        {
            "id": 1,
            "content": "It's a nice day today",
            "createAt": "2018-05-17 20:57:49",
            "createBy": {
                "id": 2,
                "username": "Star Warfighter",
                "account": "13572011907"
            },
            "totalReplay": 2,    // Total number of responses
            "replays": [
                {
                    "id": 1,
                    "commId": 1,    // id of comment
                    "fromUser": {
                        "id": 2,
                        "username": "Star Warfighter",
                        "account": "13572011907"
                    },
                    "toUser": {
                        "id": 3,
                        "username": "woxin",
                        "account": "1293141942"
                    },
                    "content": "I'm very happy today",
                    "createAt": "2018-05-28 04:37:21",
                    "click": 0
                },
                {
                    "id": 2,
                    "commId": 1,
                    "fromUser": {
                        "id": 3,
                        "username": "woxin",
                        "account": "1293141942"
                    },
                    "toUser": {
                        "id": 2,
                        "username": "Star Warfighter",
                        "account": "13572011907"
                    },
                    "content": "Why?",
                    "createAt": "2018-05-28 04:42:39",
                    "click": 0
                }
            ],
            "clickCount": 0,
            "click": false
        }
    ]
}
{
    "status": 1,
    "message": "no message"
}
  • Note: Only three responses are shown here, and the responses are not appreciated or disapproved.

Get a response

  • url:/none/replay
  • Method: GET
  • Parameters:
    • pageNo: Which page
    • pageSie: Size of each page
    • remarkId: id of comment
    • Return:
{
    "status": 0,
    "data": [
        {
            "id": 1,
            "commId": 1,
            "fromUser": {
                "id": 2,
                "username": "Star Warfighter",
                "account": "13572011907"
            },
            "toUser": {
                "id": 3,
                "username": "woxin",
                "account": "1293141942"
            },
            "content": "I'm very happy today",
            "createAt": "2018-05-28 04:37:21",
            "isClick": false,
            "click": 0
        },
        {
            "id": 2,
            "commId": 1,
            "fromUser": {
                "id": 3,
                "username": "woxin",
                "account": "1293141942"
            },
            "toUser": {
                "id": 2,
                "username": "Star Warfighter",
                "account": "13572011907"
            },
            "content": "Why?",
            "createAt": "2018-05-28 04:42:39",
            "isClick": false,
            "click": 1
        }
    ]
}
{
    "status": 1,
    "message": "No reply"
}

Reply to comments

  • url:replay/{commId} commId:id of comment
  • Method: POST
  • Parameters:
    • toId: Target user for comments
    • content:Content of the comment
  • Return:
{
    "status": 0,
    "message": "Reply Successfully"
}

Get Authentication Code

  • url:/user/getphonecode
  • Parameters:
    • phonenumber mobile number
  • Return:
    • Success:
      {
          "status": 0,
          "data":code (credentials for background validation)
          "message": "get success"
      }
      
    • Failure:
      {
          "status": -1,
          "message": "Authentication code sending failed!"
      }
      

Verification code

  • url:/user/judgephone
  • Parameters:
    • data acquired by interface above code
    • phonenumber mobile number
  • Return:
    • Success:
      {
          "status": 0,
          "message": "Verification successful"
      }
      
    • Failure:
      {
          "status": -1,
          "message": "Validation failed!"
      }

Mobile Phone Verify Change Password

No token required

  1. Change your password after verifying your mobile number
    • url:/user/changepassword
    • Parameters:
      • account mobile number
      • New password
      • sedpassword New password re-entered
    • Return:
      • Success:
        {
            "status": 0,
            "message": "Successful modification"
        }
        
      • Failure:
        {
            "status": -1,
            "message": "Passwords entered twice are different"
        }
        {
            "status": -2,
            "message": "jdbc Modification failed"
        }

 

User upload Avatar

token required

    • url:/qiniuIcon
    • Parameters:
      • image avatar file
      • token
    • Return:
      • Success:
        {
            "status": 0,
            "message": "The Avatar was uploaded successfully"
        }
        
      • Failure:
        {
            "status": 1,
            "message": "The avatar is empty"
        }
        {
            "status": -1,
            "message": "The picture upload Qiniuyun is abnormal!"
        }
        {
            "status": -2,
            "message": "No such user!"
        }
        {
            "status": -3,
            "message": "The avatar upload database failed!"
        }

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Posted by splat78423 on Sat, 18 May 2019 21:36:16 -0700