We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 645ec77 commit cfec9a8Copy full SHA for cfec9a8
api/syn.go
@@ -3,28 +3,19 @@ package api
3
import (
4
"github.com/gin-gonic/gin"
5
"my/models"
6
- "net/http"
+ "my/result"
7
)
8
9
func Syn(c *gin.Context) {
10
err := models.BookMysqlToEs()
11
error := models.SectionMysqlToEs()
12
if err != nil {
13
- c.JSON(http.StatusOK, gin.H{
14
- "code": "500",
15
- "msg": err,
16
- })
+ result.Fail(c, err.Error())
17
return
18
}
19
if error != nil {
20
21
22
- "msg": error,
23
+ result.Fail(c, error.Error())
24
25
26
27
- "code": "200",
28
- "msg": "操作成功",
29
+ result.Success(c, "操作成功")
30
0 commit comments