public override async Task <ResponseStatusList> DeleteList(string input) { ResponseStatusList result = new ResponseStatusList(); var ids = input.Split(','); long id; foreach (var item in ids) { if (!long.TryParse(item, out id)) { continue; } await base.DeleteAsync(new EntityDto <long> { Id = id }); result.ResponseStatusObject.Add(new ResponseStatus { Id = item, RequestURL = "", StatusCode = 0, StatusString = "", LocalTime = DateTime.Now }); } return(result); }
public async Task <ResponseStatusList> UpdateApes(List <ApeDto> apeDtos) { ResponseStatusList result = new ResponseStatusList(); foreach (var dto in apeDtos) { var ape = await _apeRepository.GetAsync(dto.Id); if (ape == null) { continue; } ObjectMapper.Map(dto, ape); //_apeRepository.Update(ape); result.ResponseStatusObject.Add(new ResponseStatus { Id = dto.Id.ToString(), RequestURL = "", StatusCode = 0, StatusString = "", LocalTime = DateTime.Now }); } return(result); }
public override async Task <ResponseStatusList> UpdateList(CreateOrUpdateListInputDto <FaceDto> input) { ResponseStatusList result = new ResponseStatusList(); foreach (var item in input.List) { var dto = await base.UpdateAsync(item); result.ResponseStatusObject.Add(new ResponseStatus { Id = dto.Id.ToString(), RequestURL = "", StatusCode = 0, StatusString = "", LocalTime = DateTime.Now }); } return(result); }
public override async Task <ResponseStatusList> CreateList(CreateOrUpdateListInputDto <FaceDto> input) { ResponseStatusList result = new ResponseStatusList(); foreach (var faceDto in input.List) { foreach (var subImageInfoDto in faceDto.SubImageList.SubImageInfoObject) { if (string.IsNullOrEmpty(subImageInfoDto.Data)) { continue; } SaveImageByBase64Request request = new SaveImageByBase64Request() { ImageBase64 = subImageInfoDto.Data }; SaveImageResponse response = await _imageAppService.SaveImageByBase64Async(request); subImageInfoDto.NodeId = response.BucketName; subImageInfoDto.ImageKey = response.ImageName; subImageInfoDto.StoragePath = $"{response.BucketName}:{response.ImageName}"; } var face = await base.CreateAsync(faceDto); result.ResponseStatusObject.Add(new ResponseStatus { Id = face.Id.ToString(), RequestURL = "", StatusCode = 0, StatusString = "", LocalTime = DateTime.Now }); } return(result); }