func Route(doc *swagger.API) {
	doc.Tags = append(doc.Tags, swagger.Tag{
		Name:        tag,
		Description: "资源",
	})
	doc.AddEndpoint(
		endpoint.New(
			http.MethodGet, "/resource/list",
			endpoint.Handler(list()),
			endpoint.Summary("资源列表"),
			endpoint.Query("type", swagger.TypeString, "资源类型", false),
			endpoint.ResponseSuccess(endpoint.Schema([]types.Resource{})),
			endpoint.Tags(tag),
		),
		endpoint.New(
			http.MethodGet, "/resource/info",
			endpoint.Handler(info()),
			endpoint.Summary("资源详情"),
			endpoint.Query("group", swagger.TypeString, "资源分组", true),
			endpoint.Query("kind", swagger.TypeString, "资源名称", true),
			endpoint.Query("version", swagger.TypeString, "资源版本", true),
			endpoint.ResponseSuccess(),
			endpoint.Tags(tag),
		),
		endpoint.New(
			http.MethodGet, "/resource/tree",
			endpoint.Handler(tree()),
			endpoint.Summary("资源树详情"),
			endpoint.Query("group", swagger.TypeString, "资源分组", true),
			endpoint.Query("kind", swagger.TypeString, "资源名称", true),
			endpoint.Query("version", swagger.TypeString, "资源版本", true),
			endpoint.Query("type", swagger.TypeString, "资源类型", false),
			endpoint.ResponseSuccess(),
			endpoint.Tags(tag),
		),
		endpoint.New(
			http.MethodPost, "/resource/upload",
			endpoint.Handler(upload()),
			endpoint.Summary("资源上传"),
			func(b *endpoint.Builder) {
				if b.Endpoint.Parameters == nil {
					b.Endpoint.Parameters = []swagger.Parameter{}
				}
				b.Endpoint.Parameters = append(b.Endpoint.Parameters, swagger.Parameter{
					In:          "formData",
					Type:        "file",
					Name:        "file",
					Description: "file to upload",
					Required:    true,
				})
			},
			endpoint.ResponseSuccess(),
			endpoint.Tags(tag),
		),
		endpoint.New(
			http.MethodPost, "/resource/generate",
			endpoint.Handler(generate()),
			endpoint.Summary("资源生成"),
			func(b *endpoint.Builder) {
				if b.Endpoint.Parameters == nil {
					b.Endpoint.Parameters = []swagger.Parameter{}
				}
				b.Endpoint.Parameters = append(b.Endpoint.Parameters, swagger.Parameter{
					In:          "formData",
					Type:        "file",
					Name:        "file",
					Description: "file to upload",
					Required:    true,
				})
			},
			endpoint.ResponseSuccess(),
			endpoint.Tags(tag),
		),
	)
}
// Route handle resource routing related
Route handle resource routing related
// Route handle resource routing related
func Route(doc *swagger.API) {
	doc.Tags = append(doc.Tags, swagger.Tag{
		Name:        tag,
		Description: "资源",
	})
	doc.AddEndpoint(
		endpoint.New(
			http.MethodGet, "/resource/list",
			endpoint.Handler(list()),
			endpoint.Summary("资源列表"),
			endpoint.Query("type", swagger.TypeString, "资源类型", false),
			endpoint.ResponseSuccess(endpoint.Schema([]types.Resource{})),
			endpoint.Tags(tag),
		),
		endpoint.New(
			http.MethodGet, "/resource/info",
			endpoint.Handler(info()),
			endpoint.Summary("资源详情"),
			endpoint.Query("group", swagger.TypeString, "资源分组", true),
			endpoint.Query("kind", swagger.TypeString, "资源名称", true),
			endpoint.Query("version", swagger.TypeString, "资源版本", true),
			endpoint.ResponseSuccess(),
			endpoint.Tags(tag),
		),
		endpoint.New(
			http.MethodGet, "/resource/tree",
			endpoint.Handler(tree()),
			endpoint.Summary("资源树详情"),
			endpoint.Query("group", swagger.TypeString, "资源分组", true),
			endpoint.Query("kind", swagger.TypeString, "资源名称", true),
			endpoint.Query("version", swagger.TypeString, "资源版本", true),
			endpoint.Query("type", swagger.TypeString, "资源类型", false),
			endpoint.ResponseSuccess(),
			endpoint.Tags(tag),
		),
		endpoint.New(
			http.MethodPost, "/resource/upload",
			endpoint.Handler(upload()),
			endpoint.Summary("资源上传"),
			func(b *endpoint.Builder) {
				if b.Endpoint.Parameters == nil {
					b.Endpoint.Parameters = []swagger.Parameter{}
				}
				b.Endpoint.Parameters = append(b.Endpoint.Parameters, swagger.Parameter{
					In:          "formData",
					Type:        "file",
					Name:        "file",
					Description: "file to upload",
					Required:    true,
				})
			},
			endpoint.ResponseSuccess(),
			endpoint.Tags(tag),
		),
		endpoint.New(
			http.MethodPost, "/resource/generate",
			endpoint.Handler(generate()),
			endpoint.Summary("资源生成"),
			func(b *endpoint.Builder) {
				if b.Endpoint.Parameters == nil {
					b.Endpoint.Parameters = []swagger.Parameter{}
				}
				b.Endpoint.Parameters = append(b.Endpoint.Parameters, swagger.Parameter{
					In:          "formData",
					Type:        "file",
					Name:        "file",
					Description: "file to upload",
					Required:    true,
				})
			},
			endpoint.ResponseSuccess(),
			endpoint.Tags(tag),
		),
	)
}
func Route ( doc * swagger . API ) { doc . Tags = append ( doc . Tags , swagger . Tag { Name : tag , Description : " } ) doc . AddEndpoint ( endpoint . New ( http . MethodGet , " " , endpoint . Handler ( list ( ) ) , endpoint . Summary ( " endpoint . Query ( " " , swagger . TypeString , " ) , endpoint . ResponseSuccess ( endpoint . Schema ( [ ] types . Resource { } ) ) , endpoint . Tags ( tag ) , ) , endpoint . New ( http . MethodGet , " " , endpoint . Handler ( info ( ) ) , endpoint . Summary ( " endpoint . Query ( " " , swagger . TypeString , " , endpoint . Query ( " " , swagger . TypeString , " , endpoint . Query ( " " , swagger . TypeString , " , endpoint . ResponseSuccess ( ) , endpoint . Tags ( tag ) , ) , endpoint . New ( http . MethodGet , " " , endpoint . Handler ( tree ( ) ) , endpoint . Summary ( " endpoint . Query ( " " , swagger . TypeString , " , endpoint . Query ( " " , swagger . TypeString , " , endpoint . Query ( " " , swagger . TypeString , " , endpoint . Query ( " " , swagger . TypeString , " ) , endpoint . ResponseSuccess ( ) , endpoint . Tags ( tag ) , ) , endpoint . New ( http . MethodPost , " " , endpoint . Handler ( upload ( ) ) , endpoint . Summary ( " func ( b * endpoint . Builder ) { if b . Endpoint . Parameters == nil { b . Endpoint . Parameters = [ ] swagger . Parameter { } } b . Endpoint . Parameters = append ( b . Endpoint . Parameters , swagger . Parameter { In : " " , Type : " " , Name : " " , Description : " " , Required : true , } ) } , endpoint . ResponseSuccess ( ) , endpoint . Tags ( tag ) , ) , endpoint . New ( http . MethodPost , " " , endpoint . Handler ( generate ( ) ) , endpoint . Summary ( " func ( b * endpoint . Builder ) { if b . Endpoint . Parameters == nil { b . Endpoint . Parameters = [ ] swagger . Parameter { } } b . Endpoint . Parameters = append ( b . Endpoint . Parameters , swagger . Parameter { In : " " , Type : " " , Name : " " , Description : " " , Required : true , } ) } , endpoint . ResponseSuccess ( ) , endpoint . Tags ( tag ) , ) , ) }
Route handle resource routing related
Route handle resource routing related