【Python+requests+unittest+excel】实现接口自动化测试框架
一、框架结构:
工程目录
二、Case文件设计
三、基础包 base
3.1 封装get/post请求(runmethon.py)
1 import requests2 import json3 class RunMethod:4 def post_main(self,url,data,header=None):5 res = None6 if header !=None: 7 res = requests.post(url=url,data=data,headers=header)8 else:9 res = requests.post(url=url,data=data)
10 return res.json()
11
12 def get_main(self,url,data=None,header=None):
13 res = None
14 if header !=None:
15 res = requests.get(url=url,data=data,headers=header,verify=False)
16 else:
17 res = requests.get(url=url,data=data,verify=False)
18 return res.json()
19
20 def run_main(self,method,url,data=None,header=None):
21 res = None
22 if method == 'Post':
23 res = self.post_main(url,data,header)
24 else:
25 res = self.get_main(url,data,header)
26 return json.dumps(res,ensure_ascii=False,sort_keys=True,indent=2)
3.2 封装mock(mock.py)
1 from mock import mock
2 #模拟mock 封装
3 def mock_test(mock_method,request_data,url,method,response_data):
4 mock_method = mock.Mock(return_value=response_data)
5 res = mock_method(url,method,request_data)
6 return res
四、数据操作包 operation_data
4.1 获取excel单元格中的内容(get_data.py)
4.2 获取excel中每个列(data_config.py)
1 #coding:utf-82 class global_var:3 #case_id4 Id = '0'5 request_name = '1'6 url = '2'7 run = '3'8 request_way = '4'9 header = '5'
10 case_depend = '6'
11 data_depend = '7'
12 field_depend = '8'
13 data = '9'
14 expect = '10'
15 result = '11'
16 #获取caseid
17 def get_id():
18 return global_var.Id
19
20 #获取url
21 def get_url():
22 return global_var.url
23
24 def get_run():
25 return global_var.run
26
27 def get_run_way():
28 return global_var.request_way
29
30 def get_header():
31 return global_var.header
32
33 def get_case_depend():
34 return global_var.case_depend
35
36 def get_data_depend():
37 return global_var.data_depend
38
39 def get_field_depend():
40 return global_var.field_depend
41
42 def get_data():
43 return global_var.data
44
45 def get_expect():
46 return global_var.expect
47
48 def get_result():
49 return global_var.result
50
51 def get_header_value():
52 return global_var.header
4.3 解决数据依赖(dependent.py )
1 #coding:utf-82 import sys3 import json4 sys.path.append('C:/Users/lxz/Desktop/InterFace_JIA')5 from tool.operation_excel import OperationExcel6 from base.runmethod import RunMethod7 from operation_data.get_data import GetData8 from jsonpath_rw import jsonpath,parse9 class DependdentData:
10 def __init__(self,case_id):
11 self.case_id = case_id
12 self.opera_excel = OperationExcel()
13 self.data = GetData()
14
15 #通过case_id去获取该case_id的整行数据
16 def get_case_line_data(self):
17 rows_data = self.opera_excel.get_rows_data(self.case_id)
18 return rows_data
19
20 #执行依赖测试,获取结果
21 def run_dependent(self):
22 run_method = RunMethod()
23 row_num = self.opera_excel.get_row_num(self.case_id)
24 request_data = self.data.get_data_for_json(row_num)
25 #header = self.data.is_header(row_num)
26 method = self.data.get_request_method(row_num)
27 url = self.data.get_request_url(row_num)
28 res = run_method.run_main(method,url,request_data)
29 return json.loads(res)
30
31 #根据依赖的key去获取执行依赖测试case的响应,然后返回
32 def get_data_for_key(self,row):
33 depend_data = self.data.get_depend_key(row)
34 response_data = self.run_dependent()
35 json_exe = parse(depend_data)
36 madle = json_exe.find(response_data)
37 return [math.value for math in madle][0]
38
39 if __name__ == '__main__':
40 order = {
41 "data": {
42 "_input_charset": "utf-8",
43 "body": "京东订单-1710141907182334",
44 "it_b_pay": "1d",
45 "notify_url": "http://order.imooc.com/pay/notifyalipay",
46 "out_trade_no": "1710141907182334",
47 "partner": "2088002966755334",
48 "payment_type": "1",
49 "seller_id": "yangyan01@tcl.com",
50 "service": "mobile.securitypay.pay",
51 "sign": "kZBV53KuiUf5HIrVLBCcBpWDg%2FnzO%2BtyEnBqgVYwwBtDU66Xk8VQUTbVOqDjrNymCupkVhlI%2BkFZq1jOr8C554KsZ7Gk7orC9dDbQl pr%2BaMmdjO30JBgjqjj4mmM%2Flphy9Xwr0Xrv46uSkDKdlQqLDdGAOP7YwOM2dSLyUQX%2Bo4%3D",
52 "sign_type": "RSA",
53 "string": "_input_charset=utf-8&body=京东订单-1710141907182334&it_b_pay=1d¬ify_url=http://order.imooc.com/pay/ notifyalipay&out_trade_no=1710141907182334&partner=2088002966755334&payment_type=1&seller_id=yangyan01@ tcl.com&service=mobile.securitypay.pay&subject=京东订单-1710141907182334&total_fee=299&sign=kZBV53KuiUf5H IrVLBCcBpWDg%2FnzO%2BtyEnBqgVYwwBtDU66Xk8VQUTbVOqDjrNymCupkVhlI%2BkFZq1jOr8C554KsZ7Gk7orC9dDbQlpr%2BaMmdjO30 JBgjqjj4mmM%2Flphy9Xwr0Xrv46uSkDKdlQqLDdGAOP7YwOM2dSLyUQX%2Bo4%3D&sign_type=RSA",
54 "subject": "京东订单-1710141907182334",
55 "total_fee": 299
56 },
57 "errorCode": 1000,
58 "errorDesc": "成功",
59 "status": 1,
60 "timestamp": 1507979239100
61 }
62 res = "data.out_trade_no"
63 json_exe = parse(res)
64 madle = json_exe.find(order)
65 print [math.value for math in madle][0]
五、工具类包 tool
5.1 操作excel (operation_excel.py)
1 #coding:utf-82 import xlrd3 from xlutils.copy import copy4 class OperationExcel:5 def __init__(self,file_name=None,sheet_id=None):6 if file_name:7 self.file_name = file_name8 self.sheet_id = sheet_id 9 else:
10 self.file_name = '../dataconfig/case1.xls'
11 self.sheet_id = 0
12 self.data = self.get_data()
13
14 #获取sheets的内容
15 def get_data(self):
16 data = xlrd.open_workbook(self.file_name)
17 tables = data.sheets()[self.sheet_id]
18 return tables
19
20 #获取单元格的行数
21 def get_lines(self):
22 tables = self.data
23 return tables.nrows
24
25 #获取某一个单元格的内容
26 def get_cell_value(self,row,col):
27 return self.data.cell_value(row,col)
28
29 #写入数据
30 def write_value(self,row,col,value):
31 '''
32 写入excel数据
33 row,col,value
34 '''
35 read_data = xlrd.open_workbook(self.file_name)
36 write_data = copy(read_data)
37 sheet_data = write_data.get_sheet(0)
38 sheet_data.write(row,col,value)
39 write_data.save(self.file_name)
40
41 #根据对应的caseid 找到对应行的内容
42 def get_rows_data(self,case_id):
43 row_num = self.get_row_num(case_id)
44 rows_data = self.get_row_values(row_num)
45 return rows_data
46
47 #根据对应的caseid找到对应的行号
48 def get_row_num(self,case_id):
49 num = 0
50 clols_data = self.get_cols_data()
51 for col_data in clols_data:
52 if case_id in col_data:
53 return num
54 num = num+1
55
56
57 #根据行号,找到该行的内容
58 def get_row_values(self,row):
59 tables = self.data
60 row_data = tables.row_values(row)
61 return row_data
62
63 #获取某一列的内容
64 def get_cols_data(self,col_id=None):
65 if col_id != None:
66 cols = self.data.col_values(col_id)
67 else:
68 cols = self.data.col_values(0)
69 return cols
70
71
72 if __name__ == '__main__':
73 opers = OperationExcel()
74 print opers.get_cell_value(1,2)
5.2判断字符串包含,判断字典是否相等(common_util.py)
1 #coding:utf-82 import json3 class CommonUtil:4 def is_contain(self,str_one,str_two):5 '''6 判断一个字符串是否再另外一个字符串中7 str_one:查找的字符串8 str_two:被查找的字符串9 '''
10 flag = None
11 if isinstance(str_one,unicode):
12 str_one = str_one.encode('unicode-escape').decode('string_escape')
13 return cmp(str_one,str_two)
14 if str_one in str_two:
15 flag = True
16 else:
17 flag = False
18 return flag
19
20
21 def is_equal_dict(self,dict_one,dict_two):
22 '''
23 判断两个字典是否相等
24 '''
25 if isinstance(dict_one,str):
26 dict_one = json.loads(dict_one)
27 if isinstance(dict_two,str):
28 dict_two = json.loads(dict_two)
29 return cmp(dict_one,dict_two)
5.3 操作header(operation_herder.py)
1 #coding:utf-82 import requests3 import json4 from operation_json import OperetionJson5 6 7 class OperationHeader:8 9 def __init__(self,response):
10 self.response = json.loads(response)
11
12 def get_response_url(self):
13 '''
14 获取登录返回的token的url
15 '''
16 url = self.response['data']['url'][0]
17 return url
18
19 def get_cookie(self):
20 '''
21 获取cookie的jar文件
22 '''
23 url = self.get_response_url()+"&callback=jQuery21008240514814031887_1508666806688&_=1508666806689"
24 cookie = requests.get(url).cookies
25 return cookie
26
27 def write_cookie(self):
28 cookie = requests.utils.dict_from_cookiejar(self.get_cookie())
29 op_json = OperetionJson()
30 op_json.write_data(cookie)
31
32 if __name__ == '__main__':
33
34 url = "http://www.jd.com/passport/user/login"
35 data = {
36 "username":"18513199586",
37 "password":"111111",
38 "verify":"",
39 "referer":"https://www.jd.com"
40 }
41 res = json.dumps(requests.post(url,data).json())
42 op_header = OperationHeader(res)
43 op_header.write_cookie()
5.4 操作json文件(operation_json.py)
1 #coding:utf-82 import json3 class OperetionJson:4 5 def __init__(self,file_path=None):6 if file_path == None:7 self.file_path = '../dataconfig/user.json'8 else:9 self.file_path = file_path
10 self.data = self.read_data()
11
12 #读取json文件
13 def read_data(self):
14 with open(self.file_path) as fp:
15 data = json.load(fp)
16 return data
17
18 #根据关键字获取数据
19 def get_data(self,id):
20 print type(self.data)
21 return self.data[id]
22
23 #写json
24 def write_data(self,data):
25 with open('../dataconfig/cookie.json','w') as fp:
26 fp.write(json.dumps(data))
27
28
29
30 if __name__ == '__main__':
31 opjson = OperetionJson()
32 print opjson.get_data('shop')
5.5 操作数据库(connect_db.py)
1 #coding:utf-82 import MySQLdb.cursors3 import json4 class OperationMysql:5 def __init__(self):6 self.conn = MySQLdb.connect(7 host='localhost',8 port=3306,9 user='root',
10 passwd='123456',
11 db='le_study',
12 charset='utf8',
13 cursorclass=MySQLdb.cursors.DictCursor
14 )
15 self.cur = self.conn.cursor()
16
17 #查询一条数据
18 def search_one(self,sql):
19 self.cur.execute(sql)
20 result = self.cur.fetchone()
21 result = json.dumps(result)
22 return result
23
24 if __name__ == '__main__':
25 op_mysql = OperationMysql()
26 res = op_mysql.search_one("select * from web_user where Name='ailiailan'")
27 print res
5.6 发送报告邮件(send_email.py)
1 #coding:utf-82 import smtplib3 from email.mime.text import MIMEText4 class SendEmail:5 global send_user6 global email_host7 global password8 email_host = "smtp.163.com"9 send_user = "jiaxiaonan666@163.com"
10 password = "jia_668"
11 def send_mail(self,user_list,sub,content):
12 user = "jiaxiaonan"+"<"+send_user+">"
13 message = MIMEText(content,_subtype='plain',_charset='utf-8')
14 message['Subject'] = sub
15 message['From'] = user
16 message['To'] = ";".join(user_list)
17 server = smtplib.SMTP()
18 server.connect(email_host)
19 server.login(send_user,password)
20 server.sendmail(user,user_list,message.as_string())
21 server.close()
22
23 def send_main(self,pass_list,fail_list):
24 pass_num = float(len(pass_list))
25 fail_num = float(len(fail_list))
26 count_num = pass_num+fail_num
27 #90%
28 pass_result = "%.2f%%" %(pass_num/count_num*100)
29 fail_result = "%.2f%%" %(fail_num/count_num*100)
30
31
32 user_list = ['609037724@qq.com']
33 sub = "接口自动化测试报告"
34 content = "此次一共运行接口个数为%s个,通过个数为%s个,失败个数为%s,通过率为%s,失败率为%s" %(count_num,pass_num,fail_num,pass_result,fail_result )
35 self.send_mail(user_list,sub,content)
36
37 if __name__ == '__main__':
38 sen = SendEmail()
39 sen.send_main([1,2,3,4],[2,3,4,5,6,7])
六、主函数
run_test.py
1 #coding:utf-82 import sys3 sys.path.append("C:/Users/lxz/Desktop/InterFace_JIA")4 from base.runmethod import RunMethod5 from operation_data.get_data import GetData6 from tool.common_util import CommonUtil7 from operation_data.dependent_data import DependdentData8 from tool.send_email import SendEmail9 from tool.operation_header import OperationHeader
10 from tool.operation_json import OperetionJson
11 class RunTest:
12 def __init__(self):
13 self.run_method = RunMethod()
14 self.data = GetData()
15 self.com_util = CommonUtil()
16 self.send_mai = SendEmail()
17
18 #程序执行的
19 def go_on_run(self):
20 res = None
21 pass_count = []
22 fail_count = []
23 #10 0,1,2,3
24 rows_count = self.data.get_case_lines()
25 for i in range(1,rows_count):
26 is_run = self.data.get_is_run(i)
27 if is_run:
28 url = self.data.get_request_url(i)
29 method = self.data.get_request_method(i)
30 request_data = self.data.get_data_for_json(i)
31 expect = self.data.get_expcet_data_for_mysql(i)
32 header = self.data.is_header(i)
33 depend_case = self.data.is_depend(i)
34 if depend_case != None:
35 self.depend_data = DependdentData(depend_case)
36 #获取的依赖响应数据
37 depend_response_data = self.depend_data.get_data_for_key(i)
38 #获取依赖的key
39 depend_key = self.data.get_depend_field(i)
40 request_data[depend_key] = depend_response_data
41 if header == 'write':
42 res = self.run_method.run_main(method,url,request_data)
43 op_header = OperationHeader(res)
44 op_header.write_cookie()
45
46 elif header == 'yes':
47 op_json = OperetionJson('../dataconfig/cookie.json')
48 cookie = op_json.get_data('apsid')
49 cookies = {
50 'apsid':cookie
51 }
52 res = self.run_method.run_main(method,url,request_data,cookies)
53 else:
54 res = self.run_method.run_main(method,url,request_data)
55
56 if self.com_util.is_equal_dict(expect,res) == 0:
57 self.data.write_result(i,'pass')
58 pass_count.append(i)
59 else:
60 self.data.write_result(i,res)
61 fail_count.append(i)
62 self.send_mai.send_main(pass_count,fail_count)
63
64 #将执行判断封装
65 #def get_cookie_run(self,header):
66
67
68 if __name__ == '__main__':
69 run = RunTest()
70 run.go_on_run()
B站2023年最详细的python自动化测试全栈测试开发技术入门到精通教程
相关文章:

【Python+requests+unittest+excel】实现接口自动化测试框架
一、框架结构: 工程目录 二、Case文件设计 三、基础包 base 3.1 封装get/post请求(runmethon.py) 1 import requests2 import json3 class RunMethod:4 def post_main(self,url,data,headerNone):5 res None6 if heade…...

MySQL终端的使用及其数据类型的使用
什么是数据库?数据库(Database)是按照数据结构来组织、存储和管理数据的仓库。每个数据库都有一个或多个不同的 API 用于创建,访问,管理,搜索和复制所保存的数据。我们也可以将数据存储在文件中,…...

长视频终局:一场考验资金储备的消耗战
赢者通吃,似乎已成为各行各业的常识,但事实真的是这样吗?20世纪70年代,石油价格高涨,在墨西哥湾油田拍卖中高价拍得油田的企业,要么亏损,要么收入低于预期,但仍然有无数企业在高价竞…...

javaEE初阶 — CSS 常用的属性
文章目录CSS 常用的属性1 字体属性1.1 设置字体家族 font-family1.2 设置字体大小 font-size1.3 设置字体粗细 font-weight1.4 文字倾斜 font-style2 文本属性2.1 文本颜色2.2 文本对齐2.3 文本装饰2.4 文本缩进2.5 行高3 背景属性3.1 背景颜色3.2 背景图片3.3 背景位置3.4 背景…...

【面试题】如何取消 script 标签发出的请求
大厂面试题分享 面试题库前后端面试题库 (面试必备) 推荐:★★★★★地址:前端面试题库问题之前在业务上有这样一个场景,通过 script 标签动态引入了一个外部资源,具体方式是这样的const script document.…...

蓝桥杯嵌入式(G4系列):RTC时钟
前言: 关于RTC时钟的HAL库配置我也是第一次,之前都是用库函数的写法,这里写下这篇博客来记录一下自己的学习过程。 STM32Cubemx配置: 首先点击左侧的Timers的RTC,勾选以下选项 进入时钟树配置 进入时间设置࿰…...

Linux——进程间通信1
目录 进程间通信目的 进程间通信标准 管道 匿名管道 管道实现进程间通信 管道的特点 进程池 ProcessPool.cc Task.hpp 习题 进程间通信目的 数据传输:一个进程需要将它的数据发送给另一个进程 资源共享:多个进程之间共享同样的资源。 通知事件…...

循环语句——“Python”
各位CSDN的uu们你们好呀,今天小雅兰的内容是Python中的循环语句呀,分为while循环和for循环,下面,让我们进入循环语句的世界吧 循环语句 while循环 for循环 continue和break 循环语句小结 人生重开模拟器 设置初始属性 设置性别…...

Python synonyms查找中文任意词汇的同义词近义词
Python synonyms查找中文任意词汇的同义词近义词 作者:虚坏叔叔 博客:https://xuhss.com 早餐店不会开到晚上,想吃的人早就来了!😄 一、安装 对于非专业的开发人员来说可以简单的使用Python一行代码来找到同义词。这…...
三分钟了解http和https
对应测试人员都会听过http请求和响应.在这里给大家介绍http相关的知识 一.http和https基本概念 HTTP:是互联网上应用最为广泛的一种网络协议,是一个客户端和服务器端请求和应答的标准(TCP),用于从WWW服务器传输超文本…...

docker应用:搭建私有云盘
简介:NextCloud是一个开源的云存储解决方案,可以在自己的服务器上搭建个人云存储系统。它提供了与市面上主流云存储服务(如Dropbox、Google Drive)相似的功能,包括文件存储、共享、同步、协作等。NextCloud的主要优势在…...

【C++进阶】面向对象
程序 编写程序是为了让计算机解决现实生活中的实际问题。pascal之父、结构化程序设计先驱Niklaus Wirth提出程序 算法 数据结构。程序是完成一定功能的一些列有序指令的集合。指令 操作码 指令。将指令按一定的顺序进行整合,就形成了程序。 机器语言与汇编语言…...

从ChatGPT与New Bing看程序员为什么要学习算法?
文章目录为什么要学习数据结构和算法?ChatGPT与NEW Bing 的回答想要通关大厂面试,就不能让数据结构和算法拖了后腿业务开发工程师,你真的愿意做一辈子CRUD boy吗?对编程还有追求?不想被行业淘汰?那就不要只…...

SpringBoot-实用开发篇
SpringBoot开发实用篇开发实用篇中因为牵扯到SpringBoot整合各种各样的技术,所以在整合每一个技术之前,都会做一个快速的普及,这样的话内容整个开发实用篇所包含的内容就会比较多。在学习的时候,如果对某一个技术不是很清楚&#…...

Python进阶-----高阶函数->filter() 函数
目录 前言: filter() 函数介绍 filter() 函数使用示例 1.与循环对比 2.与lambda函数综合使用 3.使用None过滤False 4.过滤字典相关数据 前言: 家人们,当你们获取了一个序列的时候,想要把一些内容去掉,保留一部分…...
C/C++面试可能会问三:指针和数组一样吗?
答案:不一样。 哪里不同? 数组名:数组名的值是一个指针常量,也就是数组第一个元素的地址。 它的类型取决于数组元素的类型:如果他们是int类型,那么数组名的类型就是“指向int的常量指针”;如果…...

数字经济新生态,中小企业如何发展营销数字化
五年弹指一挥间,中国数字经济正从尝试探索迈向快速发展,这一趋势,从今年两会的国务院机构改革、总理政府工作报告、部长通道答疑解惑、科技领域大佬提案中都能看出来。 在政府工作报告中,我们可以看到数字经济在不断壮大ÿ…...

【网络】https协议
🥁作者: 华丞臧. 📕专栏:【网络】 各位读者老爷如果觉得博主写的不错,请诸位多多支持(点赞收藏关注)。如果有错误的地方,欢迎在评论区指出。 推荐一款刷题网站 👉 LeetCode刷题网站 文章…...

【11】SCI易中期刊推荐——计算机方向(中科院4区)
🚀🚀🚀NEW!!!SCI易中期刊推荐栏目来啦 ~ 📚🍀 SCI即《科学引文索引》(Science Citation Index, SCI),是1961年由美国科学信息研究所(Institute for Scientific Information, ISI)创办的文献检索工具,创始人是美国著名情报专家尤金加菲尔德(Eugene Garfield…...

STM32 OTA应用开发——通过串口/RS485实现OTA升级(方式2)
STM32 OTA应用开发——通过串口/RS485实现OTA升级(方式2) 目录STM32 OTA应用开发——通过串口/RS485实现OTA升级(方式2)前言1 环境搭建2 功能描述3 程序编写3.1 BootLoader部分3.2 APP的制作4 修改工程中的内存配置4.1 Bootloader…...
HTML 语义化
目录 HTML 语义化HTML5 新特性HTML 语义化的好处语义化标签的使用场景最佳实践 HTML 语义化 HTML5 新特性 标准答案: 语义化标签: <header>:页头<nav>:导航<main>:主要内容<article>&#x…...
反向工程与模型迁移:打造未来商品详情API的可持续创新体系
在电商行业蓬勃发展的当下,商品详情API作为连接电商平台与开发者、商家及用户的关键纽带,其重要性日益凸显。传统商品详情API主要聚焦于商品基本信息(如名称、价格、库存等)的获取与展示,已难以满足市场对个性化、智能…...
Spring Boot 实现流式响应(兼容 2.7.x)
在实际开发中,我们可能会遇到一些流式数据处理的场景,比如接收来自上游接口的 Server-Sent Events(SSE) 或 流式 JSON 内容,并将其原样中转给前端页面或客户端。这种情况下,传统的 RestTemplate 缓存机制会…...
在rocky linux 9.5上在线安装 docker
前面是指南,后面是日志 sudo dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo dnf install docker-ce docker-ce-cli containerd.io -y docker version sudo systemctl start docker sudo systemctl status docker …...
2024年赣州旅游投资集团社会招聘笔试真
2024年赣州旅游投资集团社会招聘笔试真 题 ( 满 分 1 0 0 分 时 间 1 2 0 分 钟 ) 一、单选题(每题只有一个正确答案,答错、不答或多答均不得分) 1.纪要的特点不包括()。 A.概括重点 B.指导传达 C. 客观纪实 D.有言必录 【答案】: D 2.1864年,()预言了电磁波的存在,并指出…...

视频字幕质量评估的大规模细粒度基准
大家读完觉得有帮助记得关注和点赞!!! 摘要 视频字幕在文本到视频生成任务中起着至关重要的作用,因为它们的质量直接影响所生成视频的语义连贯性和视觉保真度。尽管大型视觉-语言模型(VLMs)在字幕生成方面…...
JDK 17 新特性
#JDK 17 新特性 /**************** 文本块 *****************/ python/scala中早就支持,不稀奇 String json “”" { “name”: “Java”, “version”: 17 } “”"; /**************** Switch 语句 -> 表达式 *****************/ 挺好的ÿ…...

springboot整合VUE之在线教育管理系统简介
可以学习到的技能 学会常用技术栈的使用 独立开发项目 学会前端的开发流程 学会后端的开发流程 学会数据库的设计 学会前后端接口调用方式 学会多模块之间的关联 学会数据的处理 适用人群 在校学生,小白用户,想学习知识的 有点基础,想要通过项…...

【JVM面试篇】高频八股汇总——类加载和类加载器
目录 1. 讲一下类加载过程? 2. Java创建对象的过程? 3. 对象的生命周期? 4. 类加载器有哪些? 5. 双亲委派模型的作用(好处)? 6. 讲一下类的加载和双亲委派原则? 7. 双亲委派模…...
6️⃣Go 语言中的哈希、加密与序列化:通往区块链世界的钥匙
Go 语言中的哈希、加密与序列化:通往区块链世界的钥匙 一、前言:离区块链还有多远? 区块链听起来可能遥不可及,似乎是只有密码学专家和资深工程师才能涉足的领域。但事实上,构建一个区块链的核心并不复杂,尤其当你已经掌握了一门系统编程语言,比如 Go。 要真正理解区…...