MCPcopy Create free account

hub / github.com/HachimiWorld/hachimi-world-server / functions

Functions625 in github.com/HachimiWorld/hachimi-world-server

↓ 113 callersMethodpost
(&self, path: &str, body: &T)
tests/common/mod.rs:209
↓ 84 callersFunctionwith_test_environment
This is used to start a black-box test environment. It will launch the web server and provide an API client, SQL pool and Redis connection for testing
tests/common/mod.rs:41
↓ 79 callersMethoduid
(&self)
src/web/jwt.rs:124
↓ 72 callersMethodget_query
(&self, path: &str, query: &T)
tests/common/mod.rs:195
↓ 71 callersFunctionwith_new_random_test_user
(env: &mut TestEnvironment)
tests/common/auth.rs:15
↓ 64 callersMethodget
(&self, key: &str)
src/config.rs:25
↓ 49 callersMethodset_token
(&mut self, token: String)
tests/common/mod.rs:174
↓ 44 callersMethodparse_resp
(self)
tests/common/mod.rs:271
↓ 22 callersFunctionassert_is_ok
(resp: Response)
tests/common/mod.rs:252
↓ 20 callersMethodget
(&self, path: &str)
tests/common/mod.rs:182
↓ 17 callersMethodget_and_parse
(&self, key: &str)
src/config.rs:36
↓ 17 callersMethodinsert
(executor: E, value: &Self::Entity)
src/db/post.rs:60
↓ 16 callersFunctionpublish_template
(env: &TestEnvironment)
tests/common/publish.rs:13
↓ 16 callersFunctionwith_test_contributor_user
(env: &mut TestEnvironment)
tests/common/auth.rs:50
↓ 15 callersMethodcount
(executor: impl PgExecutor<'e>, variant: Option<&str>)
src/db/version.rs:101
↓ 14 callersFunctionassert_is_err
(resp: Response)
tests/common/mod.rs:257
↓ 14 callersFunctiondo_follow
Helper: follow user and assert success, returning follower_count.
tests/follow.rs:12
↓ 13 callersMethodok
(data: T)
src/web/result.rs:174
↓ 11 callersFunctionscale_down_to_webp
( w: u32, h: u32, bytes: Bytes, resize_type: ResizeType, quality: f32 )
src/service/upload.rs:52
↓ 10 callersFunctiongenerate_pass_captcha_key
Make sure using test-captcha environment in integrated tests
tests/common/auth.rs:57
↓ 10 callersMethodpost_raw
(&self, path: &str)
tests/common/mod.rs:223
↓ 9 callersFunctionget_public_detail_with_cache
( mut redis: ConnectionManager, sql_pool: &PgPool, song_id_list: &[i64], )
src/service/song.rs:112
↓ 8 callersMethodis_blank
(&self)
src/util/mod.rs:19
↓ 8 callersMethodparse
(path: impl AsRef<Path>)
src/config.rs:15
↓ 8 callersMethodtry_lock
Try to acquire the lock
src/util/redlock.rs:84
↓ 8 callersMethodupload
(&self, bytes: Bytes, key: &str)
src/file_hosting/mod.rs:36
↓ 7 callersFunctioncreate_approved_song
Creates a song by publishing it as `owner_token` and approving it as `contributor_token`. Returns the approved song with both internal ID and JMID.
tests/common/publish.rs:72
↓ 7 callersFunctioncreate_playlist
( env: &TestEnvironment, name: &str, description: Option<&str>, is_public: bool, )
tests/playlist.rs:291
↓ 7 callersFunctionensure_contributor
( state: &AppState, uid: i64, )
src/service/contributor.rs:22
↓ 7 callersFunctionsend_notification
( cfg: &EmailConfig, to: &str, subject: &str, content: &str, )
src/service/mailer/mod.rs:56
↓ 6 callersFunctionadd_or_replace_document
( client: &Client, pool: &PgPool, song_ids: &[i64] )
src/search/song.rs:35
↓ 6 callersFunctioncheck_ownership
( claims: &Claims, pool: &PgPool, playlist_id: i64, )
src/web/routes/playlist.rs:458
↓ 6 callersFunctionget_public_profile
Get user profiles from DB + Redis cache. Follow-relationship fields (`is_following`, `is_followed_by`) are left `None` unless `viewer_uid` is provide
src/service/user.rs:42
↓ 5 callersFunctioncreate_tags
(api: &ApiClient)
tests/common/song.rs:4
↓ 5 callersFunctiongenerate_access_token
(uid: &str, exp: i64)
src/web/jwt.rs:27
↓ 5 callersFunctiongenerate_test_image
(width: u32, height: u32, format: ImageFormat)
tests/common/res_utils.rs:3
↓ 5 callersFunctionget_common_user_profile
Internal: fetch profiles from DB + Redis cache, without enrichments.
src/service/user.rs:66
↓ 5 callersMethodlock_with_timeout
Spin lock until the lock is acquired or timeout
src/util/redlock.rs:68
↓ 5 callersFunctionparse_jmid
(input: &str)
src/web/routes/publish/jmid.rs:118
↓ 5 callersFunctionread_test_mp3
()
tests/common/publish.rs:54
↓ 5 callersFunctionset_cache_is_liked
(redis: &mut ConnectionManager, uid: i64, song_id: i64, value: bool)
src/service/song_like.rs:190
↓ 5 callersFunctionset_code
(conn: &mut ConnectionManager, email: &str, code: &str)
src/service/verification_code.rs:42
↓ 5 callersMethoduser_info
(&self, mid: i64)
src/util/bilibili.rs:30
↓ 4 callersFunctionbuild_temp_key
(temp_id: &str)
src/web/routes/publish.rs:718
↓ 4 callersMethodbuild_url
(&self, path: &str)
tests/common/mod.rs:229
↓ 4 callersMethodclear_token
(&mut self)
tests/common/mod.rs:178
↓ 4 callersMethoddefault_headers
(&self)
tests/common/mod.rs:238
↓ 4 callersFunctionensure_review_visible
( state: &AppState, review: &SongPublishingReview, uid: i64, )
src/web/routes/publish/review.rs:643
↓ 4 callersFunctionsetup_song
Helper: creates a user, a contributor, and an approved song. Returns the song and both tokens.
tests/song.rs:25
↓ 3 callersFunctionadd_song_to_playlist
(env: &TestEnvironment, playlist_id: i64, song_id: i64)
tests/playlist.rs:307
↓ 3 callersFunctionbuild_captcha_redis_key
(captcha_key: &str)
src/service/captcha.rs:65
↓ 3 callersFunctionbuild_image_temp_key
(temp_id: &str)
src/web/routes/publish.rs:722
↓ 3 callersFunctionbuild_internal_review_data
( sql_pool: &PgPool, mut song: Song, tag_ids: &[i64], creation_info: &CreationInfo, produc
src/web/routes/publish.rs:270
↓ 3 callersFunctionbuild_recent_redis_key
(cursor: Option<DateTime<Utc>>, limit: i32, after: bool)
src/service/recommend_v2.rs:86
↓ 3 callersFunctioncheck_contributor
( claims: Claims, state: State<AppState>, )
src/web/routes/contributor.rs:21
↓ 3 callersFunctioncheck_jmid_available
Check whether the `jmid` is available (not used nor locked by other pending SRs).
src/web/routes/publish/jmid.rs:99
↓ 3 callersFunctiondecode_and_validate_access_token
(token: &str)
src/web/jwt.rs:64
↓ 3 callersMethoddelete
(executor: E, follower_id: i64, followed_id: i64)
src/db/follow.rs:54
↓ 3 callersFunctiondelete_playlist_document
( client: &Client, playlist_ids: &[i64], )
src/search/playlist.rs:42
↓ 3 callersFunctiondo_unfollow
Helper: unfollow user and assert success.
tests/follow.rs:24
↓ 3 callersFunctionget_cache_is_liked
(redis: &mut ConnectionManager, uid: i64, song_id: i64)
src/service/song_like.rs:186
↓ 3 callersFunctioninitialize_jwt_key
(keys: Keys)
src/web/jwt.rs:18
↓ 3 callersFunctionis_liked
( redis_conn: &ConnectionManager, sql_pool: &PgPool, uid: i64, song_id: i64, )
src/service/song_like.rs:95
↓ 3 callersFunctionlist_playlist_metadata
( redis: ConnectionManager, sql_pool: &PgPool, playlist_ids: &[i64], filter_private: bool )
src/service/playlist.rs:107
↓ 3 callersFunctionmake_test_image
Generate a test image in any format as raw bytes.
src/service/upload.rs:197
↓ 3 callersFunctionnotify_update
(song_id: i64, mut redis: ConnectionManager)
src/service/recommend_v2.rs:119
↓ 3 callersFunctionparse_and_validate
( input: Box<dyn MediaSource>, file_name: Option<&str>, )
src/audio/mod.rs:45
↓ 3 callersFunctionupdate_user_document
(client: &Client, document: UserDocument)
src/search/user.rs:65
↓ 3 callersFunctionverify_captcha
( redis: &mut redis::aio::ConnectionManager, captcha_key: &str, )
src/service/captcha.rs:52
↓ 3 callersFunctionwith_new_test_user
(env: &mut TestEnvironment, email: &str)
tests/common/auth.rs:20
↓ 2 callersFunctionassemble_from_db
( redis: &ConnectionManager, sql_pool: &PgPool, song: Song, )
src/service/song.rs:434
↓ 2 callersFunctionbuild_image_temp_key
(module_type: &str, temp_id: &str)
src/service/upload.rs:185
↓ 2 callersFunctionbuild_image_temp_key
(temp_id: &str)
src/web/routes/upload.rs:70
↓ 2 callersFunctionclear_cache
(mut redis: ConnectionManager)
src/web/routes/version.rs:219
↓ 2 callersFunctioncompose_publish_song_publish_review_data
( sql_pool: &PgPool, meta: PublishSongPublishReviewMeta, data: InternalSongPublishReviewData, )
src/web/routes/publish/review.rs:159
↓ 2 callersFunctionconvert_ip_to_anonymous_uid
(ip: &str)
src/util/mod.rs:39
↓ 2 callersFunctioncooldown
( user_id: i64, song_id: i64, redis: &mut ConnectionManager )
src/web/routes/play_history.rs:159
↓ 2 callersFunctioncreate_tags
(api: &ApiClient)
tests/publish_and_review.rs:168
↓ 2 callersFunctiondelete
( claims: Claims, state: State<AppState>, req: Json<PostIdReq>, )
src/web/routes/post.rs:252
↓ 2 callersMethodfrom
(err: E)
src/service/errors.rs:12
↓ 2 callersFunctiongen_cache_key
(uid: i64)
src/service/user.rs:122
↓ 2 callersFunctiongen_follow_cache_key
(follower_id: i64, followed_id: i64)
src/service/follow.rs:29
↓ 2 callersFunctiongen_profile_cache_key
(uid: i64)
src/service/follow.rs:25
↓ 2 callersFunctiongenerate_challenge_cache_key
(challenge_id: &str)
src/service/connection_account.rs:275
↓ 2 callersFunctiongenerate_refresh_token
(uid: &str)
src/web/jwt.rs:38
↓ 2 callersFunctiongenerate_refresh_token_with_exp
(uid: &str, exp: chrono::DateTime<chrono::Utc>)
src/web/jwt.rs:42
↓ 2 callersFunctiongenerate_song_display_id
Pattern: JM-AAAA-000
src/service/song.rs:511
↓ 2 callersFunctiongenerate_token_pairs_and_save
( ip: String, uid: i64, ua: String, device_info: String, sql_pool: &PgPool, )
src/web/routes/auth.rs:448
↓ 2 callersFunctiongenerate_verify_code
()
src/service/verification_code.rs:52
↓ 2 callersFunctionget_contributors_from_cache
(redis: &mut ConnectionManager)
src/service/contributor.rs:78
↓ 2 callersFunctionget_detail
(state: &State<AppState>, uid: Option<i64>, playlist_id: i64)
src/service/playlist.rs:29
↓ 2 callersFunctionget_documents_batch
(pool: &PgPool, playlist_ids: &[i64])
src/search/playlist.rs:215
↓ 2 callersFunctionget_documents_batch
( pool: &PgPool, song_ids: &[i64] )
src/search/song.rs:251
↓ 2 callersFunctionget_from_cache
(mut redis: ConnectionManager, cursor: Option<DateTime<Utc>>, limit: i32, after: bool)
src/service/recommend_v2.rs:57
↓ 2 callersFunctionget_from_cache_or_db
( sql_pool: &PgPool, mut redis: ConnectionManager, variant: &str, )
src/web/routes/version.rs:198
↓ 2 callersFunctionget_from_cache_recommend
( mut redis: ConnectionManager, user_id: i64, date: &NaiveDate, )
src/service/recommend_v2.rs:184
↓ 2 callersFunctionget_plays_cache
(redis: &mut ConnectionManager, song_id: i64)
src/service/song_play.rs:32
↓ 2 callersFunctionget_recommend
Return random 30 songs for a user in one day
src/service/recommend_v2.rs:152
↓ 2 callersFunctionget_verify_code_key
(email: &str)
src/service/verification_code.rs:56
↓ 2 callersFunctionget_verify_code_retries_key
(email: &str)
src/service/verification_code.rs:64
next →1–100 of 625, ranked by callers