add: user ads
This commit is contained in:
parent
46b3e66cd4
commit
2cb7d08ddc
41 changed files with 1095 additions and 29 deletions
|
@ -1,3 +1,4 @@
|
|||
pub mod ads;
|
||||
pub mod app_data;
|
||||
pub mod apps;
|
||||
pub mod auth;
|
||||
|
@ -31,7 +32,7 @@ use tetratto_core::model::{
|
|||
PollOption, PostContext,
|
||||
},
|
||||
communities_permissions::CommunityPermission,
|
||||
economy::ProductFulfillmentMethod,
|
||||
economy::{ProductFulfillmentMethod, UserAdSize},
|
||||
journals::JournalPrivacyPermission,
|
||||
littleweb::{DomainData, DomainTld, ServiceFsEntry},
|
||||
oauth::AppScope,
|
||||
|
@ -767,6 +768,11 @@ pub fn routes() -> Router {
|
|||
"/products/{id}/uploads/thumbnails",
|
||||
delete(products::remove_thumbnail_request),
|
||||
)
|
||||
// ads
|
||||
.route("/ads", post(ads::create_request))
|
||||
.route("/ads/{id}", delete(ads::delete_request))
|
||||
.route("/ads/{id}/running", post(ads::update_is_running_request))
|
||||
.route("/ads/host/{host}/{id}/click", get(ads::click_request))
|
||||
}
|
||||
|
||||
pub fn lw_routes() -> Router {
|
||||
|
@ -1355,3 +1361,14 @@ pub struct UpdateProductUploads {
|
|||
pub struct RemoveProductThumbnail {
|
||||
pub idx: usize,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct CreateAd {
|
||||
pub target: String,
|
||||
pub size: UserAdSize,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct UpdateAdIsRunning {
|
||||
pub is_running: bool,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue