浏览代码

Merge branch 'feature/non_friends' into debug

* feature/non_friends:
  取消基础字段收集
boweniac 5 天之前
父节点
当前提交
f50bec2ef3
共有 1 个文件被更改,包括 83 次插入85 次删除
  1. 83 85
      crontask/contact_form.go

+ 83 - 85
crontask/contact_form.go

@@ -41,87 +41,87 @@ type FormData struct {
 func (l *CronTask) analyze() {
 	usageDetails := make(map[string]map[string]string)
 	contactFieldTemplates := make(map[string][]custom_types.ContactFieldTemplate)
-	template_type_text := "text"
-	template_type_radio := "radio"
-	template_type_date := "date"
-	template_sex_id := "sex"
-	template_sex_label := "性别"
-	template_sex_options_man_label := "男"
-	template_sex_options_man_value := "男"
-	template_sex_options_woman_label := "女"
-	template_sex_options_woman_value := "男"
-
-	template_phone_id := "phone"
-	template_phone_label := "手机号"
-
-	template_name_id := "name"
-	template_name_label := "姓名"
-
-	template_age_id := "age"
-	template_age_label := "年龄(以字符串形式返回阿拉伯数字)"
-
-	template_area_id := "area"
-	template_area_label := "地区"
-
-	template_birthday_id := "birthday"
-	template_birthday_label := "出生日期"
-
-	template_birtharea_id := "birtharea"
-	template_birtharea_label := "出生地"
-
-	template_idcard_no_id := "idcard_no"
-	template_idcard_no_label := "身份证号"
-
-	template_title_id := "title"
-	template_title_label := "称呼"
-	contactBasicFieldTemplates := []custom_types.ContactFieldTemplate{
-		{
-			Label: &template_sex_label,
-			Id:    &template_sex_id,
-			Type:  &template_type_radio,
-			Options: []custom_types.ContactFieldTemplateOptions{
-				{
-					Label: &template_sex_options_man_label,
-					Value: &template_sex_options_man_value,
-				}, {
-					Label: &template_sex_options_woman_label,
-					Value: &template_sex_options_woman_value,
-				},
-			},
-		}, {
-			Label: &template_phone_label,
-			Id:    &template_phone_id,
-			Type:  &template_type_text,
-		}, {
-			Label: &template_name_label,
-			Id:    &template_name_id,
-			Type:  &template_type_text,
-		}, {
-			Label: &template_age_label,
-			Id:    &template_age_id,
-			Type:  &template_type_text,
-		}, {
-			Label: &template_area_label,
-			Id:    &template_area_id,
-			Type:  &template_type_text,
-		}, {
-			Label: &template_birthday_label,
-			Id:    &template_birthday_id,
-			Type:  &template_type_date,
-		}, {
-			Label: &template_birtharea_label,
-			Id:    &template_birtharea_id,
-			Type:  &template_type_text,
-		}, {
-			Label: &template_idcard_no_label,
-			Id:    &template_idcard_no_id,
-			Type:  &template_type_text,
-		}, {
-			Label: &template_title_label,
-			Id:    &template_title_id,
-			Type:  &template_type_text,
-		},
-	}
+	//template_type_text := "text"
+	//template_type_radio := "radio"
+	//template_type_date := "date"
+	//template_sex_id := "sex"
+	//template_sex_label := "性别"
+	//template_sex_options_man_label := "男"
+	//template_sex_options_man_value := "男"
+	//template_sex_options_woman_label := "女"
+	//template_sex_options_woman_value := "男"
+	//
+	//template_phone_id := "phone"
+	//template_phone_label := "手机号"
+	//
+	//template_name_id := "name"
+	//template_name_label := "姓名"
+	//
+	//template_age_id := "age"
+	//template_age_label := "年龄(以字符串形式返回阿拉伯数字)"
+	//
+	//template_area_id := "area"
+	//template_area_label := "地区"
+	//
+	//template_birthday_id := "birthday"
+	//template_birthday_label := "出生日期"
+	//
+	//template_birtharea_id := "birtharea"
+	//template_birtharea_label := "出生地"
+	//
+	//template_idcard_no_id := "idcard_no"
+	//template_idcard_no_label := "身份证号"
+	//
+	//template_title_id := "title"
+	//template_title_label := "称呼"
+	//contactBasicFieldTemplates := []custom_types.ContactFieldTemplate{
+	//	{
+	//		Label: &template_sex_label,
+	//		Id:    &template_sex_id,
+	//		Type:  &template_type_radio,
+	//		Options: []custom_types.ContactFieldTemplateOptions{
+	//			{
+	//				Label: &template_sex_options_man_label,
+	//				Value: &template_sex_options_man_value,
+	//			}, {
+	//				Label: &template_sex_options_woman_label,
+	//				Value: &template_sex_options_woman_value,
+	//			},
+	//		},
+	//	}, {
+	//		Label: &template_phone_label,
+	//		Id:    &template_phone_id,
+	//		Type:  &template_type_text,
+	//	}, {
+	//		Label: &template_name_label,
+	//		Id:    &template_name_id,
+	//		Type:  &template_type_text,
+	//	}, {
+	//		Label: &template_age_label,
+	//		Id:    &template_age_id,
+	//		Type:  &template_type_text,
+	//	}, {
+	//		Label: &template_area_label,
+	//		Id:    &template_area_id,
+	//		Type:  &template_type_text,
+	//	}, {
+	//		Label: &template_birthday_label,
+	//		Id:    &template_birthday_id,
+	//		Type:  &template_type_date,
+	//	}, {
+	//		Label: &template_birtharea_label,
+	//		Id:    &template_birtharea_id,
+	//		Type:  &template_type_text,
+	//	}, {
+	//		Label: &template_idcard_no_label,
+	//		Id:    &template_idcard_no_id,
+	//		Type:  &template_type_text,
+	//	}, {
+	//		Label: &template_title_label,
+	//		Id:    &template_title_id,
+	//		Type:  &template_type_text,
+	//	},
+	//}
 
 	var predicates []predicate.UsageDetail
 	predicates = append(predicates, usagedetail.TypeIn(1, 3, 4, 6))
@@ -169,10 +169,8 @@ func (l *CronTask) analyze() {
 	logx.Info("contactFieldTemplates: ", contactFieldTemplates)
 	logx.Info("usageDetails: ", usageDetails)
 	for botID, template := range contactFieldTemplates {
-		if template == nil {
-			template = contactBasicFieldTemplates
-		} else {
-			template = append(template, contactBasicFieldTemplates...)
+		if template == nil || len(template) == 0 {
+			continue
 		}
 		for receiverID, messages := range usageDetails[botID] {
 			result, _ := l.openaiRequest(messages, template)