public async Task <IActionResult> GetUserImage([FromRoute, SwaggerParameter("id,可從/useradmin取得", Required = true)] long userId, [FromRoute, SwaggerParameter("2:證件正面照,3:證件反面照", Required = true)] byte type) { UserArc userArc = userService.GetUserArcById(userId); string imageFileName = null; switch (type) { case (byte)PictureTypeEnum.Front: imageFileName = userArc.IdImageA; break; case (byte)PictureTypeEnum.Back: imageFileName = userArc.IdImageB; break; } var image = await uploadPicService.LoadImage(userArc, type, imageFileName); if (image == null) { return(NotFound()); } return(File(image, "image/jpeg")); }
public async Task <IActionResult> GetUserImage([FromRoute, SwaggerParameter("匯款申請單id", Required = true)] long remitId, [FromRoute, SwaggerParameter("0:及時照,1:簽名照", Required = true)] byte type) { RemitRecord record = remitRecordService.GetRemitRecordById(remitId); string imageFileName = null; switch (type) { case (byte)PictureTypeEnum.Instant: imageFileName = record.RealTimePic; break; case (byte)PictureTypeEnum.Signature: imageFileName = record.ESignature; break; } var image = await uploadPicService.LoadImage(null, type, imageFileName); if (image == null) { return(NotFound()); } return(File(image, "image/jpeg")); }