更新接口

This commit is contained in:
2026-08-07 23:44:35 +08:00
parent f9fcac46dc
commit a5041e10bc
22 changed files with 976 additions and 316 deletions
@@ -36,11 +36,11 @@ public:
using Service = Resource_Service<T, Json, Lock>;
using Transaction = typename Service::Transaction;
Http_Resource(T& value, std::string path, Transaction transaction = {}, Lock* shared_lock = nullptr) : service_(std::make_shared<Service>(value, std::move(path), std::move(transaction), shared_lock)) {}
template <Basic_Lock Field_Lock>
explicit Http_Resource(Synchronized_Value<std::remove_cvref_t<T>, Lock, Field_Lock>& value, std::string path, Transaction transaction = {}) : service_(std::make_shared<Service>(value, std::move(path), std::move(transaction))) {}
template <class Root, Basic_Lock Field_Lock, auto... Members>
requires (!std::is_const_v<Root>) && std::same_as<typename Synchronized_Field<Root, Lock, Field_Lock, Members...>::value_type, std::remove_cvref_t<T>>
explicit Http_Resource(Synchronized_Field<Root, Lock, Field_Lock, Members...> value, std::string path, Transaction transaction = {}, Resource_Lock_Scope lock_scope = Resource_Lock_Scope::local) : service_(std::make_shared<Service>(value, std::move(path), std::move(transaction), lock_scope)) {}
template <structive::Synchronization_Policy Policy>
explicit Http_Resource(Managed_Value<std::remove_cvref_t<T>, Policy>& value, std::string path, Transaction transaction = {}) : service_(std::make_shared<Service>(value, std::move(path), std::move(transaction))) {}
template <class Managed, std::size_t Root_Index, auto... Members>
requires (!std::is_const_v<Managed>) && std::same_as<typename Managed_Field<Managed, Root_Index, Members...>::value_type, std::remove_cvref_t<T>>
explicit Http_Resource(Managed_Field<Managed, Root_Index, Members...> value, std::string path, Transaction transaction = {}) : service_(std::make_shared<Service>(value, std::move(path), std::move(transaction))) {}
Json amis_schema() const {
return service_->amis_schema();
}