前端分页与grid布局
前端分页要将你的goods数组与ElementUI的分页效果联系起来,你需要做以下调整:
首先,根据获取到的商品数据,计算总的商品数量totalGoods,这样可以在分页组件中使用:
12345678data() { return { goods: [], // 商品数据 totalGoods: 0, // 总商品数量 pageSize: 10, // 每页显示的商品数量 currentPage: 1, // 当前页码 };},
在获取商品数据后,更新goods数组并设置totalGoods的值:
123456789101112131415161718methods: { getGoods() { this.$http.get('/queryGoods').then(res => { console.log(res) this.goods = res.data.map(good => ({ goodsDescription: good.goodsDescription, goods ...
上传下载图片
记录一下使用java上传下载图片,图片以http形式存储数据库
首先是存储路径:
123# 文件上传配置upload: directory: D:/code/timeBlank/my-fabric-application-java/src/main/resources/photo
其次是读取路径的配置文件:
123456789101112131415161718package org.chenyi.fabric.config;import org.springframework.boot.context.properties.ConfigurationProperties;import org.springframework.stereotype.Component;@Component@ConfigurationProperties(prefix = "upload")public class UploadProperties { private String directory; public String getDirectory() { retu ...
HTTP状态码
HTTP 状态码当浏览者访问一个网页时,浏览者的浏览器会向网页所在服务器发出请求。当浏览器接收并显示网页前,此网页所在的服务器会返回一个包含 HTTP 状态码的信息头(server header)用以响应浏览器的请求。
HTTP 状态码的英文为 HTTP Status Code。。
下面是常见的 HTTP 状态码:
200 - 请求成功
301 - 资源(网页等)被永久转移到其它URL
404 - 请求的资源(网页等)不存在
500 - 内部服务器错误
HTTP 状态码分类HTTP 状态码由三个十进制数字组成,第一个十进制数字定义了状态码的类型。响应分为五类:信息响应(100–199),成功响应(200–299),重定向(300–399),客户端错误(400–499)和服务器错误 (500–599):
分类
分类描述
1**
信息,服务器收到请求,需要请求者继续执行操作
2**
成功,操作被成功接收并处理
3**
重定向,需要进一步的操作以完成请求
4**
客户端错误,请求包含语法错误或无法完成请求
5**
服务器错误,服务器在处理请求的过程中发生了错误 ...
区块链网关应用
Fabric Gateway SDK 实现Fabric的编程模型,提供了一系列简单的API给应用程序与Fabric区块链网络进行交互
应用程序将各自的网络交互委托给其网关,每个网关都了解网络信道拓扑,包括组织的多个Peer节点和排序节点,使应用程序专注于业务逻辑;Peer节点可以使用gossip协议在组织内部和组织之间相互通信。
Maven依赖12345<dependency> <groupId>org.hyperledger.fabric</groupId> <artifactId>fabric-gateway-java</artifactId> <version>2.2.3</version></dependency>
准备网络证书创建目录 crypto-config 把 orderer 和 peer 节点的证书文件复制进来。
证书文件从 fabric-samples 的 test-network 目录中复制 ordererOrganizations 与 peerOrganiza ...
链码部署
前提条件启动测试网络1./network-myself.sh up
创建通道1./network-myself.sh createChannel
智能合约(链码)pom.xml文件配置远程仓库
1234567891011121314151617181920<repositories> <repository> <id>central</id> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id& ...
自定义createChannel命令
前提条件启动上一步的自定义network网络1./network-myself.sh up
拷贝配置文件以下文件是配置文件及相关脚本文件:
123456mkdir configtx #创建配置文件目录cp ../test-network/configtx/configtx.yaml ./configtx/ #拷贝测试网络中的配置文件,用于创建通道创世区块使用cp ../test-network/scripts/setAnchorPeer.sh ./scripts/ #拷贝测试网络中的配置文件,用于创建通道时设置锚节点使用cp ../test-network/scripts/envVar.sh ./scripts/cp ../test-network/scripts/configUpdate.sh ./scripts/cp ../test-network/scripts/utils.sh ./scripts/
configtx.yaml文件指定新通道的通道配置,configtxgen工具使用configtx.yaml文件中定义的通道配置来创建通道配置,并将其写入protobuf格 ...
自定义network.sh脚本
引言:依据hyperledger fabric提供的测试网络脚本搭建自己的网络环境执行./network.sh up 将调用脚本中networkUp()函数,函数解析如下图所示
创建自己的网络目录进入fabric-samples目录1cd $GOPATH/src/github.com/hyperledger/fabric/scripts/fabric-samples
创建文件夹test-network-myself1mkdir test-network-myself
进入test-network-myself目录1cd test-network-myself
创建并编辑crypto-config.yaml因hyperledger fabri是许可网络,任何节点的网络参与者都需要有证书才可以访问网络,证书是证明能够访问网络的通行证
创建crypto-config.yaml文件1touch crypto-config.yaml
编辑crypto-config.yaml文件1vim crypto-config.yaml
文件中创建2个peer节点,一个order排序节点,两个 ...
jmeter非GUI模式
jmeter非gui使用模式1、JMeter的非GUI模式说明之前,我们在启动JMeter时,一直会有一个黑色命令行窗口,窗口中提示了如下的信息:
123456789101112propertiesJun 05, 2021 10:21:22 AM java.util.prefs.WindowsPreferences <init>WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.================================================================================Don't use GUI mode for load testing !, only for Test creation and Test debugging.For load testing, use NON G ...
Hello World
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick StartCreate a new post
1$ hexo new "My New Post"
More info: Writing
Run server1$ hexo server
More info: Server
Generate static files1$ hexo generate
More info: Generating
Deploy to remote sites1$ hexo deploy
More info: Deployment
unittest单元测试框架
unittest单元测试框架unittest基本简介unittest是Python自带的一个单元测试框架,unittest又被称为PyUnit,是由Java的JUnit衍生而来,基本结构是类似的。对于单元测试,需要设置预先条件,对比预期结果和实际结果。由于unittest是Python自带的标准模块,所以不需要单独再去安装。引入包import unittest即可使用。
unittest基本概念unittest核心的四个概念test fixture:fixture表示test case运行前需要做的准备工作以及结束后的清理工作。比如,创建临时/代理数据库、目录或启动一个浏览器进程。
test case:test case是单元测试中的最小个体,通常是使用assert方法(断言)检查动作和输入的响应。unittest提供了一个基础类TestCase,一般是基于TestCase类进行扩充,来创建test case测试用例。
test suite:test suite(套件)是test case的合集,通常用test suite将test case按需求汇总后,统一执行。(批量执行用例)
t ...