Sfoglia il codice sorgente

add name black list

jaryhe 1 anno fa
parent
commit
8ff19aa107
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      impl/v1/query/V01.go

+ 9 - 0
impl/v1/query/V01.go

@@ -43,6 +43,15 @@ func V01(ctx context.Context, params string) (reply *apis.QueryResponse, err err
 	var ads3 ads3Response
 	//var updatedAt int64
 	db := database.DB()
+
+	var id int64
+	err = db.Raw("select id from t_adm_name_black_list where name=?",req.Owner).Find(&id).Error
+	if err == nil {
+		res.IsMatch = -1
+		reply.Data, _ = jsoniter.MarshalToString(res)
+		return reply, nil
+	}
+
 	err = db.Raw("select owner,updated_at from t_adm_dws3 where plate_no = ? and plate_type = ?", req.PlateNo, req.PlateType).Find(&ads3).Error
 	if err != nil {
 		if err == gorm.ErrRecordNotFound {