Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/KunMoe/kun-galgame-patch
/ functions
Functions
1,135 in github.com/KunMoe/kun-galgame-patch
⨍
Functions
1,135
◇
Types & classes
365
↓ 2 callers
Method
writeUserMultipart
( ctx context.Context, method, path, accessToken string, jsonBody any, fileName string, fileContent []byt
apps/api/internal/galgame/client/submission.go:435
↓ 2 callers
Function
writeWikiNotification
writeWikiNotification inserts a local user_message row pointing at the patch page of the galgame so the user can jump in one click.
apps/api/internal/infrastructure/cron/wiki_sync.go:242
↓ 1 callers
Method
ApplyCreator
ApplyCreator enforces moyu's eligibility gate, then files the application on the central OAuth queue with evidence. OAuth's own guards (already-creato
apps/api/internal/user/service/creator.go:75
↓ 1 callers
Method
CollectUserS3Keys
CollectUserS3Keys returns the deduped set of moyu-bucket S3 object keys that the purge must delete (PG CASCADE removes the rows but never the objects)
apps/api/internal/admin/repository/repository.go:423
↓ 1 callers
Method
CompleteUploadWithBody
CompleteUploadWithBody request with any body
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:260
↓ 1 callers
Method
CompleteUploadWithResponse
(ctx context.Context, uuid string, body CompleteUploadJSONRequestBody, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:679
↓ 1 callers
Function
ContentLimitFromQuery
ContentLimitFromQuery parses the `content_limit` query parameter and returns one of {"sfw","nsfw","all"} when recognized, or "" otherwise. Returning
apps/api/pkg/utils/contentlimit.go:24
↓ 1 callers
Method
CountCommentAndReplies
CountCommentAndReplies counts a comment + its direct replies, restricted to APPROVED rows (status = 0). DeleteComment uses this to decrement patch.com
apps/api/internal/patch/repository/repository.go:248
↓ 1 callers
Method
CountOrphanPatches
CountOrphanPatches returns true-orphan counts by category (excludeIDs excluded).
apps/api/internal/admin/service/service.go:269
↓ 1 callers
Method
CountPublishedPatchResources
CountPublishedPatchResources counts a user's PUBLISHED (status=0) patch resources — the moyu-side creator eligibility signal.
apps/api/internal/user/repository/repository.go:256
↓ 1 callers
Method
CountRootCommentsBefore
CountRootCommentsBefore returns how many APPROVED root comments of the patch sort BEFORE the given root under the list order (created DESC, id DESC).
apps/api/internal/patch/repository/repository.go:226
↓ 1 callers
Method
CountUserComments
(userID int)
apps/api/internal/user/repository/repository.go:53
↓ 1 callers
Method
CountUserFavorites
(userID int)
apps/api/internal/user/repository/repository.go:57
↓ 1 callers
Method
CountUserPatches
(userID int)
apps/api/internal/user/repository/repository.go:45
↓ 1 callers
Method
CountUserResources
(userID int)
apps/api/internal/user/repository/repository.go:49
↓ 1 callers
Method
CreateCommentLike
(rel *model.UserPatchCommentLikeRelation)
apps/api/internal/patch/repository/repository.go:285
↓ 1 callers
Method
CreateCreatorApplication
CreateCreatorApplication files a creator-role application AS THE END USER (Authorization: Bearer <token>), not via client credentials.
apps/api/pkg/userclient/client.go:316
↓ 1 callers
Method
CreateFavorite
(rel *model.UserPatchFavoriteRelation)
apps/api/internal/patch/repository/repository.go:391
↓ 1 callers
Method
CreateFollowAndIncrement
CreateFollowAndIncrement inserts the relation AND bumps both denormalized counts in ONE transaction (audit F029), so they can't drift if the process d
apps/api/internal/user/repository/repository.go:149
↓ 1 callers
Method
CreateGroupRoom
CreateGroupRoom creates a group chat. Only role >= 4 is allowed (checked in the handler layer).
apps/api/internal/chat/service/service.go:36
↓ 1 callers
Method
CreateLikeCommentNotification
(senderID int, comment *model.PatchComment)
apps/api/internal/patch/service/service.go:1640
↓ 1 callers
Method
CreatePatchByGalgameID
CreatePatchByGalgameID registers a local patch carrier directly by Wiki galgame_id — the path the publish wizard ("选择此条目") uses. Unlike the vndb_id pa
apps/api/internal/patch/service/service.go:100
↓ 1 callers
Method
CreateResourceFavorite
(rel *model.UserPatchResourceFavoriteRelation)
apps/api/internal/patch/repository/repository.go:375
↓ 1 callers
Method
CreateResourceLike
(rel *model.UserPatchResourceLikeRelation)
apps/api/internal/patch/repository/repository.go:359
↓ 1 callers
Method
CreateRoom
CreateRoom POST /api/chat/room (admin only)
apps/api/internal/chat/handler/handler.go:280
↓ 1 callers
Method
CreateUser
CreateUser inserts a new local row. Caller must populate ID with the OAuth-side integer id (NOT autoincrement; see migration 005). ON CONFLICT DO NOTH
apps/api/internal/auth/repository/repository.go:38
↓ 1 callers
Method
DeleteArtifact
DeleteArtifact request
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:254
↓ 1 callers
Method
DeleteArtifactWithResponse
DeleteArtifactWithResponse request
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:671
↓ 1 callers
Method
DeleteCommentLike
(id int)
apps/api/internal/patch/repository/repository.go:289
↓ 1 callers
Method
DeleteFavorite
(id int)
apps/api/internal/patch/repository/repository.go:395
↓ 1 callers
Method
DeleteFollowAndDecrement
DeleteFollowAndDecrement removes the relation and, ONLY if a row was actually deleted, decrements both counts — all in one transaction (audit F029 + t
apps/api/internal/user/repository/repository.go:162
↓ 1 callers
Method
DeleteResourceFavorite
(id int)
apps/api/internal/patch/repository/repository.go:379
↓ 1 callers
Method
DeleteResourceLike
(id int)
apps/api/internal/patch/repository/repository.go:363
↓ 1 callers
Method
DownloadArtifact
DownloadArtifact request
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:265
↓ 1 callers
Method
DownloadArtifactWithResponse
DownloadArtifactWithResponse request
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:682
↓ 1 callers
Method
ExchangeCode
ExchangeCode trades an authorization code (+ PKCE verifier) for tokens. KUN OAuth takes a JSON body, not RFC-6749 form-encoded, and wraps the respons
apps/api/internal/auth/service/service.go:172
↓ 1 callers
Method
FindCommentLike
===== Comment Likes =====
apps/api/internal/patch/repository/repository.go:279
↓ 1 callers
Method
FindOrCreatePrivateRoom
FindOrCreatePrivateRoom returns the unique private chat room between two users, creating it (with both members) if it does not yet exist. The room li
apps/api/internal/chat/repository/repository.go:100
↓ 1 callers
Method
FindOrCreateUserByID
FindOrCreateUserByID looks up the local user row by id, inserting an empty site-local row if it does not exist. The id MUST be the integer returned by
apps/api/internal/auth/service/service.go:249
↓ 1 callers
Method
FindPatchByVndbID
(vndbID string)
apps/api/internal/patch/repository/repository.go:137
↓ 1 callers
Method
FindResourceLike
===== Resource Likes =====
apps/api/internal/patch/repository/repository.go:353
↓ 1 callers
Method
GetAllPatches
===== All Patches =====
apps/api/internal/admin/service/service.go:193
↓ 1 callers
Method
GetArtifact
GetArtifact request
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:257
↓ 1 callers
Method
GetContributorIDs
===== Contributors ===== GetContributorIDs returns the user_ids of every contributor on a patch. Handler enriches them via OAuth /users/batch (pkg/use
apps/api/internal/patch/service/service.go:1481
↓ 1 callers
Method
GetFavoritedResourceIDs
GetFavoritedResourceIDs returns the subset of resourceIDs the user has subscribed to (收藏资源) — mirrors GetLikedResourceIDs, used to stamp is_favorite o
apps/api/internal/patch/repository/repository.go:480
↓ 1 callers
Method
GetFollowerIDs
GetFollowerIDs / GetFollowingIDs return only the user_ids; the handler layer resolves them to display briefs via OAuth /users/batch (pkg/userclient).
apps/api/internal/user/repository/repository.go:193
↓ 1 callers
Method
GetFollowingIDs
(userID, offset, limit int)
apps/api/internal/user/repository/repository.go:204
↓ 1 callers
Method
GetForEdit
(id int)
apps/api/internal/doc/service/service.go:312
↓ 1 callers
Method
GetGalgameCalendar
GetGalgameCalendar GET /api/galgame/calendar?month=YYYY-MM
apps/api/internal/common/handler.go:965
↓ 1 callers
Method
GetLikedCommentIDs
(userID int, commentIDs []int)
apps/api/internal/patch/repository/repository.go:488
↓ 1 callers
Method
GetLikedResourceIDs
moemoepoint is no longer mutated locally — OAuth is the unified source of truth (see pkg/moemoepoint). The local user.moemoepoint column is a read-cac
apps/api/internal/patch/repository/repository.go:469
↓ 1 callers
Method
GetMessages
─── Messages ─────────────────────────────────────── GetMessages polls for new messages. Resolves the room by link and checks membership first, then
apps/api/internal/chat/service/service.go:85
↓ 1 callers
Method
GetMessages
GetMessages GET /api/message
apps/api/internal/message/handler/handler.go:135
↓ 1 callers
Method
GetMessagesByIDs
GetMessagesByIDs loads bare messages by id (used to build reply quotes).
apps/api/internal/chat/repository/repository.go:316
↓ 1 callers
Method
GetMessagesByIDsInRoom
GetMessagesByIDsInRoom returns the given messages, scoped to the room (and verifying caller membership) so a member can only refresh messages from a r
apps/api/internal/chat/service/service.go:101
↓ 1 callers
Method
GetMyCreatorApplication
GetMyCreatorApplication returns the user's latest creator application (nil if none).
apps/api/pkg/userclient/client.go:328
↓ 1 callers
Method
GetOrphanCandidateIDs
===== Orphan Patches (D12) ===== GetOrphanCandidateIDs returns ids of candidate orphans (cheap local filter); the handler verifies them against Wiki b
apps/api/internal/admin/service/service.go:258
↓ 1 callers
Method
GetPatchResourceFileHistoryS3Keys
GetPatchResourceFileHistoryS3Keys returns every non-empty old_s3_key on patch_resource_file_history rows belonging to the patch's resources. UpdateRes
apps/api/internal/patch/repository/repository.go:117
↓ 1 callers
Method
GetPatchResourceS3Keys
GetPatchResourceS3Keys returns every non-empty s3_key on patch_resource rows owned by the patch. Used by DeletePatch right before the row goes away —
apps/api/internal/patch/repository/repository.go:99
↓ 1 callers
Method
GetPatchesByIDs
GetPatchesByIDs returns existing patches for the given ids in the caller- supplied order — no lazy materialization. Used by handlers that enrich a lis
apps/api/internal/patch/service/service.go:247
↓ 1 callers
Method
GetRandomPatchID
GetRandomPatchID returns a random patch id, optionally constrained by the caller's content_limit. The single-row RANDOM() path can land on a NSFW patc
apps/api/internal/patch/service/service.go:518
↓ 1 callers
Method
GetRandomPatchIDs
GetRandomPatchIDs returns up to n random patch ids. Used by the random-patch endpoint so the service layer can ask wiki to filter the candidate set by
apps/api/internal/patch/repository/repository.go:165
↓ 1 callers
Method
GetResourceFileHistoryS3Keys
GetResourceFileHistoryS3Keys returns the history's old_s3_keys for a single resource. Used by DeleteResource for the same reason as the patch-scoped h
apps/api/internal/patch/repository/repository.go:129
↓ 1 callers
Function
GetUserID
(c fiber.Ctx)
apps/api/internal/middleware/auth.go:275
↓ 1 callers
Method
GetUserInfo
GetUserInfo fetches the current user's identity from /oauth/userinfo.
apps/api/internal/auth/service/service.go:195
↓ 1 callers
Method
GetUserInfo
GetUserInfo composes the public user profile: site-local row (moemoepoint, follower/following counts, content counts) + OAuth brief (name/avatar/bio).
apps/api/internal/user/service/service.go:98
↓ 1 callers
Method
GetUserStats
GetUserStats fetches a user's galgame contribution stats from the wiki.
apps/api/internal/galgame/client/client.go:853
↓ 1 callers
Method
GetWikiMessageFeed
GetWikiMessageFeed proxies GET /galgame/messages/feed for the cron job. Authenticated via OAuth Client Basic Auth — the same client_id/secret used by
apps/api/internal/galgame/client/submission.go:361
↓ 1 callers
Method
IncrementView
IncrementView PUT /doc/view?slug=... — best-effort view counter.
apps/api/internal/doc/handler/handler.go:73
↓ 1 callers
Method
IncrementViewBySlug
IncrementViewBySlug bumps the view counter for a published doc (best-effort).
apps/api/internal/doc/service/service.go:280
↓ 1 callers
Method
InitUploadWithBody
InitUploadWithBody request with any body
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:249
↓ 1 callers
Method
InitUploadWithResponse
(ctx context.Context, body InitUploadJSONRequestBody, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:668
↓ 1 callers
Method
IsCommentVerifyEnabled
===== Admin Settings Check ===== Source of truth is the site_setting table via settingService (durable + audited), read directly — see internal/setti
apps/api/internal/patch/service/service.go:1717
↓ 1 callers
Method
IsCreatorOnlyEnabled
IsCreatorOnlyEnabled reports the admin "仅创作者 / 版主 / 管理员可发布 Galgame" toggle. When on, the publish handlers reject users without creator / moderator / a
apps/api/internal/patch/service/service.go:1723
↓ 1 callers
Method
IsFavorited
(userID, patchID int)
apps/api/internal/patch/service/service.go:1472
↓ 1 callers
Function
IsNotFound
IsNotFound reports whether an error from DeleteObject is "object not found".
apps/api/internal/infrastructure/storage/s3.go:121
↓ 1 callers
Method
JoinRoomByLink
JoinRoomByLink joins a room via its link.
apps/api/internal/chat/service/service.go:42
↓ 1 callers
Method
LatestMessagePerRoom
LatestMessagePerRoom passthrough for room-list last-message previews.
apps/api/internal/chat/service/service.go:94
↓ 1 callers
Method
List
===== Public ===== List returns the published flat list + the category tree.
apps/api/internal/doc/service/service.go:77
↓ 1 callers
Method
ListAdmin
===== Admin =====
apps/api/internal/doc/service/service.go:289
↓ 1 callers
Method
ListArtifacts
ListArtifacts request
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:246
↓ 1 callers
Method
ListEcosystem
ListEcosystem returns the OAuth app-directory strip, served same-origin from moyu so the browser never has to cross-origin fetch the OAuth provider (w
apps/api/internal/auth/service/service.go:90
↓ 1 callers
Method
ListMembers
ListMembers returns all members of a room. The handler layer attaches the user briefs from OAuth /users/batch.
apps/api/internal/chat/repository/repository.go:230
↓ 1 callers
Method
ListMessages
─── Messages ─────────────────────────────────────── ListMessages GET /api/chat/room/:link/message?after=&limit=
apps/api/internal/chat/handler/handler.go:349
↓ 1 callers
Method
ListMessagesByIDsInRoom
ListMessagesByIDsInRoom returns the given messages that belong to roomID, ascending by id. Room-scoped so a member can't fetch arbitrary messages.
apps/api/internal/chat/repository/repository.go:192
↓ 1 callers
Method
ListPinned
ListPinned returns the pinned, published docs for the home carousel, newest first by the displayed `date`. We parse the date string for ordering rathe
apps/api/internal/doc/service/service.go:92
↓ 1 callers
Method
ListReactionsByMessageIDs
ListReactionsByMessageIDs returns all reactions for the given message ids, ordered by id so reaction chips render stably. The handler attaches the rea
apps/api/internal/chat/repository/repository.go:306
↓ 1 callers
Method
ListRoomsByUser
ListRoomsByUser lists rooms a user has joined that contain at least one live (non-deleted) message, ordered by last message time desc. Empty rooms ar
apps/api/internal/chat/repository/repository.go:39
↓ 1 callers
Method
MessagesByIDs
(ids []int)
apps/api/internal/chat/service/service.go:225
↓ 1 callers
Method
MetaBatch
MetaBatch fetches width/height/thumbhash for a batch of hashes in one roundtrip, keyed by hash. Hashes image_service doesn't know are simply absent fr
apps/api/pkg/imageclient/client.go:302
↓ 1 callers
Function
New
(cfg Config)
apps/api/pkg/moemoepoint/client.go:45
↓ 1 callers
Function
NewClient
Creates a new Client, with reasonable defaults
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:203
↓ 1 callers
Function
NewCompleteUploadRequest
NewCompleteUploadRequest calls the generic CompleteUpload builder with application/json body
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:539
↓ 1 callers
Function
NewDeleteArtifactRequest
NewDeleteArtifactRequest generates requests for DeleteArtifact
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:471
↓ 1 callers
Function
NewDownloadArtifactRequest
NewDownloadArtifactRequest generates requests for DownloadArtifact
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:586
↓ 1 callers
Function
NewGetArtifactRequest
NewGetArtifactRequest generates requests for GetArtifact
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:505
↓ 1 callers
Function
NewHandler
(db *gorm.DB, wiki *galgameClient.Client, users *userclient.Client, art *artifactclient.Client, img *imageclie
apps/api/internal/common/handler.go:37
↓ 1 callers
Function
NewInitUploadRequest
NewInitUploadRequest calls the generic InitUpload builder with application/json body
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:431
↓ 1 callers
Function
NewListArtifactsRequest
NewListArtifactsRequest generates requests for ListArtifacts
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:365
↓ 1 callers
Method
NewMetaResolver
NewMetaResolver builds a resolver over this client. timeout bounds the synchronous meta-batch call on the cold path (<= 0 → 3s default) so a slow or u
apps/api/pkg/imageclient/meta_resolver.go:34
← previous
next →
201–300 of 1,135, ranked by callers