コード例 #1
0
ファイル: UserService.cs プロジェクト: BooTeK/Rainy
        public object Get(UserRequest request)
        {
            var u = new DTO.UserResponse();

            try {
                var    baseUri = ((HttpListenerRequest)this.Request.OriginalRequest).Url;
                string baseUrl = baseUri.Scheme + "://" + baseUri.Authority + "/";

                u.Username  = request.Username;
                u.Firstname = "Not";
                u.Lastname  = "Important";

                u.NotesRef = new DTO.ContentRef()
                {
                    ApiRef = baseUrl + "/api/1.0/" + request.Username + "/notes",
                    Href   = baseUrl + "/api/1.0/" + request.Username + "/notes"
                };
                using (var note_repo = GetNotes(request.Username)) {
                    u.LatestSyncRevision = note_repo.Manifest.LastSyncRevision;
                    u.CurrentSyncGuid    = note_repo.Manifest.ServerId;
                }
            } catch (Exception e) {
                Logger.Debug("CAUGHT EXCEPTION: " + e.Message);
                throw;
            }
            return(u);
        }
コード例 #2
0
ファイル: UserService.cs プロジェクト: BooTeK/Rainy
        public object Get(UserRequest request)
        {
            var u = new DTO.UserResponse ();
            try {
                var baseUri = ((HttpListenerRequest)this.Request.OriginalRequest).Url;
                string baseUrl = baseUri.Scheme + "://" + baseUri.Authority + "/";

                u.Username = request.Username;
                u.Firstname = "Not";
                u.Lastname = "Important";

                u.NotesRef = new DTO.ContentRef () {
                    ApiRef = baseUrl + "/api/1.0/" + request.Username + "/notes",
                    Href = baseUrl + "/api/1.0/" + request.Username + "/notes"
                };
                using (var note_repo = GetNotes (request.Username)) {
                    u.LatestSyncRevision = note_repo.Manifest.LastSyncRevision;
                    u.CurrentSyncGuid = note_repo.Manifest.ServerId;
                }
            } catch (Exception e) {
                Logger.Debug ("CAUGHT EXCEPTION: " + e.Message);
                throw;
            }
            return u;
        }
コード例 #3
0
ファイル: UserService.cs プロジェクト: gmstrbytes/Rainy
        public object Get(UserRequest request)
        {
            var    u       = new DTO.UserResponse();
            string baseUrl = ((HttpListenerRequest)this.Request.OriginalRequest).GetBaseUrl();

            u.Username  = request.Username;
            u.Firstname = "Not";
            u.Lastname  = "Important";

            u.NotesRef = new DTO.ContentRef()
            {
                ApiRef = baseUrl + "/api/1.0/" + request.Username + "/notes/",
                Href   = baseUrl + "/api/1.0/" + request.Username + "/notes/"
            };

            using (var note_repo = GetNotes()) {
                u.LatestSyncRevision = note_repo.Manifest.LastSyncRevision;
                u.CurrentSyncGuid    = note_repo.Manifest.ServerId;
            }
            return(u);
        }
コード例 #4
0
ファイル: UserService.cs プロジェクト: Dynalon/Rainy
        public object Get(UserRequest request)
        {
            var u = new DTO.UserResponse ();
            var baseUri = ((HttpListenerRequest)this.Request.OriginalRequest).Url;
            string baseUrl = baseUri.Scheme + "://" + baseUri.Authority + "/";

            u.Username = request.Username;
            u.Firstname = "Not";
            u.Lastname = "Important";

            u.NotesRef = new DTO.ContentRef () {
                ApiRef = baseUrl + "/api/1.0/" + request.Username + "/notes/",
                Href = baseUrl + "/api/1.0/" + request.Username + "/notes/"
            };

            using (var note_repo = GetNotes ()) {
                u.LatestSyncRevision = note_repo.Manifest.LastSyncRevision;
                u.CurrentSyncGuid = note_repo.Manifest.ServerId;
            }
            return u;
        }