浏览代码

Variable name misspelling fix: querry

Achilleas Koutsou 6 年之前
父节点
当前提交
8ae2728115

+ 2 - 2
routes/api/v1/api.go

@@ -167,7 +167,7 @@ func RegisterRoutes(m *macaron.Macaron) {
 		m.Post("/markdown", bind(api.MarkdownOption{}), misc.Markdown)
 		m.Post("/markdown", bind(api.MarkdownOption{}), misc.Markdown)
 		m.Post("/markdown/raw", misc.MarkdownRaw)
 		m.Post("/markdown/raw", misc.MarkdownRaw)
 
 
-		m.Get("/search/:querry", search.Search)
+		m.Get("/search/:query", search.Search)
 
 
 		// Users
 		// Users
 		m.Group("/users", func() {
 		m.Group("/users", func() {
@@ -228,7 +228,7 @@ func RegisterRoutes(m *macaron.Macaron) {
 			m.Get("/search", repo.Search)
 			m.Get("/search", repo.Search)
 
 
 			m.Get("/:username/:reponame", repoAssignment(), repo.Get)
 			m.Get("/:username/:reponame", repoAssignment(), repo.Get)
-			m.Get("/suggest/:querry", search.Suggest)
+			m.Get("/suggest/:query", search.Suggest)
 		})
 		})
 
 
 		m.Group("/repos", func() {
 		m.Group("/repos", func() {

+ 1 - 1
routes/api/v1/repo/repo.go

@@ -28,7 +28,7 @@ func Search(c *context.APIContext) {
 		Page:     c.QueryInt("page"),
 		Page:     c.QueryInt("page"),
 	}
 	}
 
 
-	// workaround for the all querry with logged users
+	// workaround for the all query with logged users
 	if opts.Keyword == "." {
 	if opts.Keyword == "." {
 		opts.Keyword = ""
 		opts.Keyword = ""
 	}
 	}

+ 1 - 1
routes/api/v1/search/general.go

@@ -21,7 +21,7 @@ func Search(c *context.APIContext) {
 		return
 		return
 	}
 	}
 	ireq := libgin.SearchRequest{Token: c.GetCookie(setting.SessionConfig.CookieName), UserID: c.User.ID,
 	ireq := libgin.SearchRequest{Token: c.GetCookie(setting.SessionConfig.CookieName), UserID: c.User.ID,
-		Querry: c.Params("querry"), CsrfT: c.GetCookie(setting.CSRFCookieName)}
+		Query: c.Params("query"), CsrfT: c.GetCookie(setting.CSRFCookieName)}
 	data, err := json.Marshal(ireq)
 	data, err := json.Marshal(ireq)
 	if err != nil {
 	if err != nil {
 		c.Status(http.StatusInternalServerError)
 		c.Status(http.StatusInternalServerError)

+ 1 - 1
routes/api/v1/search/suggest.go

@@ -17,7 +17,7 @@ func Suggest(c *context.APIContext) {
 		return
 		return
 	}
 	}
 	ireq := libgin.SearchRequest{Token: c.GetCookie(setting.SessionConfig.CookieName),
 	ireq := libgin.SearchRequest{Token: c.GetCookie(setting.SessionConfig.CookieName),
-		Querry: c.Params("querry"), CsrfT: c.GetCookie(setting.CSRFCookieName), SType: libgin.SEARCH_SUGGEST}
+		Query: c.Params("query"), CsrfT: c.GetCookie(setting.CSRFCookieName), SType: libgin.SEARCH_SUGGEST}
 	if c.IsLogged {
 	if c.IsLogged {
 		ireq.UserID = c.User.ID
 		ireq.UserID = c.User.ID
 	}
 	}

+ 3 - 3
routes/repo/editor.go

@@ -526,8 +526,8 @@ func UploadFilePost(c *context.Context, f form.UploadRepoFile) {
 func UploadFileToServer(c *context.Context) {
 func UploadFileToServer(c *context.Context) {
 	file, header, err := c.Req.FormFile("file")
 	file, header, err := c.Req.FormFile("file")
 	fvalue := c.Req.Form
 	fvalue := c.Req.Form
-	f_dir := filepath.Dir(fvalue.Get("full_path"))
-	log.Info("full_path:%s", f_dir)
+	fp := filepath.Dir(fvalue.Get("full_path"))
+	log.Info("full_path:%s", fp)
 	if err != nil {
 	if err != nil {
 		c.Error(http.StatusInternalServerError, fmt.Sprintf("FormFile: %v", err))
 		c.Error(http.StatusInternalServerError, fmt.Sprintf("FormFile: %v", err))
 		return
 		return
@@ -557,7 +557,7 @@ func UploadFileToServer(c *context.Context) {
 		}
 		}
 	}
 	}
 
 
-	upload, err := models.NewUpload(filepath.Join(f_dir, header.Filename), buf, file)
+	upload, err := models.NewUpload(filepath.Join(fp, header.Filename), buf, file)
 	if err != nil {
 	if err != nil {
 		c.Error(http.StatusInternalServerError, fmt.Sprintf("NewUpload: %v", err))
 		c.Error(http.StatusInternalServerError, fmt.Sprintf("NewUpload: %v", err))
 		return
 		return

+ 3 - 3
routes/search.go

@@ -26,7 +26,7 @@ func Search(c *context.Context, keywords string, sType int64) ([]byte, error) {
 	}
 	}
 
 
 	ireq := libgin.SearchRequest{Token: c.GetCookie(setting.SessionConfig.CookieName),
 	ireq := libgin.SearchRequest{Token: c.GetCookie(setting.SessionConfig.CookieName),
-		Querry: keywords, CsrfT: c.GetCookie(setting.CSRFCookieName), SType: sType, UserID: -10}
+		Query: keywords, CsrfT: c.GetCookie(setting.CSRFCookieName), SType: sType, UserID: -10}
 	if c.IsLogged {
 	if c.IsLogged {
 		ireq.UserID = c.User.ID
 		ireq.UserID = c.User.ID
 	}
 	}
@@ -65,7 +65,7 @@ func ExploreData(c *context.Context) {
 	}
 	}
 	data, err := Search(c, keywords, sType)
 	data, err := Search(c, keywords, sType)
 	if err != nil {
 	if err != nil {
-		c.Handle(http.StatusInternalServerError, "Could not querry", err)
+		c.Handle(http.StatusInternalServerError, "Could not query", err)
 		return
 		return
 	}
 	}
 
 
@@ -112,6 +112,6 @@ type SearchRequest struct {
 	Token  string
 	Token  string
 	CsrfT  string
 	CsrfT  string
 	UserID int64
 	UserID int64
-	Querry string
+	Query  string
 	SType  int64
 	SType  int64
 }
 }

+ 2 - 2
vendor/github.com/G-Node/libgin/libgin/dex.go

@@ -12,7 +12,7 @@ type SearchRequest struct {
 	Token  string
 	Token  string
 	CsrfT  string
 	CsrfT  string
 	UserID int64
 	UserID int64
-	Querry string
+	Query  string
 	SType  int64
 	SType  int64
 }
 }
 
 
@@ -20,7 +20,7 @@ const (
 	SEARCH_MATCH = iota
 	SEARCH_MATCH = iota
 	SEARCH_FUZZY
 	SEARCH_FUZZY
 	SEARCH_WILDCARD
 	SEARCH_WILDCARD
-	SEARCH_QUERRY
+	SEARCH_QUERY
 	SEARCH_SUGGEST
 	SEARCH_SUGGEST
 )
 )