Ver código fonte

add name black list

jaryhe 1 ano atrás
pai
commit
8ff19aa107
1 arquivos alterados com 9 adições e 0 exclusões
  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 {