MCPcopy Create free account

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

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

MethodIncrementView
IncrementView PUT /api/patch/:id/view
apps/api/internal/patch/handler/handler.go:275
FunctionInit
(mode string)
apps/api/pkg/logger/logger.go:8
MethodInit
Init validates, then asks the artifact service to start an upload. Artifact returns the presigned single-PUT URL or the multipart parts (server-driven
apps/api/internal/common/upload/service.go:112
MethodInitUpload
InitUpload reserves quota + creates the artifact row, returning the presigned upload URL(s) for the browser to PUT directly to B2.
apps/api/pkg/artifactclient/client.go:159
MethodInitUpload
(ctx context.Context, body InitUploadJSONRequestBody, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:292
MethodInitUploadWithBody
(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:280
MethodInitUploadWithBodyWithResponse
InitUploadWithBodyWithResponse request with any body
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:666
MethodInitUploadWithBodyWithResponse
InitUploadWithBodyWithResponse request with arbitrary body returning *InitUploadResp
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:881
MethodInitUploadWithResponse
(ctx context.Context, body InitUploadJSONRequestBody, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:889
FunctionIsAdmin
IsAdmin reports whether the caller holds a super-admin role (admin or ren).
apps/api/internal/middleware/auth.go:337
FunctionIsModerator
IsModerator reports whether the caller can moderate: super-admins or moderators.
apps/api/internal/middleware/auth.go:340
FunctionIsNotFound
IsNotFound exposes an ErrRecordNotFound check for callers to distinguish business errors.
apps/api/internal/chat/service/service.go:230
MethodIsResourceFavorited
(userID, resourceID int)
apps/api/internal/patch/service/service.go:1425
MethodJoinRoom
JoinRoom POST /api/chat/room/join
apps/api/internal/chat/handler/handler.go:312
MethodLatestMessagePerRoom
LatestMessagePerRoom returns the most recent message of each given room, keyed by chat_room_id. One query (id IN max-per-room subquery) — no N+1. Used
apps/api/internal/chat/repository/repository.go:206
MethodListArtifacts
(ctx context.Context, params *ListArtifactsParams, reqEditors ...RequestEditorFn)
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:268
MethodListArtifactsWithResponse
ListArtifactsWithResponse request
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:663
MethodListArtifactsWithResponse
ListArtifactsWithResponse request returning *ListArtifactsResp
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:872
MethodListMessages
─── Message ──────────────────────────────────────── ListMessages returns a page of messages, always in ascending id order so the frontend can append/
apps/api/internal/chat/repository/repository.go:158
MethodListMyGalgames
ListMyGalgames proxies GET /galgame/mine. Status filter is csv (default "3,4" when the caller passes an empty string).
apps/api/internal/galgame/client/submission.go:214
MethodListMyGalgames
ListMyGalgames GET /api/v1/galgame/mine
apps/api/internal/patch/handler/handler.go:1103
MethodListPinnedPosts
ListPinnedPosts GET /doc/pinned — pinned published docs for the home carousel, newest first by display date.
apps/api/internal/doc/handler/handler.go:48
MethodListPosts
===== Public ===== ListPosts GET /doc/posts — published flat list + category tree.
apps/api/internal/doc/handler/handler.go:38
MethodListRooms
─── Room ─────────────────────────────────────────── ListRooms lists all rooms the user has joined.
apps/api/internal/chat/service/service.go:31
MethodListRooms
─── Room ─────────────────────────────────────────── ListRooms GET /api/chat/room Enriches each room with: the last-message text preview, and — for P
apps/api/internal/chat/handler/handler.go:183
FunctionLoad
()
apps/api/pkg/config/config.go:99
MethodLocateComment
LocateComment resolves a comment id to its page in the root-comment listing. limit MUST match the list's page size (clamped to the same 1..30 bound).
apps/api/internal/patch/service/service.go:1606
MethodLocateComment
LocateComment GET /api/patch/comment/:commentId/locate?limit=N Resolves a comment id to {page, root_id, is_reply, galgame_id} in the paginated root-c
apps/api/internal/patch/handler/handler.go:474
MethodLog
Log reads a page of the user's moemoepoint ledger from OAuth (the source of truth — moyu keeps no local ledger). Read-only passthrough to the s2s endp
apps/api/pkg/moemoepoint/awarder.go:60
MethodLogout
Logout POST /api/v1/auth/logout Best-effort: revoke the OAuth refresh_token on the upstream OAuth server (per its implementation, /oauth/revoke looks
apps/api/internal/auth/handler/handler.go:109
MethodLookupPatchesByIDs
(ids []int)
apps/api/internal/user/service/service.go:47
MethodLookupPatchesByIDs
(ids []int)
apps/api/internal/common/handler.go:81
MethodLookupPatchesByIDs
LookupPatchesByIDs makes AdminService satisfy enricher.PatchSummaryDB, so the handler can attach galgame name/banner summaries to comment/resource lis
apps/api/internal/admin/service/service.go:199
MethodLookupPatchesByIDs
LookupPatchesByIDs returns the minimal patch projection (id + vndb_id) for a set of ids. Satisfies enricher.PatchSummaryDB so admin list endpoints can
apps/api/internal/admin/repository/repository.go:247
MethodMarkAsRead
MarkAsRead marks messages of a given type (or all) as read
apps/api/internal/message/service/service.go:27
MethodMarkAsRead
MarkAsRead marks messages as read by type (or all if type is "all")
apps/api/internal/message/repository/repository.go:54
MethodMarkAsRead
MarkAsRead PUT /api/message/read
apps/api/internal/message/handler/handler.go:184
MethodMarkSeen
MarkSeen marks messages as seen in bulk.
apps/api/internal/chat/service/service.go:192
MethodMarkSeen
─── Seen ─────────────────────────────────────────── MarkSeen writes seen markers in bulk. Duplicate inserts are ignored via OnConflict DoNothing.
apps/api/internal/chat/repository/repository.go:328
MethodMarkSeen
MarkSeen PUT /api/chat/room/:link/seen
apps/api/internal/chat/handler/handler.go:472
FunctionMaybeProbe
MaybeProbe runs the `healthcheck` subcommand and exits the process, or returns immediately when not invoked that way. It is a no-op unless os.Args[1]
apps/api/pkg/health/health.go:28
MethodMe
Me GET /api/v1/auth/me Composes identity (userID/sub/roles from session+JWT), display fields (name/avatar/bio from OAuth /users/batch), and site-loca
apps/api/internal/auth/handler/handler.go:143
FunctionMustGetUser
(c fiber.Ctx)
apps/api/internal/middleware/auth.go:271
FunctionMustRender
MustRender returns the original text on render failure (as a fallback).
apps/api/internal/infrastructure/markdown/markdown.go:391
FunctionNew
New constructs a Client. Empty BaseURL/credentials = no-op client whose calls return ErrNotConfigured, so the caller can degrade gracefully in dev.
apps/api/pkg/artifactclient/client.go:123
FunctionNew
New constructs a Client. Empty BaseURL = no-op client (Upload returns error quickly so the caller can degrade gracefully when image_service is intenti
apps/api/pkg/imageclient/client.go:71
FunctionNew
(repo *repository.AuthRepository, rdb *redis.Client, oauthCfg config.OAuthConfig)
apps/api/internal/auth/service/service.go:54
FunctionNew
(db *gorm.DB)
apps/api/internal/auth/repository/repository.go:17
FunctionNew
(svc *service.AuthService, rdb *redis.Client, db *gorm.DB, users *userclient.Client)
apps/api/internal/auth/handler/handler.go:35
FunctionNew
(repo *repository.UserRepository, s3 *storage.S3Client, users *userclient.Client, wiki *galgameClient.Client,
apps/api/internal/user/service/service.go:39
FunctionNew
(db *gorm.DB)
apps/api/internal/user/repository/repository.go:17
FunctionNew
(svc *service.UserService, wiki *galgameClient.Client, users *userclient.Client)
apps/api/internal/user/handler/handler.go:44
FunctionNew
New constructs a Client. baseURL looks like http://127.0.0.1:9280/api
apps/api/internal/galgame/client/client.go:49
FunctionNew
(repo *repository.ChatRepository)
apps/api/internal/chat/service/service.go:24
FunctionNew
(db *gorm.DB)
apps/api/internal/chat/repository/repository.go:17
FunctionNew
(svc *service.ChatService, users *userclient.Client)
apps/api/internal/chat/handler/handler.go:31
FunctionNew
(cfg *config.Config)
apps/api/internal/app/app.go:76
FunctionNew
New constructs a Handler.
apps/api/internal/common/search/search.go:30
FunctionNew
New constructs a Service. rdb may be nil in tests (idempotency then degrades to best-effort).
apps/api/internal/common/upload/service.go:46
FunctionNew
(db *gorm.DB)
apps/api/internal/setting/service/service.go:30
FunctionNew
(repo *repository.DocRepository, img *imageclient.Client, users *userclient.Client)
apps/api/internal/doc/service/service.go:42
FunctionNew
(db *gorm.DB)
apps/api/internal/doc/repository/repository.go:14
FunctionNew
(svc *service.DocService)
apps/api/internal/doc/handler/handler.go:23
FunctionNew
(repo *repository.PatchRepository, setting *settingService.Service, db *gorm.DB, s3 *storage.S3Client, art *ar
apps/api/internal/patch/service/service.go:58
FunctionNew
(db *gorm.DB)
apps/api/internal/patch/repository/repository.go:17
FunctionNew
(svc *service.PatchService, wiki *galgameClient.Client, users *userclient.Client)
apps/api/internal/patch/handler/handler.go:38
FunctionNew
(repo *repository.MessageRepository)
apps/api/internal/message/service/service.go:12
FunctionNew
(db *gorm.DB)
apps/api/internal/message/repository/repository.go:13
FunctionNew
(svc *service.MessageService, users *userclient.Client, wiki *galgameClient.Client)
apps/api/internal/message/handler/handler.go:28
FunctionNew
(repo *repository.AdminRepository, rdb *redis.Client, setting *settingService.Service, s3 *storage.S3Client, p
apps/api/internal/admin/service/service.go:36
FunctionNew
(db *gorm.DB)
apps/api/internal/admin/repository/repository.go:27
FunctionNew
(svc *service.AdminService, wiki *galgameClient.Client, users *userclient.Client)
apps/api/internal/admin/handler/handler.go:29
FunctionNewAwarder
(client *Client, db *gorm.DB)
apps/api/pkg/moemoepoint/awarder.go:18
FunctionNewClientWithResponses
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
apps/api/pkg/artifactclient/gen/artifact_client.gen.go:640
FunctionNewHandler
NewHandler constructs a Handler. img/wiki may be nil in tests.
apps/api/internal/common/upload/handler.go:30
FunctionNewPostgres
(cfg config.DatabaseConfig, mode string)
apps/api/internal/infrastructure/database/postgres.go:14
FunctionNewRedis
(cfg config.RedisConfig)
apps/api/internal/infrastructure/cache/redis.go:13
FunctionNewS3
NewS3 initializes a client from config. When cfg.Endpoint is empty it returns a disabled placeholder (so dev can start without S3).
apps/api/internal/infrastructure/storage/s3.go:35
FunctionNewTestApp
NewTestApp creates a minimal Fiber app with miniredis
apps/api/internal/testutil/testutil.go:34
MethodOAuthCallback
OAuthCallback POST /api/v1/auth/oauth/callback Exchanges the authorization code for tokens, fetches user identity from oauth/userinfo, ensures a loca
apps/api/internal/auth/handler/handler.go:44
FunctionOK
(c fiber.Ctx, data any)
apps/api/pkg/response/response.go:21
FunctionOKMessage
(c fiber.Ctx, msg string)
apps/api/pkg/response/response.go:29
FunctionOptionalAuth
(rdb *redis.Client, oauthCfg config.OAuthConfig)
apps/api/internal/middleware/auth.go:204
FunctionPaginate
(page, limit int)
apps/api/pkg/utils/pagination.go:14
FunctionPaginated
Paginated emits { code, message, data: { items, total } }. Nullish items are normalized to an empty slice to keep the shape stable for the frontend.
apps/api/pkg/response/response.go:39
FunctionParseAndValidate
(c fiber.Ctx, out any)
apps/api/pkg/utils/validate.go:13
FunctionParseMonthSet
ParseMonthSet parses the released_months CSV (e.g. "3,7,12") into a sorted, deduped []int of months 1-12, per docs/galgame_wiki/00-handbook §17.10. It
apps/api/pkg/utils/release_date.go:36
FunctionParsePaginatedResponse
ParsePaginatedResponse reads and parses the paginated JSON response body.
apps/api/internal/testutil/testutil.go:136
FunctionParseQueryAndValidate
(c fiber.Ctx, out any)
apps/api/pkg/utils/validate.go:20
FunctionParseReleaseLowerBound
ParseReleaseLowerBound parses released_from into an inclusive lower date bound. "" → (nil, nil) meaning "no lower bound". YYYY → Jan 1 of that year; Y
apps/api/pkg/utils/release_date.go:66
FunctionParseReleaseUpperBound
ParseReleaseUpperBound parses released_to into an inclusive upper date bound. "" → (nil, nil). YYYY → Dec 31 of that year; YYYY-MM → the last day of t
apps/api/pkg/utils/release_date.go:89
FunctionParseResponse
ParseResponse reads and parses the JSON response body
apps/api/internal/testutil/testutil.go:110
FunctionParseWikiReleaseDate
ParseWikiReleaseDate turns Wiki's release_date string into a date-only *time.Time for storage in patch.release_date. "" / nil / unparseable → nil (bes
apps/api/pkg/utils/release_date.go:121
MethodPatchGalgameDraft
PatchGalgameDraft proxies PATCH /galgame/:gid (status ∈ {3,4}). Editing a declined draft auto-flips it back to pending review.
apps/api/internal/galgame/client/submission.go:163
MethodPatchGalgameDraft
PatchGalgameDraft PATCH /api/v1/galgame/:gid Edit one's own pending/declined draft. Wiki auto-flips status=4 back to 3. Same dual-content-type as Sub
apps/api/internal/patch/handler/handler.go:1046
MethodPurgeUser
PurgeUser wipes every moyu-side trace of the user, then best-effort deletes the orphaned S3 objects (same philosophy as DeleteResource / DeletePatch:
apps/api/internal/admin/service/service.go:139
MethodPurgeUser
PurgeUser wipes every moyu-side trace of a user in one transaction, then the service does best-effort S3 cleanup with the keys from CollectUserS3Keys.
apps/api/internal/admin/repository/repository.go:499
MethodPurgeUser
PurgeUser POST /api/admin/user/:id/purge body: { purge_owned_patches: bool } Irreversibly removes every moyu-side trace of the user (comments, reso
apps/api/internal/admin/handler/handler.go:246
MethodPut
Put pre-seeds the cache (e.g. from an upload result, which already carries the metadata) so the first render of a freshly uploaded image needs no netw
apps/api/pkg/imageclient/meta_resolver.go:90
FunctionRateLimit
(rdb *redis.Client, prefix string, maxRequests int, window time.Duration)
apps/api/internal/middleware/ratelimit.go:15
← previousnext →701–800 of 1,135, ranked by callers