Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nft-event
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
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
duanjinfei
nft-event
Commits
54459255
Commit
54459255
authored
Jun 16, 2023
by
duanjinfei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test'
parents
3b7f13bd
cfdb342d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
LotteryController.go
controllers/LotteryController.go
+2
-2
util.go
utils/util.go
+4
-3
No files found.
controllers/LotteryController.go
View file @
54459255
...
@@ -143,7 +143,7 @@ func (c *LotteryController) ForwardReq() {
...
@@ -143,7 +143,7 @@ func (c *LotteryController) ForwardReq() {
return
return
}
}
uri
:=
""
uri
:=
""
if
utils
.
TokenUriMap
[
nftAddr
]
==
""
{
if
utils
.
TokenUriMap
[
utils
.
HexToAddr
(
nftAddr
)
]
==
""
{
uri
,
err
=
erc721
.
TokenURI
(
&
bind
.
CallOpts
{},
idBigInt
)
uri
,
err
=
erc721
.
TokenURI
(
&
bind
.
CallOpts
{},
idBigInt
)
if
err
!=
nil
||
uri
==
""
{
if
err
!=
nil
||
uri
==
""
{
c
.
ResponseInfo
(
500
,
models
.
FAILED
,
nil
)
c
.
ResponseInfo
(
500
,
models
.
FAILED
,
nil
)
...
@@ -153,7 +153,7 @@ func (c *LotteryController) ForwardReq() {
...
@@ -153,7 +153,7 @@ func (c *LotteryController) ForwardReq() {
uri
=
beego
.
AppConfig
.
String
(
"beforeEndReqUrl"
)
+
uri
[
7
:
]
uri
=
beego
.
AppConfig
.
String
(
"beforeEndReqUrl"
)
+
uri
[
7
:
]
}
}
}
else
{
}
else
{
uri
=
utils
.
TokenUriMap
[
nftAddr
]
+
id
uri
=
utils
.
TokenUriMap
[
utils
.
HexToAddr
(
nftAddr
)
]
+
id
}
}
client
:=
&
http
.
Client
{}
client
:=
&
http
.
Client
{}
req
,
err
:=
http
.
NewRequest
(
"GET"
,
uri
,
nil
)
req
,
err
:=
http
.
NewRequest
(
"GET"
,
uri
,
nil
)
...
...
utils/util.go
View file @
54459255
...
@@ -12,11 +12,12 @@ import (
...
@@ -12,11 +12,12 @@ import (
"regexp"
"regexp"
)
)
var
TokenUriMap
map
[
string
]
string
var
TokenUriMap
map
[
common
.
Address
]
string
func
init
()
{
func
init
()
{
TokenUriMap
=
make
(
map
[
string
]
string
,
0
)
TokenUriMap
=
make
(
map
[
common
.
Address
]
string
,
0
)
TokenUriMap
[
"0x23581767a106ae21c074b2276D25e5C3e136a68b"
]
=
"https://live---metadata-5covpqijaa-uc.a.run.app/metadata/"
nftAddr1
:=
common
.
HexToAddress
(
"0x23581767a106ae21c074b2276D25e5C3e136a68b"
)
TokenUriMap
[
nftAddr1
]
=
"https://live---metadata-5covpqijaa-uc.a.run.app/metadata/"
}
}
func
IsAddress
(
params
...
string
)
bool
{
func
IsAddress
(
params
...
string
)
bool
{
...
...
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