修改账号注册方法,以及邮箱协议对接
This commit is contained in:
36
api/twitter.go
Normal file
36
api/twitter.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go-account-register/libs"
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type Twitter struct{}
|
||||
|
||||
type RegisterParams struct {
|
||||
}
|
||||
|
||||
func (*Twitter) Register(ctx *gin.Context) {
|
||||
var res *libs.ErrorInfo
|
||||
var paramsJson RegisterParams
|
||||
if err := ctx.ShouldBindJSON(¶msJson); err != nil {
|
||||
res = libs.ErrorCode["ParamsError"]
|
||||
fmt.Println(err)
|
||||
ctx.JSON(http.StatusBadRequest, gin.H{
|
||||
"code": res.Code,
|
||||
"msg": res.Msg,
|
||||
"data": res.Data,
|
||||
})
|
||||
return
|
||||
}
|
||||
// var TwitterService services.TwitterAccountService
|
||||
// res = TwitterService.Register()
|
||||
ctx.JSON(http.StatusOK, gin.H{
|
||||
"code": res.Code,
|
||||
"msg": res.Msg,
|
||||
"data": res.Data,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user