feat(config): add missing dictionary item CRUD, setting delete, and numbering delete routes

- Dictionary items: POST/PUT/DELETE endpoints under /config/dictionaries/{dict_id}/items
- Settings: DELETE /config/settings/{key}
- Numbering rules: DELETE /config/numbering-rules/{id}
- Fix workflow Entities: add deleted_at and version_field to process_definition,
  add standard fields to token and process_variable entities
- Update seed data for expanded permissions
This commit is contained in:
iven
2026-04-11 12:52:29 +08:00
parent 82986e988d
commit 184034ff6b
11 changed files with 223 additions and 14 deletions

View File

@@ -8,7 +8,6 @@ use validator::Validate;
/// BPMN 节点类型
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema, PartialEq)]
#[serde(rename_all = "camelCase")]
pub enum NodeType {
StartEvent,
EndEvent,
@@ -20,7 +19,6 @@ pub enum NodeType {
/// 流程图节点定义
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct NodeDef {
pub id: String,
#[serde(rename = "type")]
@@ -38,7 +36,6 @@ pub struct NodeDef {
}
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct NodePosition {
pub x: f64,
pub y: f64,
@@ -46,7 +43,6 @@ pub struct NodePosition {
/// 流程图连线定义
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct EdgeDef {
pub id: String,
pub source: String,
@@ -61,7 +57,6 @@ pub struct EdgeDef {
/// 完整流程图
#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
#[serde(rename_all = "camelCase")]
pub struct FlowDiagram {
pub nodes: Vec<NodeDef>,
pub edges: Vec<EdgeDef>,
@@ -98,8 +93,9 @@ pub struct CreateProcessDefinitionReq {
pub edges: Vec<EdgeDef>,
}
#[derive(Debug, Deserialize, ToSchema)]
#[derive(Debug, Deserialize, Validate, ToSchema)]
pub struct UpdateProcessDefinitionReq {
#[validate(length(max = 200, message = "流程名称过长"))]
pub name: Option<String>,
pub category: Option<String>,
pub description: Option<String>,
@@ -126,7 +122,7 @@ pub struct ProcessInstanceResp {
pub active_tokens: Vec<TokenResp>,
}
#[derive(Debug, Deserialize, ToSchema)]
#[derive(Debug, Deserialize, Validate, ToSchema)]
pub struct StartInstanceReq {
pub definition_id: Uuid,
pub business_key: Option<String>,
@@ -175,13 +171,14 @@ pub struct TaskResp {
pub business_key: Option<String>,
}
#[derive(Debug, Deserialize, ToSchema)]
#[derive(Debug, Deserialize, Validate, ToSchema)]
pub struct CompleteTaskReq {
#[validate(length(min = 1, max = 50, message = "审批结果不能为空"))]
pub outcome: String,
pub form_data: Option<serde_json::Value>,
}
#[derive(Debug, Deserialize, ToSchema)]
#[derive(Debug, Deserialize, Validate, ToSchema)]
pub struct DelegateTaskReq {
pub delegate_to: Uuid,
}
@@ -203,8 +200,9 @@ pub struct ProcessVariableResp {
pub value_date: Option<DateTime<Utc>>,
}
#[derive(Debug, Clone, Deserialize, ToSchema)]
#[derive(Debug, Clone, Deserialize, Validate, ToSchema)]
pub struct SetVariableReq {
#[validate(length(min = 1, max = 100, message = "变量名不能为空"))]
pub name: String,
pub var_type: Option<String>,
pub value: serde_json::Value,