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

refactor: the naming method of uploaded attachments #1500

Merged
merged 9 commits into from
Oct 29, 2021

Conversation

guqing
Copy link
Member

@guqing guqing commented Oct 20, 2021

Fix #1499

如何测试:

  1. 首先通过 FilePathDescriptor 确定该类所构造的文件路径信息是否正确

  2. 尝试所有不同的上传方式来确定功能是否受影响

  3. 测试上传后的附件信息是否符合预期包括 fileKey,path等,并测试对同一存储方式下,上传同名文件后的附件信息是否正确,检查是否有重命名

@guqing guqing marked this pull request as draft October 20, 2021 10:34
@ruibaby ruibaby added this to the 1.4.13 milestone Oct 20, 2021
@ruibaby ruibaby added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 20, 2021
@ruibaby ruibaby linked an issue Oct 21, 2021 that may be closed by this pull request
@guqing guqing changed the title feat: Refactor the naming method of uploaded attachments refactor: the naming method of uploaded attachments Oct 21, 2021
@guqing guqing requested review from JohnNiang, ruibaby and LIlGG October 21, 2021 10:17
@guqing guqing marked this pull request as ready for review October 21, 2021 10:17
@JohnNiang
Copy link
Member

JohnNiang commented Oct 21, 2021

Please tell us how to test your feature in the description of this PR, thanks.

And add Fix #1499 into the description of this PR.

@guqing
Copy link
Member Author

guqing commented Oct 21, 2021

Please tell us how to test your feature in the description of this PR, thanks.

And add Fix #1499 into the description of this PR.

done.

@JohnNiang
Copy link
Member

JohnNiang commented Oct 22, 2021

I think this PR provides a feature for halo, so I suggest adding this PR into milestone v1.5.x. What do you reckon?

@ruibaby ruibaby modified the milestones: 1.4.13, 1.5.x Oct 22, 2021
@ruibaby
Copy link
Member

ruibaby commented Oct 22, 2021

I think this PR provides a feature for halo, so I suggest adding this PR into milestone v1.5.x. What do you reckon?

Agree

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

我发现每一个 FileHandler 都会使用 FileDescriptor 处理,如果在 FileHandler 接口中定义一下类似的行为会不会更好呢?

@guqing
Copy link
Member Author

guqing commented Oct 22, 2021

我发现每一个 FileHandler 都会使用 FileDescriptor 处理,如果在 FileHandler 接口中定义一下类似的行为会不会更好呢?

你是的说在接口中写默认实现还是什么呢 主要是感觉可能后续可能会增加名称策略或者存储路径策略 放到接口中感觉不太好

@JohnNiang
Copy link
Member

比如我们在 FileHandler 接口中新增一个方法:

FileDescriptor getFileDescriptor();

我们可以默认实现一个 FileDescritor,需要定制的实现类手动实现一个即可。

@guqing
Copy link
Member Author

guqing commented Oct 22, 2021

@JohnNiang 好的👍

@guqing
Copy link
Member Author

guqing commented Oct 25, 2021

比如我们在 FileHandler 接口中新增一个方法:

FileDescriptor getFileDescriptor();

我们可以默认实现一个 FileDescritor,需要定制的实现类手动实现一个即可。

改好了

@ruibaby
Copy link
Member

ruibaby commented Oct 25, 2021

对于文件名获取可能有点问题,比如 1.4.9.png

image
image

@guqing
Copy link
Member Author

guqing commented Oct 25, 2021

对于文件名获取可能有点问题,比如 1.4.9.png

FilenameUtils.getBasename(originalFileName)这个方法有问题? 我倒是没看过这个方法

@guqing
Copy link
Member Author

guqing commented Oct 25, 2021

对于文件名获取可能有点问题,比如 1.4.9.png

已解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

重构上传附件的命名方式
3 participants