mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -27,6 +27,27 @@ import (
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func getRepoFile(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
func checkoutRepo(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
if err := model.CheckoutRepo(id); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = model.Conf.Language(141)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func getRepoIndexLogs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
@@ -60,7 +81,7 @@ func indexRepo(c *gin.Context) {
|
||||
message := arg["message"].(string)
|
||||
if err := model.IndexRepo(message); nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = model.Conf.Language(137)
|
||||
ret.Msg = model.Conf.Language(140)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,9 @@ func ServeAPI(ginServer *gin.Engine) {
|
||||
ginServer.Handle("POST", "/api/repo/initRepoKey", model.CheckAuth, initRepoKey)
|
||||
ginServer.Handle("POST", "/api/repo/importRepoKey", model.CheckAuth, importRepoKey)
|
||||
ginServer.Handle("POST", "/api/repo/indexRepo", model.CheckAuth, indexRepo)
|
||||
ginServer.Handle("POST", "/api/repo/checkoutRepo", model.CheckAuth, checkoutRepo)
|
||||
ginServer.Handle("POST", "/api/repo/getRepoIndexLogs", model.CheckAuth, getRepoIndexLogs)
|
||||
ginServer.Handle("POST", "/api/repo/getRepoFile", model.CheckAuth, getRepoFile)
|
||||
|
||||
ginServer.Handle("POST", "/api/notification/pushMsg", model.CheckAuth, pushMsg)
|
||||
ginServer.Handle("POST", "/api/notification/pushErrMsg", model.CheckAuth, pushErrMsg)
|
||||
|
||||
Reference in New Issue
Block a user