| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package admin
- import (
- "app/commons/constant"
- "github.com/gin-gonic/gin"
- "github.com/shopspring/decimal"
- )
- func (s *Server) AssetConfig(ctx *gin.Context) {
- c := s.FromContext(ctx)
- type Request struct {
- WithdrawStatus bool `json:"withdrawStatus" gorm:"type:tinyint;default:false;comment:是否允许提现(全局):0=禁止,1=允许"`
- WithdrawNoauditLimit decimal.Decimal `json:"withdrawNoauditLimit" gorm:"default:0;type:decimal(25,8);comment:提现免审额度,0表示都需要审核"`
- MinWithdrawAmount decimal.Decimal `json:"minWithdrawAmount" gorm:"default:0;type:decimal(25,8);comment:提现最小限额,0表示无限制"`
- MaxWithdrawAmount decimal.Decimal `json:"maxWithdrawAmount" gorm:"default:0;type:decimal(25,8);comment:每笔提现最大限额,-1表示无限制,0表示不能提现"`
- WithdrawRatio decimal.Decimal `json:"withdrawRatio" gorm:"type:decimal(25,8);comment:提现手续费比例"`
- WithdrawAmount decimal.Decimal `json:"withdrawAmount" gorm:"type:decimal(25,8);comment:单次提现手续费数量"`
- }
- req := new(Request)
- if err := c.ShouldBindJSON(&req); err != nil {
- c.Resp(constant.ErrorParams)
- return
- }
- //sysConfig, err := s.GetWithdrawConfig()
- //if err != nil {
- // c.Resp(err.Error())
- // return
- //}
- //if req.WithdrawRatio.LessThan(decimal.Zero) {
- // c.Resp("最小提现手续费不能小于0")
- // return
- //}
- //if req.MinWithdrawAmount.LessThan(decimal.Zero) {
- // c.Resp("最小提现数量不能小于0")
- // return
- //}
- //if req.MaxWithdrawAmount.LessThan(decimal.Zero) {
- // c.Resp("最大提现数量不能小于0")
- // return
- //}
- //if req.WithdrawAmount.LessThan(decimal.Zero) {
- // c.Resp("最小提现手续费不能小于0")
- // return
- //}
- c.Resp(nil)
- }
|