Posts

Showing posts from August 18, 2018

node.js connecting to s3 and youtube

Image
Clash Royale CLAN TAG #URR8PPP .everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0; up vote 2 down vote favorite I have a task to connect to S3 get a JSON file with the names of artists, use the youtube-data-api and search for the top 10 songs. Then send it back in a given format to S3 back. console.log("Loading up the best code ever!!!"); //packagess import var fs = require('fs'); var AWS = require('aws-sdk'); var Singer = require('./Singer') //prepare all the AWS S3 data AWS.config.update( region: "us-west-1" ); var credentials = new AWS.SharedIniFileCredentials(); AWS.config.credentials = credentials; // Create S3 service object s3 = new AWS.S3( apiVersion: '2006-03-01' ); // Create the parameters for calling createBucket var bucketParams = Bucket: 'pc-backend-exercises', Key: 'toSearch.json', ResponseContentType: 'application/json' ; /// prepare the y...

Java File Upload Service Design

Image
Clash Royale CLAN TAG #URR8PPP .everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0; up vote 0 down vote favorite I am creating an application that will upload a file in the web. There are three services: login, upload and logout. All of it sends request and receives response which I put in a DTO. Model has all the logic, while view has the UI. Controller connects the model and view. Above are the fields inside its respective DTO. Is there a better way to do this? As you can see, the fields are repeating, but varies whether it is on request or response. I created two interfaces and its respective DTO implements it. First: public interface TransferrableKey extends TransferrableData public String getLogonkey(); public void setLogonkey(String logonKey); public String getTokenkey(); public void setTokenkey(String tokenKey); Second: public interface TransferrableResponse extends TransferrableData public String getMessage(); public v...