In v0.5.1-rc.2, INN is not displayed on the right side

โš“ Dev    ๐Ÿ“… 2023-06-26    ๐Ÿ‘ค Ryza    ๐Ÿ‘๏ธ 212      

Ryza

Warning

This post was published 93 days ago. The infomation described in this article may have changed.

@freedit

๐Ÿท๏ธ v0.5.1-rc.2

freedit    2023-06-26 ๐Ÿ‘ ๐Ÿ‘Ž

#2 yes. At the current stage, recommendations are based on the number of posts. However, this is an independent function, and there may be better recommendation algorithms in the future. code

3

freedit    2023-06-26 ๐Ÿ‘ ๐Ÿ‘Ž

#[cached(time = 120, result = true)]
fn recommend_inns() -> Result<Vec<(u32, String)>, AppError> {
    let page_params = ParamsPage {
        anchor: 100,
        n: 10,
        is_desc: false,
    };
    let inns: Vec<Inn> = get_batch(&DB, "default", "inns_count", "inns", &page_params)?;
    let mut recommend_inns = Vec::new();
    for inn in inns {
        recommend_inns.push((inn.iid, inn.inn_name));
    }
    Ok(recommend_inns)
}
9

Ryza    2023-06-27 ๐Ÿ‘ ๐Ÿ‘Ž [op]

@freedit This code will only display the last inn๏ผŒFor example, if I have 4 inns, only the last one will be displayed on the right side and the others will not be displayed

11