Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
chain33_sdk
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
harrylee2015
chain33_sdk
Commits
031fc8ab
Commit
031fc8ab
authored
May 26, 2018
by
lihailei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add orgCreateTime.
parent
c8a804dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
contract.go
src/controllers/contract.go
+11
-1
No files found.
src/controllers/contract.go
View file @
031fc8ab
...
@@ -12,6 +12,14 @@ import (
...
@@ -12,6 +12,14 @@ import (
blacklist
"gitlab.33.cn/lihailei/chain33_sdk/src/models/contract/blacklist/types"
blacklist
"gitlab.33.cn/lihailei/chain33_sdk/src/models/contract/blacklist/types"
"net/http"
"net/http"
"time"
)
var
(
initialCredit
int64
=
1e8
layout
=
"2006-01-02 15:04:05.000"
date
=
"20060102150405.000"
loc
*
time
.
Location
)
)
// ContractController operations for Peer
// ContractController operations for Peer
...
@@ -34,7 +42,9 @@ func (c *ContractController) Invoke() {
...
@@ -34,7 +42,9 @@ func (c *ContractController) Invoke() {
if
c
.
Ctx
.
Request
.
Method
==
http
.
MethodPost
&&
funcName
==
blacklist
.
FuncName_CreateOrg
{
if
c
.
Ctx
.
Request
.
Method
==
http
.
MethodPost
&&
funcName
==
blacklist
.
FuncName_CreateOrg
{
var
org
blacklist
.
Org
var
org
blacklist
.
Org
json
.
Unmarshal
(
c
.
Ctx
.
Input
.
RequestBody
,
&
org
)
json
.
Unmarshal
(
c
.
Ctx
.
Input
.
RequestBody
,
&
org
)
org
.
OrgAddr
=
GetMd5String
(
UniqueId
())
org
.
OrgAddr
=
GetMd5String
(
UniqueId
())
org
.
CreateTime
=
time
.
Now
()
.
In
(
loc
)
.
Format
(
layout
)
org
.
UpdateTime
=
time
.
Now
()
.
In
(
loc
)
.
Format
(
layout
)
action
:=
&
blacklist
.
BlackAction
{
Value
:
&
blacklist
.
BlackAction_Or
{
&
org
},
FuncName
:
blacklist
.
FuncName_CreateOrg
}
action
:=
&
blacklist
.
BlackAction
{
Value
:
&
blacklist
.
BlackAction_Or
{
&
org
},
FuncName
:
blacklist
.
FuncName_CreateOrg
}
addr
,
priv
:=
Genaddress
()
addr
,
priv
:=
Genaddress
()
tx
:=
&
types
.
Transaction
{
Execer
:
[]
byte
(
"user.blacklist"
),
Payload
:
types
.
Encode
(
action
),
Fee
:
1e6
,
To
:
addr
}
tx
:=
&
types
.
Transaction
{
Execer
:
[]
byte
(
"user.blacklist"
),
Payload
:
types
.
Encode
(
action
),
Fee
:
1e6
,
To
:
addr
}
...
...
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