62 lines
1.7 KiB
Go
62 lines
1.7 KiB
Go
package service
|
|
|
|
import (
|
|
"context"
|
|
"github.com/dubbogo/gost/log/logger"
|
|
"github.com/exhibition-main/api/exhibition"
|
|
"github.com/exhibition-main/internal/msg"
|
|
"github.com/exhibition-main/internal/response"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func RegisterRecordList(c *gin.Context) {
|
|
var recordListReq exhibition.RecordListReq
|
|
if err := c.ShouldBind(&recordListReq); err != nil {
|
|
logger.Errorf("RegisterRecordList ShouldBind err", err)
|
|
response.ResponseQuickMsg(c, msg.Fail, msg.INVALID_PARAMS, nil)
|
|
return
|
|
}
|
|
resp, err := GrpcExhibitionClientImpl.RegisterRecordList(context.Background(), &recordListReq)
|
|
if err != nil {
|
|
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
|
return
|
|
}
|
|
response.ResponseQuickMsg(c, msg.Ok, resp.Msg, resp)
|
|
return
|
|
|
|
}
|
|
|
|
func CheckPhone(c *gin.Context) {
|
|
var registerInfo exhibition.RegisterInfo
|
|
if err := c.ShouldBind(®isterInfo); err != nil {
|
|
logger.Errorf("CheckPhone ShouldBind err", err)
|
|
response.ResponseQuickMsg(c, msg.Fail, msg.INVALID_PARAMS, nil)
|
|
return
|
|
}
|
|
resp, err := GrpcExhibitionClientImpl.CheckPhone(context.Background(), ®isterInfo)
|
|
if err != nil {
|
|
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
|
return
|
|
}
|
|
response.ResponseQuickMsg(c, msg.Ok, resp.Msg, resp)
|
|
return
|
|
|
|
}
|
|
|
|
func SaveRegisterRecord(c *gin.Context) {
|
|
var registerInfo exhibition.RegisterInfo
|
|
if err := c.ShouldBind(®isterInfo); err != nil {
|
|
logger.Errorf("SaveRegisterRecord ShouldBind err", err)
|
|
response.ResponseQuickMsg(c, msg.Fail, msg.INVALID_PARAMS, nil)
|
|
return
|
|
}
|
|
resp, err := GrpcExhibitionClientImpl.SaveRegisterRecord(context.Background(), ®isterInfo)
|
|
if err != nil {
|
|
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
|
return
|
|
}
|
|
response.ResponseQuickMsg(c, msg.Ok, resp.Msg, resp)
|
|
return
|
|
|
|
}
|