/// <summary>
 /// 上传经纬度
 /// </summary>
 /// <param name="lAndLUpLoadMapper"></param>
 /// <param name="userId"></param>
 public async Task UpLoadingAsync(LAndLUpLoadMapper lAndLUpLoadMapper, int userId)
 {
     SqlParameter[] parameters = new[]
     {
         new SqlParameter("Latitude", lAndLUpLoadMapper.Latitude),
         new SqlParameter("Longitude", lAndLUpLoadMapper.Longitude),
         new SqlParameter("userId", userId),
     };
     var result = await _myContext.Database.ExecuteSqlCommandAsync(
         "update LatitudeAndLongitudes set Latitude=@Latitude,Longitude=@Longitude where UserId=@userId",
         parameters);
 }
예제 #2
0
        public async Task <IActionResult> UpLoadApiAsync(LAndLUpLoadMapper lAndLUpLoadMapper)
        {
            var jwt = HttpRequest();
            CustomStatusCode code;
            await _longitudeResource.UpLoadingAsync(lAndLUpLoadMapper, jwt.Id);

            _logger.LogInformation($"用户 {jwt.Id} 上传经纬度成功");
            code = new CustomStatusCode
            {
                Status  = "200",
                Message = $"用户 {jwt.Id} 上传经纬度成功"
            };
            return(StatusCode(200, code));
        }