You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
685 B
33 lines
685 B
package express
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"recook/internal/back"
|
|
"recook/internal/service"
|
|
"recook/tools"
|
|
)
|
|
|
|
type queryParam struct {
|
|
Mobile string `json:"mobile"`
|
|
ExpressCompCode string `json:"expressCompCode"`
|
|
ExpressNo string `json:"expressNo"`
|
|
}
|
|
|
|
// 快递直接查询
|
|
func DirectQuery(c *gin.Context) {
|
|
// todo qps限制 前期不多,暂不限制
|
|
var p queryParam
|
|
if err := tools.Params(&p, c); err != nil {
|
|
back.Fail(c, "参数错误"+err.Error())
|
|
return
|
|
}
|
|
|
|
pac, err := service.QueryPackage(p.Mobile, p.ExpressCompCode, p.ExpressNo)
|
|
if err != nil {
|
|
back.Fail(c, err.Error())
|
|
return
|
|
}
|
|
back.Suc(c, "查询成功", &pac)
|
|
return
|
|
}
|