946 lines
37 KiB
C
946 lines
37 KiB
C
#include <stdio.h>
|
||
#include <time.h>
|
||
#include <stdlib.h>
|
||
#include <unistd.h>
|
||
#include <cjson/cJSON.h>
|
||
#include <string.h>
|
||
#include <ctype.h>
|
||
#include "common_user.h"
|
||
#include "array_index.h"
|
||
#include "user_group.h"
|
||
#include "user.h"
|
||
#include "user_account_config.h"
|
||
#include "user_group_config.h"
|
||
#include "user_recover_config.h"
|
||
#include "user_auth.h"
|
||
#include "database.h"
|
||
#include "redisMq.h"
|
||
|
||
extern USERGROUP g_group_table[GROUP_INDEX_MAX];
|
||
extern USERACCOUNT g_user_table[USER_INDEX_MAX];
|
||
|
||
int main6(void)
|
||
{
|
||
char * testin; //input
|
||
char testout[2000]; //output
|
||
ret_code ret_pro; //执行结果
|
||
int outlen = 1; //out数据长度
|
||
|
||
void *test_hdbc = connect_database(USER_ACCOUNT_DATABASE_ID);
|
||
if(NULL == test_hdbc)
|
||
{
|
||
printf("fail connect database... \n");
|
||
}
|
||
|
||
char * create_group1 = "CREATE TABLE IF NOT EXISTS user_group1 (\
|
||
uuid bigint(20) NOT NULL AUTO_INCREMENT,\
|
||
id bigint(11) NOT NULL,\
|
||
gname char(255) NOT NULL,\
|
||
gdescription char(255) DEFAULT NULL,\
|
||
PRIMARY KEY (uuid),\
|
||
UNIQUE KEY id (id) USING BTREE,\
|
||
UNIQUE KEY gname (gname) USING BTREE\
|
||
) ENGINE=InnoDB AUTO_INCREMENT=1059 DEFAULT CHARSET=utf8";
|
||
|
||
char * create_user1 = "CREATE TABLE IF NOT EXISTS user_account1 (\
|
||
uuid bigint(11) NOT NULL AUTO_INCREMENT,\
|
||
id bigint(11) NOT NULL,\
|
||
group_id bigint(11) NOT NULL,\
|
||
user_name char(255) NOT NULL,\
|
||
udescription char(255) DEFAULT NULL,\
|
||
password char(255) NOT NULL DEFAULT 'A31as%4Gb',\
|
||
multi_player bigint(8) NOT NULL DEFAULT '0',\
|
||
valid_always bigint(8) NOT NULL DEFAULT '0',\
|
||
valid_begin_time char(255) DEFAULT NULL,\
|
||
valid_end_time char(255) DEFAULT NULL,\
|
||
PRIMARY KEY (uuid,id),\
|
||
UNIQUE KEY id (id) USING BTREE,\
|
||
UNIQUE KEY user_name (user_name) USING BTREE,\
|
||
KEY group_id (group_id) USING BTREE,\
|
||
CONSTRAINT user_account1_ibfk_1 FOREIGN KEY (group_id) REFERENCES user_group1 (id) ON DELETE CASCADE ON UPDATE CASCADE\
|
||
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8";
|
||
int rett = 0;
|
||
|
||
rett = create_database_table(1, test_hdbc, "user_group1", create_group1);
|
||
printf("ret create user_group : %d .\n", rett);
|
||
|
||
rett = create_database_table(1, test_hdbc, "user_account1", create_user1);
|
||
printf("ret create user_account : %d .\n", rett);
|
||
|
||
|
||
return 0;
|
||
}
|
||
|
||
int main5(void)
|
||
{
|
||
char * testrec;
|
||
int testnum;
|
||
userecover_config_get_all(CONFIG_FROM_RECOVER1,testrec, &testnum);
|
||
printf("usermanager recover... \n");
|
||
|
||
char * testin; //input
|
||
char testout[2000]; //output
|
||
ret_code ret_pro; //执行结果
|
||
int outlen = 1; //out数据长度
|
||
|
||
printf("\n************************************user uuid -> user 详情*******************************************\n");
|
||
testin = "{\"type\": 3,\"data\":{\"user_id\": 15}}";
|
||
ret_pro = user_config_get(1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
return 0;
|
||
|
||
|
||
printf("\n************************************修改 group 描述*******************************************\n");
|
||
testin = "{\"type\": 2,\"data\": {\"gid\": 1013,\"gdescription\": \"修改修改用户组的描述修改修改用户组的描述一二\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
printf("\n************************************查询 user list*******************************************\n");
|
||
testin = "{\"type\": 4,\"data\":{\"group_id\": 1014, \"user_name\": \"0\",\"page_start\": 1,\"page_counts\": 5}}";
|
||
ret_pro = user_config_get(1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("************************************新增 group*******************************************\n");
|
||
testin = "{\"type\": 0,\"data\": {\"gname\": \"group011\",\"gdescription\": \"描述group011\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
printf("\n************************************删除 group*******************************************\n");
|
||
testin = "{\"type\": 1,\"data\": {\"group_id\": 1021}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
printf("\n************************************新增 user*******************************************\n");
|
||
testin = "{\"type\": 0,\"data\": {\"uname\": \"user011\",\"gname\": \"测试组01\"}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
printf("\n************************************删除 user*******************************************\n");
|
||
testin = "{\"type\": 1,\"data\":{\"user_id\": 11}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
return 0;
|
||
}
|
||
|
||
void trim(char *in, char *out)
|
||
{
|
||
char * c;
|
||
int i;
|
||
int len;
|
||
size_t nLen = strlen(in);
|
||
i = 0;
|
||
while(in[i] == ' ')
|
||
{
|
||
i++;
|
||
}
|
||
if (i != nLen)
|
||
{
|
||
c = &in[i]; // 找到第一个非空字符指针
|
||
i = nLen - 1;
|
||
while(in[i] == ' ')
|
||
{
|
||
i--; // 找到最后一个非空字符
|
||
}
|
||
len = i + 1 - (c - in);
|
||
memcpy(out, c, i + 1 - (c - in));
|
||
}
|
||
else
|
||
{
|
||
memset(out, 0 ,strlen(out));
|
||
}
|
||
|
||
|
||
return;
|
||
}
|
||
|
||
|
||
int main(void)
|
||
{
|
||
|
||
|
||
char *name1 = "a a ";
|
||
int len = strlen(name1);
|
||
char name2[100] = {0};
|
||
printf("name2 len=%ld.\n",strlen(name2));
|
||
printf("name1=%s.\n",name1);
|
||
TRIM_NAME(name1, name2);
|
||
printf("name1=%s.\n",name2);
|
||
printf("name2 len=%ld.\n",strlen(name2));
|
||
|
||
|
||
return 0;
|
||
|
||
USER_AUTH_RET user_ret;
|
||
|
||
user_auth_login("user04", "A31as%4Gb", &user_ret);
|
||
user_auth_login("user04", "A31as%4Gb", &user_ret);
|
||
user_auth_login("user04", "A31as%4G", &user_ret);
|
||
user_auth_login("user04", "A31as%4G", &user_ret);
|
||
user_auth_login("user04", "A31as%4G", &user_ret);
|
||
user_auth_login("user04", "A31as%4G", &user_ret);
|
||
|
||
user_auth_login("user04", "A31as%4G", &user_ret);
|
||
user_auth_login("user04", "A31as%4G", &user_ret);
|
||
user_auth_login("user04", "A31as%4G", &user_ret);
|
||
|
||
|
||
printf("%d,%d,%d\n", user_ret.ret, user_ret.user_id, user_ret.group_id);
|
||
|
||
return 0;
|
||
}
|
||
|
||
int main3(void)
|
||
{
|
||
char * testrec;
|
||
int testnum;
|
||
userecover_config_get_all(CONFIG_FROM_RECOVER1,testrec, &testnum);
|
||
|
||
printf("hello. \n");
|
||
return 0;
|
||
}
|
||
|
||
|
||
int main1(void)
|
||
{
|
||
char * testin; //input
|
||
char testout[2000]; //output
|
||
ret_code ret_pro; //执行结果
|
||
int outlen = 1; //out数据长度
|
||
|
||
printf("************************************start*******************************************\n");
|
||
printf("初始化用户组:%d\n", init_group());
|
||
printf("初始化用户:%d\n", init_user());
|
||
|
||
printf("************************************新增 group*******************************************\n");
|
||
testin = "{\"type\": 0,\"data\": {\"gname\": \"group01\",\"gdescription\": \"描述group01\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
testin = "{\"type\": 0,\"data\": {\"gname\": \"group02\",\"gdescription\": \"描述group02\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
testin = "{\"type\": 0,\"data\": {\"gname\": \"group03\",\"gdescription\": \"描述group03\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
testin = "{\"type\": 0,\"data\": {\"gname\": \"group04\",\"gdescription\": \"描述group04\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
testin = "{\"type\": 0,\"data\": {\"gname\": \"group05\",\"gdescription\": \"描述group05\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
testin = "{\"type\": 0,\"data\": {\"gname\": \"group06\",\"gdescription\": \"描述group06\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("\n************************************查询 group 列表*******************************************\n");
|
||
testin = "{\"type\": 4,\"data\": \"\"}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("\n************************************group name -> group uuid*******************************************\n");
|
||
testin = "{\"type\": 7,\"data\": {\"gname\":\"group04\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("\n************************************修改 group 描述*******************************************\n");
|
||
testin = "{\"type\": 2,\"data\": {\"gid\": 938,\"gdescription\": \"修改用户组的描述\"}}";
|
||
ret_pro = usergroup_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("\n************************************新增 user*******************************************\n");
|
||
testin = "{\"type\": 0,\"data\": {\"uname\": \"user01\",\"gname\": \"group01\"}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
testin = "{\"type\": 0,\"data\": {\"uname\": \"user00\",\"gname\": \"group01\",\"udesp\": \"用户描述\",\"pwd\": \"A31as%4Gb\",\"multi\":0,\"valid\":1, \"valid_begin_time\": \"2013-07-04 15:04:23\",\"valid_end_time\": \"2020-07-04 15:04:23\"}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
testin = "{\"type\": 0,\"data\": {\"uname\": \"user02\",\"gname\": \"group02\",\"pwd\": \"123456\"}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
testin = "{\"type\": 0,\"data\": {\"uname\": \"user03\",\"gname\": \"group03\"}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
testin = "{\"type\": 0,\"data\": {\"uname\": \"user04\",\"gname\": \"group04\"}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("\n************************************修改 user web*******************************************\n");
|
||
testin = "{\"type\": 2,\"data\": {\"ID\":3,\"GID\":938,\"resetpwd\":0,\"uname\": \"user02\",\"gname\": \"group01\",\"udescription\": \"修改用户描述\",\"passwd\": \"A31as%4Gb\",\"multi\":0,\"valid\":1, \"valid_begin_time\": \"2013-07-04 15:04:23\",\"valid_end_time\": \"2020-07-04 15:04:23\"}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("\n************************************查询 user list*******************************************\n");
|
||
testin = "{\"type\": 4,\"data\":{\"group_id\": 0, \"user_name\": \"3\",\"page_start\": 1,\"page_counts\": 20}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("\n************************************user name -> user uuid*******************************************\n");
|
||
testin = "{\"type\": 7,\"data\":{\"uname\": \"user03\"}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("\n************************************user uuid -> user 详情*******************************************\n");
|
||
testin = "{\"type\": 3,\"data\":{\"user_id\": 2}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
|
||
printf("\n************************************移动分组*******************************************\n");
|
||
testin = "{\"type\": 6,\"data\":{\"user_id\": [2],\"batch\":{\"all\":1,\"old_group_id\":0},\"new_group_id\":927}}";
|
||
ret_pro = user_config_proc(1, 1, testin, strlen(testin)+1, testout, &outlen);
|
||
printf("执行结果:%d, 返回数据:%s .\n", ret_pro, testout);
|
||
|
||
}
|
||
|
||
int main2(void)
|
||
{
|
||
|
||
int ID = 1;
|
||
int GID_temp = 2;
|
||
char *uname = "xiaoming";
|
||
char *udesp = "";
|
||
int multi = 0;
|
||
int valid = 0;
|
||
char *valid_begin_time = "";
|
||
char *valid_end_time = "";
|
||
void *adduser_hdbc = connect_database(USER_ACCOUNT_DATABASE_ID);
|
||
int num1;
|
||
char * retptr1 = NULL;
|
||
if(NULL == adduser_hdbc)
|
||
{
|
||
printf("aaaaaaaaa");
|
||
}
|
||
// char *adduser_sql = "INSERT INTO `user_account` SET id = ?, group_id = ?, user_name = ?, password = ?, udescription = ?, \
|
||
// multi_player = ?, valid_always = ?, valid_begin_time = ?, valid_end_time = ?";
|
||
// int ret_adduser = update_database(USER_ACCOUNT_DATABASE_ID, adduser_hdbc, DB_OP_INSERT, USER_TABLE, adduser_sql, 9,
|
||
// DB_DATA_INT_TYPE, sizeof(ID), ID,
|
||
// DB_DATA_INT_TYPE, sizeof(GID_temp), GID_temp,
|
||
// DB_DATA_STRING_TYPE, strlen(uname)+1, uname,
|
||
// DB_DATA_STRING_TYPE, 9, "12345678",
|
||
// DB_DATA_STRING_TYPE, strlen(udesp)+1, udesp,
|
||
// DB_DATA_INT_TYPE, sizeof(multi), multi,
|
||
// DB_DATA_INT_TYPE, sizeof(valid), valid,
|
||
// DB_DATA_STRING_TYPE, strlen(valid_begin_time)+1, valid_begin_time,
|
||
// DB_DATA_STRING_TYPE, strlen(valid_end_time)+1,valid_end_time);
|
||
// printf("ret_adduser = %d .\n",ret_adduser);
|
||
|
||
/*
|
||
char * aa = "户";
|
||
int len = strlen(aa)+strlen("*")*2+1;
|
||
char user_name_para[len];
|
||
memset(user_name_para, 0, len);
|
||
strcat(user_name_para, "%");
|
||
strcat(user_name_para, aa);
|
||
strcat(user_name_para, "%");
|
||
printf("user_name_para = %s\n",user_name_para);
|
||
|
||
int rett = create_database_table(1, adduser_hdbc, "ctest", "create table ctest ( id bigint, fl double, dt character(10), status character(7))");
|
||
|
||
retptr1 = select_datebase_by_number(1, adduser_hdbc, "user_account", "SELECT id FROM `user_account` WHERE user_name LIKE ?", 1, 0, &num1, 2,
|
||
DB_DATA_STRING_TYPE, 20, user_name_para,
|
||
DB_DATA_STRING_TYPE, 20, aa);
|
||
//printf("长度:%d \n",strlen(retptr1));
|
||
|
||
char * moveug_sql = "UPDATE `user_account` \
|
||
SET group_id = ( \
|
||
SELECT \
|
||
user_group.id \
|
||
FROM \
|
||
user_group \
|
||
WHERE \
|
||
user_group.uuid = ? \
|
||
) \
|
||
WHERE \
|
||
uuid = ?";
|
||
int new_group_uuid = 712;
|
||
int user_uuid[1] = {3};
|
||
unsigned short *user_uuid_1 = user_uuid;
|
||
int temp_i = 0;
|
||
rett = update_database(1, adduser_hdbc, DB_OP_UPDATE, USER_TABLE, moveug_sql, 2,
|
||
DB_DATA_INT_TYPE, sizeof(new_group_uuid), new_group_uuid,
|
||
DB_DATA_INT_TYPE, sizeof(user_uuid_1[temp_i]), user_uuid_1[temp_i]);
|
||
|
||
printf("更新用户组id结果:%d\n",rett);
|
||
|
||
//printf("user = %s\n", retptr1);
|
||
|
||
char * sele_sql = "SELECT \
|
||
user_group.uuid gid,\
|
||
user_group.gname,\
|
||
user_group.gdescription,\
|
||
IFNULL(t1.count1, 0) useraccount\
|
||
FROM\
|
||
user_group\
|
||
LEFT JOIN (\
|
||
SELECT\
|
||
user_account.group_id,\
|
||
COUNT(*) count1\
|
||
FROM\
|
||
user_account\
|
||
GROUP BY\
|
||
user_account.group_id\
|
||
) t1 ON user_group.id = t1.group_id\
|
||
ORDER BY\
|
||
user_group.uuid";
|
||
|
||
retptr1 = select_datebase_by_number(1, adduser_hdbc, "user_account", sele_sql, 1, 0, &num1, 0);
|
||
//printf("user = %s\n", retptr1);
|
||
disconnect_database(USER_ACCOUNT_DATABASE_ID, adduser_hdbc);
|
||
return 0;
|
||
*/
|
||
|
||
int outsize;
|
||
char output7[5000];
|
||
char *testin7 = "{\"type\": 4,\"data\":{\"group_id\": 0, \"user_name\": \"\",\"page_start\": 1,\"page_counts\": 20}}";
|
||
int a7 = 1;
|
||
ret_code c7 = user_config_proc(1, 1, testin7, strlen(testin7)+1, output7, &a7);
|
||
outsize = strlen(output7);
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第7次结果,查询用户列表,查询结果:%d\n", c7);
|
||
printf("%s\n", output7);
|
||
printf("*******************************************************************************\n");
|
||
|
||
char output8[100];
|
||
char *testin8 = "{\"type\": 7,\"data\":{\"uname\": \"用户07\"}}";
|
||
int a8 = 1;
|
||
ret_code c8 = user_config_proc(1, 1, testin8, strlen(testin8)+1, output8, &a8);
|
||
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第8次结果,根据用户名->用户uuid,查询结果:%d\n", c8);
|
||
printf("%s\n", output8);
|
||
printf("*******************************************************************************\n");
|
||
|
||
|
||
char output9[100];
|
||
char *testin9 = "{\"type\": 7,\"data\":{\"gname\": \"aaa30\"}}";
|
||
int a9 = 1;
|
||
ret_code c9 = usergroup_config_proc(1, 1, testin9, strlen(testin9)+1, output9, &a9);
|
||
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第9次结果,根据用户组名->用户组uuid,查询结果:%d\n", c9);
|
||
printf("%s\n", output9);
|
||
printf("*******************************************************************************\n");
|
||
|
||
char output10[200];
|
||
char *testin10 = "{\"type\": 3,\"data\":{\"user_id\": 4}}";
|
||
int a10 = 1;
|
||
ret_code c10 = user_config_proc(1, 1, testin10, strlen(testin10)+1, output10, &a10);
|
||
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第10次结果,根据用户uuid->用户详情,查询结果:%d\n", c10);
|
||
printf("%s\n", output10);
|
||
printf("*******************************************************************************\n");
|
||
|
||
char output11[200];
|
||
char *testin11 = "{\"type\": 6,\"data\":{\"user_id\": [3,4,5],\"batch\":{\"all\":1,\"old_group_id\":0},\"new_group_id\":717}}";
|
||
int a11 = 1;
|
||
ret_code c11 = user_config_proc(1, 1, testin11, strlen(testin11)+1, output11, &a11);
|
||
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第11次结果,移动分组,结果:%d\n", c11);
|
||
printf("%s\n", output11);
|
||
printf("*******************************************************************************\n");
|
||
|
||
char output12[2000];
|
||
char *testin12 = "{\"type\": 4,\"data\":\"\"}";
|
||
int a12 = 1;
|
||
ret_code c12 = usergroup_config_proc(1, 1, testin12, strlen(testin12)+1, output12, &a12);
|
||
outsize = strlen(output12);
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第12次结果,用户组列表,查询结果:%d\n", c12);
|
||
printf("%s\n", output12);
|
||
printf("*******************************************************************************\n");
|
||
|
||
char output13[100];
|
||
char *testin13 = "{\"type\":2,\"data\":{\"ID\":4,\"GID\":811,\"uname\":\"用户06\",\"gname\":\"aaa03\",\"resetpwd\":1,\"passwd\":\"A31as%4Gb\",\
|
||
\"udescription\":\"测试修改描述\",\"multi\":1,\"valid\":1,\"valid_begin_time\":\"2018-01-01 00:00:00\",\"valid_end_time\":\"2019-01-01 00:00:00\"}}";
|
||
int a13 = 1;
|
||
ret_code c13 = user_config_proc(1, 1, testin13, strlen(testin13)+1, output13, &a13);
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第13次结果,修改用户,结果:%d\n", c13);
|
||
printf("%s\n", output13);
|
||
printf("*******************************************************************************\n");
|
||
|
||
char output14[100];
|
||
char *testin14 = "{\"type\": 2,\"data\":{\"gid\":835,\"gdescription\":\"111\"}}";
|
||
int a14 = 1;
|
||
ret_code c14 = usergroup_config_proc(1, 1, testin14, strlen(testin14)+1, output14, &a14);
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第14次结果,修改用户组描述,结果:%d\n", c14);
|
||
printf("%s\n", output14);
|
||
printf("*******************************************************************************\n");
|
||
|
||
|
||
return 0;
|
||
|
||
printf("初始化用户组:%d\n", init_group());
|
||
|
||
printf("增加一个用户组:%d\n", add_group("", ""));
|
||
printf("增加一个用户组:%d\n", add_group("aaa01", "描述02"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa03", "描述03"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa,", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa04", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa07", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa08", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa09", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa10", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa11", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa12", "描述04"));
|
||
|
||
//USERGROUP U[22] = { 0 };
|
||
//int gsize = get_group_count();
|
||
|
||
// USERGROUP* U;
|
||
// U = (USERGROUP*)malloc(sizeof(USERGROUP) * gsize);
|
||
// if (NULL == U)
|
||
// {
|
||
// printf("shibaile");
|
||
// }
|
||
|
||
//show_group_list(U);
|
||
// for (int i = 0; i < gsize; i++)
|
||
// {
|
||
// printf("第 %d 用户组 ID : %d, NAME: %s, 描述:%s \n", i, U[i].ID, U[i].gname, U[i].gdescription);
|
||
// }
|
||
|
||
// char* name1 = { "aaa18" };
|
||
// printf("删除一个组:%s, %d\n", name1, del_group_by_name(name1));
|
||
// printf("删除一个组:%s, %d\n", "aaa03", del_group_by_name("aaa03"));
|
||
// printf("删除一个组:%s, %d\n", "aaaa03", del_group_by_name("aaaa03"));
|
||
|
||
// printf("增加一个用户组:%d\n", add_group("aaa30", "就爱看九分阿道夫就卡了阿道夫阿道夫就"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa31", "描述31"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa32", "描述31"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa13", "描述04"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa14", "描述04"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa15", "描述04"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa16", "描述04"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa17", "描述04"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa18", "描述04"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa18", "描述04"));
|
||
// printf("增加一个用户组:%d\n", add_group("aaa20", "描述04"));
|
||
//printf("增加一个用户组:%d\n", add_group("aaa21", "描述04"));
|
||
|
||
char *testgroupin = "{\"type\": 0,\"data\": {\"gname\": \"aaa21\",\"gdescription\": \"xxx\"}}";
|
||
char * outputgroup;
|
||
outputgroup = malloc(130);
|
||
if (NULL == outputgroup)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
int olenth_01 = 1;
|
||
int *olenth = &olenth_01;
|
||
ret_code ret_add_group = usergroup_config_proc(1,1,testgroupin,1,outputgroup,olenth);
|
||
printf("测试对外接口-增加一个用户组:%d\n", ret_add_group);
|
||
printf("%s \n", outputgroup);
|
||
//UCHAR_FREE(outputgroup);
|
||
|
||
printf("增加一个用户组:%d\n", add_group("aaa22", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa23", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa20", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa20", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa24", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa25", "描述04"));
|
||
printf("增加一个用户组:%d\n", add_group("aaa26", "描述04"));
|
||
|
||
|
||
//gsize = get_group_count();
|
||
|
||
// USERGROUP* U1;
|
||
// U1 = (USERGROUP*)malloc(sizeof(USERGROUP) * gsize);
|
||
// if (NULL == U1)
|
||
// {
|
||
// printf("shibaile");
|
||
// }
|
||
|
||
//show_group_list(U1);
|
||
// for (int i = 0; i < gsize; i++)
|
||
// {
|
||
// printf("第 %d 用户组 ID : %d, NAME: %s, 描述:%s \n", i, U1[i].ID, U1[i].gname, U1[i].gdescription);
|
||
// }
|
||
|
||
|
||
|
||
|
||
char* name2 = { "aaa10" };
|
||
USERGROUP* U2;
|
||
U2 = (USERGROUP*)malloc(sizeof(USERGROUP));
|
||
if (NULL == U2)
|
||
{
|
||
printf("shibaile");
|
||
}
|
||
//find_group_by_name(name2, U2);
|
||
if (NULL != U2)
|
||
{
|
||
printf("%s, %d, %s, %s \n", name2, U2->ID, U2->gname, U2->gdescription);
|
||
}
|
||
|
||
printf("*************************************\n");
|
||
|
||
|
||
printf("初始化用户:%d\n", init_user());
|
||
for (int i = 0; i < 10; i++)
|
||
{
|
||
printf("初始化后的第 %d 个用户,ID:%d, PWD:%s \n", i, g_user_table[i].ID, g_user_table[i].passwd);
|
||
}
|
||
|
||
USERADD* addUserResullt;
|
||
addUserResullt = (USERADD*)malloc(sizeof(USERADD));
|
||
printf("sizeof(USERADD): %ld\n",sizeof(USERADD));
|
||
memset(addUserResullt, 0, sizeof(USERADD));
|
||
|
||
if (NULL == addUserResullt)
|
||
{
|
||
printf("shibaile");
|
||
}
|
||
|
||
usermanager_add_user("用户01", "aaa04", "hello", NULL, 0, 0, NULL, NULL,addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
//addUserResullt = AddUser("用户02", "aaa04", NULL);
|
||
//printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user(NULL, "aaa04", NULL,NULL,0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("", "aaa04", NULL, NULL, 0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("用户04,", "aaa04", NULL,NULL,0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("用户05", "aCaa04", NULL,NULL, 0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("用户01", "aaa04", NULL,NULL, 0, 0, NULL, NULL,addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("用户04", "aaa07", NULL,NULL, 0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("用户05", "aaa07", NULL,NULL, 0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("用户06", "aaa07", NULL,NULL, 0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("用户07", "aaa07", NULL,NULL, 0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("用户08", "aaa07", NULL,NULL, 0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
usermanager_add_user("用户09", "aaa07", NULL,NULL, 0, 0, NULL, NULL, addUserResullt);
|
||
printf("%d,%d\n", addUserResullt->result, addUserResullt->userID);
|
||
|
||
|
||
|
||
char * output1;
|
||
output1 = malloc(40);
|
||
if (NULL == output1)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
|
||
char *testin = "{\"type\": 0,\"data\": {\"uname\": \"小明\",\"gname\": \"aaa14\"}}";
|
||
int a_01 = 1;
|
||
int *a = &a_01;
|
||
ret_code c = user_config_proc(1, 1, testin, 1, output1, a);
|
||
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第一次结果,新增用户:%d\n", c);
|
||
printf("%s\n", output1);
|
||
printf("*******************************************************************************\n");
|
||
|
||
|
||
for (int i = 0; i < USER_INDEX_MAX; i++)
|
||
{
|
||
if (g_user_table[i].ID != 0)
|
||
{
|
||
printf("tianjia后的第 %d 个用户, ID:%d, GID:%d, 用户名:%s, PWD:%s \n", i, g_user_table[i].ID, g_user_table[i].GID, g_user_table[i].uname, g_user_table[i].passwd);
|
||
}
|
||
}
|
||
|
||
printf("*****************************************************\n");
|
||
|
||
USERLIST* ulist;
|
||
ulist = (USERLIST*)malloc(sizeof(USERLIST));
|
||
if (NULL == ulist)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
|
||
|
||
// USERLIST* ulist2;
|
||
// ulist2 = (USERLIST*)malloc(sizeof(USERLIST));
|
||
// if (NULL == ulist2)
|
||
// {
|
||
// printf("ulist fail");
|
||
// }
|
||
|
||
// ulist2->ID = 2;
|
||
// ulist2->GID = 4;
|
||
// strcpy(ulist2->udescription, "修改用");
|
||
// strcpy(ulist2->passwd, "zhelishimima123");
|
||
// ulist2->multi = 1;
|
||
// ulist2->valid = 1;
|
||
// strcpy(ulist2->valid_begin_time, "2013-07-04 15:04:23");
|
||
// strcpy(ulist2->valid_end_time, "2019-07-04 15:04:23");
|
||
|
||
|
||
// printf("%d\n", mod_user_web(ulist2));
|
||
|
||
char *testmodweb = "{\"type\":2, \"data\":{\"ID\": 3,\"GID\" : 5,\"uname\" : \"用户05\",\"gname\" : \"aaa07\", \"resetpwd\" : 1,\
|
||
\"udescription\" : \"修改用\",\"multi\" : 1,\"valid\" : 1,\"valid_begin_time\" : \"2013-07-04 15:04:23\",\"valid_end_time\" : \"2019-10-04 15:04:23\"}}";
|
||
|
||
char * output2;
|
||
output2 = malloc(50);
|
||
if (NULL == output2)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
//printf("123 .\n");
|
||
ret_code cc = user_config_proc(1, 1, testmodweb, 1, output2, a);
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第二次结果,修改用户web:%d\n", cc);
|
||
printf("%s\n", output2);
|
||
printf("*******************************************************************************\n");
|
||
|
||
|
||
USERLIST* ulist22;
|
||
ulist22 = (USERLIST*)malloc(sizeof(USERLIST));
|
||
if (NULL == ulist22)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
|
||
mod_user_line("用户06", 0, "testtest描述");
|
||
mod_user_line("用户06", 1, "aaa12");
|
||
mod_user_line("用户06", 2, "zhelishidenglumima");
|
||
mod_user_line("用户05", 3, "1");
|
||
mod_user_line("用户06", 4, "1");
|
||
mod_user_line("用户06", 5, "2013-03-03 15:04:23");
|
||
mod_user_line("用户05", 6, "2018-03-03 15:04:23");
|
||
mod_user_line("用户05", 7, "2020-03-03 15:04:23");
|
||
char *testmodline = "{\"type\":5, \"data\":{\"uname\": \"用户06\",\"attr_type\" : 6,\"attr_data\" : \"2018-03-03 15:04:23\"}}";
|
||
|
||
char * output3;
|
||
output3 = malloc(50);
|
||
if (NULL == output3)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
ret_code ccc = user_config_proc(1, 1, testmodline, 1, output3, a);
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第三次结果,修改用户-line:%d\n", ccc);
|
||
printf("%s\n", output3);
|
||
printf("*******************************************************************************\n");
|
||
|
||
|
||
char * output4;
|
||
output4 = malloc(100);
|
||
if (NULL == output4)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
|
||
char *testin4 = "{\"type\": 1,\"data\":[\"用户01\", \"用户02\", \"用户04\"]}";
|
||
int a4_01 = 1;
|
||
int *a4 = &a4_01;;
|
||
ret_code c4 = user_config_proc(1, 1, testin4, 1, output4, a4);
|
||
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第四次结果,删除用户:%d\n", c4);
|
||
printf("%s\n", output4);
|
||
printf("*******************************************************************************\n");
|
||
|
||
|
||
|
||
char * output5;
|
||
output5 = malloc(100);
|
||
if (NULL == output5)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
|
||
char *testin5 = "{\"type\": 1,\"data\":[\"aaa\", \"aaa07\", \"aaa08\"]}";
|
||
int a5_01 = 1;
|
||
int *a5 = &a5_01;
|
||
ret_code c5 = usergroup_config_proc(1, 1, testin5, 1, output5, a5);
|
||
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第五次结果,删除用户组:%d\n", c5);
|
||
printf("%s\n", output5);
|
||
printf("*******************************************************************************\n");
|
||
//UCHAR_FREE(output5);
|
||
|
||
USER_AUTH_RET *aret;
|
||
aret = (USER_AUTH_RET*)malloc(sizeof(USER_AUTH_RET));
|
||
if (NULL == aret)
|
||
{
|
||
printf("111111111111");
|
||
}
|
||
time_t t1 = time(NULL);
|
||
|
||
user_auth_login("用户07", "12345678", aret);
|
||
printf("%d,%d,%d\n", aret->ret, aret->user_id, aret->group_id);
|
||
|
||
sleep(1);
|
||
t1 = time(NULL);
|
||
USER_AUTH_RET aret01;
|
||
user_auth_login("用户05", "zhelishidenglumima", &aret01);
|
||
printf("%d,%d,%d\n", aret01.ret, aret01.user_id, aret01.group_id);
|
||
|
||
// sleep(1);
|
||
// t1 = time(NULL);
|
||
// user_auth_login("用户05", "zhelishidenglumima", aret);
|
||
// printf("%d,%d,%d\n",aret->ret,aret->user_id,aret->group_id);
|
||
|
||
// sleep(1);
|
||
// t1 = time(NULL);
|
||
// user_auth_login("用户05", "zhelishidenglumima", aret);
|
||
// printf("%d,%d,%d\n", aret->ret, aret->user_id, aret->group_id);
|
||
|
||
// sleep(1);
|
||
// t1 = time(NULL);
|
||
// user_auth_login("用户05", "zhelishidenglumima", aret);
|
||
// printf("%d,%d,%d\n", aret->ret, aret->user_id, aret->group_id);
|
||
|
||
// sleep(1);
|
||
// t1 = time(NULL);
|
||
// user_auth_login("用户05", "zhelishidenglumima", aret);
|
||
// printf("%d,%d,%d\n", aret->ret, aret->user_id, aret->group_id);
|
||
|
||
// mod_user_line("用户05", 6, "2020-03-03 15:04:23");
|
||
// sleep(1);
|
||
// t1 = time(NULL);
|
||
// user_auth_login("用户05", "zhelishidenglumima", aret);
|
||
// printf("%d,%d,%d\n", aret->ret, aret->user_id, aret->group_id);
|
||
|
||
|
||
char * output6;
|
||
output6 = malloc(100);
|
||
if (NULL == output6)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
char *testin6 = "{\"type\": 1,\"data\":[\"用户01\", \"用户02\", \"用户04\", \"用户05\"]}";
|
||
int a6_01 = 1;
|
||
int *a6 = &a6_01;;
|
||
ret_code c6 = user_config_proc(1, 1, testin6, 1, output6, a6);
|
||
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第六次结果,删除用户05:%d\n", c4);
|
||
printf("%s\n", output6);
|
||
printf("*******************************************************************************\n");
|
||
//UCHAR_FREE(output6);
|
||
|
||
int user_ids[3] = {1,2,4};
|
||
reset_online_by_userid(user_ids, 3);
|
||
|
||
void * test_hdbc;
|
||
|
||
/* 连接数据库 */
|
||
test_hdbc = connect_database(12);
|
||
if(NULL == test_hdbc)
|
||
{
|
||
printf("fall connnect database. \n");
|
||
return -1;
|
||
}
|
||
|
||
int num_sql;
|
||
int ret;
|
||
char * ret_sql = NULL;
|
||
char * select_sql = "SELECT U.uid, U.id FROM `user_group` U WHERE id > ?";
|
||
ret_sql = select_datebase_by_number(1, test_hdbc, "user_group", select_sql, 1, 20, &num_sql, 1,
|
||
DB_DATA_INT_TYPE, 8, 2);
|
||
|
||
printf("num_sql = %d \n", num_sql);
|
||
printf("test_hdbc = %p \n", test_hdbc);
|
||
//printf("ret_sql = %s \n",ret_sql);
|
||
|
||
/* 创建table, 其中列类型包括长整形、浮点型、字符串 */
|
||
//ret = create_database_table(1, test_hdbc, "ctest", "create table ctest ( id bigint, fl double, dt character(10), status character(7))");
|
||
|
||
/* 根据指定信息查询数据库的获取的结果的条目数 */
|
||
ret = get_select_datebase_number(1, test_hdbc, "ctest", "select * from ctest where id = '911231233333333337'", &num_sql, 0);
|
||
printf("num_sql = %d \n", num_sql);
|
||
printf("ret = %d \n", ret);
|
||
|
||
int num;
|
||
char * retptr = NULL;
|
||
retptr = select_datebase_by_number(1, test_hdbc, "user_group", " SELECT UG.id FROM user_group UG WHERE UG.gname = '用户组01'", 1, 0, &num, 0);
|
||
printf("user_group = %s\n", retptr);
|
||
|
||
retptr = select_datebase_by_number(1, test_hdbc, "user_account", " SELECT * FROM user_account WHERE id = 4", 1, 0, &num, 0);
|
||
printf("user_group = %s\n", retptr);
|
||
|
||
char *usergrouname = "test17";
|
||
num = update_database(1, test_hdbc, DB_OP_INSERT, "user_group", "INSERT INTO user_group SET id = ?, gname = ? ", 2,
|
||
DB_DATA_INT_TYPE, 4, 26,
|
||
DB_DATA_STRING_TYPE, strlen(usergrouname), usergrouname);
|
||
printf("insert user_group ret = %d \n", num);
|
||
|
||
num = update_database(1, test_hdbc, DB_OP_DEL, "user_group", "DELETE FROM user_group WHERE gname = ? ", 1,
|
||
DB_DATA_STRING_TYPE, 10, "用户组03");
|
||
printf("delete user_group ret = %d \n", num);
|
||
|
||
num = update_database(1, test_hdbc, DB_OP_UPDATE, "user_group", "UPDATE user_group SET gdescription = ? WHERE gname = ? ", 2,
|
||
DB_DATA_STRING_TYPE, 10, "z111111111111111111",
|
||
DB_DATA_STRING_TYPE, 10, "test04");
|
||
printf("update user_group ret = %d \n", num);
|
||
|
||
// num = update_database(1, test_hdbc, 1, "user_account",
|
||
// "INSERT INTO user_account SET id = ?, group_id = ?, user_name = ?", 3,
|
||
// DB_DATA_INT_TYPE, 4, 9,
|
||
// DB_DATA_INT_TYPE, 4, 3,
|
||
// DB_DATA_STRING_TYPE, 10, "test01");
|
||
// printf("insert user01 ret = %d \n", num);
|
||
|
||
// num = update_database(1, test_hdbc, 1, "user_account",
|
||
// "INSERT INTO user_account SET id = 8, group_id = 12, user_name = 'test02' ", 0);
|
||
// printf("insert user02 ret = %d \n", num);
|
||
|
||
// num = update_database(1, test_hdbc, 1, "user_group",
|
||
// "INSERT INTO user_group SET id = ?, gname = ?", 2,
|
||
// DB_DATA_INT_TYPE, 4, 10,
|
||
// DB_DATA_STRING_TYPE, 10, "test04");
|
||
// printf("insert user_group ret = %d \n", num);
|
||
|
||
// ret = update_database(1, test_hdbc, 1, "ctest", "insert into ctest values(?, ?, ?, '30' )", 3,
|
||
// DB_DATA_INT_TYPE, 4, 91123123333333333,
|
||
// DB_DATA_FLOAT_TYPE, 8, 11111111.555555555,
|
||
// DB_DATA_STRING_TYPE, 4, "TEMP");
|
||
// printf("insert ret = %d \n", ret);
|
||
ret = disconnect_database(1, test_hdbc);
|
||
|
||
/* char * output7;
|
||
output7 = malloc(100);
|
||
if (NULL == output7)
|
||
{
|
||
printf("ulist fail");
|
||
}
|
||
char *testin7 = "{\"type\": 4,\"data\":{\"group_id\": 0, \"user_name\": \"户\",\"page_start\": 1,\"page_counts\": 10}}";
|
||
int a7_01 = 1;
|
||
int *a7 = &a7_01;;
|
||
ret_code c7 = user_config_proc(1, 1, testin7, strlen(testin7)+1, output7, a7);
|
||
|
||
printf("*******************************************************************************\n");
|
||
printf("这里是个测试第7次结果,查询:%d\n", c7);
|
||
printf("%s\n", output7);
|
||
printf("*******************************************************************************\n");
|
||
UCHAR_FREE(output7);
|
||
*/
|
||
return 0;
|
||
}
|
||
|