add # for cron pattern that can ignore seconds, which makes the cron pattern running in minimum minute like linux crontab pattern (#3306)

This commit is contained in:
John Guo
2024-02-07 15:38:24 +08:00
committed by GitHub
parent 51326f3d02
commit 5307f0742e
34 changed files with 489 additions and 302 deletions

View File

@ -0,0 +1,40 @@
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package main
import (
"context"
"github.com/gogf/gf/v2/frame/g"
)
type Req struct {
g.Meta `path:"/user" method:"get"`
}
type Res []Item
type Item struct {
Id int64
Name string
}
var (
User = cUser{}
)
type cUser struct{}
func (c *cUser) GetList(ctx context.Context, req *Req) (res *Res, err error) {
res = &Res{
{Id: 1, Name: "john"},
{Id: 2, Name: "smith"},
{Id: 3, Name: "alice"},
{Id: 4, Name: "katyusha"},
}
return
}

View File

@ -0,0 +1,29 @@
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package main
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp"
)
func main() {
s := g.Server()
s.Group("/", func(group *ghttp.RouterGroup) {
group.Middleware(ghttp.MiddlewareHandlerResponse)
group.Bind(
User,
)
})
oai := s.GetOpenApi()
oai.Config.CommonResponse = ghttp.DefaultHandlerResponse{}
oai.Config.CommonResponseDataField = "Data"
s.SetOpenApiPath("/api")
s.SetSwaggerPath("/swagger")
s.SetPort(8199)
s.Run()
}