wxiaoguang
f0ba87fda8
Avatar refactor, move avatar code from models
to models.avatars
, remove duplicated code ( #17123 )
...
Why this refactor
The goal is to move most files from `models` package to `models.xxx` package. Many models depend on avatar model, so just move this first.
And the existing logic is not clear, there are too many function like `AvatarLink`, `RelAvatarLink`, `SizedRelAvatarLink`, `SizedAvatarLink`, `MakeFinalAvatarURL`, `HashedAvatarLink`, etc. This refactor make everything clear:
* user.AvatarLink()
* user.AvatarLinkWithSize(size)
* avatars.GenerateEmailAvatarFastLink(email, size)
* avatars.GenerateEmailAvatarFinalLink(email, size)
And many duplicated code are deleted in route handler, the handler and the model share the same avatar logic now.
2021-10-06 01:25:46 +02:00
..
2021-10-06 01:25:46 +02:00
2021-09-24 19:32:56 +08:00
2021-09-23 18:50:06 +08:00
2021-09-25 15:00:12 +02:00
2021-09-29 22:53:12 +02:00
2021-09-23 23:45:36 +08:00
2021-09-27 19:07:19 +01:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-08-09 14:08:51 -04:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2017-05-04 13:54:56 +08:00
2021-09-25 15:00:12 +02:00
2021-09-24 19:32:56 +08:00
2021-09-23 23:45:36 +08:00
2021-09-22 13:38:34 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-07-13 15:28:07 +02:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-22 13:38:34 +08:00
2021-03-14 19:52:12 +01:00
2021-09-27 16:55:12 +01:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2021-09-24 19:32:56 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-10-01 11:24:43 -04:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-29 22:53:12 +02:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-25 15:00:12 +02:00
2021-10-05 16:41:48 +02:00
2021-10-05 16:41:48 +02:00
2021-09-24 19:32:56 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2020-01-14 11:38:04 +08:00
2021-09-24 19:32:56 +08:00
2021-09-27 19:07:19 +01:00
2021-06-07 07:27:09 +02:00
2021-09-24 19:32:56 +08:00
2021-09-23 23:45:36 +08:00
2018-04-09 23:15:32 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-25 15:00:12 +02:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-27 19:07:19 +01:00
2021-09-27 16:55:12 +01:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2021-09-24 19:32:56 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2021-09-22 13:38:34 +08:00
2021-09-24 19:32:56 +08:00
2021-01-20 20:36:55 +00:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-10-05 20:39:37 +02:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-25 15:00:12 +02:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2020-08-16 23:07:38 -04:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-10-06 01:25:46 +02:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-23 23:45:36 +08:00
2021-09-24 19:32:56 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2021-09-25 15:00:12 +02:00
2021-09-19 19:49:59 +08:00
2021-09-24 19:32:56 +08:00
2021-09-19 19:49:59 +08:00
2020-11-27 21:42:08 -05:00