feat(service): expand service layer with new domain operations

- Add IM service modules: audit, channel roles, custom emojis, forum
  tags, integrations, invitations, repo links, slash commands, stages,
  voice, webhooks
- Add PR service modules: review requests, templates
- Add repo service modules: contributors, release assets, git extras
  (archive, branch rename, commit extras, diff/merge, tag, tree)
- Add user service: social (follow/block)
- Add internal auth service
- Update existing service modules with expanded functionality
- Remove deleted IM modules: articles, delivery trace, drafts,
  follows, messages, polls, presence, reactions, threads
This commit is contained in:
zhenyi
2026-06-10 18:49:32 +08:00
parent cec6dce955
commit 420dedbc1e
100 changed files with 3797 additions and 3839 deletions
+16 -17
View File
@@ -4,27 +4,25 @@ use serde::Serialize;
use uuid::Uuid;
use crate::service::ServiceContext;
use delivery_trace::{trace_error, trace_request};
use events::ImEvent;
pub mod articles;
pub mod audit;
pub mod categories;
pub mod channel_roles;
pub mod channels;
pub mod delivery_trace;
pub mod drafts;
pub mod custom_emojis;
pub mod events;
pub mod follows;
pub mod forum_tags;
pub mod integrations;
pub mod invitations;
pub mod members;
pub mod messages;
pub mod polls;
pub mod presence;
pub mod reactions;
pub mod repo_links;
pub mod session;
pub mod threads;
pub mod slash_commands;
pub mod stages;
pub mod util;
pub mod voice;
pub mod webhooks;
pub use messages::{EditMessageParams, SendMessageParams};
pub use presence::UpdatePresenceParams;
pub use session::ImSession;
#[derive(Clone)]
@@ -33,11 +31,11 @@ pub struct ImService {
}
impl ImService {
fn emit_event(&self, event: ImEvent) {
pub(crate) fn emit_event(&self, event: events::ImEvent) {
let _ = self.ctx.im_events.publish(event);
}
async fn publish<T: Serialize>(&self, subject: &str, request_id: Uuid, event: &T) {
pub(crate) async fn publish<T: Serialize>(&self, subject: &str, request_id: Uuid, event: &T) {
match self
.ctx
.nats
@@ -48,9 +46,10 @@ impl ImService {
)
.await
{
Ok(_) => trace_request("nats_published", request_id, subject),
Ok(_) => {
tracing::debug!(subject, %request_id, "nats event published");
}
Err(e) => {
trace_error("nats_failed", request_id, subject, &e);
tracing::warn!(subject, error = %e, "nats publish failed");
}
}