本来应该多积累一些 东西才发布新版的,但是我觉得 这两个功能,有和没有 的差距还是有一点点大的,会在一定程度上影响开发效率,所以就选择了赶紧发出来。
以前 如果一个请求中包含了 同名的多个参数,那么 beerus 只会获取一个,现在对这个功能进行了升级,可以一次性把所有同名参数都获取到。
传统方式
支持 urlencode 和 get 请求
req.FormValues("name")
实体接收
支持 urlencode ,JSON 和 get 请求
type DemoParam struct {
	TestReception []string
}
比如有这么一个条件
where id > 10 and (name = 'bee' or age > 18)
以前的条件构造器是不支持的,现在支持了,只需要这么写即可
conditions := make([]*entity.Condition,0)
conditions = append(conditions, entity.GetCondition("id > ?", 10))
conditions = append(conditions, entity.GetCondition("and (name = ? or age > ?)", "bee", 18))// 后面可以无限追加参数,只要能跟第一个参数的里的问号对应上即可
resultMap, err := operation.GetDBTemplate("Data source name").Select("table name", conditions)
感兴趣的伙伴们可以访问官网,了解更多:https://beeruscc.com
|      1sanggao      2021-12-20 10:13:32 +08:00  1 没有意义的轮子 | 
|      2dcoder      2021-12-20 10:16:27 +08:00 上次看见个 Go 的 micro service framework 取名叫 Kratos 你这个取名叫 Beerus 我也是用 Go 的, 忽然觉得这个社群有点中二, 哈哈哈 | 
|  |      3Oktfolio      2021-12-20 10:19:05 +08:00 破壊神? | 
|  |      4Joker123456789 OP @Oktfolio  同道中人,居然认出了这个名字,哈哈 | 
|      5limyel      2021-12-20 15:26:24 +08:00 感觉这样子自己造一套轮子挺好玩的,造轮子要啥意义啊,just for fun 就行了。 |