delete useless code

This commit is contained in:
lnk
2025-04-29 15:05:36 +08:00
parent 2a8f2c996c
commit 59079da4be
22 changed files with 1140 additions and 12715 deletions

View File

@@ -23,19 +23,14 @@ using namespace std;
#include "../mms/db_interface.h"
#include <iostream>
char* OSS_ENDPOINT;
char* ACCESS_KEY_ID;
char* ACCESS_KEY_SECRET;
char* OSS_ENDPOINT;
char* ACCESS_KEY_ID;
char* ACCESS_KEY_SECRET;
char* BUCKET_NAME;
//const char OSS_ENDPOINT[] = "oss-cn-nanjing.aliyuncs.com";
//const char ACCESS_KEY_ID[] = "LTAI5tER4bgJxT6Ptie7t2X7";
//const char ACCESS_KEY_SECRET[] = "dSYIC5hD3flhTNoLMAxCoKjSPdWFSz";
//const char BUCKET_NAME[] = "cn-pq-test";
const char OBJECT_NAME[] = "comtrade/temp.json";
void init_sample_request_options(oss_request_options_t *options, int is_cname);
void put_object_from_buffer();
void put_object_from_buffer_new(char* File_Name, char* data);
void put_object_from_file();
@@ -52,27 +47,19 @@ void TestOSS()
aos_pool_t *pool = NULL;
apr_status_t ret;
// initialize http io system, call it olny once
/* <20>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>aos_http_io_initialize<7A><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>*/
printf(">>>TestOSS ini Start");
if (aos_http_io_initialize(NULL, 0) != AOSE_OK) {
return;
}
printf(">>>TestOSS put Start");
// run samples
//put_object_from_buffer();
//put_object_from_file();
put_object_from_buffer();
get_object_to_file();
//get_object_to_buffer();
//get_object_to_file();
//delete_object();
printf(">>>TestOSS put End");
// deinitialize http io system, call it olny once
aos_http_io_deinitialize();
return ;
@@ -84,7 +71,6 @@ void PutOSS(char* File_Name,char* data) //zw
aos_pool_t* pool = NULL;
apr_status_t ret;
// initialize http io system, call it olny once
/* <20>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>aos_http_io_initialize<7A><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>*/
printf(">>>PutOSS ini Start");
printf(File_Name);
@@ -100,8 +86,6 @@ void PutOSS(char* File_Name,char* data) //zw
printf(">>>PutOSS put End");
// deinitialize http io system, call it olny once
aos_http_io_deinitialize();
return;
@@ -113,22 +97,18 @@ void GetOSS(char* File_Name,char* savepath) //zw
aos_pool_t* pool = NULL;
apr_status_t ret;
// initialize http io system, call it olny once
/* <20>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>aos_http_io_initialize<7A><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>*/
printf(">>>GetOSS ini Start");
if (aos_http_io_initialize(NULL, 0) != AOSE_OK) {
return;
}
printf(">>>GetOSS put Start");
get_object_to_file_new(File_Name,savepath);//ʹ<><CAB9>buffer<65><72><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
printf(">>>GetOSS put End");
// deinitialize http io system, call it olny once
aos_http_io_deinitialize();
return;
@@ -140,32 +120,29 @@ void DelOSS(char* File_Name)
aos_pool_t* pool = NULL;
apr_status_t ret;
// initialize http io system, call it olny once
/* <20>ڳ<EFBFBD><DAB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>aos_http_io_initialize<7A><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڴ<EFBFBD><DAB4><EFBFBD>ȫ<EFBFBD><C8AB><EFBFBD><EFBFBD>Դ<EFBFBD><D4B4>*/
printf(">>>DelOSS ini Start");
if (aos_http_io_initialize(NULL, 0) != AOSE_OK) {
return;
}
printf(">>>DelOSS put Start");
delete_object_new(File_Name);//ʹ<><CAB9>buffer<65><72><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
printf(">>>DelOSS put End");
// deinitialize http io system, call it olny once
aos_http_io_deinitialize();
return;
}
void coutTest() {
void coutTest()
{
std:: cout << "OSS_ENDPOINT:" << OSS_ENDPOINT << std::endl;
std::cout << "ACCESS_KEY_ID:" << ACCESS_KEY_ID << std::endl;
std::cout << "ACCESS_KEY_SECRET:" << ACCESS_KEY_SECRET << std::endl;
std::cout << "BUCKET_NAME:" << BUCKET_NAME << std::endl;
}
void init_sample_request_options(oss_request_options_t *options, int is_cname)
@@ -175,7 +152,6 @@ void init_sample_request_options(oss_request_options_t *options, int is_cname)
aos_str_set(&options->config->access_key_id, ACCESS_KEY_ID);
aos_str_set(&options->config->access_key_secret, ACCESS_KEY_SECRET);
options->config->is_cname = is_cname;
options->ctl = aos_http_controller_create(options->pool, 0);
}
@@ -231,7 +207,6 @@ void put_object_from_buffer_new(char* File_Name,char* data)//zw
aos_buf_t* content = NULL;
char* str = data;
aos_status_t* s = NULL;
aos_pool_create(&p, NULL);
options = oss_request_options_create(p);
init_sample_request_options(options, is_cname);
@@ -323,10 +298,8 @@ void put_object_from_file_new(char* File_Name, char* path)
printf("put object from file succeeded\n");
}
else {
printf("put object from file failed, code:%d, error_code:%s, error_msg:%s, request_id:%s\n",
s->code, s->error_code, s->error_msg, s->req_id);
printf("put object from file failed, code:%d, error_code:%s, error_msg:%s, request_id:%s\n",s->code, s->error_code, s->error_msg, s->req_id);
}
aos_pool_destroy(p);
}