1
This commit is contained in:
parent
b9a8208c1e
commit
47b1ca0245
@ -297,6 +297,36 @@ func (this *mailMgr) CaSendMail(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
}
|
||||
{
|
||||
var dbErr error
|
||||
found := false
|
||||
f5.GetGoStyleDb().OrmSelectOne(
|
||||
constant.MAIL_DB,
|
||||
"t_mail",
|
||||
[][]string{
|
||||
{"unikey", reqJson.UniKey},
|
||||
},
|
||||
func (err error, ds *f5.DataSet) {
|
||||
dbErr = err
|
||||
if err == nil {
|
||||
if ds.Next() {
|
||||
found = true
|
||||
}
|
||||
}
|
||||
});
|
||||
if dbErr != nil {
|
||||
rspObj.ErrCode = 500
|
||||
rspObj.ErrMsg = dbErr.Error()
|
||||
c.JSON(200, rspObj)
|
||||
return
|
||||
}
|
||||
if found {
|
||||
rspObj.ErrCode = 3
|
||||
rspObj.ErrMsg = "mail already exists"
|
||||
c.JSON(200, rspObj)
|
||||
return
|
||||
}
|
||||
}
|
||||
mailId := f5.GetApp().NewLockNodeUuid()
|
||||
nowTime := f5.GetApp().GetRealSeconds()
|
||||
f5.GetGoStyleDb().Insert(
|
||||
|
Loading…
x
Reference in New Issue
Block a user