CAFECA-IO / iSunFA

Artificial Intelligence in Financial
https://isunfa.com
GNU General Public License v3.0
0 stars 0 forks source link

[DOCS] -Certificate API規劃 #2872

Open TinyMurky opened 2 hours ago

TinyMurky commented 2 hours ago

Summary

Certificate API規劃

Tasks

Dependencies

No response

Other Dependencies

No response

Additional Notes

No response

TinyMurky commented 2 hours ago

Pusher 相關API

Pusher 流程:

Qrcode ---> encrypt api

  • 位置:/pages/users/accounting/certificate_list.tsx =>/components/certificate/certificate_list_body.tsx 358 行 => src/components/certificate/certificate_qrcode_modal.tsx
  • 在>/components/certificate/certificate_list_body.tsx 中使用 APIHandler<string>(APIName.ENCRYPT)取得 companyId加密後的token
  • 前端把token放到src/components/certificate/certificate_qrcode_modal.tsx
  • token好的時候同時會驅動 /components/certificate/certificate_list_body.tsx => certificateHandler 發送Pusher, 呼叫setUploadingCertificates在pusher中放入image的metadata ICertificateMeta (其中url是專門for前端)

手機上傳流程 -> pusher api + v

  • 位置: /pages/mobile_upload.tsx
  • ICertificateMetaWithFile 先用pusherAPI上傳pusher通知(手機板不可以subscribe pusher, 要用後端的api), 把圖片設定為processing, 再使用 uploadCertificates 上傳圖片(使用公用upload api POST /api/v2/upload/),