김재형

Implement dummy file share api and search api

......@@ -166,6 +166,62 @@ createServer({
};
});
this.post("/items/:item_id/share", (schema, request) => {
return {
status: 200,
user_id: 1,
shared: "2020-05-14T06:20:44Z",
data: {
id: "2342",
name: "image.jpg",
is_folder: false,
size: 92929,
path:
"https://presignedurldemo.s3.eu-west-2.amazonaws.com/image.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJJWZ7B6WCRGMKFGQ%2F20180210%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=20180210T171315Z&X-Amz-Expires=1800&X-Amz-Signature=12b74b0788aa036bc7c3d03b3f20c61f1f91cc9ad8873e3314255dc479a25351&X-Amz-SignedHeaders=host",
created_timestamp: "2020-05-14T06:20:44Z",
updated_timestamp: "2020-05-14T06:20:44Z",
},
};
});
this.post("/shared/:shared_item_id", (schema, request) => {
return {
status: 200,
data: {
name: "image.jpg",
size: 92929,
path:
"https://presignedurldemo.s3.eu-west-2.amazonaws.com/image.jpg?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJJWZ7B6WCRGMKFGQ%2F20180210%2Feu-west-2%2Fs3%2Faws4_request&X-Amz-Date=20180210T171315Z&X-Amz-Expires=1800&X-Amz-Signature=12b74b0788aa036bc7c3d03b3f20c61f1f91cc9ad8873e3314255dc479a25351&X-Amz-SignedHeaders=host",
},
};
});
this.post("/items/search", (schema, request) => {
return {
status: 200,
data: {
list: [
{
id: "2341",
is_folder: true,
name: "cloudComputing",
created_timestamp: "2020-05-14T06:20:44Z",
updated_timestamp: "2020-05-14T06:20:44Z",
size: 0,
},
{
id: "2341",
is_folder: true,
name: "cloudComputing",
created_timestamp: "2020-05-14T06:20:44Z",
updated_timestamp: "2020-05-14T06:20:44Z",
size: 0,
},
],
},
};
});
this.post("/users/login", (schema, request) => {
const body = JSON.parse(request.requestBody);
const admin = schema.findBy("user", {
......