58 lines
1.7 KiB
C++
58 lines
1.7 KiB
C++
|
|
#ifndef BATTLEFIELD_CORE_TASK_HPP
|
|||
|
|
#define BATTLEFIELD_CORE_TASK_HPP
|
|||
|
|
|
|||
|
|
#include <string>
|
|||
|
|
#include <vector>
|
|||
|
|
#include <cstdint>
|
|||
|
|
#include "core/event.hpp"
|
|||
|
|
|
|||
|
|
namespace battlefield {
|
|||
|
|
|
|||
|
|
/// @brief 任务草案状态枚举
|
|||
|
|
enum class DraftStatus : int32_t {
|
|||
|
|
DRAFT = 0, ///< 草稿
|
|||
|
|
SUBMITTED = 1, ///< 已提交
|
|||
|
|
APPROVED = 2, ///< 已批准
|
|||
|
|
REJECTED = 3 ///< 已驳回
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
/// @brief 任务草案数据结构,对应 T_TASK_DRAFT(内存缓存后持久化)
|
|||
|
|
struct TaskDraft {
|
|||
|
|
std::string id; ///< 任务草案ID
|
|||
|
|
std::string title; ///< 任务标题
|
|||
|
|
std::string description; ///< 任务描述
|
|||
|
|
int32_t priority{0}; ///< 优先级
|
|||
|
|
DraftStatus status{DraftStatus::DRAFT}; ///< 状态
|
|||
|
|
std::string relatedEventId; ///< 关联事件ID
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
/// @brief 任务生成模块(覆盖 SRS-F-02-001 ~ SRS-F-02-004)
|
|||
|
|
class TaskGenerator {
|
|||
|
|
public:
|
|||
|
|
/// @brief 基于选定事件生成作战任务草案
|
|||
|
|
/// @param event 源事件
|
|||
|
|
/// @return 生成的 TaskDraft 对象
|
|||
|
|
TaskDraft CreateTaskFromEvent(const Event& event);
|
|||
|
|
|
|||
|
|
/// @brief 获取当前所有任务草案列表
|
|||
|
|
/// @return 草案列表
|
|||
|
|
std::vector<TaskDraft> GetDraftList() const;
|
|||
|
|
|
|||
|
|
/// @brief 提交任务草案送交处理(对应接口 IF-02)
|
|||
|
|
/// @param draftId 草案ID
|
|||
|
|
/// @param targetUrl 目标任务引擎地址
|
|||
|
|
/// @return 是否提交成功
|
|||
|
|
bool SubmitDraft(const std::string& draftId, const std::string& targetUrl);
|
|||
|
|
|
|||
|
|
/// @brief 按优先级排序草案列表
|
|||
|
|
/// @param ascending 是否升序
|
|||
|
|
void SortDraftsByPriority(bool ascending = true);
|
|||
|
|
|
|||
|
|
private:
|
|||
|
|
std::vector<TaskDraft> drafts_; ///< 内存暂存的任务草案
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
} // namespace battlefield
|
|||
|
|
|
|||
|
|
#endif // BATTLEFIELD_CORE_TASK_HPP
|