Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/HachimiWorld/hachimi-world-server
/ functions
Functions
625 in github.com/HachimiWorld/hachimi-world-server
⨍
Functions
625
◇
Types & classes
274
↓ 113 callers
Method
post
(&self, path: &str, body: &T)
tests/common/mod.rs:209
↓ 84 callers
Function
with_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 callers
Method
uid
(&self)
src/web/jwt.rs:124
↓ 72 callers
Method
get_query
(&self, path: &str, query: &T)
tests/common/mod.rs:195
↓ 71 callers
Function
with_new_random_test_user
(env: &mut TestEnvironment)
tests/common/auth.rs:15
↓ 64 callers
Method
get
(&self, key: &str)
src/config.rs:25
↓ 49 callers
Method
set_token
(&mut self, token: String)
tests/common/mod.rs:174
↓ 44 callers
Method
parse_resp
(self)
tests/common/mod.rs:271
↓ 22 callers
Function
assert_is_ok
(resp: Response)
tests/common/mod.rs:252
↓ 20 callers
Method
get
(&self, path: &str)
tests/common/mod.rs:182
↓ 17 callers
Method
get_and_parse
(&self, key: &str)
src/config.rs:36
↓ 17 callers
Method
insert
(executor: E, value: &Self::Entity)
src/db/post.rs:60
↓ 16 callers
Function
publish_template
(env: &TestEnvironment)
tests/common/publish.rs:13
↓ 16 callers
Function
with_test_contributor_user
(env: &mut TestEnvironment)
tests/common/auth.rs:50
↓ 15 callers
Method
count
(executor: impl PgExecutor<'e>, variant: Option<&str>)
src/db/version.rs:101
↓ 14 callers
Function
assert_is_err
(resp: Response)
tests/common/mod.rs:257
↓ 14 callers
Function
do_follow
Helper: follow user and assert success, returning follower_count.
tests/follow.rs:12
↓ 13 callers
Method
ok
(data: T)
src/web/result.rs:174
↓ 11 callers
Function
scale_down_to_webp
( w: u32, h: u32, bytes: Bytes, resize_type: ResizeType, quality: f32 )
src/service/upload.rs:52
↓ 10 callers
Function
generate_pass_captcha_key
Make sure using test-captcha environment in integrated tests
tests/common/auth.rs:57
↓ 10 callers
Method
post_raw
(&self, path: &str)
tests/common/mod.rs:223
↓ 9 callers
Function
get_public_detail_with_cache
( mut redis: ConnectionManager, sql_pool: &PgPool, song_id_list: &[i64], )
src/service/song.rs:112
↓ 8 callers
Method
is_blank
(&self)
src/util/mod.rs:19
↓ 8 callers
Method
parse
(path: impl AsRef<Path>)
src/config.rs:15
↓ 8 callers
Method
try_lock
Try to acquire the lock
src/util/redlock.rs:84
↓ 8 callers
Method
upload
(&self, bytes: Bytes, key: &str)
src/file_hosting/mod.rs:36
↓ 7 callers
Function
create_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 callers
Function
create_playlist
( env: &TestEnvironment, name: &str, description: Option<&str>, is_public: bool, )
tests/playlist.rs:291
↓ 7 callers
Function
ensure_contributor
( state: &AppState, uid: i64, )
src/service/contributor.rs:22
↓ 7 callers
Function
send_notification
( cfg: &EmailConfig, to: &str, subject: &str, content: &str, )
src/service/mailer/mod.rs:56
↓ 6 callers
Function
add_or_replace_document
( client: &Client, pool: &PgPool, song_ids: &[i64] )
src/search/song.rs:35
↓ 6 callers
Function
check_ownership
( claims: &Claims, pool: &PgPool, playlist_id: i64, )
src/web/routes/playlist.rs:458
↓ 6 callers
Function
get_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 callers
Function
create_tags
(api: &ApiClient)
tests/common/song.rs:4
↓ 5 callers
Function
generate_access_token
(uid: &str, exp: i64)
src/web/jwt.rs:27
↓ 5 callers
Function
generate_test_image
(width: u32, height: u32, format: ImageFormat)
tests/common/res_utils.rs:3
↓ 5 callers
Function
get_common_user_profile
Internal: fetch profiles from DB + Redis cache, without enrichments.
src/service/user.rs:66
↓ 5 callers
Method
lock_with_timeout
Spin lock until the lock is acquired or timeout
src/util/redlock.rs:68
↓ 5 callers
Function
parse_jmid
(input: &str)
src/web/routes/publish/jmid.rs:118
↓ 5 callers
Function
read_test_mp3
()
tests/common/publish.rs:54
↓ 5 callers
Function
set_cache_is_liked
(redis: &mut ConnectionManager, uid: i64, song_id: i64, value: bool)
src/service/song_like.rs:190
↓ 5 callers
Function
set_code
(conn: &mut ConnectionManager, email: &str, code: &str)
src/service/verification_code.rs:42
↓ 5 callers
Method
user_info
(&self, mid: i64)
src/util/bilibili.rs:30
↓ 4 callers
Function
build_temp_key
(temp_id: &str)
src/web/routes/publish.rs:718
↓ 4 callers
Method
build_url
(&self, path: &str)
tests/common/mod.rs:229
↓ 4 callers
Method
clear_token
(&mut self)
tests/common/mod.rs:178
↓ 4 callers
Method
default_headers
(&self)
tests/common/mod.rs:238
↓ 4 callers
Function
ensure_review_visible
( state: &AppState, review: &SongPublishingReview, uid: i64, )
src/web/routes/publish/review.rs:643
↓ 4 callers
Function
setup_song
Helper: creates a user, a contributor, and an approved song. Returns the song and both tokens.
tests/song.rs:25
↓ 3 callers
Function
add_song_to_playlist
(env: &TestEnvironment, playlist_id: i64, song_id: i64)
tests/playlist.rs:307
↓ 3 callers
Function
build_captcha_redis_key
(captcha_key: &str)
src/service/captcha.rs:65
↓ 3 callers
Function
build_image_temp_key
(temp_id: &str)
src/web/routes/publish.rs:722
↓ 3 callers
Function
build_internal_review_data
( sql_pool: &PgPool, mut song: Song, tag_ids: &[i64], creation_info: &CreationInfo, produc
src/web/routes/publish.rs:270
↓ 3 callers
Function
build_recent_redis_key
(cursor: Option<DateTime<Utc>>, limit: i32, after: bool)
src/service/recommend_v2.rs:86
↓ 3 callers
Function
check_contributor
( claims: Claims, state: State<AppState>, )
src/web/routes/contributor.rs:21
↓ 3 callers
Function
check_jmid_available
Check whether the `jmid` is available (not used nor locked by other pending SRs).
src/web/routes/publish/jmid.rs:99
↓ 3 callers
Function
decode_and_validate_access_token
(token: &str)
src/web/jwt.rs:64
↓ 3 callers
Method
delete
(executor: E, follower_id: i64, followed_id: i64)
src/db/follow.rs:54
↓ 3 callers
Function
delete_playlist_document
( client: &Client, playlist_ids: &[i64], )
src/search/playlist.rs:42
↓ 3 callers
Function
do_unfollow
Helper: unfollow user and assert success.
tests/follow.rs:24
↓ 3 callers
Function
get_cache_is_liked
(redis: &mut ConnectionManager, uid: i64, song_id: i64)
src/service/song_like.rs:186
↓ 3 callers
Function
initialize_jwt_key
(keys: Keys)
src/web/jwt.rs:18
↓ 3 callers
Function
is_liked
( redis_conn: &ConnectionManager, sql_pool: &PgPool, uid: i64, song_id: i64, )
src/service/song_like.rs:95
↓ 3 callers
Function
list_playlist_metadata
( redis: ConnectionManager, sql_pool: &PgPool, playlist_ids: &[i64], filter_private: bool )
src/service/playlist.rs:107
↓ 3 callers
Function
make_test_image
Generate a test image in any format as raw bytes.
src/service/upload.rs:197
↓ 3 callers
Function
notify_update
(song_id: i64, mut redis: ConnectionManager)
src/service/recommend_v2.rs:119
↓ 3 callers
Function
parse_and_validate
( input: Box<dyn MediaSource>, file_name: Option<&str>, )
src/audio/mod.rs:45
↓ 3 callers
Function
update_user_document
(client: &Client, document: UserDocument)
src/search/user.rs:65
↓ 3 callers
Function
verify_captcha
( redis: &mut redis::aio::ConnectionManager, captcha_key: &str, )
src/service/captcha.rs:52
↓ 3 callers
Function
with_new_test_user
(env: &mut TestEnvironment, email: &str)
tests/common/auth.rs:20
↓ 2 callers
Function
assemble_from_db
( redis: &ConnectionManager, sql_pool: &PgPool, song: Song, )
src/service/song.rs:434
↓ 2 callers
Function
build_image_temp_key
(module_type: &str, temp_id: &str)
src/service/upload.rs:185
↓ 2 callers
Function
build_image_temp_key
(temp_id: &str)
src/web/routes/upload.rs:70
↓ 2 callers
Function
clear_cache
(mut redis: ConnectionManager)
src/web/routes/version.rs:219
↓ 2 callers
Function
compose_publish_song_publish_review_data
( sql_pool: &PgPool, meta: PublishSongPublishReviewMeta, data: InternalSongPublishReviewData, )
src/web/routes/publish/review.rs:159
↓ 2 callers
Function
convert_ip_to_anonymous_uid
(ip: &str)
src/util/mod.rs:39
↓ 2 callers
Function
cooldown
( user_id: i64, song_id: i64, redis: &mut ConnectionManager )
src/web/routes/play_history.rs:159
↓ 2 callers
Function
create_tags
(api: &ApiClient)
tests/publish_and_review.rs:168
↓ 2 callers
Function
delete
( claims: Claims, state: State<AppState>, req: Json<PostIdReq>, )
src/web/routes/post.rs:252
↓ 2 callers
Method
from
(err: E)
src/service/errors.rs:12
↓ 2 callers
Function
gen_cache_key
(uid: i64)
src/service/user.rs:122
↓ 2 callers
Function
gen_follow_cache_key
(follower_id: i64, followed_id: i64)
src/service/follow.rs:29
↓ 2 callers
Function
gen_profile_cache_key
(uid: i64)
src/service/follow.rs:25
↓ 2 callers
Function
generate_challenge_cache_key
(challenge_id: &str)
src/service/connection_account.rs:275
↓ 2 callers
Function
generate_refresh_token
(uid: &str)
src/web/jwt.rs:38
↓ 2 callers
Function
generate_refresh_token_with_exp
(uid: &str, exp: chrono::DateTime<chrono::Utc>)
src/web/jwt.rs:42
↓ 2 callers
Function
generate_song_display_id
Pattern: JM-AAAA-000
src/service/song.rs:511
↓ 2 callers
Function
generate_token_pairs_and_save
( ip: String, uid: i64, ua: String, device_info: String, sql_pool: &PgPool, )
src/web/routes/auth.rs:448
↓ 2 callers
Function
generate_verify_code
()
src/service/verification_code.rs:52
↓ 2 callers
Function
get_contributors_from_cache
(redis: &mut ConnectionManager)
src/service/contributor.rs:78
↓ 2 callers
Function
get_detail
(state: &State<AppState>, uid: Option<i64>, playlist_id: i64)
src/service/playlist.rs:29
↓ 2 callers
Function
get_documents_batch
(pool: &PgPool, playlist_ids: &[i64])
src/search/playlist.rs:215
↓ 2 callers
Function
get_documents_batch
( pool: &PgPool, song_ids: &[i64] )
src/search/song.rs:251
↓ 2 callers
Function
get_from_cache
(mut redis: ConnectionManager, cursor: Option<DateTime<Utc>>, limit: i32, after: bool)
src/service/recommend_v2.rs:57
↓ 2 callers
Function
get_from_cache_or_db
( sql_pool: &PgPool, mut redis: ConnectionManager, variant: &str, )
src/web/routes/version.rs:198
↓ 2 callers
Function
get_from_cache_recommend
( mut redis: ConnectionManager, user_id: i64, date: &NaiveDate, )
src/service/recommend_v2.rs:184
↓ 2 callers
Function
get_plays_cache
(redis: &mut ConnectionManager, song_id: i64)
src/service/song_play.rs:32
↓ 2 callers
Function
get_recommend
Return random 30 songs for a user in one day
src/service/recommend_v2.rs:152
↓ 2 callers
Function
get_verify_code_key
(email: &str)
src/service/verification_code.rs:56
↓ 2 callers
Function
get_verify_code_retries_key
(email: &str)
src/service/verification_code.rs:64
next →
1–100 of 625, ranked by callers