Skip to content

Instantly share code, notes, and snippets.

@paulyung541
Last active February 5, 2020 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulyung541/30f8804067f6f5c5b72e4812e066cf8f to your computer and use it in GitHub Desktop.
Save paulyung541/30f8804067f6f5c5b72e4812e066cf8f to your computer and use it in GitHub Desktop.
医联: 云药房; 经纪人ME小程序; 2019-02-05
// 根据类目获取 药品列表
import (
"git.medlinker.com/service-sdk/med-sdk-go/med-ih-medication/spu-pack"
spuSrv "med-patient-medication/app/api_http/medication/spu_pack"
)
// fcid 是类目id(path) params(query) 只用传 start 和 limit
result, err := spuSrv.Service{}.PaginateByFrontCategory(api_http.ParserMedContext(ctx), 0, fcid, *params)
// 分页数据转换为前端可用的数据
func (r Response) PaginateConvert(target, origin interface{}, err error) {}
// 使用上面这个函数,返回下面这种json
// {
// "errcode": 0,
// "errmsg": "success",
// "data": {
// "more": true,
// "list": [
// {},
// {}
// ]
// }
// }
//
// 传入的结构体要是下面这样
type Model struct {
HasMore bool
Data []*XXX
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment