package controllers

import (
	"github.com/civet148/log"
	"github.com/gin-gonic/gin"
	"intent-system/pkg/proto"
)

func (m *Controller) SendAuthCode(c *gin.Context) {
	var req proto.SendAuthCodeReq
	if err := m.bindJSON(c, &req); err != nil {
		log.Errorf("%s", err)
		return
	}
	resp, code := m.CommonCore.SendAuthCode(&req)
	if !code.Ok() {
		m.Error(c, code)
		return
	}
	m.OK(c, resp, 1, 1)
}
