micro-account/pkg/service/submitInfo.go

31 lines
801 B
Go
Raw Normal View History

2025-05-30 13:37:38 +00:00
package service
import (
"context"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"errors"
"fmt"
account "github.com/fonchain_enterprise/micro-account/api/accountFiee"
"github.com/fonchain_enterprise/micro-account/pkg/m"
"github.com/fonchain_enterprise/micro-account/pkg/model"
)
func (a *AccountFieeProvider) SaveSubmitInfo(_ context.Context, in *account.SubmitInfoRequest) (*account.CommonResponse, error) {
// 将信息 保存到数据库中
fmt.Println(in)
response := &account.CommonResponse{}
err := model.DB.Create(&model.SubmitInfo{
FirstName: in.FirstName,
LastName: in.LastName,
Email: in.Email,
Company: in.Company,
Phone: in.Phone,
})
if err != nil {
logger.Error(err)
return response, errors.New(m.SaveSubmitInfoFailedEn)
}
return response, nil
}