Skip to content

Commit

Permalink
Merge pull request #223 from Enraged-Dun-Cookie-Development-Team/fix-…
Browse files Browse the repository at this point in the history
…公告cdn返回格式错误

🐛 修复公告cdn返回格式错误
  • Loading branch information
phidiaLam authored Dec 18, 2024
2 parents 485b6d8 + d2d2a18 commit 79d8e2b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Rust toolchain Stable
uses: actions-rs/toolchain@v1
with:
toolchain: 1.80.1
toolchain: 1.81.0
components: clippy
default: true
- name: Rust toolchain Nightly
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ page_next_id = { version = "0.1.0", path = "./libs/page_next_id" }


[dependencies]

# async
async-trait = { workspace = true }
# axum
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.2
FROM lukemathwalker/cargo-chef:latest-rust-1.80.1 AS chef
FROM lukemathwalker/cargo-chef:latest-rust-1.81.0 AS chef
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
Expand Down
13 changes: 9 additions & 4 deletions logic/ceobe_operation_logic/src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use persistence::{
use serde::{Deserialize, Serialize};
use tencent_cloud_server::cdn::purge_urls_cache::PurgeCachePath;
use typed_builder::TypedBuilder;
use url::Url;

use crate::error::LogicError;

Expand Down Expand Up @@ -73,8 +74,7 @@ impl TryInto<ToolLinkResp> for FrontendToolLink {
pub struct AnnouncementResp {
pub start_time: String,
pub over_time: String,
pub content: String,
pub img_url: String,
pub html: String,
pub notice: bool,
}

Expand All @@ -89,11 +89,16 @@ impl From<announcement::Model> for AnnouncementResp {
..
}: announcement::Model,
) -> Self {
let image = Url::parse(&img_url)
.map(|url| url.to_string())
.unwrap_or_else(|_| format!(r#"/assets/image/{img_url}.png"#));

Self {
start_time: naive_date_time_format(start_time),
over_time: naive_date_time_format(over_time),
content,
img_url,
html: format!(
r#"<div class="online-area"><img class="online-title-img radius" src="{image}"/><div>{content}</div></div>"#,
),
notice,
}
}
Expand Down

0 comments on commit 79d8e2b

Please sign in to comment.