2024-02-06 06:01:50 +00:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/exhibition-main/api/account"
|
2024-02-18 08:10:34 +00:00
|
|
|
appconfig "github.com/exhibition-main/internal/config"
|
2024-02-06 06:01:50 +00:00
|
|
|
"github.com/exhibition-main/internal/msg"
|
|
|
|
"github.com/exhibition-main/internal/response"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/gin-gonic/gin/binding"
|
|
|
|
)
|
|
|
|
|
|
|
|
// OnlySend 用户登录操作
|
|
|
|
func OnlySend(c *gin.Context) {
|
|
|
|
|
|
|
|
var req account.SendMsgRequest
|
|
|
|
|
|
|
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
|
|
response.ResponseQuickMsg(c, msg.Fail, msg.INVALID_PARAMS, nil)
|
|
|
|
return
|
|
|
|
}
|
2024-02-18 08:10:34 +00:00
|
|
|
req.Domain = appconfig.Data.System.Domain
|
|
|
|
req.Scope = "exhibition"
|
2024-02-06 06:01:50 +00:00
|
|
|
|
2024-02-18 08:10:34 +00:00
|
|
|
res, err := AccountProvider.OnlySendMsg(c, &req)
|
2024-02-06 06:01:50 +00:00
|
|
|
if err != nil {
|
|
|
|
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
response.ResponseQuickMsg(c, msg.Ok, msg.SUCCESS, res)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
// OnlyCheck 检测
|
|
|
|
func OnlyCheck(c *gin.Context) {
|
|
|
|
|
|
|
|
var req account.CheckMsgRequest
|
|
|
|
|
|
|
|
if err := c.ShouldBindBodyWith(&req, binding.JSON); err != nil {
|
|
|
|
response.ResponseQuickMsg(c, msg.Fail, msg.INVALID_PARAMS, nil)
|
|
|
|
return
|
|
|
|
}
|
2024-02-18 08:10:34 +00:00
|
|
|
|
|
|
|
req.Domain = appconfig.Data.System.Domain
|
|
|
|
req.Scope = "exhibition"
|
2024-02-06 06:01:50 +00:00
|
|
|
|
|
|
|
res, err := AccountProvider.OnlyCheckMsg(c, &req)
|
|
|
|
if err != nil {
|
|
|
|
response.ResponseQuickMsg(c, msg.Fail, err.Error(), nil)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
response.ResponseQuickMsg(c, msg.Ok, msg.SUCCESS, res)
|
|
|
|
return
|
|
|
|
}
|