Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileQuestion / ImageConstraintの実装改築 #86

Merged
merged 14 commits into from
Jun 2, 2024

Conversation

Shion1305
Copy link
Member

@Shion1305 Shion1305 commented May 26, 2024

  • ✨ (model/question)FileTypes instead of FileType
  • ✨ (model/question) FileType as FileConstraint
  • ♻️ (model/question) change signature of FileConstraint Export()
  • ♻️ (model/question) change signature of Question Export()
  • ✨ (model/question) impl multiple FileConstraints for a question
  • ✨ (model/question) ImageFileConstraint with distinctive Implementation
  • ✨ (schema/section) response schema for ImageConstraint FileTypes
  • ✨ (schema/section) Import&Export logic for ImageFileConstraint
  • 💥 (model/question) remove map[FileType]FileConstraint, add ImageFileConstraint
  • ♻️ (model/question) move ImageSpecs to new file
  • ✅ (model/question) TestImportFileQuestion
Property Value
Corresponding Issue #87
Assignee @Shion1305

PRで実装される機能

  • ImageConstraintの新規での実装
  • FileQuestion/ConstraintのImport/Export

PRで修正される機能

  • map[FileType]FileConstraint の廃止
  • QuestionのExport関数のシグネチャ変更

レビューをお願いしたいポイント

  • 激オモになってしまってごめんなさい...

@Shion1305 Shion1305 force-pushed the shion/file-question-image-constraint-new branch from 42b5a9e to d849a8b Compare May 26, 2024 15:11
Copy link

codecov bot commented May 26, 2024

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Copy link

codecov bot commented May 26, 2024

Codecov Report

Attention: Patch coverage is 56.76692% with 115 lines in your changes are missing coverage. Please review.

Project coverage is 25.30%. Comparing base (bf262bf) to head (5259aa0).

Files Patch % Lines
...pkg/domain/model/question/file_constraint_image.go 54.31% 53 Missing ⚠️
svc/pkg/handler/section/info.go 0.00% 23 Missing ⚠️
...omain/model/question/file_constraint_image_spec.go 87.17% 10 Missing ⚠️
svc/pkg/handler/agent/question.go 0.00% 10 Missing ⚠️
svc/pkg/infra/writer/question.go 0.00% 10 Missing ⚠️
svc/pkg/domain/model/question/file.go 78.26% 5 Missing ⚠️
svc/pkg/domain/model/question/checkbox.go 0.00% 2 Missing ⚠️
svc/pkg/domain/model/question/radio_button.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #86      +/-   ##
==========================================
+ Coverage   24.47%   25.30%   +0.82%     
==========================================
  Files         114      114              
  Lines        3362     3505     +143     
==========================================
+ Hits          823      887      +64     
- Misses       2539     2618      +79     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}

func (c ImageFileConstraint) GetFileType() FileType {
return Image
}

func (c ImageFileConstraint) GetExtensions() []Extension {
return c.Extensions
return []Extension{".jpg", ".jpeg", ".png", ".webp"}
}

func (c ImageFileConstraint) ValidateFiles(files []File) error {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この関数は画像ファイルのみに対して実行するもの?? であると、実際に使用する際にファイルから画像のみを取り出す必要が出てきて面倒そう..

Copy link
Collaborator

@Ryo-Sasaki-xxx Ryo-Sasaki-xxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
抽象化のおかげで差分いい感じに収まった感あります!すごすんに

@Shion1305 Shion1305 merged commit 742ebe4 into main Jun 2, 2024
5 checks passed
@Shion1305 Shion1305 deleted the shion/file-question-image-constraint-new branch June 2, 2024 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QuestionTypeの追加 / Parse-Encodeを実装する
2 participants