git commit -m "第一版,默认zookeeper启动在127.0.0.1:2187上,提供/api/kv/的一个put、一个get接口#6
Open
huang-juanjuan wants to merge 2 commits into
Open
git commit -m "第一版,默认zookeeper启动在127.0.0.1:2187上,提供/api/kv/的一个put、一个get接口#6huang-juanjuan wants to merge 2 commits into
huang-juanjuan wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
测试在本地,假定zookeeper启动在127.0.0.1:2181, dkv-server为自用测试类
启动\distributedKeyValue\dkv-client\src\main\java\com\dkv\dkvclient\DkvClientApplication.java
client运行在8081(application.properties修改)
启动后在127.0.0.1:8081提供两个接口
post:
curl -X POST http://localhost:8081/api/kv/name -H "Content-Type: application/json" -d '{"value":"huangtianyu"}'
设name对应的value为指定值
get:
curl http://localhost:8081/api/kv/name
获取name对应的值