添加 交易相关的处理
This commit is contained in:
@@ -304,8 +304,6 @@ func AccountRegisterEmailCode(ctx *ActionContext[AccountRegisterEmailCodeParam])
|
||||
// old_password: string;
|
||||
// token?: string;
|
||||
func MemberAlterPassword(ctx *ActionContext[MemberAlterPasswordParam]) (resp *basic.Response) {
|
||||
// ctx.ShouldBind()
|
||||
log.Println()
|
||||
return resp.Success()
|
||||
}
|
||||
|
||||
|
||||
43
server/app/internal/handlers/actions/securities.go
Normal file
43
server/app/internal/handlers/actions/securities.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package actions
|
||||
|
||||
import "github.com/iapologizewhenimwrong/Vestmore_GO/utils/basic"
|
||||
|
||||
// @Action securities/account
|
||||
// SecuritiesAccount
|
||||
// market: string;
|
||||
// randstr: string;
|
||||
// sign: string;
|
||||
// action: string;
|
||||
// app_market: int64;
|
||||
// timestamp: int64;
|
||||
// token: string;
|
||||
func SecuritiesAccount(ctx *ActionContext[SecuritiesAccountParam]) (resp *basic.Response) {
|
||||
|
||||
return resp.Success()
|
||||
}
|
||||
|
||||
// @Action securities/currency
|
||||
// SecuritiesCurrency
|
||||
// randstr: string;
|
||||
// sign: string;
|
||||
// action: string;
|
||||
// app_market: int64;
|
||||
// timestamp: int64;
|
||||
// token: string;
|
||||
func SecuritiesCurrency(ctx *ActionContext[SecuritiesCurrencyParam]) (resp *basic.Response) {
|
||||
|
||||
return resp.Success()
|
||||
}
|
||||
|
||||
// @Action securities/capital
|
||||
// SecuritiesCapital
|
||||
// randstr: string;
|
||||
// sign: string;
|
||||
// action: string;
|
||||
// app_market: int64;
|
||||
// timestamp: int64;
|
||||
// token: string;
|
||||
func SecuritiesCapital(ctx *ActionContext[SecuritiesCapitalParam]) (resp *basic.Response) {
|
||||
|
||||
return resp.Success()
|
||||
}
|
||||
@@ -53,6 +53,12 @@ func init() {
|
||||
HandlersFuncRoutes["base/getToken"] = BaseGetTokenHandler
|
||||
// func MemberAlterPassword(ctx *gin.Context, param *MemberAlterPasswordParam) (resp *basic.Response)
|
||||
HandlersFuncRoutes["member/alterPassword"] = MemberAlterPasswordHandler
|
||||
// func SecuritiesAccount(ctx *gin.Context, param *SecuritiesAccountParam) (resp *basic.Response)
|
||||
HandlersFuncRoutes["securities/account"] = SecuritiesAccountHandler
|
||||
// func SecuritiesCapital(ctx *gin.Context, param *SecuritiesCapitalParam) (resp *basic.Response)
|
||||
HandlersFuncRoutes["securities/capital"] = SecuritiesCapitalHandler
|
||||
// func SecuritiesCurrency(ctx *gin.Context, param *SecuritiesCurrencyParam) (resp *basic.Response)
|
||||
HandlersFuncRoutes["securities/currency"] = SecuritiesCurrencyHandler
|
||||
}
|
||||
|
||||
type AccountForgetSmsCodeParam struct {
|
||||
@@ -299,3 +305,106 @@ func MemberAlterPasswordHandler(ctx *gin.Context) {
|
||||
}
|
||||
ctx.JSON(200, resp)
|
||||
}
|
||||
|
||||
type SecuritiesAccountParam struct {
|
||||
Market string `json:"market" form:"market" binding:"-"`
|
||||
Randstr string `json:"randstr" form:"randstr" binding:"-"`
|
||||
Sign string `json:"sign" form:"sign" binding:"-"`
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
AppMarket int64 `json:"app_market" form:"app_market" binding:"-"`
|
||||
Timestamp int64 `json:"timestamp" form:"timestamp" binding:"-"`
|
||||
Token string `json:"token" form:"token" binding:"-"`
|
||||
}
|
||||
|
||||
func SecuritiesAccountHandler(ctx *gin.Context) {
|
||||
var resp *basic.Response
|
||||
|
||||
param := &SecuritiesAccountParam{}
|
||||
err := ctx.ShouldBind(param)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
resp = resp.Error(basic.ErrParamParse)
|
||||
ctx.JSON(200, resp)
|
||||
return
|
||||
}
|
||||
|
||||
actx := &ActionContext[SecuritiesAccountParam]{
|
||||
Lang: basic.GetLangString(param),
|
||||
GinCtx: ctx,
|
||||
Param: param,
|
||||
}
|
||||
|
||||
resp = SecuritiesAccount(actx)
|
||||
if resp == nil {
|
||||
resp = resp.Error(basic.ErrRespNotNil)
|
||||
}
|
||||
ctx.JSON(200, resp)
|
||||
}
|
||||
|
||||
type SecuritiesCapitalParam struct {
|
||||
Randstr string `json:"randstr" form:"randstr" binding:"-"`
|
||||
Sign string `json:"sign" form:"sign" binding:"-"`
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
AppMarket int64 `json:"app_market" form:"app_market" binding:"-"`
|
||||
Timestamp int64 `json:"timestamp" form:"timestamp" binding:"-"`
|
||||
Token string `json:"token" form:"token" binding:"-"`
|
||||
}
|
||||
|
||||
func SecuritiesCapitalHandler(ctx *gin.Context) {
|
||||
var resp *basic.Response
|
||||
|
||||
param := &SecuritiesCapitalParam{}
|
||||
err := ctx.ShouldBind(param)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
resp = resp.Error(basic.ErrParamParse)
|
||||
ctx.JSON(200, resp)
|
||||
return
|
||||
}
|
||||
|
||||
actx := &ActionContext[SecuritiesCapitalParam]{
|
||||
Lang: basic.GetLangString(param),
|
||||
GinCtx: ctx,
|
||||
Param: param,
|
||||
}
|
||||
|
||||
resp = SecuritiesCapital(actx)
|
||||
if resp == nil {
|
||||
resp = resp.Error(basic.ErrRespNotNil)
|
||||
}
|
||||
ctx.JSON(200, resp)
|
||||
}
|
||||
|
||||
type SecuritiesCurrencyParam struct {
|
||||
Randstr string `json:"randstr" form:"randstr" binding:"-"`
|
||||
Sign string `json:"sign" form:"sign" binding:"-"`
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
AppMarket int64 `json:"app_market" form:"app_market" binding:"-"`
|
||||
Timestamp int64 `json:"timestamp" form:"timestamp" binding:"-"`
|
||||
Token string `json:"token" form:"token" binding:"-"`
|
||||
}
|
||||
|
||||
func SecuritiesCurrencyHandler(ctx *gin.Context) {
|
||||
var resp *basic.Response
|
||||
|
||||
param := &SecuritiesCurrencyParam{}
|
||||
err := ctx.ShouldBind(param)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
resp = resp.Error(basic.ErrParamParse)
|
||||
ctx.JSON(200, resp)
|
||||
return
|
||||
}
|
||||
|
||||
actx := &ActionContext[SecuritiesCurrencyParam]{
|
||||
Lang: basic.GetLangString(param),
|
||||
GinCtx: ctx,
|
||||
Param: param,
|
||||
}
|
||||
|
||||
resp = SecuritiesCurrency(actx)
|
||||
if resp == nil {
|
||||
resp = resp.Error(basic.ErrRespNotNil)
|
||||
}
|
||||
ctx.JSON(200, resp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user