【发布时间】:2017-08-24 06:30:46
【问题描述】:
我试图弄清楚如何创建一个动态路由,我可以在其中查询我的结构的某些部分。 例如,假设我有以下结构。
type News struct {
Id int64 `json:"id"`
Category string `json:"category"`
ImageUrl string `json:"image_url"`
Title string `json:"title"`
Description string `json:"description"`
Source string `json:"source"`
}
现在,我将如何创建一条路线,例如
localhost:1234/news?title="sometitle"&source="somesource
【问题讨论】: