开放接口,修复上游同步不对的问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m55s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m55s
This commit is contained in:
@@ -90,6 +90,24 @@ func (s *IotCardStore) GetByICCID(ctx context.Context, iccid string) (*model.Iot
|
||||
return &card, err
|
||||
}
|
||||
|
||||
// GetByIdentifier 通过 ICCID、虚拟号或 MSISDN 精确查询 IoT 卡
|
||||
func (s *IotCardStore) GetByIdentifier(ctx context.Context, identifier string) (*model.IotCard, error) {
|
||||
var card model.IotCard
|
||||
query := s.db.WithContext(ctx).Where(
|
||||
"virtual_no = ? OR iccid = ? OR msisdn = ? OR iccid_19 = ? OR iccid_20 = ?",
|
||||
identifier,
|
||||
identifier,
|
||||
identifier,
|
||||
identifier,
|
||||
identifier,
|
||||
)
|
||||
query = middleware.ApplyShopFilter(ctx, query)
|
||||
if err := query.First(&card).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &card, nil
|
||||
}
|
||||
|
||||
func (s *IotCardStore) GetByIDs(ctx context.Context, ids []uint) ([]*model.IotCard, error) {
|
||||
if len(ids) == 0 {
|
||||
return []*model.IotCard{}, nil
|
||||
|
||||
Reference in New Issue
Block a user