예제 #1
0
        public List <SAccount> GetAccounts()
        {
            SBasic <List <SAccount> > response = RESTService.MakeAndExecuteGetRequest <List <SAccount> >("/api/accounts", null);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #2
0
        public List <SMedia> GetMedias()
        {
            SBasic <List <SMedia> > response = RESTService.MakeAndExecuteGetRequest <List <SMedia> >("/api/medias", null);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #3
0
        // Feedback
        public List <SFeedback> GetFeedbacks()
        {
            SBasic <List <SFeedback> > response = RESTService.MakeAndExecuteGetRequest <List <SFeedback> >("/api/feedbacks", null);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #4
0
        public List <SSite> GetSites()
        {
            SBasic <List <SSite> > response = RESTService.MakeAndExecuteGetRequest <List <SSite> >("/api/sites", null);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #5
0
        public SAccount GetAccount(int account_id)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("id", account_id.ToString());
            SBasic <SAccount> response = RESTService.MakeAndExecuteGetRequest <SAccount>("/api/account/{id}?field=id", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #6
0
        public List <SFeedback> GetFeedbacksForNote(string note_id)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("id", note_id);
            SBasic <List <SFeedback> > response = RESTService.MakeAndExecuteGetRequest <List <SFeedback> >("/api/note/{id}/feedbacks", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #7
0
        public SNote DeleteNote(string note_id)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("id", note_id);
            SBasic <SNote> response = RESTService.MakeAndExecuteGetRequest <SNote>("/api/note/{id}/delete", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #8
0
        public List <SNote> GetNotes(string context_id, string note_type)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("id", context_id); get_params.Add("type", note_type);
            SBasic <List <SNote> > response = RESTService.MakeAndExecuteGetRequest <List <SNote> >("/api/context/{id}/notes/{type}", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #9
0
        // API Endpoints

        // Account
        public SAccount GetAccount(string account_username)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("username", account_username);
            SBasic <SAccount> response = RESTService.MakeAndExecuteGetRequest <SAccount>("/api/account/{username}", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #10
0
        public List <SNote> GetNotesMostRecent(int n)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("n", n.ToString());
            SBasic <List <SNote> > response = RESTService.MakeAndExecuteGetRequest <List <SNote> >("/api/sync/recent/{n}", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #11
0
        // Notification
        public string SendAliveMessage()
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("site", Configurations.site_name);
            SBasic <string> response = RESTService.MakeAndExecuteGetRequest <string>("/api/notification/alive/at/{site}", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #12
0
        public List <SContext> GetContextsForSite(string site_name)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("name", site_name);
            SBasic <List <SContext> > response = RESTService.MakeAndExecuteGetRequest <List <SContext> >("/api/site/{name}/contexts", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #13
0
        public SFeedback GetFeedback(string feedback_id)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("id", feedback_id);
            SBasic <SFeedback> response = RESTService.MakeAndExecuteGetRequest <SFeedback>("/api/feedback/{id}", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #14
0
        // Site
        public SSite GetSite(string site_name)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("name", site_name);
            SBasic <SSite> response = RESTService.MakeAndExecuteGetRequest <SSite>("/api/site/{name}", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #15
0
        public List <SFeedback> GetFeedbacksForUser(string account_username)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("username", account_username);
            SBasic <List <SFeedback> > response = RESTService.MakeAndExecuteGetRequest <List <SFeedback> >("/api/account/{username}/feedbacks", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #16
0
        public SContext DeleteContext(string context_id)
        {
            Dictionary <string, string> get_params = new Dictionary <string, string>();

            get_params.Add("id", context_id);
            SBasic <SContext> response = RESTService.MakeAndExecuteGetRequest <SContext>("/api/context/{id}/delete", get_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #17
0
        public SFeedback CreateFeedback(string kind, string model, string object_id, string account_username, object feedback_content, string parent_id)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("kind", kind); get_params.Add("model", model); get_params.Add("id", object_id); get_params.Add("username", account_username);
            post_params.Add("content", feedback_content); post_params.Add("parent_id", parent_id);
            SBasic <SFeedback> response = RESTService.MakeAndExecutePostRequest <SFeedback>("/api/feedback/new/{kind}/for/{model}/{id}/by/{username}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #18
0
        //public SMedia AddMedia(string note_id, string note_title, object note_file)
        //{
        //    Dictionary<string, string> get_params = new Dictionary<string, string>();
        //    Dictionary<string, object> post_params = new Dictionary<string, object>();
        //    get_params.Add("id", note_id);
        //    post_params.Add("title", note_title); post_params.Add("file", note_file);
        //    SBasic<SMedia> response = RESTService.MakeAndExecutePostRequest<SMedia>("/api/note/{id}/new/photo", get_params, post_params);
        //    if (response != null)
        //        if (response.data != null)
        //            return response.data;
        //    return null;
        //}
        public SNote UpdateNote(string note_id, string status)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("id", note_id);
            post_params.Add("status", status);
            SBasic <SNote> response = RESTService.MakeAndExecutePostRequest <SNote>("/api/note/{id}/update", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #19
0
        //Interaction Log
        //public string CreateInteractionFile(long start_date, long end_date, string file_name, string file_path)
        //{
        //    Dictionary<string, string> get_params = new Dictionary<string, string>();
        //    Dictionary<string, object> post_params = new Dictionary<string, object>();
        //    get_params.Add("kind", "tabletop"); get_params.Add("site", Configurations.GetSiteNameForServer());
        //    post_params.Add("start", start_date); post_params.Add("end", end_date);
        //    string response = RESTService.MakeAndExecutePostRequestWithFile("/api/log/new/{kind}/at/{site}", get_params, post_params, file_name, file_path);
        //    return response;
        //}
        public SInteractionLog CreateInteractionRecord(int type, string details, int touch_id, double touch_x, double touch_y, string date)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("type", type.ToString()); get_params.Add("site", Configurations.GetSiteNameForServer());
            post_params.Add("date", date); post_params.Add("touch_id", touch_id.ToString()); post_params.Add("touch_x", touch_x.ToString()); post_params.Add("touch_y", touch_y.ToString());
            post_params.Add("details", details);
            SBasic <SInteractionLog> response = RESTService.MakeAndExecutePostRequest <SInteractionLog>("/api/interaction/new/{type}/at/{site}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #20
0
        public SNote CreateNote(string account_username, string note_kind, string note_content, string context_name, string status)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("username", account_username);
            post_params.Add("kind", note_kind); post_params.Add("content", note_content);
            post_params.Add("context", context_name); post_params.Add("status", status);
            SBasic <SNote> response = RESTService.MakeAndExecutePostRequest <SNote>("/api/note/new/{username}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #21
0
        public SContext AddContext(string title, string description, string icon)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("site", Configurations.GetSiteNameForServer());
            post_params.Add("title", title); post_params.Add("description", description);
            post_params.Add("icon", icon);
            SBasic <SContext> response = RESTService.MakeAndExecutePostRequest <SContext>("/api/context/new/activity/at/{site}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #22
0
        public SContext UpdateContext(string context_id, string title, string description, string icon)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("id", context_id);
            post_params.Add("title", title); post_params.Add("description", description);
            post_params.Add("icon", icon);
            SBasic <SContext> response = RESTService.MakeAndExecutePostRequest <SContext>("/api/context/{id}/update", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }
예제 #23
0
        public SAccount UpdateAccount(string account_username, string account_password, string account_email, string account_consent, string affiliation, string icon_url)
        {
            Dictionary <string, string> get_params  = new Dictionary <string, string>();
            Dictionary <string, object> post_params = new Dictionary <string, object>();

            get_params.Add("username", account_username);
            post_params.Add("password", account_password);
            post_params.Add("email", account_email); post_params.Add("consent", account_consent);
            post_params.Add("affiliation", affiliation); post_params.Add("icon_url", icon_url);
            SBasic <SAccount> response = RESTService.MakeAndExecutePostRequest <SAccount>("/api/account/update/{username}", get_params, post_params);

            if (response != null)
            {
                if (response.data != null)
                {
                    return(response.data);
                }
            }
            return(null);
        }