|
|
@ -3,6 +3,8 @@ package controller
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/taoshihan1991/imaptool/models"
|
|
|
|
"github.com/taoshihan1991/imaptool/models"
|
|
|
|
|
|
|
|
"github.com/taoshihan1991/imaptool/tools"
|
|
|
|
|
|
|
|
"log"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func GetKefuInfo(c *gin.Context){
|
|
|
|
func GetKefuInfo(c *gin.Context){
|
|
|
@ -19,10 +21,14 @@ func GetKefuInfo(c *gin.Context){
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func PostKefuInfo(c *gin.Context){
|
|
|
|
func PostKefuInfo(c *gin.Context){
|
|
|
|
|
|
|
|
name:=c.PostForm("name")
|
|
|
|
|
|
|
|
password:=c.PostForm("password")
|
|
|
|
|
|
|
|
avator:=c.PostForm("avator")
|
|
|
|
|
|
|
|
models.CreateUser(name,tools.Md5(password),avator)
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
"code": 200,
|
|
|
|
"code": 200,
|
|
|
|
"msg": "ok",
|
|
|
|
"msg": "ok",
|
|
|
|
"result":"aaa",
|
|
|
|
"result":"",
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
func GetKefuList(c *gin.Context){
|
|
|
|
func GetKefuList(c *gin.Context){
|
|
|
@ -33,3 +39,13 @@ func GetKefuList(c *gin.Context){
|
|
|
|
"result":users,
|
|
|
|
"result":users,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func DeleteKefuInfo(c *gin.Context){
|
|
|
|
|
|
|
|
kefuId := c.Query("id")
|
|
|
|
|
|
|
|
log.Println(kefuId)
|
|
|
|
|
|
|
|
models.DeleteUserById(kefuId)
|
|
|
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
|
|
|
"code": 200,
|
|
|
|
|
|
|
|
"msg": "删除成功",
|
|
|
|
|
|
|
|
"result":"",
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|