18

Beerus 发布 1.1.3

 3 years ago
source link: https://www.v2ex.com/t/823235
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

本来应该多积累一些 东西才发布新版的,但是我觉得 这两个功能,有和没有 的差距还是有一点点大的,会在一定程度上影响开发效率,所以就选择了赶紧发出来。

http 请求支持同名多参数

以前 如果一个请求中包含了 同名的多个参数,那么 beerus 只会获取一个,现在对这个功能进行了升级,可以一次性把所有同名参数都获取到。

传统方式

支持 urlencode 和 get 请求

req.FormValues("name")

实体接收

支持 urlencode ,JSON 和 get 请求

type DemoParam struct {

	TestReception []string
}

DB 的条件构造器 支持多参数

比如有这么一个条件

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK