Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bwallet
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
Go
bwallet
Commits
8d341a91
Commit
8d341a91
authored
Jul 06, 2022
by
shajiaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/optimize' into 'master'
托管手续费增加对应币种 See merge request
!83
parents
6c060f28
c9cdcda6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
12 deletions
+20
-12
fee.go
models/fee.go
+6
-4
fee.go
routers/api/backend/fee.go
+1
-0
recommend_coin.go
routers/api/backend/recommend_coin.go
+5
-4
fee.go
service/fee_service/fee.go
+7
-4
fee.go
validate_service/fee.go
+1
-0
No files found.
models/fee.go
View file @
8d341a91
...
@@ -15,6 +15,7 @@ type Fee struct {
...
@@ -15,6 +15,7 @@ type Fee struct {
Fees
float32
`json:"fees"`
Fees
float32
`json:"fees"`
TransactionFees
float32
`json:"transaction_fees"`
TransactionFees
float32
`json:"transaction_fees"`
CoinName
string
`json:"coin_name"`
CoinName
string
`json:"coin_name"`
TargetCoinName
string
`json:"target_coin_name"`
TransferType
uint8
`json:"transfer_type"`
TransferType
uint8
`json:"transfer_type"`
CoinInfo
*
Coin
`gorm:"foreignkey:Cid" json:"coin,omitempty"`
CoinInfo
*
Coin
`gorm:"foreignkey:Cid" json:"coin,omitempty"`
...
@@ -77,10 +78,11 @@ func GetFees(pageNum, pageSize int, maps interface{}) ([]*Fee, error) {
...
@@ -77,10 +78,11 @@ func GetFees(pageNum, pageSize int, maps interface{}) ([]*Fee, error) {
func
AddFee
(
data
map
[
string
]
interface
{})
(
error
)
{
func
AddFee
(
data
map
[
string
]
interface
{})
(
error
)
{
fee
:=
Fee
{
fee
:=
Fee
{
Cid
:
data
[
"cid"
]
.
(
int
),
Cid
:
data
[
"cid"
]
.
(
int
),
PlatformId
:
data
[
"platform_id"
]
.
(
int
),
PlatformId
:
data
[
"platform_id"
]
.
(
int
),
CoinName
:
data
[
"coin_name"
]
.
(
string
),
CoinName
:
data
[
"coin_name"
]
.
(
string
),
TransferType
:
data
[
"transfer_type"
]
.
(
uint8
),
TargetCoinName
:
data
[
"target_coin_name"
]
.
(
string
),
TransferType
:
data
[
"transfer_type"
]
.
(
uint8
),
}
}
if
err
:=
db
.
Create
(
&
fee
)
.
Error
;
err
!=
nil
{
if
err
:=
db
.
Create
(
&
fee
)
.
Error
;
err
!=
nil
{
return
err
return
err
...
...
routers/api/backend/fee.go
View file @
8d341a91
...
@@ -104,6 +104,7 @@ func EditTransactionFees(c *gin.Context) {
...
@@ -104,6 +104,7 @@ func EditTransactionFees(c *gin.Context) {
feeService
:=
fee_service
.
Fee
{
feeService
:=
fee_service
.
Fee
{
Id
:
fee
.
Id
,
Id
:
fee
.
Id
,
Fees
:
fee
.
Fees
,
Fees
:
fee
.
Fees
,
TargetCoinName
:
fee
.
TargetCoinName
,
FeesType
:
fee
.
FeesType
,
FeesType
:
fee
.
FeesType
,
TransactionFees
:
fee
.
TransactionFees
,
TransactionFees
:
fee
.
TransactionFees
,
}
}
...
...
routers/api/backend/recommend_coin.go
View file @
8d341a91
...
@@ -135,10 +135,11 @@ func AddRecommendCoin(c *gin.Context) {
...
@@ -135,10 +135,11 @@ func AddRecommendCoin(c *gin.Context) {
coin
,
_
:=
coinService
.
Get
()
coin
,
_
:=
coinService
.
Get
()
feeService
:=
fee_service
.
Fee
{
feeService
:=
fee_service
.
Fee
{
Cid
:
coin_id
,
Cid
:
coin_id
,
PlatformId
:
platform_id
,
PlatformId
:
platform_id
,
CoinName
:
coin
.
Name
,
CoinName
:
coin
.
Name
,
TransferType
:
uint8
(
i
),
TargetCoinName
:
coin
.
Name
,
TransferType
:
uint8
(
i
),
}
}
feeService
.
Add
()
feeService
.
Add
()
...
...
service/fee_service/fee.go
View file @
8d341a91
...
@@ -12,6 +12,7 @@ type Fee struct {
...
@@ -12,6 +12,7 @@ type Fee struct {
Fees
float32
Fees
float32
TransactionFees
float32
TransactionFees
float32
CoinName
string
CoinName
string
TargetCoinName
string
TransferType
uint8
TransferType
uint8
PageNum
int
PageNum
int
...
@@ -41,10 +42,11 @@ func (c *Fee) GetAll() ([]*models.Fee, error) {
...
@@ -41,10 +42,11 @@ func (c *Fee) GetAll() ([]*models.Fee, error) {
func
(
c
*
Fee
)
Add
()
error
{
func
(
c
*
Fee
)
Add
()
error
{
fee
:=
map
[
string
]
interface
{}{
fee
:=
map
[
string
]
interface
{}{
"cid"
:
c
.
Cid
,
"cid"
:
c
.
Cid
,
"platform_id"
:
c
.
PlatformId
,
"platform_id"
:
c
.
PlatformId
,
"coin_name"
:
c
.
CoinName
,
"coin_name"
:
c
.
CoinName
,
"transfer_type"
:
c
.
TransferType
,
"target_coin_name"
:
c
.
TargetCoinName
,
"transfer_type"
:
c
.
TransferType
,
}
}
if
err
:=
models
.
AddFee
(
fee
);
err
!=
nil
{
if
err
:=
models
.
AddFee
(
fee
);
err
!=
nil
{
...
@@ -58,6 +60,7 @@ func (c *Fee) Edit() error {
...
@@ -58,6 +60,7 @@ func (c *Fee) Edit() error {
return
models
.
EditFee
(
c
.
Id
,
map
[
string
]
interface
{}{
return
models
.
EditFee
(
c
.
Id
,
map
[
string
]
interface
{}{
"fees_type"
:
c
.
FeesType
,
"fees_type"
:
c
.
FeesType
,
"fees"
:
c
.
Fees
,
"fees"
:
c
.
Fees
,
"target_coin_name"
:
c
.
TargetCoinName
,
"transaction_fees"
:
c
.
TransactionFees
,
"transaction_fees"
:
c
.
TransactionFees
,
})
})
}
}
...
...
validate_service/fee.go
View file @
8d341a91
...
@@ -11,6 +11,7 @@ type Fee struct {
...
@@ -11,6 +11,7 @@ type Fee struct {
type
EditFee
struct
{
type
EditFee
struct
{
Id
int
`json:"id" validate:"required"`
Id
int
`json:"id" validate:"required"`
FeesType
uint8
`json:"fees_type" validate:"omitempty"`
FeesType
uint8
`json:"fees_type" validate:"omitempty"`
TargetCoinName
string
`json:"target_coin_name" validate:"omitempty"`
Fees
float32
`json:"fees" validate:"omitempty"`
Fees
float32
`json:"fees" validate:"omitempty"`
TransactionFees
float32
`json:"transaction_fees" validate:"omitempty"`
TransactionFees
float32
`json:"transaction_fees" validate:"omitempty"`
}
}
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