{"openapi":"3.0.0","info":{"title":"API Documentation","description":"This is an example API documentation","version":"1.0.0"},"servers":[{"description":"Backend API Server","url":"http://192.168.1.251:3000"},{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/AESOPT02504/6003CEM-API/1.0.0"}],"paths":{"/api/account/user/add":{"post":{"summary":"Add a user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}}}}},"responses":{"201":{"description":"User sign up successful"},"400":{"description":"Empty username or password"},"401":{"description":"Invalid API key"},"409":{"description":"Username already exists"}}}},"/api/account/user/login":{"post":{"summary":"User login","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}}}}},"responses":{"200":{"description":"Login successful, returns user ID"},"400":{"description":"Empty username or password"},"401":{"description":"Incorrect username or password"}}}},"/api/account/staff/add":{"post":{"summary":"Add a staff","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"},"signupCode":{"type":"string"}}}}}},"responses":{"201":{"description":"Staff sign up successful"},"400":{"description":"Empty username or password"},"401":{"description":"Invalid sign-up code"},"409":{"description":"Username already exists"}}}},"/api/account/staff/login":{"post":{"summary":"Staff login","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"username":{"type":"string"},"password":{"type":"string"}}}}}},"responses":{"200":{"description":"Login successful, returns staff ID"},"400":{"description":"Empty username or password"},"401":{"description":"Incorrect username or password"}}}},"/api/cat/add":{"post":{"summary":"Add a cat","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"string"},"breed":{"type":"string"},"location":{"type":"string"},"userId":{"type":"string"},"image":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"Cat added successfully"},"400":{"description":"Missing required fields"},"500":{"description":"Internal Server Error"}}}},"/api/cat/getallcat":{"get":{"summary":"Get all cats","responses":{"200":{"description":"OK"}}}},"/api/cat/getcat/{catid}":{"get":{"summary":"Get cat by ID","parameters":[{"in":"path","name":"catid","schema":{"type":"string"},"required":true,"description":"ID of the cat"}],"responses":{"200":{"description":"OK"}}}},"/api/cat/search":{"get":{"summary":"Search for cats","parameters":[{"in":"query","name":"name","schema":{"type":"string"},"description":"Cat name"},{"in":"query","name":"age","schema":{"type":"string"},"description":"Cat age"},{"in":"query","name":"breed","schema":{"type":"string"},"description":"Cat breed"},{"in":"query","name":"status","schema":{"type":"string"},"description":"Cat status"},{"in":"query","name":"location","schema":{"type":"string"},"description":"Cat location"}],"responses":{"200":{"description":"OK"},"500":{"description":"Database query failed"}}}},"/api/cat/delete/{catid}":{"delete":{"summary":"Delete a cat","parameters":[{"in":"path","name":"catid","schema":{"type":"string"},"required":true,"description":"ID of the cat"}],"responses":{"201":{"description":"Cat deleted successfully"},"500":{"description":"Failed to delete cat"}}}},"/api/cat/update/{catid}":{"put":{"summary":"Update a cat","parameters":[{"in":"path","name":"catid","schema":{"type":"string"},"required":true,"description":"ID of the cat"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"age":{"type":"string"},"breed":{"type":"string"},"location":{"type":"string"},"status":{"type":"string"}}}}}},"responses":{"200":{"description":"OK"},"500":{"description":"Failed to update cat"}}}},"/api/favorite/add":{"post":{"summary":"Add a favorite cat","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"catid":{"type":"string"},"userId":{"type":"string"}}}}}},"responses":{"201":{"description":"Favorite added successfully"},"409":{"description":"Cat already exists"}}}},"/api/favorite/getallcat/{userId}":{"get":{"summary":"Get favorite cats by user ID","parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true,"description":"ID of the user"}],"responses":{"200":{"description":"OK"}}}},"/api/favorite/delete/{favoriteid}":{"delete":{"summary":"Delete a favorite cat","parameters":[{"in":"path","name":"favoriteid","schema":{"type":"string"},"required":true,"description":"ID of the favorite cat"}],"responses":{"201":{"description":"Favorite cat deleted successfully"},"500":{"description":"Failed to delete favorite cat"}}}},"/api/message/add":{"post":{"summary":"Add a message to the database","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"senderId":{"type":"string"},"receiverId":{"type":"string"},"message":{"type":"string"}}}}}},"responses":{"200":{"description":"Message sent successfully"},"500":{"description":"An error occurred while adding the message"}}}},"/api/message/get/{userId}":{"get":{"summary":"Get messages from the database by user ID","parameters":[{"in":"path","name":"userId","schema":{"type":"string"},"required":true,"description":"ID of the user"}],"responses":{"200":{"description":"OK"},"500":{"description":"An error occurred while retrieving the messages"}}}},"/api/message/delete/{messageid}":{"delete":{"summary":"Delete a message from the database","parameters":[{"in":"path","name":"messageid","schema":{"type":"string"},"required":true,"description":"ID of the message"}],"responses":{"201":{"description":"Message deleted successfully"},"500":{"description":"An error occurred while deleting the message"}}}}}}