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(&paramsJson); 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,
	})
}
