aa
This commit is contained in:
38
controllers/sim_controller.go
Normal file
38
controllers/sim_controller.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-print/model"
|
||||
"git.rosy.net.cn/jx-print/services"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func GetCardsInfo(c *gin.Context) {
|
||||
var (
|
||||
err error
|
||||
tokenInfo *model.TokenInfo
|
||||
param = &struct {
|
||||
AppID int `json:"app_id" form:"app_id" binding:"required"`
|
||||
PrintNo string `json:"print_no" form:"print_no"` //打印机编号
|
||||
CardStatus int `json:"card_status" form:"card_status"` //卡状态(1.正常 2.停机 3.待激活)
|
||||
IccID string `json:"icc_id" form:"icc_id"`
|
||||
BeginDate string `json:"begin_date" form:"begin_date"` //卡到期时间段 2006-01-01
|
||||
EndDate string `json:"end_date" form:"end_date"` //卡到期时间
|
||||
Offset int `json:"offset" form:"offset"`
|
||||
PageSize int `json:"page_size" form:"page_size" binding:"required"`
|
||||
}{}
|
||||
)
|
||||
if err = c.ShouldBind(¶m); err != nil {
|
||||
buildErrJson(c, err)
|
||||
return
|
||||
}
|
||||
if tokenInfo = checkToken(c); tokenInfo == nil {
|
||||
return
|
||||
}
|
||||
if !callFunc(c, func() (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = services.GetCardsInfo(tokenInfo, param.AppID, param.PrintNo, param.CardStatus, param.IccID, param.BeginDate, param.EndDate, param.Offset, param.PageSize)
|
||||
return retVal, "", err
|
||||
}) {
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user