示例#1
0
        public IActionResult CreateArt(int userId, string artTitle)
        {
            int artId = mainService.CreateArt(userId, artTitle);

            return(ActionResults.Json(new {
                artId = artId
            }));
        }
示例#2
0
        public IActionResult PushMessage(int userId, [FromBody] Message message)
        {
            mainService.PushMessage(message);

            return(ActionResults.Json(new {
                message = "Pushed Message."
            }));
        }
示例#3
0
        public IActionResult DisconnectDevice(int userId)
        {
            mainService.DisconnectDevice(userId);

            return(ActionResults.Json(new {
                message = "Device Disconnected."
            }));
        }
示例#4
0
        public IActionResult ConnectWithoutHololens()
        {
            int userId = mainService.ConnectWithoutHoloLens();

            return(ActionResults.Json(new {
                userId = userId
            }));
        }
示例#5
0
        public IActionResult SaveSettings([FromBody] SettingsChangedMessage message)
        {
            mainService.PushMessage(message);

            return(ActionResults.Json(new {
                message = "Pushed Message."
            }));
        }
示例#6
0
        public IActionResult SaveTextMessage([FromBody] SaveTextMessage message)
        {
            mainService.PushMessage(message);

            return(ActionResults.Json(new {
                message = "Pushed Message."
            }));
        }
示例#7
0
 public IActionResult GetMessages(int userId)
 {
     if (!mainService.CheckUserExists(userId))
     {
         return(ActionResults.Json(new {
             error = "No such user!"
         }, 400));
     }
     return(ActionResults.Json(new
     {
         messages = JsonConvert.SerializeObject(mainService.GetMessages(userId))
     }));
 }
示例#8
0
        public IActionResult ConnectWithHololens(string pin)
        {
            int userId = mainService.ConnectWithHoloLens(pin);

            if (userId != 0)
            {
                return(ActionResults.Json(new {
                    userId = userId
                }, 200));
            }
            else
            {
                return(ActionResults.Json(new {
                    error = "Pin does not match with any device"
                }, 400));
            }
        }
示例#9
0
 public IActionResult GetMediaItems(int userId)
 {
     return(ActionResults.Json(mainService.GetMediaItems(userId, true)));
 }
示例#10
0
 [HttpGet("dump")] // calismiyor
 public IActionResult Dump()
 {
     return(ActionResults.Json(mainService.Dump()));
 }
示例#11
0
 [HttpGet("gallery")] // calismiyor
 public IActionResult Gallery(int userId)
 {
     return(ActionResults.Json(mainService.GetGallery(userId)));
 }
示例#12
0
 [HttpGet("search")] // ???
 public IActionResult Search(string json)
 {
     return(ActionResults.Json(mainService.getSearchResult(json)));
 }
示例#13
0
        [HttpPost("getDetails")] //db gelince test et
        public IActionResult GetDetails(int artId)
        {
            var result = mainService.getDetails(artId);

            return(ActionResults.Json(result));
        }
示例#14
0
 [HttpGet("pin")] // --
 public IActionResult GeneratePin()
 {
     return(ActionResults.Json(new {
         pin = mainService.GeneratePin()
     }));
 }
示例#15
0
 public IActionResult CheckForPairing(string pin)
 {
     return(ActionResults.Json(new {
         userId = mainService.CheckForPairing(pin)
     }));
 }