MCPcopy Create free account

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

Functions1,135 in github.com/KunMoe/kun-galgame-patch

↓ 448 callersMethodError
()
apps/api/internal/galgame/client/client.go:37
↓ 133 callersMethodSet
Set replaces or adds a user.
apps/api/pkg/userclient/mock.go:52
↓ 42 callersMethodError
()
apps/api/pkg/errors/errors.go:11
↓ 40 callersMethodCreate
(ctx context.Context, userID int, req dto.DocCreateRequest)
apps/api/internal/doc/service/service.go:334
↓ 37 callersMethodDo
(req *http.Request)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:179
↓ 35 callersMethodDelete
(id int)
apps/api/internal/doc/service/service.go:436
↓ 32 callersMethodget
─── Generic GET ───────────────────────────────────── get sends a GET request, parses the {code, message, data} envelope and unmarshals data into out.
apps/api/internal/galgame/client/client.go:214
↓ 30 callersFunctiongetIDParam
(c fiber.Ctx, name string)
apps/api/internal/patch/handler/handler.go:42
↓ 29 callersMethodPut
(value []byte)
apps/api/internal/infrastructure/markdown/markdown.go:82
↓ 26 callersMethodScan
(value any)
apps/api/internal/patch/model/model.go:45
↓ 23 callersMethodOffset
()
apps/api/pkg/utils/pagination.go:10
↓ 21 callersFunctiongetEnv
(key, fallback string)
apps/api/pkg/config/config.go:172
↓ 18 callersFunctioncancel
()
apps/web/app/composables/useResourceUpload.ts:397
↓ 16 callersMethodRequest
Request sends an HTTP request to the Fiber app and returns the response
apps/api/internal/testutil/testutil.go:86
↓ 13 callersMethodAward
Award adjusts the user's unified balance and syncs the local cache. Best-effort + non-blocking: it must be called OUTSIDE any DB transaction and AFTE
apps/api/pkg/moemoepoint/awarder.go:30
↓ 13 callersMethodGalgameBatch
GalgameBatch calls /galgame/batch?ids=1,2,3 to fetch lightweight galgame info in bulk. contentLimit is the NSFW filter — pass "sfw" / "nsfw" / "all"
apps/api/internal/galgame/client/client.go:442
↓ 13 callersMethodUpdate
(id int, req dto.DocUpdateRequest)
apps/api/internal/doc/service/service.go:375
↓ 13 callersMethodUsers
Users fetches user briefs by id. Cache hits skip the network. Misses are deduped, sharded into chunks of 100, coalesced via singleflight, and the resu
apps/api/pkg/userclient/client.go:100
↓ 12 callersFunctionNew
(code int, message string, httpStatus int)
apps/api/pkg/errors/errors.go:15
↓ 12 callersFunctiontruncate
(s string, n int)
apps/api/internal/galgame/client/client.go:838
↓ 12 callersFunctionwriteWikiResult
writeWikiResult is the shared result -> response mapping for both modes. Wiki business errors (e.g. 80008 image quota, 60002 review rejected, 40300 fo
apps/api/internal/patch/handler/handler.go:922
↓ 11 callersMethodInit
Init POST /api/upload/init — start an upload; the artifact service decides single-PUT vs multipart and returns the presigned URL(s).
apps/api/internal/common/upload/handler.go:52
↓ 11 callersFunctiongetUID
(c fiber.Ctx)
apps/api/internal/user/handler/handler.go:48
↓ 10 callersFunctionNew
(cfg Config)
apps/api/pkg/userclient/client.go:76
↓ 9 callersMethodStatus
Status returns HTTPResponse.Status
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:724
↓ 9 callersFunctionqs
(q?: Q)
apps/web/app/composables/useGalgameEdit.ts:134
↓ 8 callersMethodapplyEditors
(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:619
↓ 8 callersFunctionwriteBatchResp
(w http.ResponseWriter, users []Brief, notFound []uint)
apps/api/pkg/userclient/client_test.go:192
↓ 7 callersMethodGetCommentByID
(id int)
apps/api/internal/patch/repository/repository.go:216
↓ 7 callersMethodGetResourceByID
(id int)
apps/api/internal/patch/repository/repository.go:307
↓ 7 callersMethodgatePatchByContentLimit
gatePatchByContentLimit checks whether `patchID`'s owning galgame passes the caller's content_limit filter. Returns true → handler may serve the data;
apps/api/internal/patch/handler/handler.go:64
↓ 6 callersMethodContentType
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:740
↓ 6 callersMethodUpdateCount
(patchID int, field string, delta int)
apps/api/internal/patch/repository/repository.go:454
↓ 6 callersFunctionatoi
atoi is a panic-free helper for already-regex-validated digit strings.
apps/api/pkg/utils/release_date.go:140
↓ 6 callersMethodcreateDedupMessage
createDedupMessage inserts a user_message unless a matching one already exists. redeliverAfterRead controls the dedup window: - false: dedup against A
apps/api/internal/patch/service/service.go:1537
↓ 6 callersFunctiongetIDParam
(c fiber.Ctx, name string)
apps/api/internal/admin/handler/handler.go:111
↓ 6 callersFunctionnewTestClient
(srv *httptest.Server)
apps/api/pkg/moemoepoint/client_test.go:11
↓ 6 callersMethodownedPatchIDsSubquery
ownedPatchIDsSubquery is the `id IN (patches owned by U)` building block, reused across the owned-patch collateral counts and the S3-key collection.
apps/api/internal/admin/repository/repository.go:348
↓ 5 callersMethodAdjust
Adjust applies a signed moemoepoint delta to a user. Returns the resulting authoritative balance. A non-zero business code (16002/16003/16004/…) or an
apps/api/pkg/moemoepoint/client.go:84
↓ 5 callersMethodConfigured
Configured reports whether the client can talk to the artifact service.
apps/api/pkg/artifactclient/client.go:155
↓ 5 callersMethodCreateLog
(actorID int, action string, data any)
apps/api/internal/patch/service/service.go:43
↓ 5 callersMethodCreateTestSession
CreateTestSession creates a Redis session and returns the cookie value. roles is the OAuth roles set; pass e.g. "admin" / "moderator" to grant privile
apps/api/internal/testutil/testutil.go:60
↓ 5 callersMethodDB
DB exposes the underlying *gorm.DB so a few thin "no-business-logic" handler endpoints (the wiki messages read-state shims) can do single-table reads
apps/api/internal/patch/service/service.go:393
↓ 5 callersMethodDeleteObject
DeleteObject deletes an object. Returns nil even if the object does not exist (idempotent).
apps/api/internal/infrastructure/storage/s3.go:129
↓ 5 callersMethodError
()
apps/api/pkg/userclient/client.go:312
↓ 5 callersMethodReady
Ready reports whether the client has been configured. When not configured, all operations return ErrNotConfigured.
apps/api/internal/infrastructure/storage/s3.go:87
↓ 5 callersMethodUser
User is a single-id convenience wrapper. Returns (nil, nil) when the id is not present.
apps/api/pkg/userclient/client.go:162
↓ 5 callersFunctioncountOrLog
countOrLog runs a Count and, on a DB error, LOGS it instead of silently returning a false 0 (audit F074). These four profile aggregates are display-on
apps/api/internal/user/repository/repository.go:37
↓ 5 callersMethodeffectiveBanner
effectiveBanner prefers the image_service-derived URL (from the hash) and falls back to the legacy static banner URL.
apps/api/internal/doc/service/service.go:48
↓ 5 callersFunctionmapErr
mapErr turns a non-success artifact response into a sentinel (where callers branch) or a descriptive error.
apps/api/pkg/artifactclient/client.go:277
↓ 5 callersFunctionrequest
( endpoint: string, options: ApiOptions = {} )
apps/web/app/composables/useApi.ts:167
↓ 5 callersMethodresolveRoomForMember
─── helpers ──────────────────────────────────────── resolveRoomForMember fetches the room and confirms userID is a member, else returns an error.
apps/api/internal/chat/service/service.go:203
↓ 4 callersMethodConfigured
Configured reports whether the client has both a base URL and credentials — i.e. Upload / ReferencePing can actually reach image_service. Lets callers
apps/api/pkg/imageclient/client.go:217
↓ 4 callersMethodDelete
Delete soft-deletes an artifact (GC physically reclaims it after the TTL).
apps/api/pkg/artifactclient/client.go:259
↓ 4 callersMethodGetAll
GetAll returns docs newest-first by the frontmatter date string (lexical == chronological for ISO), slug ASC to break ties. onlyPublished restricts to
apps/api/internal/doc/repository/repository.go:21
↓ 4 callersMethodGetGalgame
GetGalgame calls /galgame/:gid; used to enrich detail pages. contentLimit is the NSFW filter — pass "sfw" / "nsfw" / "all" to apply, or "" to omit th
apps/api/internal/galgame/client/client.go:403
↓ 4 callersMethodGetMessage
GetMessage fetches a single message by ID.
apps/api/internal/chat/repository/repository.go:250
↓ 4 callersMethodGetPatchByID
(id int)
apps/api/internal/patch/repository/repository.go:27
↓ 4 callersMethodGetPatchDetail
GetPatchDetail returns the local patch row, or gorm.ErrRecordNotFound when moyu has none. Like GetPatch it does NOT materialize on view (see GetPatch)
apps/api/internal/patch/service/service.go:255
↓ 4 callersMethodInvalidate
Invalidate drops both positive and negative cache entries for a single id.
apps/api/pkg/userclient/client.go:212
↓ 4 callersMethodStatusCode
StatusCode returns HTTPResponse.StatusCode
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:732
↓ 4 callersMethodTableName
()
apps/api/internal/patch/model/model.go:154
↓ 4 callersMethodTouchResourceUpdateTime
TouchResourceUpdateTime bumps a galgame's patch.resource_update_time to now — the moyu "最近更新" sort key. Called after a successful Wiki galgame-info ed
apps/api/internal/patch/service/service.go:400
↓ 4 callersFunctionapplyGalgame
applyGalgame merges the Wiki galgame info into a card.
apps/api/internal/galgame/enricher/enricher.go:523
↓ 4 callersMethodattachResourceUsers
attachResourceUsers / attachCommentUsers do the same id-collect → batch → stamp dance for the various list endpoints below. Best-effort: on OAuth erro
apps/api/internal/common/handler.go:45
↓ 4 callersFunctioncomplete
( artifactUuid: string, parts?: { part_number: number; etag: string }[] )
apps/web/app/composables/useResourceUpload.ts:240
↓ 4 callersFunctiondeleteOAuthCookie
(name: string)
apps/web/app/shared/utils/pkce.ts:53
↓ 4 callersFunctiondisplayGalgameName
displayGalgameName picks the first non-empty translation for the local notification body. Falls back to the integer id so the message never reads "您提交
apps/api/internal/infrastructure/cron/wiki_sync.go:281
↓ 4 callersFunctionjoinInts
─── helpers ─────────────────────────────────────────
apps/api/internal/galgame/client/client.go:830
↓ 4 callersFunctionread
()
apps/web/app/composables/useResourceResumeUploads.ts:13
↓ 4 callersFunctionreadBody
(t *testing.T, resp *http.Response)
apps/api/pkg/response/response_test.go:107
↓ 4 callersFunctionrefreshOAuthToken
(ctx context.Context, rdb *redis.Client, oauthCfg config.OAuthConfig, sessionID string, session *SessionData)
apps/api/internal/middleware/auth.go:531
↓ 4 callersFunctionresolveUser
resolveUser turns a single OAuth user id into a PatchUser brief (name / avatar / roles) via the short-TTL userclient cache. Returns nil for a nil clie
apps/api/internal/galgame/enricher/enricher.go:200
↓ 4 callersFunctionsetupApp
()
apps/api/pkg/response/response_test.go:18
↓ 4 callersFunctionuseApi
()
apps/web/app/composables/useApi.ts:29
↓ 3 callersMethodAddMember
AddMember joins a room; idempotent if already a member.
apps/api/internal/chat/repository/repository.go:85
↓ 3 callersMethodBalance
Balance reads a user's current authoritative balance (GET /users/:id/moemoepoint). Used by the one-time cache-seed cmd.
apps/api/pkg/moemoepoint/client.go:120
↓ 3 callersMethodCheckGalgameByVndbID
CheckGalgameByVndbID calls /galgame/check?vndb_id=xxx and returns (exists, galgame_id). Used as a pre-check for POST /api/patch.
apps/api/internal/galgame/client/client.go:418
↓ 3 callersMethodFindByID
===== User Info =====
apps/api/internal/user/repository/repository.go:23
↓ 3 callersMethodGetBool
GetBool reports whether the setting is enabled. A missing key → false (settings default off). A read error also yields false: failing safe means an ou
apps/api/internal/setting/service/service.go:35
↓ 3 callersMethodGetByID
(id int)
apps/api/internal/doc/repository/repository.go:37
↓ 3 callersMethodGetBySlug
(slug string)
apps/api/internal/doc/repository/repository.go:31
↓ 3 callersFunctionGetUser
(c fiber.Ctx)
apps/api/internal/middleware/auth.go:263
↓ 3 callersFunctionHasAnyRole
HasAnyRole reports whether the current request's roles set contains any of the listed roles. Pass nothing to require "at least logged in".
apps/api/internal/middleware/auth.go:313
↓ 3 callersMethodLog
Log reads a page of a user's moemoepoint ledger (GET /users/:id/moemoepoint/log). Cursor pagination: pass beforeID=0 for the newest page, then the las
apps/api/pkg/moemoepoint/client.go:176
↓ 3 callersMethodProxy
Proxy relays a GET / JSON-write to the Wiki Service. pathAndQuery is the Wiki path WITH its leading slash and any query string, e.g. "/galgame/8329/r
apps/api/internal/galgame/client/editing.go:35
↓ 3 callersMethodRecalculatePatchAggregates
===== Aggregate Updates =====
apps/api/internal/patch/repository/repository.go:428
↓ 3 callersMethodUpload
Upload sends one image to image_service. - body / filename / mime describe the file (mime may be "" — the server sniffs by magic number anyway). - pr
apps/api/pkg/imageclient/client.go:117
↓ 3 callersMethodValue
()
apps/api/internal/patch/model/model.go:72
↓ 3 callersFunctionapiGet
(path: string)
apps/web/server/utils/kunSitemapSources.ts:92
↓ 3 callersMethodattachPatchSummaries
attachPatchSummaries fills the `Patch` field on every comment / resource row in one Wiki batch call, avoiding an N+1 over the page. Either slice may b
apps/api/internal/common/handler.go:298
↓ 3 callersFunctionattachUsersToResources
attachUsersToResources batch-fetches publisher briefs from OAuth and stamps the User field on each resource row.
apps/api/internal/patch/service/service.go:870
↓ 3 callersFunctionbaseCard
baseCard builds the local-field portion of the card from a patch (Wiki-owned fields like Name/Banner start empty).
apps/api/internal/galgame/enricher/enricher.go:495
↓ 3 callersFunctionbriefToPatchUser
briefToPatchUser is the small adapter from OAuth /users/batch shape to the embedded PatchUser wire shape ({id, name, avatar}).
apps/api/internal/patch/service/service.go:609
↓ 3 callersFunctioncalendarContentLimits
─── Galgame release calendar (发售月表) ─────────────── Thin moyu-side wrapper over the wiki calendar endpoints (docs/galgame_wiki/01-galgame.md §发售月历). T
apps/api/internal/common/handler.go:892
↓ 3 callersFunctiondocID
(c fiber.Ctx)
apps/api/internal/doc/handler/handler.go:27
↓ 3 callersMethodeffectiveAuthorAvatar
effectiveAuthorAvatar resolves a user brief to a renderable avatar URL, preferring the image_service hash (the post-OAuth-migration form; "100" varian
apps/api/internal/doc/service/service.go:62
↓ 3 callersMethodenrichCalendarItems
enrichCalendarItems collects ids → looks up which moyu has a patch for → builds the has_patch-stamped cards, then stamps is_favorite for the logged-in
apps/api/internal/common/handler.go:927
↓ 3 callersMethodensureCanPublishGalgame
===== Patch CRUD ===== ensureCanPublishGalgame enforces the "creator_only" publish toggle: when on, only the trusted-publisher set — creators / modera
apps/api/internal/patch/handler/handler.go:84
↓ 3 callersMethodensureLocalPatch
ensureLocalPatch reads the local patch row, lazily INSERTing a zero-stat stub when it's missing. It is called from the INTERACTION paths (ToggleFavori
apps/api/internal/patch/service/service.go:271
next →1–100 of 1,135, ranked by callers