米醋儿

米醋屋个人技术博客会员

发文1586

关于我:网站开发,小程序开发,APP开发,系统开发

网站开发,小程序开发,APP开发,系统开发

技能

  • 西安远洋房产,不行,别买

    西安远洋房产,不行,别买
    动态 2023-02-25

  • 鸡蛋如果 表面摸起来很粗糙,说明鸡蛋很新...

    鸡蛋如果 表面摸起来很粗糙,说明鸡蛋很新鲜
    动态 2023-02-24

  • 路由参数

    ```go func main() { router := gin.Default() // 此 handler 将匹配 /user/john 但不会匹配 /user/ 或者 /user router.GET("/user/:name", func(c *gin.
    2023-02-24

  • 查询字符串参数

    ```go func main() { router := gin.Default() // 使用现有的基础请求对象解析查询字符串参数。 // 示例 URL: /welcome?firstname=Jane&lastname=Doe router.GET
    2023-02-24

  • 参数获取/表单参数

    ```go id := c.Query("id") page := c.DefaultQuery("page", "0") name := c.PostForm("name") message := c.PostForm("message") ```
    2023-02-24

  • 参数

    米醋屋个人博客文章《参数》点击查看文章详情。
    2023-02-24

  • 静态文件服务

    ```go func main() { router := gin.Default() router.Static("/assets", "./assets") router.StaticFS("/more_static", http.Dir("my_file_sys
    2023-02-24

  • 路由分组

    ```go func main() { router := gin.Default() // 简单的路由组: v1 v1 := router.Group("/v1") { v1.POST("/login", loginEndpoint)
    2023-02-24

  • 重定向

    HTTP 重定向很容易。 内部、外部重定向均支持。 ```go r.GET("/test", func(c *gin.Context) { c.Redirect(http.StatusMovedPermanently, "http://www.google.com/") }) ```
    2023-02-24

  • 路由

    米醋屋个人博客文章《路由》点击查看文章详情。
    2023-02-24

  • 内置函数一览

    [![](https://cos.micuer.com/web/markdown/63f84c63a4e38.png)](https://cos.micuer.com/web/markdown/63f84c63a4e38.png)
    2023-02-24

  • 变量赋值

    ```go // 未定义过的变量 $var := pipeline // 已定义过的变量 $var = pipeline ```
    2023-02-24

  • if

    ```go {{if .articles }} {{.articles}} {{else}} 没有任何文章 {{end}} ```
    2023-02-24

  • range

    ```html {{range $index,$v := .res}} {{$v.Title
    2023-02-24

  • 我的博客也被攻击了

    今天上午,收到云服务器商的通知,说“您的服务器遭受攻击,导致ip延迟解析”,结果就是目前博客无法访问。
    图文 2023-02-24