Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
cb6c3cf1
Commit
cb6c3cf1
authored
Jan 25, 2021
by
jiangpeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dapp/vote:update doc
parent
545b3d75
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
129 additions
and
68 deletions
+129
-68
vote.proto
plugin/dapp/vote/proto/vote.proto
+22
-23
readme.md
plugin/dapp/vote/readme.md
+107
-45
No files found.
plugin/dapp/vote/proto/vote.proto
View file @
cb6c3cf1
...
...
@@ -10,8 +10,8 @@ message VoteAction {
UpdateGroup
updateGroup
=
3
;
//更新组成员
CreateVote
createVote
=
4
;
//创建一个投票
CommitVote
commitVote
=
5
;
//组员提交投票
CloseVote
closeVote
=
6
;
UpdateMember
updateMember
=
7
;
CloseVote
closeVote
=
6
;
//关闭投票
UpdateMember
updateMember
=
7
;
//更新用户信息
}
}
...
...
@@ -25,7 +25,7 @@ message CreateGroup {
string
name
=
1
;
//投票组名称
repeated
string
admins
=
2
;
//管理员地址列表
repeated
GroupMember
members
=
3
;
//组员
string
description
=
4
;
string
description
=
4
;
//描述
}
//更新投票组
...
...
@@ -33,8 +33,8 @@ message UpdateGroup {
string
groupID
=
1
;
//投票组ID
repeated
GroupMember
addMembers
=
2
;
//需要增加的组成员
repeated
string
removeMembers
=
3
;
//删除组成员的地址列表
repeated
string
addAdmins
=
4
;
repeated
string
removeAdmins
=
5
;
repeated
string
addAdmins
=
4
;
//增加管理员
repeated
string
removeAdmins
=
5
;
//删除管理员
}
// 投票组信息
...
...
@@ -46,7 +46,7 @@ message GroupInfo {
string
creator
=
4
;
//创建者
repeated
string
admins
=
5
;
//管理员列表
repeated
GroupMember
members
=
6
;
//成员列表
string
description
=
7
;
string
description
=
7
;
//描述信息
}
message
GroupInfos
{
...
...
@@ -62,11 +62,11 @@ message VoteOption {
// 创建投票交易,请求结构
message
CreateVote
{
string
name
=
1
;
//投票名称
string
groupID
=
2
;
//投票关联组
列表
string
groupID
=
2
;
//投票关联组
repeated
string
voteOptions
=
3
;
//投票选项列表
int64
beginTimestamp
=
4
;
//投票开始时间戳
int64
endTimestamp
=
5
;
//投票结束时间戳
string
description
=
6
;
string
description
=
6
;
//描述信息
}
// 创建提交投票交易,请求结构
...
...
@@ -76,16 +76,16 @@ message CommitVote {
}
message
CommitInfo
{
string
addr
=
1
;
string
txHash
=
2
;
string
addr
=
1
;
//提交地址
string
txHash
=
2
;
//提交交易哈希
}
message
CloseVote
{
string
voteID
=
1
;
string
voteID
=
1
;
// 投票ID
}
message
UpdateMember
{
string
name
=
1
;
string
name
=
1
;
//用户名称
}
//投票信息
...
...
@@ -99,8 +99,8 @@ message VoteInfo {
int64
beginTimestamp
=
6
;
//投票开始时间戳
int64
endTimestamp
=
7
;
//投票结束时间戳
repeated
CommitInfo
commitInfos
=
8
;
//已投票的提交信息
string
description
=
9
;
uint32
status
=
10
;
string
description
=
9
;
//描述信息
uint32
status
=
10
;
//状态,0正常,1关闭
}
message
VoteInfos
{
...
...
@@ -109,7 +109,7 @@ message VoteInfos {
message
MemberInfo
{
string
addr
=
1
;
//地址
string
name
=
2
;
string
name
=
2
;
//用户名称
repeated
string
groupIDs
=
3
;
//所属投票组的ID列表
}
...
...
@@ -118,7 +118,7 @@ message MemberInfos {
}
message
ReqStrings
{
repeated
string
items
=
1
;
repeated
string
items
=
1
;
//请求项数组
}
//列表请求结构
...
...
@@ -129,14 +129,13 @@ message ReqListItem {
}
message
ReqListVote
{
string
groupID
=
1
;
ReqListItem
listReq
=
2
;
string
groupID
=
1
;
//所属组ID
ReqListItem
listReq
=
2
;
//列表请求
}
message
ReplyVoteList
{
repeated
VoteInfo
pendingList
=
1
;
repeated
VoteInfo
ongoingList
=
2
;
repeated
VoteInfo
finishedList
=
3
;
repeated
VoteInfo
closedList
=
4
;
repeated
VoteInfo
pendingList
=
1
;
//即将开始投票列表
repeated
VoteInfo
ongoingList
=
2
;
//正在进行投票列表
repeated
VoteInfo
finishedList
=
3
;
//已经完成投票列表
repeated
VoteInfo
closedList
=
4
;
//已经关闭投票列表
}
plugin/dapp/vote/readme.md
View file @
cb6c3cf1
...
...
@@ -21,6 +21,7 @@ message CreateGroup {
string
name
=
1
;
//投票组名称
repeated
string
admins
=
2
;
//管理员地址列表
repeated
GroupMember
members
=
3
;
//组员
string
description
=
4
;
//描述
}
message
GroupMember
{
...
...
@@ -42,19 +43,25 @@ message GroupInfo {
string
creator
=
4
;
//创建者
repeated
string
admins
=
5
;
//管理员列表
repeated
GroupMember
members
=
6
;
//成员列表
string
description
=
7
;
//描述信息
}
```
##### 创建交易示例
#### 更新投票组成员
指定投票组ID,并由管理员添加或删除组成员
#### 更新投票组
指定投票组ID,并由管理员添加或删除组成员、管理员
##### 交易请求
```
proto
message
Update
Member
{
message
Update
Group
{
string
groupID
=
1
;
//投票组ID
repeated
GroupMember
addMembers
=
2
;
//需要增加的组成员
repeated
string
removeMemberAddrs
=
3
;
//删除组成员的地址列表
repeated
string
removeMembers
=
3
;
//删除组成员的地址列表
repeated
string
addAdmins
=
4
;
//增加管理员
repeated
string
removeAdmins
=
5
;
//删除管理员
}
```
##### 交易回执
...
...
@@ -69,12 +76,14 @@ message GroupInfo {
string
creator
=
4
;
//创建者
repeated
string
admins
=
5
;
//管理员列表
repeated
GroupMember
members
=
6
;
//成员列表
string
description
=
7
;
//描述信息
}
```
#### 创建投票
-
由管理员发起
-
设定投票名称,投票选项,关联投票组ID
-
关联投票组,即只有这些投票组的成员进行投票
-
投票ID在交易执行后生成
...
...
@@ -85,10 +94,11 @@ message GroupInfo {
// 创建投票交易,请求结构
message
CreateVote
{
string
name
=
1
;
//投票名称
repeated
string
voteGroups
=
2
;
//投票关联组列表
string
groupID
=
2
;
//投票关联组
repeated
string
voteOptions
=
3
;
//投票选项列表
int64
beginTimestamp
=
4
;
//投票开始时间戳
int64
endTimestamp
=
5
;
//投票结束时间戳
string
description
=
6
;
//描述信息
}
```
...
...
@@ -101,12 +111,14 @@ message VoteInfo {
string
ID
=
1
;
//投票ID
string
name
=
2
;
//投票名称
string
creator
=
3
;
//投票
创建者
repeated
string
voteGroups
=
4
;
//投票关联的投票组
string
creator
=
3
;
//
创建者
string
groupID
=
4
;
//投票关联的投票组
repeated
VoteOption
voteOptions
=
5
;
//投票的选项
int64
beginTimestamp
=
6
;
//投票开始时间戳
int64
endTimestamp
=
7
;
//投票结束时间戳
repeated
string
votedMembers
=
8
;
//已投票的成员
repeated
CommitInfo
commitInfos
=
8
;
//已投票的提交信息
string
description
=
9
;
//描述信息
uint32
status
=
10
;
//状态,0正常,1关闭
}
//投票选项
...
...
@@ -127,8 +139,7 @@ message VoteOption {
// 创建提交投票交易,请求结构
message
CommitVote
{
string
voteID
=
1
;
//投票ID
string
groupID
=
2
;
//所属投票组ID
uint32
optionIndex
=
3
;
//投票选项数组下标,下标对应投票内容
uint32
optionIndex
=
2
;
//投票选项数组下标,下标对应投票内容
}
```
...
...
@@ -137,16 +148,61 @@ message CommitVote {
```
proto
//投票信息
message
CommitInfo
{
string
addr
=
1
;
//提交地址
string
txHash
=
2
;
//提交交易哈希
}
```
#### 关闭投票
-
由管理员发起,将指定投票关闭
##### 交易请求
```
proto
message
CloseVote
{
string
voteID
=
1
;
// 投票ID
}
```
##### 交易回执
```
proto
message
VoteInfo
{
string
ID
=
1
;
//投票ID
string
name
=
2
;
//投票名称
string
creator
=
3
;
//投票
创建者
repeated
string
voteGroups
=
4
;
//投票关联的投票组
string
creator
=
3
;
//
创建者
string
groupID
=
4
;
//投票关联的投票组
repeated
VoteOption
voteOptions
=
5
;
//投票的选项
int64
beginTimestamp
=
6
;
//投票开始时间戳
int64
endTimestamp
=
7
;
//投票结束时间戳
repeated
string
votedMembers
=
8
;
//已投票的成员
repeated
CommitInfo
commitInfos
=
8
;
//已投票的提交信息
string
description
=
9
;
//描述信息
uint32
status
=
10
;
//状态,0正常,1关闭
}
```
#### 更新用户信息
-
目前仅支持用户更新名称信息
##### 交易请求
```
proto
message
UpdateMember
{
string
name
=
1
;
//用户名称
}
```
##### 交易回执
```
proto
message
MemberInfo
{
string
addr
=
1
;
//地址
string
name
=
2
;
//用户名称
repeated
string
groupIDs
=
3
;
//所属投票组的ID列表
}
```
...
...
@@ -155,66 +211,64 @@ message VoteInfo {
以下功能为本地查询,无需创建交易
#### 获取组信息
根据投票组ID查询组信息
根据投票组ID查询组信息
,支持多个同时查询
##### 请求结构
```
proto
message
ReqString
{
string
Data
=
1
;
message
ReqString
s
{
repeated
string
items
=
1
;
//请求项数组
}
```
##### 响应结构
```
proto
message
GroupVoteInfo
{
GroupInfo
groupInfo
=
1
;
// 投票组信息
repeated
string
voteIDs
=
2
;
//投票组关联的投票ID信息
message
GroupInfos
{
repeated
GroupInfo
groupList
=
1
;
//投票组信息列表
}
```
#### 获取投票信息
根据投票ID查询投票信息
根据投票ID查询投票信息
,支持多个同时查询
##### 请求结构
```
proto
message
ReqString
{
string
Data
=
1
;
message
ReqString
s
{
repeated
string
items
=
1
;
//请求项数组
}
```
##### 响应结构
```
proto
message
VoteInfo
{
string
ID
=
1
;
//投票ID
string
name
=
2
;
//投票名称
string
creator
=
3
;
//投票创建者
repeated
string
voteGroups
=
4
;
//投票关联的投票组
repeated
VoteOption
voteOptions
=
5
;
//投票的选项
int64
beginTimestamp
=
6
;
//投票开始时间戳
int64
endTimestamp
=
7
;
//投票结束时间戳
repeated
string
votedMembers
=
8
;
//已投票的成员
message
ReplyVoteList
{
repeated
VoteInfo
pendingList
=
1
;
//即将开始投票列表
repeated
VoteInfo
ongoingList
=
2
;
//正在进行投票列表
repeated
VoteInfo
finishedList
=
3
;
//已经完成投票列表
repeated
VoteInfo
closedList
=
4
;
//已经关闭投票列表
}
```
#### 获取成员信息
根据成员地址,查询成员信息
获取用户信息,支持多个同时查询
##### 请求结构
```
proto
message
ReqString
{
string
Data
=
1
;
message
ReqString
s
{
repeated
string
items
=
1
;
//请求项数组
}
```
##### 响应结构
```
proto
message
MemberInfos
{
repeated
MemberInfo
memberList
=
1
;
//投票组成员信息列表
}
message
MemberInfo
{
string
addr
=
1
;
//地址
repeated
string
groupIDs
=
2
;
//所属投票组的ID列表
string
name
=
2
;
//用户名称
repeated
string
groupIDs
=
3
;
//所属投票组的ID列表
}
```
...
...
@@ -225,15 +279,15 @@ message MemberInfo {
//列表请求结构
message
ReqListItem
{
string
startItemID
=
1
;
//列表开始的ID,如请求组列表即groupID,不包含在结果中
int32
count
=
2
;
//
请求列表项
数量
int32
count
=
2
;
//
列表项单次请求
数量
int32
direction
=
3
;
// 0表示根据ID降序,1表示升序
}
```
##### 响应结构
```
proto
message
Group
Vote
Infos
{
repeated
Group
Vote
Info
groupList
=
1
;
//投票组信息列表
message
GroupInfos
{
repeated
GroupInfo
groupList
=
1
;
//投票组信息列表
}
```
...
...
@@ -242,21 +296,29 @@ message GroupVoteInfos {
##### 请求结构
```
proto
//列表请求结构
message
ReqListVote
{
string
groupID
=
1
;
//所属组ID
ReqListItem
listReq
=
2
;
//列表请求
}
message
ReqListItem
{
string
startItemID
=
1
;
//列表开始的ID,如请求组列表即groupID,不包含在结果中
int32
count
=
2
;
//
请求列表项
数量
int32
count
=
2
;
//
列表项单次请求
数量
int32
direction
=
3
;
// 0表示根据ID降序,1表示升序
}
```
##### 响应结构
```
proto
message
VoteInfos
{
repeated
VoteInfo
voteList
=
1
;
//投票信息列表
message
ReplyVoteList
{
repeated
VoteInfo
pendingList
=
1
;
//即将开始投票列表
repeated
VoteInfo
ongoingList
=
2
;
//正在进行投票列表
repeated
VoteInfo
finishedList
=
3
;
//已经完成投票列表
repeated
VoteInfo
closedList
=
4
;
//已经关闭投票列表
}
```
#### 获取
投票组成员
列表
#### 获取
用户
列表
##### 请求结构
...
...
@@ -264,7 +326,7 @@ message VoteInfos {
//列表请求结构
message
ReqListItem
{
string
startItemID
=
1
;
//列表开始的ID,如请求组列表即groupID,不包含在结果中
int32
count
=
2
;
//
请求列表项
数量
int32
count
=
2
;
//
列表项单次请求
数量
int32
direction
=
3
;
// 0表示根据ID降序,1表示升序
}
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment