jason 1 год назад
Родитель
Сommit
0220098b61
2 измененных файлов с 8 добавлено и 2 удалено
  1. 2 2
      impl/v1/query/V01.go
  2. 6 0
      log/gd_adm_data-access.log

+ 2 - 2
impl/v1/query/V01.go

@@ -45,8 +45,8 @@ func V01(ctx context.Context, params string) (reply *apis.QueryResponse, err err
 	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 {
+	err = db.Raw("select id from t_adm_name_black_list where name=?", req.Owner).Find(&id).Error
+	if err == nil && id > 0 {
 		res.IsMatch = -1
 		reply.Data, _ = jsoniter.MarshalToString(res)
 		return reply, nil

+ 6 - 0
log/gd_adm_data-access.log

@@ -30,3 +30,9 @@
 {"L":"INFO","T":"2023-03-15 14:45:41.012","C":"task/access.go:18","M":"Query","appname":"gd_adm_data","trace_id":0,"span_id":0,"parent_id":0,"status":"FAIL","elapsed":"98.000000ms"}
 {"L":"INFO","T":"2023-03-15 14:50:12.130","C":"task/access.go:18","M":"Query","appname":"gd_adm_data","trace_id":0,"span_id":0,"parent_id":0,"status":"FAIL","elapsed":"98.000000ms"}
 {"L":"INFO","T":"2023-03-15 14:51:21.372","C":"task/access.go:18","M":"Query","appname":"gd_adm_data","trace_id":0,"span_id":0,"parent_id":0,"status":"FAIL","elapsed":"90.000000ms"}
+{"L":"INFO","T":"2023-04-07 07:41:14.339","C":"task/access.go:18","M":"Query","appname":"gd_adm_data","trace_id":0,"span_id":0,"parent_id":0,"status":"SUCCESS","elapsed":"1.962885ms"}
+{"L":"INFO","T":"2023-04-07 07:41:15.318","C":"task/access.go:18","M":"Query","appname":"gd_adm_data","trace_id":0,"span_id":0,"parent_id":0,"status":"SUCCESS","elapsed":"1.579845ms"}
+{"L":"INFO","T":"2023-04-07 07:41:16.283","C":"task/access.go:18","M":"Query","appname":"gd_adm_data","trace_id":0,"span_id":0,"parent_id":0,"status":"SUCCESS","elapsed":"1.529553ms"}
+{"L":"INFO","T":"2023-04-07 07:41:26.828","C":"task/access.go:18","M":"Query","appname":"gd_adm_data","trace_id":0,"span_id":0,"parent_id":0,"status":"SUCCESS","elapsed":"1.655185ms"}
+{"L":"INFO","T":"2023-04-07 07:41:44.787","C":"task/access.go:18","M":"Query","appname":"gd_adm_data","trace_id":0,"span_id":0,"parent_id":0,"status":"SUCCESS","elapsed":"0.868602ms"}
+{"L":"INFO","T":"2023-04-07 07:42:05.555","C":"task/access.go:18","M":"Query","appname":"gd_adm_data","trace_id":0,"span_id":0,"parent_id":0,"status":"SUCCESS","elapsed":"0.822842ms"}