Commit f69a7d22 authored by liuyu's avatar liuyu

offer create and get record

parent 6fa10d20
...@@ -1457,6 +1457,10 @@ ProblemDetails.h ...@@ -1457,6 +1457,10 @@ ProblemDetails.h
/home/liuyu/UDSF/src/impl/ProblemDetails.h /home/liuyu/UDSF/src/impl/ProblemDetails.h
string string
- -
mysql/mysql.h
-
logger.hpp
/home/liuyu/UDSF/src/impl/logger.hpp
/home/liuyu/UDSF/src/impl/MetaSchemaCRUDApiImpl.cpp /home/liuyu/UDSF/src/impl/MetaSchemaCRUDApiImpl.cpp
MetaSchemaCRUDApiImpl.h MetaSchemaCRUDApiImpl.h
...@@ -1545,6 +1549,8 @@ RecordCRUDApiImpl.h ...@@ -1545,6 +1549,8 @@ RecordCRUDApiImpl.h
/home/liuyu/UDSF/src/impl/RecordCRUDApiImpl.h /home/liuyu/UDSF/src/impl/RecordCRUDApiImpl.h
logger.hpp logger.hpp
/home/liuyu/UDSF/src/impl/logger.hpp /home/liuyu/UDSF/src/impl/logger.hpp
list
-
/home/liuyu/UDSF/src/impl/RecordCRUDApiImpl.h /home/liuyu/UDSF/src/impl/RecordCRUDApiImpl.h
pistache/endpoint.h pistache/endpoint.h
...@@ -1815,6 +1821,8 @@ RecordMeta.h ...@@ -1815,6 +1821,8 @@ RecordMeta.h
/home/liuyu/UDSF/src/model/RecordMeta.h /home/liuyu/UDSF/src/model/RecordMeta.h
/home/liuyu/UDSF/src/model/RecordMeta.h /home/liuyu/UDSF/src/model/RecordMeta.h
set
-
string string
- -
map map
......
...@@ -447,7 +447,40 @@ CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o ...@@ -447,7 +447,40 @@ CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o
/home/liuyu/UDSF/build/ext/include/pistache/type_checkers.h /home/liuyu/UDSF/build/ext/include/pistache/type_checkers.h
/home/liuyu/UDSF/build/ext/include/pistache/typeid.h /home/liuyu/UDSF/build/ext/include/pistache/typeid.h
/home/liuyu/UDSF/build/ext/include/pistache/view.h /home/liuyu/UDSF/build/ext/include/pistache/view.h
/home/liuyu/UDSF/build/ext/include/spdlog/async_logger.h
/home/liuyu/UDSF/build/ext/include/spdlog/common.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/async_log_helper.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/async_logger_impl.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/file_helper.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/log_msg.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/logger_impl.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/mpmc_blocking_q.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/null_mutex.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/os.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/pattern_formatter_impl.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/registry.h
/home/liuyu/UDSF/build/ext/include/spdlog/details/spdlog_impl.h
/home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/format.cc
/home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/format.h
/home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/ostream.cc
/home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/ostream.h
/home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/printf.cc
/home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/printf.h
/home/liuyu/UDSF/build/ext/include/spdlog/fmt/fmt.h
/home/liuyu/UDSF/build/ext/include/spdlog/formatter.h
/home/liuyu/UDSF/build/ext/include/spdlog/logger.h
/home/liuyu/UDSF/build/ext/include/spdlog/sinks/android_sink.h
/home/liuyu/UDSF/build/ext/include/spdlog/sinks/ansicolor_sink.h
/home/liuyu/UDSF/build/ext/include/spdlog/sinks/base_sink.h
/home/liuyu/UDSF/build/ext/include/spdlog/sinks/file_sinks.h
/home/liuyu/UDSF/build/ext/include/spdlog/sinks/sink.h
/home/liuyu/UDSF/build/ext/include/spdlog/sinks/stdout_sinks.h
/home/liuyu/UDSF/build/ext/include/spdlog/sinks/syslog_sink.h
/home/liuyu/UDSF/build/ext/include/spdlog/sinks/wincolor_sink.h
/home/liuyu/UDSF/build/ext/include/spdlog/spdlog.h
/home/liuyu/UDSF/build/ext/include/spdlog/tweakme.h
/home/liuyu/UDSF/src/api/BlockCRUDApi.h /home/liuyu/UDSF/src/api/BlockCRUDApi.h
/home/liuyu/UDSF/src/common/logger.hpp
/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp /home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp
/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.h /home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.h
/home/liuyu/UDSF/src/model/AccessTokenErr.h /home/liuyu/UDSF/src/model/AccessTokenErr.h
......
...@@ -446,7 +446,40 @@ CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu ...@@ -446,7 +446,40 @@ CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/pistache/type_checkers.h CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/pistache/type_checkers.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/pistache/typeid.h CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/pistache/typeid.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/pistache/view.h CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/pistache/view.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/async_logger.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/common.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/async_log_helper.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/async_logger_impl.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/file_helper.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/log_msg.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/logger_impl.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/mpmc_blocking_q.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/null_mutex.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/os.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/pattern_formatter_impl.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/registry.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/details/spdlog_impl.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/format.cc
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/format.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/ostream.cc
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/ostream.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/printf.cc
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/fmt/bundled/printf.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/fmt/fmt.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/formatter.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/logger.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/sinks/android_sink.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/sinks/ansicolor_sink.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/sinks/base_sink.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/sinks/file_sinks.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/sinks/sink.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/sinks/stdout_sinks.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/sinks/syslog_sink.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/sinks/wincolor_sink.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/spdlog.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/build/ext/include/spdlog/tweakme.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/src/api/BlockCRUDApi.h CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/src/api/BlockCRUDApi.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/src/common/logger.hpp
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.h CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.h
CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/src/model/AccessTokenErr.h CMakeFiles/udsf.dir/home/liuyu/UDSF/src/impl/BlockCRUDApiImpl.cpp.o: /home/liuyu/UDSF/src/model/AccessTokenErr.h
......
No preview for this file type
{"meta": { "tages" : {"context_type" : ["gnb_context"], "modify_time" :["0202020"],"recordId" : ["460110123456789" ] } },
"blocks": [{"Content-ID": "userDefBinaryBlob", "Content-Type": "text/plain", "content": "QmxvY2sgY29udGVudA=="}, {"Content-Id": "userDefJsonBlob", "Content-Type": "application/json", "content": {"key": "ftsimpletype-999550000000002", "value": "A3E71A78377179B5B91A;imsi-999550000000123"}}]}
{"meta": { "tages" : {"context_type" : ["gnb_context"], "modify_time" :["0202020"],"recordId" : ["460110123456789" ] }},"blocks":[{"Content-ID":"gnb_global_id","Content-type":"text/plain","content":"012345"}]}
{"meta":{ "tags" :{"modify_time" : ["111"], "gnb_context" :["222"],"recordId" : ["460110123456789" ]} }, "blocks": [{"Content-ID": "userDefBinaryBlob", "Content-Type": "text/plain", "content": "QmxvY2sgY29udGVudA=="}] }
\ No newline at end of file
-- MySQL dump 10.13 Distrib 8.0.24, for Linux (x86_64)
--
-- Host: localhost Database: _123
-- ------------------------------------------------------
-- Server version 8.0.24
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `_456`
--
DROP TABLE IF EXISTS `_456`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `_456` (
`imsi` varchar(15) DEFAULT NULL,
`_key` varchar(32) DEFAULT NULL,
`OPc` varchar(32) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `_456`
--
LOCK TABLES `_456` WRITE;
/*!40000 ALTER TABLE `_456` DISABLE KEYS */;
INSERT INTO `_456` VALUES ('460110123456789','00112233445566778899AABBCCDDEEFF','000102030405060708090A0B0C0D0E0F'),('460112223456789','00112233445566778899AABBCCDDEEFF','000102030405060708090A0B0C0D0E0F');
/*!40000 ALTER TABLE `_456` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2021-04-26 18:25:53
...@@ -142,6 +142,8 @@ void BlockCRUDApi::get_block_handler(const Pistache::Rest::Request &request, Pis ...@@ -142,6 +142,8 @@ void BlockCRUDApi::get_block_handler(const Pistache::Rest::Request &request, Pis
auto recordId = request.param(":recordId").as<std::string>(); auto recordId = request.param(":recordId").as<std::string>();
auto blockId = request.param(":blockId").as<std::string>(); auto blockId = request.param(":blockId").as<std::string>();
Logger::udsf_server().info("--GET!--/%s/%s/records/%s",realmId.c_str(),storageId.c_str(),recordId.c_str());
// Getting the query params // Getting the query params
auto supportedFeaturesQuery = request.query().get("supported-features"); auto supportedFeaturesQuery = request.query().get("supported-features");
Pistache::Optional<std::string> supportedFeatures; Pistache::Optional<std::string> supportedFeatures;
......
...@@ -46,12 +46,13 @@ void RecordCRUDApi::setupRoutes() { ...@@ -46,12 +46,13 @@ void RecordCRUDApi::setupRoutes() {
void RecordCRUDApi::create_or_modify_record_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) { void RecordCRUDApi::create_or_modify_record_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response) {
// Getting the path params // Getting the path params
Logger::udsf_server().info("Record : GET!");
auto realmId = request.param(":realmId").as<std::string>(); auto realmId = request.param(":realmId").as<std::string>();
auto storageId = request.param(":storageId").as<std::string>(); auto storageId = request.param(":storageId").as<std::string>();
auto recordId = request.param(":recordId").as<std::string>(); auto recordId = request.param(":recordId").as<std::string>();
Logger::udsf_server().info("--Put!--/%s/%s/records/%s",realmId.c_str(),storageId.c_str(),recordId.c_str());
// Getting the body param // Getting the body param
Record record; Record record;
...@@ -77,8 +78,9 @@ void RecordCRUDApi::create_or_modify_record_handler(const Pistache::Rest::Reques ...@@ -77,8 +78,9 @@ void RecordCRUDApi::create_or_modify_record_handler(const Pistache::Rest::Reques
// Getting the header params // Getting the header params
auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match"); auto ifNoneMatch = request.headers().tryGetRaw("If-None-Match");
auto ifMatch = request.headers().tryGetRaw("If-Match"); auto ifMatch = request.headers().tryGetRaw("If-Match");
std::cout<<request.body()<<std::endl;
try { try {
//{"meta": { "tags" : {"tag1" : ["value1"], "tag2" :["value2"] } }, "blocks": [{"Content-ID": "userDefBinaryBlob", "Content-Type": "text/plain", "content": "QmxvY2sgY29udGVudA=="}, {"Content-Id": "userDefJsonBlob", "Content-Type": "application/json", "content": {"key": "ftsimpletype-999550000000002", "value": "A3E71A78377179B5B91A;imsi-999550000000123"}}]}
nlohmann::json::parse(request.body()).get_to(record); nlohmann::json::parse(request.body()).get_to(record);
this->create_or_modify_record(realmId, storageId, recordId, record, ifNoneMatch, ifMatch, getPrevious, supportedFeatures, response); this->create_or_modify_record(realmId, storageId, recordId, record, ifNoneMatch, ifMatch, getPrevious, supportedFeatures, response);
} catch (nlohmann::detail::exception &e) { } catch (nlohmann::detail::exception &e) {
......
...@@ -19,10 +19,11 @@ namespace api { ...@@ -19,10 +19,11 @@ namespace api {
using namespace org::openapitools::server::model; using namespace org::openapitools::server::model;
BlockCRUDApiImpl::BlockCRUDApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr) BlockCRUDApiImpl::BlockCRUDApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr,MYSQL *mysql)
: BlockCRUDApi(rtr) : BlockCRUDApi(rtr)
{ } {
mysql_block = mysql;
}
//void BlockCRUDApiImpl::create_or_modify_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const AnyType &body, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) { //void BlockCRUDApiImpl::create_or_modify_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const AnyType &body, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) {
// response.send(Pistache::Http::Code::Ok, "Do some magic\n"); // response.send(Pistache::Http::Code::Ok, "Do some magic\n");
//} //}
...@@ -30,10 +31,92 @@ void BlockCRUDApiImpl::delete_block(const std::string &realmId, const std::strin ...@@ -30,10 +31,92 @@ void BlockCRUDApiImpl::delete_block(const std::string &realmId, const std::strin
response.send(Pistache::Http::Code::Ok, "Do some magic BlockCRUDApiImpl::delete_block\n"); response.send(Pistache::Http::Code::Ok, "Do some magic BlockCRUDApiImpl::delete_block\n");
} }
void BlockCRUDApiImpl::get_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) { void BlockCRUDApiImpl::get_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic BlockCRUDApiImpl::get_block\n"); const std::string change_dabatase = "use "+ std::string("_" ) +realmId ;
printf("------------%s------------------\n",change_dabatase.c_str());
if(mysql_query(mysql_block, change_dabatase.c_str())){
Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n",change_dabatase.c_str(), mysql_error(mysql_block));
return;
}
const std::string chose_block = "select "+blockId+ " from "+ std::string("_" )+ storageId + " where imsi="+ recordId;
if(mysql_query(mysql_block, chose_block.c_str())){
Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n", chose_block,mysql_error(mysql_block));
return;
}
MYSQL_RES *result = mysql_store_result(mysql_block);
if (NULL == result)
{
printf("mysql_store_result failure!SQL(%s) error(%d):%s\n", chose_block,mysql_errno(mysql_block), mysql_error(mysql_block));
return;
}
int num_rows = mysql_num_rows(result);//2
printf("got:%d row:\n", (int)num_rows);
int num_fields = mysql_num_fields(result);//3
printf("number of fields:%d\n", (int)num_fields);
nlohmann::json json;
MYSQL_ROW row;
while (row = mysql_fetch_row(result))
{
unsigned long *lengths = mysql_fetch_lengths(result);
for (int i = 0; i < num_fields; i++)
{
char *filed = row[i];
unsigned int field_length = lengths[i];
json = {{blockId, filed}};
printf("column[%d],length[%d],data[%s]\n", i, field_length, filed ? filed : "null");
}
printf("\n");
}
mysql_free_result(result);
response.send(Pistache::Http::Code::Ok, json.dump());
} }
void BlockCRUDApiImpl::get_block_list(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) { void BlockCRUDApiImpl::get_block_list(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic BlockCRUDApiImpl::get_block_list\n"); const std::string change_dabatase = "use "+ std::string("_" ) +realmId ;
printf("------------%s------------------\n",change_dabatase.c_str());
if(mysql_query(mysql_block, change_dabatase.c_str())){
Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n",change_dabatase.c_str(), mysql_error(mysql_block));
return;
}
const std::string chose_block = "select OPc,_key from "+ std::string("_" )+ storageId + " where imsi="+ recordId;
if(mysql_query(mysql_block, chose_block.c_str())){
Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n", chose_block,mysql_error(mysql_block));
return;
}
MYSQL_RES *result = mysql_store_result(mysql_block);
if (NULL == result)
{
printf("mysql_store_result failure!SQL(%s) error(%d):%s\n", chose_block,mysql_errno(mysql_block), mysql_error(mysql_block));
return;
}
int num_rows = mysql_num_rows(result);//2
printf("got:%d row:\n", (int)num_rows);
int num_fields = mysql_num_fields(result);//3
printf("number of fields:%d\n", (int)num_fields);
nlohmann::json json;
MYSQL_FIELD *field = nullptr;
MYSQL_ROW row;
while (row = mysql_fetch_row(result))
{
unsigned long *lengths = mysql_fetch_lengths(result);
for (int i = 0; i < num_fields; i++)
{
char *filed = row[i];
unsigned int field_length = lengths[i];
field = mysql_fetch_field(result);
json[field->name] = filed;
printf("column[%d],length[%d],field[%s]:data[%s]\n", i, field_length, field->name,filed ? filed : "null");
}
printf("\n");
}
mysql_free_result(result);
response.send(Pistache::Http::Code::Ok, json.dump());
} }
} }
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
#include "Inline_response_200.h" #include "Inline_response_200.h"
#include "ProblemDetails.h" #include "ProblemDetails.h"
#include <string> #include <string>
#include <mysql/mysql.h>
#include "logger.hpp"
namespace org { namespace org {
namespace openapitools { namespace openapitools {
namespace server { namespace server {
...@@ -43,14 +44,15 @@ using namespace org::openapitools::server::model; ...@@ -43,14 +44,15 @@ using namespace org::openapitools::server::model;
class BlockCRUDApiImpl : public org::openapitools::server::api::BlockCRUDApi { class BlockCRUDApiImpl : public org::openapitools::server::api::BlockCRUDApi {
public: public:
BlockCRUDApiImpl(std::shared_ptr<Pistache::Rest::Router>); BlockCRUDApiImpl(std::shared_ptr<Pistache::Rest::Router>,MYSQL *mysql);
~BlockCRUDApiImpl() {} ~BlockCRUDApiImpl() {}
//void create_or_modify_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const AnyType &body, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response); //void create_or_modify_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const AnyType &body, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response);
void delete_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response); void delete_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response);
void get_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response); void get_block(const std::string &realmId, const std::string &storageId, const std::string &recordId, const std::string &blockId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response);
void get_block_list(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response); void get_block_list(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response);
private:
MYSQL *mysql_block;
}; };
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "RecordCRUDApiImpl.h" #include "RecordCRUDApiImpl.h"
#include "logger.hpp" #include "logger.hpp"
#include <list>
namespace org { namespace org {
namespace openapitools { namespace openapitools {
namespace server { namespace server {
...@@ -26,7 +27,73 @@ RecordCRUDApiImpl::RecordCRUDApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr ...@@ -26,7 +27,73 @@ RecordCRUDApiImpl::RecordCRUDApiImpl(std::shared_ptr<Pistache::Rest::Router> rtr
} }
void RecordCRUDApiImpl::create_or_modify_record(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Record &record, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) { void RecordCRUDApiImpl::create_or_modify_record(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Record &record, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic RecordCRUDApiImpl::create_or_modify_record\n"); const std::string change_dabatase = "use " + realmId ;
Logger::udsf_server().info("------------%s------------------",change_dabatase.c_str());
if(mysql_query(mysql_record, change_dabatase.c_str())){
Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n",change_dabatase.c_str(), mysql_error(mysql_record));
return;
}
std::map<std::string, std::set<std::string>> meta_map = record.getMeta().getTags();
std::map<std::string, std::set<std::string>>::iterator it_meta;
int i_meta=0;
std::string meta[meta_map.size()];
for(it_meta=meta_map.begin();it_meta!=meta_map.end();)
{
meta[i_meta] = it_meta->first;
meta_map.erase(it_meta++);
i_meta++;
}
std::map<std::string, std::string> blocks_map = record.getBlocks().at(0);
std::string block[blocks_map.size()];
std::map<std::string, std::string>::iterator it_block;
int i_block=0;
for(it_block=blocks_map.begin();it_block!=blocks_map.end();)
{
block[i_block] = it_block->first;
blocks_map.erase(it_block++);
i_block++;
}
std::string extrnal = "create table IF NOT EXISTS "+ storageId + "(";
for(int i=0;i<i_meta;i++)
{
extrnal = extrnal + meta[i] + " varchar(32)";
extrnal = extrnal + std::string(",") ;
}
for(int j=0;j<i_block;j++)
{
extrnal = extrnal + block[j] + " varchar(32)";
if(j==(i_block-1)){
break;
}
extrnal = extrnal + std::string(",") ;
}
const std::string create_table = extrnal + ")";
Logger::udsf_server().info("%s", create_table.c_str());
if(mysql_query(mysql_record, create_table.c_str())){
Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n", create_table.c_str(),mysql_error(mysql_record));
return;
}
extrnal = "insert into "+ storageId + " values(\'";
for(int ii=0;ii<i_meta;ii++)
{
extrnal = extrnal +(*(record.getMeta().getTags().find(meta[ii])->second.begin())).c_str() + "\', \'";
}
for(int jj=0;jj<i_block;jj++)
{
extrnal = extrnal + record.getBlocks().at(0).find(block[jj])->second.c_str() +"\'";
if(jj==(i_block-1)){
break;
}
extrnal = extrnal + ", \'" ;
}
const std::string insert_record = extrnal + ")";
Logger::udsf_server().info("%s", insert_record.c_str());
if(mysql_query(mysql_record, insert_record.c_str())){
Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n", insert_record.c_str(),mysql_error(mysql_record));
return;
}
response.send(Pistache::Http::Code::Created);
} }
void RecordCRUDApiImpl::delete_record(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) { void RecordCRUDApiImpl::delete_record(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifMatch, const Pistache::Optional<bool> &getPrevious, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) {
response.send(Pistache::Http::Code::Ok, "Do some magic RecordCRUDApiImpl::delete_record\n"); response.send(Pistache::Http::Code::Ok, "Do some magic RecordCRUDApiImpl::delete_record\n");
...@@ -35,16 +102,16 @@ void RecordCRUDApiImpl::get_meta(const std::string &realmId, const std::string & ...@@ -35,16 +102,16 @@ void RecordCRUDApiImpl::get_meta(const std::string &realmId, const std::string &
response.send(Pistache::Http::Code::Ok, "Do some magic RecordCRUDApiImpl::get_meta\n"); response.send(Pistache::Http::Code::Ok, "Do some magic RecordCRUDApiImpl::get_meta\n");
} }
void RecordCRUDApiImpl::get_record(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) { void RecordCRUDApiImpl::get_record(const std::string &realmId, const std::string &storageId, const std::string &recordId, const Pistache::Optional<Pistache::Http::Header::Raw> &ifNoneMatch, const Pistache::Optional<Pistache::Http::Header::Raw> &ifModifiedSince, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) {
const std::string change_dabatase = "use "+ realmId + std::string("_" ) + storageId ; const std::string change_dabatase = "use " + realmId ;
printf("------------%s------------------\n",change_dabatase.c_str()); printf("------------%s------------------\n",change_dabatase.c_str());
if(mysql_query(mysql_record, change_dabatase.c_str())){ if(mysql_query(mysql_record, change_dabatase.c_str())){
Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n",change_dabatase.c_str(), mysql_error(mysql_record)); Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n",change_dabatase.c_str(), mysql_error(mysql_record));
return; return;
} }
const std::string chose_record = "select * from "+ std::string("_" )+ recordId ; const std::string chose_record = "select * from "+ storageId + " where RECORD_ID="+recordId ;
if(mysql_query(mysql_record, chose_record.c_str())){ if(mysql_query(mysql_record, chose_record.c_str())){
Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n", chose_record,mysql_error(mysql_record)); Logger::udsf_server().error("mysql_real_query failure!SQL(%s) error:%s\n", chose_record.c_str(),mysql_error(mysql_record));
return; return;
} }
...@@ -59,7 +126,9 @@ void RecordCRUDApiImpl::get_record(const std::string &realmId, const std::string ...@@ -59,7 +126,9 @@ void RecordCRUDApiImpl::get_record(const std::string &realmId, const std::string
printf("got:%d row:\n", (int)num_rows); printf("got:%d row:\n", (int)num_rows);
int num_fields = mysql_num_fields(result);//3 int num_fields = mysql_num_fields(result);//3
printf("number of fields:%d\n", (int)num_fields); printf("number of fields:%d\n", (int)num_fields);
MYSQL_FIELD *field = nullptr;
nlohmann::json json;
MYSQL_ROW row; MYSQL_ROW row;
while (row = mysql_fetch_row(result)) while (row = mysql_fetch_row(result))
{ {
...@@ -68,13 +137,14 @@ void RecordCRUDApiImpl::get_record(const std::string &realmId, const std::string ...@@ -68,13 +137,14 @@ void RecordCRUDApiImpl::get_record(const std::string &realmId, const std::string
{ {
char *filed = row[i]; char *filed = row[i];
unsigned int field_length = lengths[i]; unsigned int field_length = lengths[i];
printf("column[%d],length[%d],data[%s]\n", i, field_length, filed ? filed : "null"); field = mysql_fetch_field(result);
json[field->name] = filed;
printf("column[%d],length[%d],field[%s]:data[%s]\n", i, field_length, field->name,filed ? filed : "null");
} }
printf("\n"); printf("\n");
} }
mysql_free_result(result); mysql_free_result(result);
nlohmann::json json;
json = {{"foo", "bar"}};
response.send(Pistache::Http::Code::Ok, json.dump()); response.send(Pistache::Http::Code::Ok, json.dump());
} }
void RecordCRUDApiImpl::search_record(const std::string &realmId, const std::string &storageId, const Pistache::Optional<int32_t> &limitRange, const Pistache::Optional<SearchExpression> &filter, const Pistache::Optional<bool> &countIndicator, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) { void RecordCRUDApiImpl::search_record(const std::string &realmId, const std::string &storageId, const Pistache::Optional<int32_t> &limitRange, const Pistache::Optional<SearchExpression> &filter, const Pistache::Optional<bool> &countIndicator, const Pistache::Optional<std::string> &supportedFeatures, Pistache::Http::ResponseWriter &response) {
......
...@@ -37,8 +37,8 @@ void to_json(nlohmann::json& j, const Record& o) ...@@ -37,8 +37,8 @@ void to_json(nlohmann::json& j, const Record& o)
{ {
j = nlohmann::json(); j = nlohmann::json();
j["meta"] = o.m_Meta; j["meta"] = o.m_Meta;
// if(o.blocksIsSet() || !o.m_Blocks.empty()) if(o.blocksIsSet() || !o.m_Blocks.empty())
// j["blocks"] = o.m_Blocks; j["blocks"] = o.m_Blocks;
} }
void from_json(const nlohmann::json& j, Record& o) void from_json(const nlohmann::json& j, Record& o)
...@@ -46,7 +46,7 @@ void from_json(const nlohmann::json& j, Record& o) ...@@ -46,7 +46,7 @@ void from_json(const nlohmann::json& j, Record& o)
j.at("meta").get_to(o.m_Meta); j.at("meta").get_to(o.m_Meta);
if(j.find("blocks") != j.end()) if(j.find("blocks") != j.end())
{ {
// j.at("blocks").get_to(o.m_Blocks); j.at("blocks").get_to(o.m_Blocks);
o.m_BlocksIsSet = true; o.m_BlocksIsSet = true;
} }
} }
...@@ -59,15 +59,15 @@ void Record::setMeta(RecordMeta const& value) ...@@ -59,15 +59,15 @@ void Record::setMeta(RecordMeta const& value)
{ {
m_Meta = value; m_Meta = value;
} }
// std::vector<AnyType>& Record::getBlocks() std::vector<std::map<std::string, std::string>> Record::getBlocks() const
// { {
// return m_Blocks; return m_Blocks;
// } }
//void Record::setBlocks(std::vector<AnyType> const& value) void Record::setBlocks(std::vector<std::map<std::string, std::string>> const& value)
//{ {
// m_Blocks = value; m_Blocks = value;
// m_BlocksIsSet = true; m_BlocksIsSet = true;
//} }
bool Record::blocksIsSet() const bool Record::blocksIsSet() const
{ {
return m_BlocksIsSet; return m_BlocksIsSet;
......
...@@ -29,6 +29,12 @@ namespace openapitools { ...@@ -29,6 +29,12 @@ namespace openapitools {
namespace server { namespace server {
namespace model { namespace model {
// struct block{
// std::string Content_id ;
// std::string Content_type;
// std::string caontent;
// };
/// <summary> /// <summary>
/// Definition of a Record /// Definition of a Record
/// </summary> /// </summary>
...@@ -51,8 +57,8 @@ public: ...@@ -51,8 +57,8 @@ public:
/// <summary> /// <summary>
/// list of opaque Block&#39;s in this Record /// list of opaque Block&#39;s in this Record
/// </summary> /// </summary>
// std::vector<AnyType>& getBlocks(); std::vector<std::map<std::string, std::string>> getBlocks() const;
// void setBlocks(std::vector<AnyType> const& value); void setBlocks(std::vector<std::map<std::string, std::string>> const& value);
bool blocksIsSet() const; bool blocksIsSet() const;
void unsetBlocks(); void unsetBlocks();
...@@ -61,7 +67,7 @@ public: ...@@ -61,7 +67,7 @@ public:
protected: protected:
RecordMeta m_Meta; RecordMeta m_Meta;
//std::vector<AnyType> m_Blocks; std::vector< std::map<std::string, std::string>> m_Blocks;
bool m_BlocksIsSet; bool m_BlocksIsSet;
}; };
......
...@@ -44,8 +44,8 @@ void to_json(nlohmann::json& j, const RecordMeta& o) ...@@ -44,8 +44,8 @@ void to_json(nlohmann::json& j, const RecordMeta& o)
j["ttl"] = o.m_Ttl; j["ttl"] = o.m_Ttl;
if(o.callbackReferenceIsSet()) if(o.callbackReferenceIsSet())
j["callbackReference"] = o.m_CallbackReference; j["callbackReference"] = o.m_CallbackReference;
// if(o.tagsIsSet() || !o.m_Tags.empty()) if(o.tagsIsSet() || !o.m_Tags.empty())
// j["tags"] = o.m_Tags; j["tags"] = o.m_Tags;
} }
void from_json(const nlohmann::json& j, RecordMeta& o) void from_json(const nlohmann::json& j, RecordMeta& o)
...@@ -62,7 +62,7 @@ void from_json(const nlohmann::json& j, RecordMeta& o) ...@@ -62,7 +62,7 @@ void from_json(const nlohmann::json& j, RecordMeta& o)
} }
if(j.find("tags") != j.end()) if(j.find("tags") != j.end())
{ {
// j.at("tags").get_to(o.m_Tags); j.at("tags").get_to(o.m_Tags);
o.m_TagsIsSet = true; o.m_TagsIsSet = true;
} }
} }
...@@ -101,15 +101,15 @@ void RecordMeta::unsetCallbackReference() ...@@ -101,15 +101,15 @@ void RecordMeta::unsetCallbackReference()
{ {
m_CallbackReferenceIsSet = false; m_CallbackReferenceIsSet = false;
} }
// std::map<std::string, Set<std::string>>& RecordMeta::getTags() std::map<std::string, std::set<std::string>>& RecordMeta::getTags()
// { {
// return m_Tags; return m_Tags;
// } }
// void RecordMeta::setTags(std::map<std::string, Set<std::strmakeing>> const& value) void RecordMeta::setTags(std::map<std::string, std::set<std::string>> const& value)
// { {
// m_Tags = value; m_Tags = value;
// m_TagsIsSet = true; m_TagsIsSet = true;
// } }
bool RecordMeta::tagsIsSet() const bool RecordMeta::tagsIsSet() const
{ {
return m_TagsIsSet; return m_TagsIsSet;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#define RecordMeta_H_ #define RecordMeta_H_
//#include "Set.h" #include <set>
#include <string> #include <string>
#include <map> #include <map>
#include <vector> #include <vector>
...@@ -61,8 +61,8 @@ public: ...@@ -61,8 +61,8 @@ public:
/// <summary> /// <summary>
/// A dictionary of {\&quot;tagName\&quot;: [ \&quot;tagValue\&quot;, ...] }. A tag name can be used to retrieve a Record. The tagValue are unique. /// A dictionary of {\&quot;tagName\&quot;: [ \&quot;tagValue\&quot;, ...] }. A tag name can be used to retrieve a Record. The tagValue are unique.
/// </summary> /// </summary>
//std::map<std::string, Set<std::string>>& getTags(); std::map<std::string, std::set<std::string>>& getTags();
//void setTags(std::map<std::string, Set<std::string>> const& value); void setTags(std::map<std::string, std::set<std::string>> const& value);
bool tagsIsSet() const; bool tagsIsSet() const;
void unsetTags(); void unsetTags();
...@@ -73,7 +73,7 @@ protected: ...@@ -73,7 +73,7 @@ protected:
bool m_TtlIsSet; bool m_TtlIsSet;
std::string m_CallbackReference; std::string m_CallbackReference;
bool m_CallbackReferenceIsSet; bool m_CallbackReferenceIsSet;
//std::map<std::string, Set<std::string>> m_Tags; std::map<std::string, std::set<std::string>> m_Tags;
bool m_TagsIsSet; bool m_TagsIsSet;
}; };
......
...@@ -36,7 +36,7 @@ UDSFApiServer::UDSFApiServer(Pistache::Address address, MYSQL *mysql) ...@@ -36,7 +36,7 @@ UDSFApiServer::UDSFApiServer(Pistache::Address address, MYSQL *mysql)
m_router = std::make_shared<Pistache::Rest::Router>(); m_router = std::make_shared<Pistache::Rest::Router>();
m_BlockCRUDApiserver = m_BlockCRUDApiserver =
std::make_shared<BlockCRUDApiImpl>(m_router); std::make_shared<BlockCRUDApiImpl>(m_router,mysql);
m_MetaSchemaCRUDApiserver = m_MetaSchemaCRUDApiserver =
std::make_shared<MetaSchemaCRUDApiImpl>(m_router); std::make_shared<MetaSchemaCRUDApiImpl>(m_router);
m_NotificationSubscriptionCRUDApiserver = m_NotificationSubscriptionCRUDApiserver =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment