初步框架代码
This commit is contained in:
92
server/app/internal/handlers/actions/auth.go
Normal file
92
server/app/internal/handlers/actions/auth.go
Normal file
@@ -0,0 +1,92 @@
|
||||
package actions
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// @Action base/getToken
|
||||
// Base_GetToken
|
||||
// action: string;
|
||||
// app_market: string;
|
||||
// lang: string;
|
||||
// token: string;
|
||||
func BaseGetToken(ctx *gin.Context) {
|
||||
param := &BaseGetTokenParam{}
|
||||
ctx.ShouldBind(param)
|
||||
log.Println()
|
||||
}
|
||||
|
||||
// @Action account/loginWithTelephonePassword
|
||||
// AccountLoginWithTelephonePassword
|
||||
// action: string;
|
||||
// country_code: string;
|
||||
// device?: string;
|
||||
// lang: string;
|
||||
// password: string;
|
||||
// telephone: string;
|
||||
// token?: string;
|
||||
// version?: string;
|
||||
func AccountLoginWithTelephonePassword(ctx *gin.Context) {
|
||||
// ctx.ShouldBind()
|
||||
log.Println()
|
||||
}
|
||||
|
||||
// @Action account/registerSmsCode
|
||||
// AccountRegisterSmsCode
|
||||
// action: string;
|
||||
// country_code?: string;
|
||||
// telephone?: string;
|
||||
// token: string;
|
||||
func AccountRegisterSmsCode(ctx *gin.Context) {
|
||||
// ctx.ShouldBind()
|
||||
log.Println()
|
||||
}
|
||||
|
||||
// @Action account/forgetSmsCode
|
||||
// AccountForgetSmsCode
|
||||
// action: string;
|
||||
// country_code?: string;
|
||||
// telephone?: string;
|
||||
// token: string;
|
||||
func AccountForgetSmsCode(ctx *gin.Context) {
|
||||
// ctx.ShouldBind()
|
||||
log.Println()
|
||||
}
|
||||
|
||||
// @Action account/registerEmailCode
|
||||
// AccountRegisterEmailCode
|
||||
// action: string;
|
||||
// email?: string;
|
||||
// token: string;
|
||||
func AccountRegisterEmailCode(ctx *gin.Context) {
|
||||
// ctx.ShouldBind()
|
||||
log.Println()
|
||||
}
|
||||
|
||||
// @Action member/alterPassword
|
||||
// MemberAlterPassword
|
||||
// action: string;
|
||||
// confirm_password: string;
|
||||
// new_password: string;
|
||||
// old_password: string;
|
||||
// token?: string;
|
||||
func MemberAlterPassword(ctx *gin.Context) {
|
||||
// ctx.ShouldBind()
|
||||
log.Println()
|
||||
}
|
||||
|
||||
// @Action account/loginWithEmailPassword
|
||||
// AccountLoginWithEmailPassword
|
||||
// action: string;
|
||||
// device?: string;
|
||||
// email: string;
|
||||
// lang: string;
|
||||
// password: string;
|
||||
// token?: string;
|
||||
// version?: string;
|
||||
func AccountLoginWithEmailPassword(ctx *gin.Context) {
|
||||
// ctx.ShouldBind()
|
||||
log.Println()
|
||||
}
|
||||
57
server/app/internal/handlers/actions/types_gen.go
Normal file
57
server/app/internal/handlers/actions/types_gen.go
Normal file
@@ -0,0 +1,57 @@
|
||||
package actions
|
||||
|
||||
type AccountForgetSmsCodeParam struct {
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
CountryCode string `json:"country_code" form:"country_code" binding:"required"`
|
||||
Telephone string `json:"telephone" form:"telephone" binding:"required"`
|
||||
Token string `json:"token" form:"token" binding:"-"`
|
||||
}
|
||||
|
||||
type AccountLoginWithEmailPasswordParam struct {
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
Device string `json:"device" form:"device" binding:"required"`
|
||||
Email string `json:"email" form:"email" binding:"-"`
|
||||
Lang string `json:"lang" form:"lang" binding:"-"`
|
||||
Password string `json:"password" form:"password" binding:"-"`
|
||||
Token string `json:"token" form:"token" binding:"required"`
|
||||
Version string `json:"version" form:"version" binding:"required"`
|
||||
}
|
||||
|
||||
type AccountLoginWithTelephonePasswordParam struct {
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
CountryCode string `json:"country_code" form:"country_code" binding:"-"`
|
||||
Device string `json:"device" form:"device" binding:"required"`
|
||||
Lang string `json:"lang" form:"lang" binding:"-"`
|
||||
Password string `json:"password" form:"password" binding:"-"`
|
||||
Telephone string `json:"telephone" form:"telephone" binding:"-"`
|
||||
Token string `json:"token" form:"token" binding:"required"`
|
||||
Version string `json:"version" form:"version" binding:"required"`
|
||||
}
|
||||
|
||||
type AccountRegisterEmailCodeParam struct {
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
Email string `json:"email" form:"email" binding:"required"`
|
||||
Token string `json:"token" form:"token" binding:"-"`
|
||||
}
|
||||
|
||||
type AccountRegisterSmsCodeParam struct {
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
CountryCode string `json:"country_code" form:"country_code" binding:"required"`
|
||||
Telephone string `json:"telephone" form:"telephone" binding:"required"`
|
||||
Token string `json:"token" form:"token" binding:"-"`
|
||||
}
|
||||
|
||||
type BaseGetTokenParam struct {
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
AppMarket string `json:"app_market" form:"app_market" binding:"-"`
|
||||
Lang string `json:"lang" form:"lang" binding:"-"`
|
||||
Token string `json:"token" form:"token" binding:"-"`
|
||||
}
|
||||
|
||||
type MemberAlterPasswordParam struct {
|
||||
Action string `json:"action" form:"action" binding:"-"`
|
||||
ConfirmPassword string `json:"confirm_password" form:"confirm_password" binding:"-"`
|
||||
NewPassword string `json:"new_password" form:"new_password" binding:"-"`
|
||||
OldPassword string `json:"old_password" form:"old_password" binding:"-"`
|
||||
Token string `json:"token" form:"token" binding:"required"`
|
||||
}
|
||||
Reference in New Issue
Block a user