diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..31b4221b70cb20bc8f940df8f068756162e4917b --- /dev/null +++ b/README.en.md @@ -0,0 +1,53 @@ +# SNMS Identifier Resolution Platform Interface Script + +The SNMS (Server Network Management System) Identifier Resolution Platform Interface Script is a multi-language implemented API client library used to interact with the Identifier Resolution Platform. This project provides implementations in both Java and Python, supporting functions such as enterprise registration, identifier management, prefix configuration, template management, and statistical analysis. + +## Project Overview + +This project aims to simplify the integration development work with the Identifier Resolution Platform by encapsulating complete RESTful API calling logic. Developers can quickly complete platform docking without directly handling HTTP request details. The project adopts a modular design, where each functional module is independent yet can be coordinated and called through a unified client. + +## Core Functions + +### Authentication Module +The authentication module provides user registration and token retrieval functions, supporting two authentication methods: ciphertext and plaintext. The ciphertext mode uses the SHA256 encryption algorithm for secondary encryption of passwords, providing higher security. The obtained token can be used for all subsequent API calls, implementing a unified authentication mechanism. + +### Enterprise Management Module +The enterprise management module supports enterprise information registration, file upload, enterprise information update, and enterprise list query functions. When registering an enterprise, users can choose to create an associated user simultaneously or register enterprise information separately and then bind the user afterwards. The system also supports managed and unmanaged enterprise prefix configuration modes to meet different business scenario requirements. + +### Identifier Management Module +The identifier management module provides complete lifecycle management functions for identifiers, including registration, query, update, and deletion. It supports both single record operation and batch operation modes; batch operations can significantly improve efficiency in processing large volumes of data. When registering an identifier, it is necessary to associate a template version and a specific list of identifier values to ensure data structure consistency. + +### Prefix Management Module +The prefix management module is responsible for the configuration and query of prefix resources. Prefixes are a core concept in the identifier resolution system, used to uniquely identify a resolution service node. The system supports two types of prefixes: managed prefixes (managed by proxy servers) and unmanaged prefixes (configuration of processing methods and network parameters performed independently), allowing flexible configuration of network ports such as TCP, UDP, and HTTP. + +### Template Management Module +The template management module provides creation, query, update, and deletion functions for identifier templates. Templates define the data structure of identifiers, including industry classification, template type, and a specific list of data items. When creating an identifier, valid template information must be specified to ensure identifier data conforms to predefined specifications. + +### Statistical Analysis Module +The statistical analysis module provides multi-dimensional data statistics interfaces, supporting data aggregation by prefix, by date, by month, etc. Statistical data covers indicators such as total identifier resolution volume, daily resolution volume, and monthly resolution volume, providing data support for operational analysis. + +## Environment Requirements + +The Java version requires JDK 1.8 or higher, and the corresponding dependency JAR packages need to be downloaded. The Python version requires Python 3.6 or higher, with the recommendation to use a virtual environment for package management. Both versions require the ability to access the Identifier Resolution Platform API service. + +## Quick Start + +### Java Version Quick Start + +First, ensure the JDK environment is correctly configured, then download the dependency JAR packages provided by the project. Compilation can be done using the compilation script in the project or directly via the command line to compile all Java source files. After compilation is complete, run the example program for functional verification. + +When creating an SNMSClient instance, the platform's base address must be specified. It is recommended to configure the base address in a configuration file for future maintenance. After obtaining the token, it needs to be synchronized to all API modules to ensure subsequent requests can pass identity verification. + +### Python Version Quick Start + +Use pip to install project dependencies, or directly import the relevant modules into your project. After creating the SNMSClient client instance, obtain the access token through the authentication module, then set the token to the client. The client will automatically synchronize the token to all sub-modules. + +## Directory Structure + +The project root directory contains two subdirectories, `java` and `python`, storing the implementation code for the corresponding languages respectively. Each language directory is divided by functional module; core files include the implementation of various API modules and the main client class. + +## Precautions + +Before using this interface script, please ensure that the platform access address and network connection are correctly configured. Tokens have validity periods and need to be re-obtained after expiration. Some sensitive operations may require additional permission verification; please refer to the platform interface documentation for detailed information. + +Although batch operations are highly efficient, it is recommended to control the data volume per operation to avoid request timeouts or excessive server pressure. In production environments, user credential information should be kept securely, avoiding plaintext storage of sensitive authentication data. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5b8d3f07acaecd8130876a174abd6be8bb65454b --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ + + +# SNMS 标识解析平台接口脚本 + +SNMS(Server Network Management System)标识解析平台接口脚本是一个多语言实现的API客户端库,用于与标识解析平台进行交互。该项目提供了Java和Python两种语言的实现,支持企业注册、标识管理、前缀配置、模板管理和统计分析等功能。 + +## 项目概述 + +本项目旨在简化与标识解析平台的集成开发工作,封装了完整的RESTful API调用逻辑,开发者无需直接处理HTTP请求细节即可快速完成平台对接。项目采用模块化设计,各功能模块相互独立又可通过统一客户端进行协调调用。 + +## 核心功能 + +### 认证模块 +认证模块提供用户注册和令牌获取功能,支持密文和明文两种认证方式。密文模式采用SHA256加密算法对密码进行二次加密,提供更高的安全性。获取到的令牌可用于后续所有API调用,实现统一的身份验证机制。 + +### 企业管理模块 +企业管理模块支持企业信息注册、文件上传、企业信息更新和企业列表查询等功能。注册企业时可选择同时创建关联用户,或单独注册企业信息后进行用户绑定。系统还支持托管和非托管两种企业前缀配置模式,满足不同业务场景需求。 + +### 标识管理模块 +标识管理模块提供标识的注册、查询、更新和删除等完整生命周期管理功能。支持单条记录操作和批量操作两种模式,批量操作可显著提高大批量数据处理效率。标识注册时需要关联模板版本和具体的标识值列表,确保数据结构的一致性。 + +### 前缀管理模块 +前缀管理模块负责前缀资源的配置和查询工作。前缀是标识解析系统中的核心概念,用于唯一标识一个解析服务节点。系统支持托管前缀(由代理服务器管理)和非托管前缀(自行配置处理方式和网络参数)两种类型,可灵活配置TCP、UDP、HTTP等网络端口。 + +### 模板管理模块 +模板管理模块提供标识模板的创建、查询、更新和删除功能。模板定义了标识的数据结构,包括行业分类、模板类型和具体的数据项列表。创建标识时必须指定有效的模板信息,确保标识数据符合预定义的规范。 + +### 统计分析模块 +统计分析模块提供多维度的数据统计接口,支持按前缀、按日期、按月份等维度进行数据汇总。统计数据涵盖标识解析总量、每日解析量、月度解析量等指标,为运营分析提供数据支撑。 + +## 环境要求 + +Java版本需要JDK 1.8或更高版本,并需要下载相应的依赖JAR包。Python版本需要Python 3.6或更高版本,推荐使用虚拟环境进行包管理。两个版本都需要能够访问标识解析平台的API服务。 + +## 快速开始 + +### Java版快速开始 + +首先确保JDK环境已正确配置,然后下载项目提供的依赖JAR包。编译时可使用项目中的编译脚本或直接通过命令行编译所有Java源文件。编译完成后,运行示例程序进行功能验证。 + +创建SNMSClient实例时需要指定平台的基地址,建议将基地址配置在配置文件中以便后续维护。获取令牌后需要将令牌同步到所有API模块,确保后续请求能够通过身份验证。 + +### Python版快速开始 + +使用pip安装项目依赖,或直接将相关模块导入到您的项目中。创建SNMSClient客户端实例后,通过认证模块获取访问令牌,然后将令牌设置到客户端,客户端会自动将令牌同步到所有子模块。 + +## 目录结构 + +项目根目录下包含java和python两个子目录,分别存放对应语言的实现代码。每个语言目录下按功能模块划分,核心文件包括各API模块实现和主客户端类。 + +## 注意事项 + +使用本接口脚本前,请确保已正确配置平台访问地址和网络连接。令牌具有时效性,过期后需要重新获取。部分敏感操作可能需要额外的权限验证,请参考平台接口文档获取详细信息。 + +批量操作虽然效率较高,但建议控制单次操作的数据量,避免请求超时或服务器压力过大。生产环境中应妥善保管用户凭证信息,避免明文存储敏感认证数据。 \ No newline at end of file