MCPcopy Create free account

hub / github.com/KunMoe/kun-galgame-forum / functions

Functions2,016 in github.com/KunMoe/kun-galgame-forum

↓ 2 callersMethodUpdateFields
UpdateFields updates arbitrary fields on an article row (inside a tx).
apps/api/internal/doc/repository/article_repo.go:95
↓ 2 callersMethodUpdatePollFields
UpdatePollFields patches poll scalar columns inside a tx.
apps/api/internal/topic/repository/poll_repo.go:172
↓ 2 callersMethodUpdateRoomLastMessage
UpdateRoomLastMessage refreshes chat_room.last_message_* fields.
apps/api/internal/message/repository/chat_repo.go:275
↓ 2 callersMethodUpdateStatus
UpdateStatus sets the status column (0 = valid, 1 = expired).
apps/api/internal/galgame/repository/resource_repo.go:257
↓ 2 callersMethodUserCollectionIDsForGalgame
UserCollectionIDsForGalgame returns the ids of the user's collections that currently contain the galgame.
apps/api/internal/galgame/repository/collection_repo.go:153
↓ 2 callersMethodUsers
Users returns a map of id -> User. Missing IDs are absent (not nil entries). Order is irrelevant; caller looks up by id. The function transparently:
apps/api/pkg/userclient/userclient.go:166
↓ 2 callersMethodValue
()
apps/api/internal/topic/model/topic_draft.go:16
↓ 2 callersFunctionaggregate
aggregate folds per-link verdicts into the resource-level verdict. See CheckShare for the rules. Split out so the conservative logic is unit-tested.
apps/api/pkg/linkcheck/linkcheck.go:140
↓ 2 callersFunctionappendUniqueStr
────────────────────────────────────────── Shared helpers ──────────────────────────────────────────
apps/api/internal/user/service/user_mapper.go:13
↓ 2 callersFunctionapplyGameTypeFilter
applyGameTypeFilter narrows to galgames classified as a given WORK type by their raters. The type lives in galgame_rating.galgame_type — a JSONB array
apps/api/internal/galgame/repository/list_repo.go:305
↓ 2 callersFunctionapplyRatingFilter
applyRatingFilter adds the advanced rating WHEREs. minRatingCount is a high-confidence gate (only games with enough votes); minRating filters on the s
apps/api/internal/galgame/repository/list_repo.go:267
↓ 2 callersFunctionapplyReleaseFilter
applyReleaseFilter adds inclusive release_date bounds when present. Bounds are pre-resolved "YYYY-MM-DD" strings (PG casts the literal to date). Setti
apps/api/internal/galgame/repository/list_repo.go:282
↓ 2 callersFunctionapplyTransforms
applyTransforms runs the post-render HTML rewrites (code/table/spoiler/video wrappers) and the single server-side sanitization pass shared by every re
apps/api/internal/infrastructure/markdown/markdown.go:288
↓ 2 callersFunctionbuildAuthorizeUrl
( opts: OAuthFlowOptions = {} )
apps/web/app/utils/oauth-auth.ts:30
↓ 2 callersMethodbuildListQuery
buildListQuery returns a pre-filtered *gorm.DB with `status != 1` applied.
apps/api/internal/toolset/repository/toolset_repo.go:45
↓ 2 callersFunctionbuildReactionSummaries
buildReactionSummaries turns the windowed rows for ONE target + the viewer's own keys + a hydrated user map into ordered DTO summaries — each carries
apps/api/internal/topic/service/reactions.go:25
↓ 2 callersMethodcacheResult
cacheResult best-effort stores the enriched result with activityCacheTTL. A redis/marshal failure is ignored — caching must never break the response.
apps/api/internal/activity/service/activity_service.go:108
↓ 2 callersFunctioncachedBatch
cachedBatch serves a per-(id,sfw) TTL cache over a batch fetch: returns the hits, calls `fetch` for ONLY the misses, then caches the results — includi
apps/api/internal/galgame/client/client.go:45
↓ 2 callersMethodcallPatchAuthMe
callPatchAuthMe is the shared post-validation path for UpdateBio / UpdateUsername. Pulls the access token, calls the OAuth client, and hands errors ba
apps/api/internal/user/handler/profile_handler.go:119
↓ 2 callersFunctioncanViewResults
canViewResults returns true if the caller is allowed to see vote counts / voter identities according to the poll's result_visibility setting.
apps/api/internal/topic/service/mapper.go:106
↓ 2 callersFunctioncircumCircle
( vertices: Vertex[], i: number, j: number, k: number )
apps/web/app/composables/useTriangulate.ts:46
↓ 2 callersMethodclearReplyReaction
clearReplyReaction removes the user's `reaction` on a reply if present (like⇄ dislike exclusion), reversing the like count + moemoepoint for a 'like'.
apps/api/internal/topic/service/reply_service.go:431
↓ 2 callersMethodclearTopicReaction
clearTopicReaction removes the user's `reaction` if present (for like⇄dislike exclusion), reversing the like count + moemoepoint when it was a 'like'.
apps/api/internal/topic/service/topic_write_service.go:430
↓ 2 callersFunctioncollectCategoryIDs
collectCategoryIDs returns the unique category IDs from a slice of rows.
apps/api/internal/website/service/mapper.go:69
↓ 2 callersFunctioncollectSingle
( path: string, pick: (data: unknown) => Record<string, unknown>[], loc: (row: Record<string, unkn
apps/web/server/utils/kunSitemapSources.ts:149
↓ 2 callersFunctioncollectWebsiteIDs
collectWebsiteIDs returns the IDs from a slice of website rows.
apps/api/internal/website/service/mapper.go:83
↓ 2 callersFunctioncontains
contains is a thin wrapper so the test reads as English prose.
apps/api/internal/galgame/client/banner_test.go:10
↓ 2 callersFunctioncontentImageHash
contentImageHash extracts the base 64-hex content hash from a /image/<hash> token, ignoring any _variant suffix (every variant of a hash shares the ma
apps/api/internal/infrastructure/markdown/markdown.go:714
↓ 2 callersMethodcounts
(q *gorm.DB, userID int)
apps/api/internal/admin/repository/purge_repo.go:54
↓ 2 callersFunctioncoversFromWiki
U2: cover/screenshot row mappers. Plain field-by-field copy — wire shape is identical (snake_case JSON tags); the wrappers exist so the frontend-expos
apps/api/internal/galgame/service/galgame_mapper.go:109
↓ 2 callersFunctioncreateEmptyLocaleMap
()
apps/web/app/store/index.ts:3
↓ 2 callersFunctiondecodeCursor
decodeCursor parses an opaque cursor into a repository.Cursor. Empty → nil (first page). A malformed cursor also → nil: a stale/garbage token just res
apps/api/internal/activity/service/activity_service.go:375
↓ 2 callersFunctiondecodeProviderNames
decodeProviderNames safely turns the row's jsonb provider_name bytes into a string slice. A null/empty/invalid value yields an empty slice rather than
apps/api/internal/galgame/service/resource_mapper.go:16
↓ 2 callersFunctiondedupInts
────────────────────────────────────────── small int-set helpers ──────────────────────────────────────────
apps/api/internal/galgame/service/collection_service.go:456
↓ 2 callersFunctiondefaultStatus
(s string)
apps/api/internal/friendlink/handler/friendlink_handler.go:128
↓ 2 callersFunctiondestroySpoilerAnimation
(spoilerEl: HTMLElement)
apps/web/app/composables/topic/useSpoilerContent.ts:39
↓ 2 callersFunctiondestroySpoilerAnimation
(spoilerEl: HTMLElement)
apps/web/app/composables/topic/useParticleSpoilerContent.ts:122
↓ 2 callersMethoddoJSONWithToken
doJSONWithToken is do/doJSON but authenticates as the END USER (Bearer) rather than the client-credentials Basic header — for acting-on-behalf-of- use
apps/api/pkg/userclient/userclient.go:519
↓ 2 callersMethodeligibility
(ctx context.Context, userID int)
apps/api/internal/galgame/service/creator_service.go:54
↓ 2 callersFunctionemptyStrSlice
(s []string)
apps/api/internal/user/service/user_mapper.go:22
↓ 2 callersMethodenrichAndHydrate
enrichAndHydrate runs the full row → item pipeline: galgame name/brief enrichment (which drops brief-missing rows), topic rich-card enrichment, then O
apps/api/internal/activity/service/activity_service.go:393
↓ 2 callersFunctionensureLoaded
(accounts: Ref<KnownAccount[]>)
apps/web/app/composables/useKnownAccounts.ts:46
↓ 2 callersFunctionescapeHtml
(ch: string)
apps/web/app/composables/useSideBySideDiff.ts:26
↓ 2 callersFunctionextractForwardedCookies
( cookieHeader?: string )
apps/web/app/utils/kunFetch.ts:62
↓ 2 callersFunctionfetchPage
(src: PagedSource, page: number)
apps/web/server/utils/kunSitemapSources.ts:98
↓ 2 callersMethodfetchWikiBriefs
────────────────────────────────────────── Internal helpers ──────────────────────────────────────────
apps/api/internal/galgame/service/resource_service.go:481
↓ 2 callersMethodfindOrCreatePrivateRoom
────────────────────────────────────────── Helpers ────────────────────────────────────────── findOrCreatePrivateRoom returns the (roomID, roomName) f
apps/api/internal/message/service/chat_service.go:271
↓ 2 callersFunctionfindReactionStatus
findReactionStatus resolves which of `ids` the user reacted to with `reaction` in `table` (the reaction-aware sibling of findInteractionStatus; shared
apps/api/internal/topic/repository/reaction_repo.go:170
↓ 2 callersFunctionformatYM
(y, m int)
apps/api/internal/galgame/service/calendar_service.go:275
↓ 2 callersMethodgetCachedResult
getCachedResult returns a cached activity Result, and true on a hit. Fail-open: redis.Nil (miss) or ANY error (redis down, bad JSON) is treated as a m
apps/api/internal/activity/service/activity_service.go:91
↓ 2 callersFunctiongroupResourceMeta
groupResourceMeta bucketises rows from galgame_resource into per-galgame platform/language sets (preserving insertion order + dedup).
apps/api/internal/galgame/service/galgame_mapper.go:27
↓ 2 callersMethodhydrateUsers
────────────────────────────────────────── Row → item assembly ──────────────────────────────────────────
apps/api/internal/galgame/service/comment_service.go:215
↓ 2 callersFunctionimageCdnBase
()
apps/web/app/utils/imageSrc.ts:27
↓ 2 callersFunctioninitializeTooltip
(element: HTMLElement, binding: DirectiveBinding)
apps/web/app/plugins/tooltipDirective.ts:8
↓ 2 callersFunctionintArrayLit
intArrayLit renders an int slice as a Postgres array literal ("{1,2,3}", or "{}" for empty) for `= ANY(?::int[])` — one bound param instead of an N-pl
apps/api/internal/galgame/repository/list_repo.go:335
↓ 2 callersFunctionisMeaningfulDate
(d: Date)
apps/web/shared/utils/time.ts:8
↓ 2 callersFunctionjoinInts
(xs []int, sep string)
apps/api/pkg/userclient/userclient.go:483
↓ 2 callersFunctionjoinStrings
(s []string, sep string)
apps/api/internal/galgame/client/client.go:561
↓ 2 callersFunctionlocalModels
()
apps/api/internal/admin/service/overview_service.go:36
↓ 2 callersFunctionlookupWikiUser
(users map[string]dto.WikiUser, userID int)
apps/api/internal/galgame/service/galgame_mapper.go:98
↓ 2 callersFunctionmapKeys
(m map[string]bool)
apps/api/internal/home/service/home_service.go:257
↓ 2 callersMethodmapListRows
mapListRows enriches topic card rows with tags+sections and maps to DTOs. Identity (UserName/UserAvatar) is hydrated from OAuth via userclient since k
apps/api/internal/topic/service/topic_service.go:158
↓ 2 callersFunctionmapOAuthError
mapOAuthError translates an *oauth.Error into the kungal AppError shape so the response keeps its standard {code, message, data} envelope. OAuth's env
apps/api/internal/user/handler/profile_handler.go:136
↓ 2 callersFunctionmarshalDomain
marshalDomain produces a jsonb-compatible payload for the website's alternate-domain list. The column is a jsonb default '[]', so we always emit a JSO
apps/api/internal/website/service/website_service.go:22
↓ 2 callersFunctionnewGoldmark
newGoldmark builds a goldmark instance with the project's shared extension / parser config. hardWraps adds html.WithHardWraps() so a single newline re
apps/api/internal/infrastructure/markdown/markdown.go:157
↓ 2 callersFunctionnewUnicodeIDs
()
apps/api/internal/infrastructure/markdown/markdown.go:362
↓ 2 callersFunctionnormalizeCoverImages
normalizeCoverImages validates the incoming cover tokens, drops duplicates (keeping first-seen order), and returns them ready to persist. A malformed
apps/api/internal/topic/service/topic_write_service.go:81
↓ 2 callersFunctionparseCollectionPage
parseCollectionPage reads page/limit with sane defaults (page>=1, 1<=limit<=50).
apps/api/internal/galgame/handler/collection_handler.go:151
↓ 2 callersFunctionparseUserID
(c fiber.Ctx)
apps/api/internal/admin/handler/purge_handler.go:49
↓ 2 callersFunctionparseYM
(s string)
apps/api/internal/galgame/service/calendar_service.go:263
↓ 2 callersMethodpostEnvelope
postEnvelope POSTs a JSON-serialized payload to OAuth and decodes the standard envelope. Used by ExchangeCode and RefreshOAuthToken — both hit /oauth/
apps/api/internal/user/oauth/client.go:371
↓ 2 callersFunctionproviderArrayLit
(providers []string)
apps/api/internal/galgame/repository/list_repo.go:327
↓ 2 callersFunctionrange
(from: number, to: number)
apps/web/server/utils/kunSitemapSources.ts:53
↓ 2 callersFunctionrecount
recount sets parentTable.countCol = COUNT(child rows) for the given surviving parent ids. Identifiers are caller-owned constants — never user input —
apps/api/internal/admin/repository/purge_repo.go:357
↓ 2 callersFunctionrefreshMe
()
apps/web/app/composables/useRefreshMe.ts:35
↓ 2 callersFunctionrefreshSession
refreshSession is the lock-winner path: actually call OAuth, mutate the passed-in session in place, and write the result back to Redis. Failure branc
apps/api/internal/middleware/auth.go:276
↓ 2 callersFunctionremoveMine
(idx: number)
apps/web/app/composables/useReactions.ts:69
↓ 2 callersFunctionrenewSlidingSession
renewSlidingSession implements the rolling half of the session-timeout model: while the user is active it slides the cookie + Redis TTL forward, so a
apps/api/internal/middleware/auth.go:350
↓ 2 callersFunctionreplyPlainPreview
replyPlainPreview is the reply's markdown-stripped content, used for pin-reply solution notification previews. (The Phase-4 migration folded legacy mu
apps/api/internal/topic/service/reply_service.go:497
↓ 2 callersFunctionresetReactiveState
( target: T, defaults: T )
apps/web/app/store/index.ts:10
↓ 2 callersMethodresolveAvatarURL
resolveAvatarURL maps a user's avatar to a render-ready URL. The new avatar pipeline (POST /auth/me/avatar) writes only `avatar_image_hash` and leaves
apps/api/pkg/userclient/userclient.go:122
↓ 2 callersMethodresolveBannerURL
resolveBannerURL prefers the content-addressed hash (image_service) and falls back to the legacy free-form Banner URL while the migration is in flight
apps/api/internal/doc/service/article_service.go:34
↓ 2 callersFunctionrowToMeta
rowToDownloadDetail maps a resource row + links + liked flag + owner to the rowToMeta shapes the credential-free metadata returned by the page endpoin
apps/api/internal/galgame/service/resource_mapper.go:121
↓ 2 callersFunctionrowToScores
rowToScores pulls the per-axis scores off a rating row.
apps/api/internal/galgame/service/rating_mapper.go:26
↓ 2 callersFunctionsanitizeViewerIDs
sanitizeViewerIDs de-dups and drops the owner (implicitly always a viewer).
apps/api/internal/galgame/service/collection_service.go:495
↓ 2 callersFunctionscan
(els: HTMLElement[], groupEnd: () => number)
apps/web/app/composables/topic/useTopicTOC.ts:100
↓ 2 callersFunctionscreenshotsFromWiki
(rows []dto.WikiGalgameScreenshot)
apps/api/internal/galgame/service/galgame_mapper.go:126
↓ 2 callersFunctionscrollTo
(el: HTMLElement, flash: boolean)
apps/web/app/composables/topic/useTopicScroll.ts:16
↓ 2 callersFunctionsplitCSV
────────────────────────────────────────── Shared slice/CSV utilities ──────────────────────────────────────────
apps/api/internal/galgame/service/galgame_mapper.go:18
↓ 2 callersFunctionstartOAuthLogin
( opts: OAuthFlowOptions = {} )
apps/web/app/utils/oauth-auth.ts:78
↓ 2 callersFunctiontranslateValidationErrors
translateValidationErrors converts validator errors to user-friendly Chinese messages, avoiding exposure of internal struct/field names.
apps/api/pkg/utils/validate.go:39
↓ 2 callersFunctiontrimNonEmpty
────────────────────────────────────────── Helpers ────────────────────────────────────────── trimNonEmpty trims whitespace from each string and drops
apps/api/internal/toolset/service/toolset_service.go:348
↓ 2 callersFunctionuseKunFeed
(baseUrl: string, link: 'galgame' | 'topic')
apps/web/server/utils/kunFeed.ts:25
↓ 2 callersFunctionuseRefreshMe
()
apps/web/app/composables/useRefreshMe.ts:34
↓ 2 callersFunctionuseTopicEditorStore
()
apps/web/app/composables/topic/useTopicEditorStore.ts:3
↓ 2 callersFunctionvalidMonth
(mm string)
apps/api/pkg/utils/release_date.go:79
↓ 2 callersFunctionwaitForRefresh
waitForRefresh is the lock-loser path. Another request is currently refreshing this user's token; instead of racing through with the stale access toke
apps/api/internal/middleware/auth.go:384
↓ 2 callersFunctionwebsiteCardsFromRows
websiteCardsFromRows maps slim website rows to WebsiteCard DTOs given the pre-loaded category-name and tag-level-sum maps. Both maps may be nil / emp
apps/api/internal/website/service/mapper.go:13
↓ 2 callersFunctionwikiAliasesToNames
(aliases []dto.WikiAlias)
apps/api/internal/galgame/service/galgame_mapper.go:150
↓ 2 callersFunctionwikiModels
()
apps/api/internal/admin/service/overview_service.go:58
← previousnext →301–400 of 2,016, ranked by callers