Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/swagger/traPortfolio.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ components:
- 10
- 11
- 12
- 13
x-enum-varnames:
- homepage
- blog
Expand All @@ -870,6 +871,7 @@ components:
- hackthebox
- ctftime
- bluesky
- mixi2
x-enum-descriptions:
- ホームページ (IDはリンクのURLそのまま)
- ブログ (IDはリンクのURLそのまま)
Expand All @@ -884,6 +886,7 @@ components:
- HackTheBox
- CTFtime
- Bluesky
- mixi2
x-go-type: uint8
Project:
title: Project
Expand Down
2 changes: 2 additions & 0 deletions internal/domain/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
HACKTHEBOX
CTFTIME
BLUESKY
MIXI2
AccountLimit
)

Expand Down Expand Up @@ -140,6 +141,7 @@
HACKTHEBOX: regexp.MustCompile(`^https://app\.hackthebox\.com/users/[a-zA-Z0-9]+$`),
CTFTIME: regexp.MustCompile(`^https://ctftime\.org/user/[0-9]+$`),
BLUESKY: regexp.MustCompile(`^https://bsky\.app/profile/[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](\.[a-zA-Z0-9]+)+$`),
MIXI2: regexp.MustCompile(`^https://mixi\.social/@[a-zA-Z][a-zA-Z0-9_]{3,15}$`),

Check warning on line 144 in internal/domain/user.go

View check run for this annotation

Codecov / codecov/patch

internal/domain/user.go#L144

Added line #L144 was not covered by tests
}

if r, ok := urlRegexp[accountType]; ok {
Expand Down
5 changes: 5 additions & 0 deletions internal/pkgs/random/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ func AccountURLString(accountType domain.AccountType) string {
"https://bsky.app/profile/tpf.bsky.social",
"https://bsky.app/profile/tpf.example.com",
},
domain.MIXI2: {
"https://mixi.social/@traPisct",
"https://mixi.social/@athiV5ka91",
"https://mixi.social/@ydO_XjxLDG",
},
}
if accountType == domain.HOMEPAGE || accountType == domain.BLOG {
return fmt.Sprintf("https://%s", AlphaNumeric())
Expand Down