浏览代码

3.20存档

yankun 2 月之前
父节点
当前提交
8462d15f2b
共有 100 个文件被更改,包括 4990 次插入737 次删除
  1. 6 0
      .idea/go.imports.xml
  2. 74 13
      app/api/youngee_talent_api/talent_auth_get_api.go
  3. 39 22
      app/api/youngee_talent_api/talent_auth_post_api.go
  4. 5 0
      app/model/youngee_talent_model/auth_model.go
  5. 64 53
      app/model/youngee_talent_model/local_info.go
  6. 8 0
      app/model/youngee_talent_model/message.go
  7. 11 9
      app/model/youngee_talent_model/product_info.go
  8. 26 32
      app/model/youngee_talent_model/project_detail.go
  9. 27 19
      app/model/youngee_talent_model/project_info.go
  10. 14 12
      app/model/youngee_talent_model/selection.go
  11. 6 2
      app/model/youngee_talent_model/selection_task.go
  12. 47 3
      app/model/youngee_talent_model/talent_account.go
  13. 1 1
      app/model/youngee_talent_model/talent_bank.go
  14. 3 3
      app/model/youngee_talent_model/talent_income.go
  15. 38 10
      app/model/youngee_talent_model/talent_info.go
  16. 17 14
      app/model/youngee_talent_model/task_income.go
  17. 72 70
      app/model/youngee_talent_model/task_info.go
  18. 7 7
      app/model/youngee_talent_model/task_script.go
  19. 28 18
      app/service/youngee_sectask_service/seletion_square.go
  20. 1 0
      app/service/youngee_talent_service/LoginFromSms.go
  21. 55 29
      app/service/youngee_talent_service/log_message.go
  22. 594 58
      app/service/youngee_talent_service/talent_account.go
  23. 9 6
      app/service/youngee_talent_service/talent_address.go
  24. 170 18
      app/service/youngee_talent_service/talent_info.go
  25. 241 173
      app/service/youngee_talent_service/talent_ks_auth.go
  26. 1 1
      app/service/youngee_talent_service/wxlogin.go
  27. 134 42
      app/service/youngee_task_service/local_life_info.go
  28. 253 36
      app/service/youngee_task_service/project_info.go
  29. 4 1
      app/service/youngee_task_service/task_data.go
  30. 11 6
      app/service/youngee_task_service/task_income.go
  31. 302 10
      app/service/youngee_task_service/task_info.go
  32. 15 16
      app/system/wxpay/wxpay_model.go
  33. 5 3
      app/system/wxpay/wxpay_service.go
  34. 61 18
      app/utils/type_transform.go
  35. 二进制
      bin/main
  36. 二进制
      bin/v4.1.4/.DS_Store
  37. 二进制
      bin/v4.1.4/linux_amd64/.DS_Store
  38. 二进制
      bin/v4.1.4/linux_amd64/youngmini_server
  39. 2 1
      config/config.toml
  40. 29 0
      deploy.sh
  41. 43 31
      router/router.go
  42. 26 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_acceptance_bill_request_body.go
  43. 151 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_acceptance_bill_result.go
  44. 35 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_auto_classification_request_body.go
  45. 33 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_auto_classification_result.go
  46. 26 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_auto_classification_result_status.go
  47. 28 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bank_receipt_dict.go
  48. 25 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bank_receipt_kv_pair.go
  49. 29 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bank_receipt_request_body.go
  50. 25 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bank_receipt_result.go
  51. 29 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bankcard_request_body.go
  52. 41 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bankcard_result.go
  53. 47 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_belong_item_list.go
  54. 26 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_beneficiary_item.go
  55. 32 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_business_card_request_body.go
  56. 56 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_business_card_result.go
  57. 26 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_business_license_request_body.go
  58. 56 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_business_license_result.go
  59. 55 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_cambodian_id_card_request_body.go
  60. 96 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_cambodian_id_card_result.go
  61. 40 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_cambodian_id_card_score_information_result.go
  62. 28 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_char_list_iem.go
  63. 46 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_chile_id_card_confidence.go
  64. 25 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_chile_id_card_request_body.go
  65. 48 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_chile_id_card_result.go
  66. 25 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_colombia_id_card_request_body.go
  67. 64 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_colombia_id_card_result.go
  68. 35 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_custom_template_request_body.go
  69. 43 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_driver_license_back.go
  70. 73 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_driver_license_front.go
  71. 35 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_driver_license_request_body.go
  72. 80 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_driver_license_result.go
  73. 61 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_exit_entry_permit_confidence.go
  74. 34 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_exit_entry_permit_endorsement_info.go
  75. 31 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_exit_entry_permit_request_body.go
  76. 66 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_exit_entry_permit_result.go
  77. 29 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_extra_info_list.go
  78. 44 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_request_body.go
  79. 34 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_result.go
  80. 26 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_result_image_size.go
  81. 38 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_words_block_list.go
  82. 32 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_words_region_list.go
  83. 26 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_flight_itinerary_request_body.go
  84. 98 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_flight_itinerary_result.go
  85. 44 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_table_request_body.go
  86. 29 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_table_result.go
  87. 41 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_table_words_block_list.go
  88. 28 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_text_char_list.go
  89. 41 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_text_request_body.go
  90. 29 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_text_result.go
  91. 32 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_text_words_block_list.go
  92. 35 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_handwriting_request_body.go
  93. 26 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_handwriting_result.go
  94. 32 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_handwriting_words_block_list.go
  95. 29 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_health_code_request_body.go
  96. 74 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_health_code_result.go
  97. 29 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_health_code_words_block_list.go
  98. 31 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_hk_id_card_request_body.go
  99. 58 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_hk_id_card_result.go
  100. 106 0
      vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_household_register_content.go

+ 6 - 0
.idea/go.imports.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GoImports">
+    <option name="optimizeImportsOnTheFly" value="false" />
+  </component>
+</project>

+ 74 - 13
app/api/youngee_talent_api/talent_auth_get_api.go

@@ -91,7 +91,6 @@ func (*talentAuthGetApi) DisplayQrcode(r *ghttp.Request) {
 	if err != nil {
 		panic("write response error")
 	}
-
 }
 
 // 达人授权快手电商
@@ -113,8 +112,8 @@ func (*talentAuthGetApi) CheckAccount(r *ghttp.Request) {
 }
 
 // 轮询用户是否扫码了,,好让弹窗消失 1.避免重复绑定 2.扫码之后弹窗消失。/kuangshouauth中删除老数据。此接口code=0时,说明查到了新数据进来。弹窗消失
-func (*talentAuthGetApi) CheckKsNewAccount(r *ghttp.Request) {
-	res := youngee_talent_service.CheckKsNewAccount(r)
+func (*talentAuthGetApi) CheckNewAccount(r *ghttp.Request) {
+	res := youngee_talent_service.CheckNewAccount(r)
 	err := r.Response.WriteJson(res)
 	if err != nil {
 		panic("write response error")
@@ -122,13 +121,13 @@ func (*talentAuthGetApi) CheckKsNewAccount(r *ghttp.Request) {
 }
 
 // 轮询用户是否扫码了,好让弹窗消失/douyinauth中检查是否已被绑定,未绑定则,删除老数据。此接口code=0时,说明查到了新数据进来。弹窗消失
-func (*talentAuthGetApi) CheckDyNewAccount(r *ghttp.Request) {
-	res := youngee_talent_service.CheckDyNewAccount(r)
-	err := r.Response.WriteJson(res)
-	if err != nil {
-		panic("write response error")
-	}
-}
+//func (*talentAuthGetApi) CheckDyNewAccount(r *ghttp.Request) {
+//	res := youngee_talent_service.CheckDyNewAccount(r)
+//	err := r.Response.WriteJson(res)
+//	if err != nil {
+//		panic("write response error")
+//	}
+//}
 
 // 查30天销量(此时已经执行完了/kuaishouauth,在checkaccount的过程中执行此函数)
 func (*talentAuthGetApi) QuerySalesFor30Days(r *ghttp.Request) {
@@ -193,6 +192,15 @@ func (*talentAuthGetApi) GetDouyinList(r *ghttp.Request) {
 	}
 }
 
+// 账号管理--小红书/微博/哔哩哔哩
+func (*talentAuthGetApi) GetMyAccountList(r *ghttp.Request) {
+	res := youngee_talent_service.GetMyAccountList(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
 // 带货---点击添加橱窗---展示可选择的快手信息
 func (*talentAuthGetApi) AddWindowKuaishouList(r *ghttp.Request) {
 	res := youngee_talent_service.AddWindowKuaishouList(r)
@@ -220,6 +228,14 @@ func (*talentAuthGetApi) SignUpProjKuaishouList(r *ghttp.Request) {
 	}
 }
 
+func (*talentAuthGetApi) SignUpProjAccountList(r *ghttp.Request) {
+	res := youngee_task_service.SignUpProjAccountList(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
 func (*talentAuthGetApi) AddWindow(r *ghttp.Request) {
 	res := youngee_talent_service.AddWindow(r)
 	err := r.Response.WriteJson(res)
@@ -499,13 +515,40 @@ func (*talentAuthGetApi) GetMessageList(r *ghttp.Request) {
 	}
 }
 
-func (*talentAuthGetApi) GetMessageDetail(r *ghttp.Request) {
-	res := youngee_talent_service.GetMessageDetail(r)
+// 清理所有未读消息
+func (*talentAuthGetApi) CleanAllUnread(r *ghttp.Request) {
+	res := youngee_talent_service.CleanAllUnread(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
+// 进入消息详情--清空此类型未读消息
+func (*talentAuthGetApi) CleanTypeUnread(r *ghttp.Request) {
+	res := youngee_talent_service.CleanTypeUnread(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
+func (*talentAuthGetApi) DeleteMessage(r *ghttp.Request) {
+	res := youngee_talent_service.DeleteMessage(r)
 	err := r.Response.WriteJson(res)
 	if err != nil {
 		panic("write response error")
 	}
 }
+
+//func (*talentAuthGetApi) GetMessageDetail(r *ghttp.Request) {
+//	res := youngee_talent_service.GetMessageDetail(r)
+//	err := r.Response.WriteJson(res)
+//	if err != nil {
+//		panic("write response error")
+//	}
+//}
+
 func (*talentAuthGetApi) HasUnReadMessage(r *ghttp.Request) {
 	res := youngee_talent_service.HasUnReadMessage(r)
 	err := r.Response.WriteJson(res)
@@ -712,6 +755,15 @@ func (*talentAuthGetApi) GetProjRecruitList(r *ghttp.Request) {
 	}
 }
 
+// // 匹配本地生活策略,含是否可选属性
+//func (*talentAuthGetApi) GetLocalRecruitList(r *ghttp.Request) {
+//	res := youngee_task_service.GetLocalRecruitList(r)
+//	err := r.Response.WriteJson(res)
+//	if err != nil {
+//		panic("write response error")
+//	}
+//}
+
 // 提现记录列表
 func (*talentAuthGetApi) GetWithdrawList(r *ghttp.Request) {
 	res := youngee_task_service.GetWithdrawList(r)
@@ -731,7 +783,7 @@ func (*talentAuthGetApi) GetWithdrawDetail(r *ghttp.Request) {
 }
 
 // todo: 获取本地生活详情页
-func (*talentGetApi) GetLocalLifeDetail(r *ghttp.Request) {
+func (*talentAuthGetApi) GetLocalLifeDetail(r *ghttp.Request) {
 	res := youngee_task_service.GetLocalLifeDetail(r)
 
 	err := r.Response.WriteJson(res)
@@ -739,3 +791,12 @@ func (*talentGetApi) GetLocalLifeDetail(r *ghttp.Request) {
 		panic("write response error")
 	}
 }
+
+// test
+func (*talentAuthGetApi) TestImage(r *ghttp.Request) {
+	res := youngee_talent_service.TestImage(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}

+ 39 - 22
app/api/youngee_talent_api/talent_auth_post_api.go

@@ -81,16 +81,25 @@ func (*talentAuthPostApi) AddTalentAccount(r *ghttp.Request) {
 	}
 }
 
-// UpdateTalentAccount 修改达人社媒账号
-// youngee_platform_account_info
-func (*talentAuthPostApi) UpdateTalentAccount(r *ghttp.Request) {
-	res := youngee_talent_service.OnUpdateTalentAccount(r)
+// 删除账号
+func (*talentAuthPostApi) DelTalentAccount(r *ghttp.Request) {
+	res := youngee_talent_service.DelTalentAccount(r)
 	err := r.Response.WriteJson(res)
 	if err != nil {
 		panic("write response error")
 	}
 }
 
+// UpdateTalentAccount 修改达人社媒账号
+// youngee_platform_account_info
+//func (*talentAuthPostApi) UpdateTalentAccount(r *ghttp.Request) {
+//	res := youngee_talent_service.OnUpdateTalentAccount(r)
+//	err := r.Response.WriteJson(res)
+//	if err != nil {
+//		panic("write response error")
+//	}
+//}
+
 // OnAddTalentBank 添加银行卡绑定信息
 // younggee_talent_bank
 func (*talentAuthPostApi) AddTalentBank(r *ghttp.Request) {
@@ -167,21 +176,13 @@ func (*talentAuthPostApi) UpdateLogisticsAddress(r *ghttp.Request) {
 	}
 }
 
-func (*talentAuthPostApi) SetMessageRead(r *ghttp.Request) {
-	res := youngee_talent_service.SetMessageRead(r)
-	err := r.Response.WriteJson(res)
-	if err != nil {
-		panic("write response error")
-	}
-}
-
-func (*talentAuthPostApi) DeleteMessage(r *ghttp.Request) {
-	res := youngee_talent_service.DeleteMessage(r)
-	err := r.Response.WriteJson(res)
-	if err != nil {
-		panic("write response error")
-	}
-}
+//func (*talentAuthPostApi) SetMessageRead(r *ghttp.Request) {
+//	res := youngee_talent_service.SetMessageRead(r)
+//	err := r.Response.WriteJson(res)
+//	if err != nil {
+//		panic("write response error")
+//	}
+//}
 
 func (*talentAuthPostApi) GetAutoTime(r *ghttp.Request) {
 	res := youngee_task_service.GetAutoTime(r)
@@ -218,6 +219,14 @@ func (*talentAuthPostApi) AddYoungTeam(r *ghttp.Request) {
 	}
 }
 
+func (*talentAuthPostApi) UpdateTalentName(r *ghttp.Request) {
+	res := youngee_talent_service.UpdateTalentName(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
 //func (*talentAuthPostApi) SignUpSecTaskFromWindow(r *ghttp.Request) {
 //	res := youngee_sectask_service.SignUpSecTaskFromWindow(r)
 //	err := r.Response.WriteJson(res)
@@ -227,7 +236,7 @@ func (*talentAuthPostApi) AddYoungTeam(r *ghttp.Request) {
 //}
 
 // 带货加入橱窗---选中账号---点击提交(选品不存在/未开通)--需要提供productid和openid和粉丝数和销量(他们来自list中)
-func (*talentAuthGetApi) AddWindowWithKsAccount(r *ghttp.Request) {
+func (*talentAuthPostApi) AddWindowWithKsAccount(r *ghttp.Request) {
 	res := youngee_talent_service.AddWindowWithKsAccount(r)
 	err := r.Response.WriteJson(res)
 	if err != nil {
@@ -253,7 +262,7 @@ func (*talentAuthPostApi) SignUpSecTaskWithKsAccount(r *ghttp.Request) {
 //	}
 //}
 
-// 种草---已选中账号--点击立即报名并加入橱窗
+// 种草---已选中快手账号--点击立即报名并加入橱窗
 func (*talentAuthPostApi) SignUpTaskWithKsAccount(r *ghttp.Request) {
 	res := youngee_task_service.SignUpTaskWithKsAccount(r)
 	err := r.Response.WriteJson(res)
@@ -262,6 +271,15 @@ func (*talentAuthPostApi) SignUpTaskWithKsAccount(r *ghttp.Request) {
 	}
 }
 
+// 种草---已选中社媒账号--点击立即报名
+func (*talentAuthPostApi) SignUpTaskWithAccount(r *ghttp.Request) {
+	res := youngee_task_service.SignUpTaskWithAccount(r)
+	err := r.Response.WriteJson(res)
+	if err != nil {
+		panic("write response error")
+	}
+}
+
 // 本地生活报名
 func (*talentAuthPostApi) SignUpLocalWithKsAccount(r *ghttp.Request) {
 	res := youngee_task_service.SignUpLocalWithKsAccount(r)
@@ -286,5 +304,4 @@ func (*talentAuthPostApi) AuthCurrentPhone(r *ghttp.Request) {
 	if err != nil {
 		panic("write response error")
 	}
-
 }

+ 5 - 0
app/model/youngee_talent_model/auth_model.go

@@ -65,3 +65,8 @@ type DYListResult struct {
 	Count    int
 	UserInfo []*KuaishouUserInfo // 用户信息列表
 }
+
+type AccountListResult struct {
+	Count    int
+	UserInfo []*KuaishouUserInfo // 用户信息列表
+}

+ 64 - 53
app/model/youngee_talent_model/local_info.go

@@ -45,10 +45,16 @@ type YounggeeLocalLifeInfo struct {
 	TotalRecruitNum     int                `json:"total_recruit_num"`      // 此任务各策略招募人数总和
 	Tools               string             `json:"tools"`                  // 工具选择,1邀约招募 2样品物流 3审稿工具 4作品审查 5数据巡检 6结算账单(,分隔)
 	InvoiceStatus       int                `json:"invoice_status"`         // 开票状态(1开票中 2已开票)
-	YounggeeStore       *YounggeeStore     `json:"younggee_store"`         //关联门店
-	RecruitStrategys    []*RecruitStrategy `orm:"with:project_id=project_id"`
+	YounggeeStore       *YounggeeStore     `orm:"with:store_id=store_id"`  //关联门店
+	RecruitStrategys    []*RecruitStrategy `orm:"with:project_id=local_id"`
 	Enterprise          *Enterprise        `orm:"with:enterprise_id=enterprise_id"`
 	WatchNum            int                `json:"watch_num"`
+	MinFollowers        int                `json:"min_followers"`
+	MaxFollowers        int                `json:"max_followers"`
+	IsShowOffer         int                `json:"is_show_offer"`
+	HaveSelfOffer       int                `json:"have_self_offer"`
+	MaxOffer            int                `json:"max_offer"`
+	MinOffer            int                `json:"min_offer"`
 }
 
 // 服务商接手的项目信息
@@ -75,57 +81,62 @@ type LocalInfoSupplier struct {
 }
 
 type LocalInfoDetail struct {
-	Id                  int                `json:"id"`                              // 本地生活表主键ID
-	LocalId             string             `json:"local_id"`                        // 项目id
-	LocalType           int                `json:"local_type"`                      // 项目类型,1代表全流程项目,2代表专项项目
-	LocalPlatform       int                `json:"local_platform"`                  // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
-	ServiceChargeRate   float64            `json:"service_charge_rate"`             // 公开服务费率
-	StoreId             int                `json:"store_id"`                        // 关联门店id
-	StoreRelatedAt      *gtime.Time        `json:"store_related_at"`                // 关联门店时间
-	TeamBuyingId        int                `json:"team_buying_id"`                  // 关联团购id
-	TeamBuyingRelatedAt *gtime.Time        `json:"team_buying_related_at"`          // 关联团购时间
-	PromoteBody         int                `json:"promote_body"`                    // 推广主体(1门店 2团购)
-	Donate              int                `json:"donate"`                          // 赠送达人套餐(1有赠送 2无赠送)
-	LocalName           string             `json:"local_name"`                      // 任务标题
-	TalentType          string             `json:"talent_type"`                     // 达人类型(,分隔)
-	RecruitDdl          *gtime.Time        `json:"recruit_ddl"`                     // 招募截止时间
-	TaskForm            int                `json:"task_form"`                       // '任务形式,1-2分别代表线下探店,素材分发',
-	ContentType         int                `json:"content_type"`                    // 内容形式,1代表图文,2代表视频
-	TaskDetail          string             `json:"task_detail"`                     // 任务详情
-	TaskStatus          int                `json:"task_status"`                     // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、执行中、失效、已结案
-	EnterpriseId        string             `json:"enterprise_id"`                   // 所属企业id
-	SubAccountId        int                `json:"sub_account_id"`                  // 子账号id
-	OperatorType        int                `json:"operator_type"`                   // 创建者类型,1商家主账号,2商家子账号
-	ApplyNum            int                `json:"apply_num"`                       // 报名人数
-	RecruitNum          int                `json:"recruit_num"`                     // 已招募人数
-	CreatedAt           *gtime.Time        `json:"created_at"`                      // 创建时间
-	UpdatedAt           *gtime.Time        `json:"updated_at"`                      // 修改时间
-	AutoFailAt          *gtime.Time        `json:"auto_fail_at"`                    // 失效自动处理时间
-	AutoTaskId          int                `json:"auto_task_id"`                    // 定时任务id
-	AutoDefaultId       int                `json:"auto_default_id"`                 // 违约状态id
-	PaymentAmount       float32            `json:"payment_amount"`                  // 支付金额
-	PayAt               *gtime.Time        `json:"pay_at"`                          // 支付时间
-	SubmitAt            *gtime.Time        `json:"submit_at"`                       // 提交审核时间
-	PassAt              *gtime.Time        `json:"pass_at"`                         // 审核通过时间
-	FinishAt            *gtime.Time        `json:"finish_at"`                       // 结案时间
-	EstimatedCost       float64            `json:"estimated_cost"`                  // 预估成本
-	SettlementAmount    float64            `json:"settlement_amount"`               // 结算金额
-	TotalRecruitNum     int                `json:"total_recruit_num"`               // 此任务各策略招募人数总和
-	Tools               string             `json:"tools"`                           // 工具选择,1邀约招募 2样品物流 3审稿工具 4作品审查 5数据巡检 6结算账单(,分隔)
-	InvoiceStatus       int                `json:"invoice_status"`                  // 开票状态(1开票中 2已开票)
-	WatchedNum          int                `json:"watched_num"`                     // 浏览量
-	YounggeeStore       *YounggeeStore     `orm:"with:store_id=store_id"`           //关联门店
-	RecruitStrategys    []*RecruitStrategy `orm:"with:project_id=store_id"`         //门店的策略
-	Enterprise          *Enterprise        `orm:"with:enterprise_id=enterprise_id"` //商家信息
-	YounggeeSupplier    *YounggeeSupplier  `json:"younggee_supplier"`               //服务商信息
-	PlatformInfo        *PlatformInfo      `orm:"with:platform_id=local_platform"`  //平台信息
-	LocalInfoSupplier   *LocalInfoSupplier //服务商提供的LocalInfo
-	ProjectBrief        []*ProjectBrief    `orm:"with:project_brief_id=id"` // 项目brief图
-	ProjectMaterial     []*ProjectMaterial `orm:"with:project_material=id"` // 项目brief图
+	gmeta.Meta           `orm:"table:younggee_local_life_info"`
+	Id                   int                     `json:"id"`                              // 本地生活表主键ID
+	LocalId              string                  `json:"local_id"`                        // 项目id
+	LocalType            int                     `json:"local_type"`                      // 项目类型,1代表全流程项目,2代表专项项目
+	LocalPlatform        int                     `json:"local_platform"`                  // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	ServiceChargeRate    float64                 `json:"service_charge_rate"`             // 公开服务费率
+	StoreId              int                     `json:"store_id"`                        // 关联门店id
+	StoreRelatedAt       *gtime.Time             `json:"store_related_at"`                // 关联门店时间
+	TeamBuyingId         int                     `json:"team_buying_id"`                  // 关联团购id
+	TeamBuyingRelatedAt  *gtime.Time             `json:"team_buying_related_at"`          // 关联团购时间
+	PromoteBody          int                     `json:"promote_body"`                    // 推广主体(1门店 2团购)
+	Donate               int                     `json:"donate"`                          // 赠送达人套餐(1有赠送 2无赠送)
+	LocalName            string                  `json:"local_name"`                      // 任务标题
+	TalentType           string                  `json:"talent_type"`                     // 达人类型(,分隔)
+	RecruitDdl           *gtime.Time             `json:"recruit_ddl"`                     // 招募截止时间
+	TaskForm             int                     `json:"task_form"`                       // '任务形式,1-2分别代表线下探店,素材分发',
+	ContentType          int                     `json:"content_type"`                    // 内容形式,1代表图文,2代表视频
+	TaskDetail           string                  `json:"task_detail"`                     // 任务详情
+	TaskStatus           int                     `json:"task_status"`                     // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、执行中、失效、已结案
+	EnterpriseId         string                  `json:"enterprise_id"`                   // 所属企业id
+	SubAccountId         int                     `json:"sub_account_id"`                  // 子账号id
+	OperatorType         int                     `json:"operator_type"`                   // 创建者类型,1商家主账号,2商家子账号
+	ApplyNum             int                     `json:"apply_num"`                       // 报名人数
+	RecruitNum           int                     `json:"recruit_num"`                     // 已招募人数
+	CreatedAt            *gtime.Time             `json:"created_at"`                      // 创建时间
+	UpdatedAt            *gtime.Time             `json:"updated_at"`                      // 修改时间
+	AutoFailAt           *gtime.Time             `json:"auto_fail_at"`                    // 失效自动处理时间
+	AutoTaskId           int                     `json:"auto_task_id"`                    // 定时任务id
+	AutoDefaultId        int                     `json:"auto_default_id"`                 // 违约状态id
+	PaymentAmount        float32                 `json:"payment_amount"`                  // 支付金额
+	PayAt                *gtime.Time             `json:"pay_at"`                          // 支付时间
+	SubmitAt             *gtime.Time             `json:"submit_at"`                       // 提交审核时间
+	PassAt               *gtime.Time             `json:"pass_at"`                         // 审核通过时间
+	FinishAt             *gtime.Time             `json:"finish_at"`                       // 结案时间
+	EstimatedCost        float64                 `json:"estimated_cost"`                  // 预估成本
+	SettlementAmount     float64                 `json:"settlement_amount"`               // 结算金额
+	TotalRecruitNum      int                     `json:"total_recruit_num"`               // 此任务各策略招募人数总和
+	Tools                string                  `json:"tools"`                           // 工具选择,1邀约招募 2样品物流 3审稿工具 4作品审查 5数据巡检 6结算账单(,分隔)
+	InvoiceStatus        int                     `json:"invoice_status"`                  // 开票状态(1开票中 2已开票)
+	WatchedNum           int                     `json:"watched_num"`                     // 浏览量
+	YounggeeStore        *YounggeeStore          `orm:"with:store_id=store_id"`           //关联门店
+	RecruitStrategys     []*RecruitStrategy      `orm:"with:project_id=local_id"`         //门店的策略
+	Enterprise           *Enterprise             `orm:"with:enterprise_id=enterprise_id"` //商家信息
+	YounggeeSupplier     *YounggeeSupplier       `json:"younggee_supplier"`               //服务商信息
+	PlatformInfo         *PlatformInfo           `orm:"with:platform_id=local_platform"`  //平台信息
+	LocalInfoSupplier    *LocalInfoSupplier      //服务商提供的LocalInfo
+	ProjectBrief         []*ProjectBrief         `orm:"with:project_id=id"` // 项目brief图
+	ProjectMaterial      []*ProjectMaterial      `orm:"with:project_id=id"` // 项目brief图
+	YounggeeProductPhoto []*YounggeeProductPhoto `json:"younggee_product_photo"`
 	//违约说明
-	DraftDefault *DraftDefault `json:"draft_default"` //初稿违约说明
-	LinkDefault  *LinkDefault  `json:"link_breach"`   //链接违约说明
-	DataDefault  *DataDefault  `json:"data_default"`  //数据违约说明
+	DraftBreakTime    int `json:"draft_break_time"`    //初稿上传截止时间
+	DraftBreakPercent int `json:"draft_break_percent"` //初稿扣款比例
+	LinkBreakTime     int `json:"link_break_time"`     //链接上传截止
+	LinkBreakPercent  int `json:"link_break_percent"`  //超时扣款比例
+	DataBreakTime     int `json:"data_break_time"`     //数据上传截止时间
+	DataBreakPercent  int `json:"data_break_percent"`  //超时扣款比例
 
 }
 
@@ -145,7 +156,7 @@ type YounggeeStore struct {
 	OperateType          int                     `json:"operate_type"`           // 操作人类型(1商家 2后台)
 	EnterpriseId         string                  `json:"enterprise_id"`          // 商家id
 	SubAccountId         int                     `json:"sub_account_id"`         // 商家子账号id
-	YounggeeTeamBuying   []*YounggeeTeamBuying   `json:"younggee_team_buying"`   //关联团购
+	YounggeeTeamBuying   []*YounggeeTeamBuying   `orm:"with:store_id=store_id"`  //关联团购
 	YounggeeProductPhoto []*YounggeeProductPhoto `json:"younggee_product_photo"` //门店照片
 
 }

+ 8 - 0
app/model/youngee_talent_model/message.go

@@ -91,9 +91,17 @@ type YounggeeMutilMessInfo struct {
 	gmeta.Meta     `orm:"table:message_multi_info"`
 	Id             int         `orm:"id,primary"   json:"id"`                 // id,递增
 	MessageContent string      `orm:"message_content" json:"message_content"` //具体消息信息
+	MessTitle      string      `orm:"mess_title" json:"mess_title"`           //标题
 	MessType       int         `orm:"mess_type"     json:"mess_type"`         //消息类型 1-6
 	TalentId       string      `orm:"talent_id"     json:"talent_id"`
 	CreatedAt      *gtime.Time `orm:"created_at"   json:"created_at"` // 消息创建时间
 	IsReaded       int         `orm:"is_readed"    json:"is_readed"`  // 是否已读,1表示未读,2表示已读
 	IsDeleted      int         `orm:"is_deleted"   json:"is_deleted"` // 是否删除,1表示未删,2表示已删
 }
+
+type NotificationTypeResult struct {
+	Type        int                     `json:"type"`
+	UnreadCount int                     `json:"unread_count"`
+	LatestInfo  *YounggeeMutilMessInfo  `json:"latest_info"` //最新的信息,展示在消息列表页
+	Data        []YounggeeMutilMessInfo `json:"data"`        // 返回该类型所有消息
+}

+ 11 - 9
app/model/youngee_talent_model/product_info.go

@@ -9,7 +9,7 @@ import (
 type YounggeeProduct struct {
 	gmeta.Meta          `orm:"table:younggee_product"`
 	ProductId           int         `json:"product_id"`           // 商品id
-	KuaishouProductId   int64       `json:"kuaishou_product_id"`  // 快手中实际商品id
+	KuaishouProductId   string      `json:"kuaishou_product_id"`  // 快手中实际商品id
 	ProductName         string      `json:"product_name"`         // 商品名称
 	ProductType         int         `json:"product_type"`         // 商品类型
 	ShopAddress         string      `json:"shop_address"`         // 店铺地址,商品类型为线下品牌时需填写
@@ -27,14 +27,16 @@ type YounggeeProduct struct {
 }
 
 type YounggeeProductPhoto struct {
-	gmeta.Meta     `orm:"table:younggee_product_photo"`
-	ProductPhotoId int         `json:"product_photo_id"` // 商品图片id
-	PhotoUrl       string      `json:"photo_url"`        // 图片或视频url
-	StoreId        int         `json:"store_id"`
-	PhotoUid       string      `json:"photo_uid"`                                 //
-	Symbol         int         `json:"symbol"`                                    // 图片为主图或详情图标志位,1为主图,2为详情图,3为视频
-	ProductId      int         `json:"product_id"`                                // 所属商品id
-	CreatedAt      *gtime.Time `orm:"created_at"               json:"created_at"` // 创建时间
+	gmeta.Meta       `orm:"table:younggee_product_photo"`
+	ProductPhotoId   int         `json:"product_photo_id"` // 商品图片id
+	PhotoUrl         string      `json:"photo_url"`        // 图片或视频url
+	StoreId          int         `json:"store_id"`
+	TeamBuyingId     int         `json:"team_buying_id"`
+	ProductPhotoType int         `json:"product_photo_type"`                        //'图片类型:1商品,2门店,3团购',
+	PhotoUid         string      `json:"photo_uid"`                                 //
+	Symbol           int         `json:"symbol"`                                    // 图片为主图或详情图标志位,1为主图,2为详情图,3为视频
+	ProductId        int         `json:"product_id"`                                // 所属商品id
+	CreatedAt        *gtime.Time `orm:"created_at"               json:"created_at"` // 创建时间
 }
 
 // 两张product相关信息表汇总到一张。再selection中请求一次selection信息,请求一个product信息

+ 26 - 32
app/model/youngee_talent_model/project_detail.go

@@ -36,7 +36,7 @@ type ProductPhoto struct {
 type RecruitStrategy struct {
 	gmeta.Meta        `orm:"table:recruit_strategy"`
 	RecruitStrategyId int     `json:"recruit_strategy_id"` // 招募策略id
-	FeeForm           int     `json:"fee_form"`            // 稿费形式,1-3分别代表产品置换、固定稿费、自报价
+	FeeForm           int     `json:"fee_form"`            // 稿费形式,1-3分别代表无费置换、一口价、自报价
 	StrategyId        int     `json:"strategy_id"`         // 策略id
 	FollowersLow      int     `json:"followers_low"`       // 达人粉丝数下限
 	FollowersUp       int     `json:"followers_up"`        // 达人粉丝数上限
@@ -47,6 +47,7 @@ type RecruitStrategy struct {
 	ServiceCharge     float64 `json:"service_charge"`      // 平台服务费,稿费形式为产品置换时必填
 	ServiceRate       float64 `json:"service_rate"`        //服务费率
 	IsFit             int     `json:"is_fit"`              //此策略是否匹配成功
+
 }
 
 // 种草brief
@@ -134,6 +135,7 @@ type ProjectDetail struct {
 	ProjectStatus   int         `json:"project_status"`   // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
 	ProjectPlatform int         `json:"project_platform"` // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
 	ProjectForm     int         `json:"project_form"`     // 项目形式,1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
+	ProductCategory string      `json:"product_category"` // 商品类型
 	TalentType      string      `json:"talent_type"`      // 达人类型
 	RecruitDdl      *gtime.Time `json:"recruit_ddl"`      // 招募截止时间
 	ContentType     int         `json:"content_type"`     // 内容形式,1代表图文,2代表视频
@@ -142,36 +144,28 @@ type ProjectDetail struct {
 	ProductId       int         `json:"product_id"`       // 关联商品id
 	EnterpriseId    string      `json:"enterprise_id"`    // 所属企业id
 	//SupplierId          string               `json:"supplier_id"`                                   //所属服务商id
-	WatchedNum          int                  `json:"watched_num"`               // 浏览量
-	ProjectBrief        []*ProjectBrief      `orm:"with:project_id=project_id"` // 项目brief图
-	ProjectMaterial     []*ProjectMaterial   `orm:"with:project_id=project_id"` // 项目brief图
-	RecruitStrategy     []*RecruitStrategy   `orm:"with:project_id=project_id"` // 招募策略
-	Enterprise          *Enterprise          //商家信息
-	ProjectInfoSupplier *ProjectInfoSupplier //服务商单的project
-	YounggeeSupplier    *YounggeeSupplier    //服务商信息
-	PlatformInfo        *PlatformInfo        `orm:"with:platform_id=project_platform"`              //平台信息,目前为快手
-	ProductSnap         string               `orm:"product_snap"         json:"product_snap"`       // 商品信息快照
-	ProductPhotoSnap    string               `orm:"product_photo_snap"   json:"product_photo_snap"` // 商品图片快照
-	ServiceChargeRate   float64              `orm:"service_charge_rate" json:"service_charge_rate"` //服务费率
-	ViewNum             int                  `orm:"view_num" json:"view_num"`                       //浏览量
+	WatchedNum           int                     `json:"watched_num"`               // 浏览量
+	ProjectBrief         []*ProjectBrief         `orm:"with:project_id=project_id"` // 项目brief图
+	ProjectMaterial      []*ProjectMaterial      `orm:"with:project_id=project_id"` // 项目brief图
+	RecruitStrategy      []*RecruitStrategy      `orm:"with:project_id=project_id"` // 招募策略
+	Enterprise           *Enterprise             //商家信息
+	ProjectInfoSupplier  *ProjectInfoSupplier    //服务商单的project
+	YounggeeSupplier     *YounggeeSupplier       //服务商信息
+	YounggeeProduct      *YounggeeProduct        `orm:"with:product_id=product_id"`                     // 商品基本表
+	YounggeeProductPhoto []*YounggeeProductPhoto `orm:"with:product_id=product_id"`                     // 商品图片表
+	PlatformInfo         *PlatformInfo           `orm:"with:platform_id=project_platform"`              //平台信息,目前为快手
+	ProductSnap          string                  `orm:"product_snap"         json:"product_snap"`       // 商品信息快照
+	ProductPhotoSnap     string                  `orm:"product_photo_snap"   json:"product_photo_snap"` // 商品图片快照
+	ServiceChargeRate    float64                 `orm:"service_charge_rate" json:"service_charge_rate"` //服务费率
+	ViewNum              int                     `orm:"view_num" json:"view_num"`                       //浏览量
 	//违约说明
-	AutoTaskId   int           `orm:"auto_task_id" json:"auto_task_id"`
-	AutoDefaltId int           `orm:"auto_defalt_id" json:"auto_defalt_id"`
-	DraftDefault *DraftDefault `json:"draft_default"` //初稿违约说明
-	LinkDefault  *LinkDefault  `json:"link_breach"`   //链接违约说明
-	DataDefault  *DataDefault  `json:"data_default"`  //数据违约说明
-}
-
-type DraftDefault struct {
-	BreakTime   int `json:"break_time"`
-	BreakPecent int `json:"break_pecent"`
-}
-
-type LinkDefault struct {
-	BreakTime   int `json:"break_time"`
-	BreakPecent int `json:"break_pecent"`
-}
-type DataDefault struct {
-	BreakTime   int `json:"break_time"`
-	BreakPecent int `json:"break_pecent"`
+	AutoTaskId        int `orm:"auto_task_id" json:"auto_task_id"`
+	AutoDefaultId     int `orm:"auto_default_id" json:"auto_default_id"`
+	DraftBreakTime    int `json:"draft_break_time"`    //初稿上传截止时间
+	DraftBreakPercent int `json:"draft_break_percent"` //初稿扣款比例
+	LinkBreakTime     int `json:"link_break_time"`     //链接上传截止
+	LinkBreakPercent  int `json:"link_break_percent"`  //超时扣款比例
+	DataBreakTime     int `json:"data_break_time"`     //数据上传截止时间
+	DataBreakPercent  int `json:"data_break_percent"`  //超时扣款比例
+	IsCollected       int `json:"is_collected"`        //此达人是否收藏 1表示已收藏,0表示没有收藏
 }

+ 27 - 19
app/model/youngee_talent_model/project_info.go

@@ -14,25 +14,33 @@ type ProductCoverInfo struct {
 }
 
 type ProjectInfo struct {
-	gmeta.Meta       `orm:"table:project_info"`
-	ProjectId        int                `json:"project_id"`       // 项目id
-	ProjectName      string             `json:"project_name"`     // 项目名称
-	ProjectStatus    int                `json:"project_status"`   // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
-	ProjectPlatform  int                `json:"project_platform"` // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
-	ProjectForm      int                `json:"project_form"`     // 项目形式,1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
-	RecruitDdl       *gtime.Time        `json:"recruit_ddl"`      // 招募截止时间
-	ProjectType      int                `json:"project_type"`     // 项目类型,1代表全流程项目,2代表专项项目
-	ContentType      int                `json:"content_type"`     // 内容形式,1代表图文,2代表视频
-	ProjectDetail    string             `json:"project_detail"`   // 项目详情
-	RecruitNum       int                `json:"recruit_num"`      //
-	ApplyNum         int                `json:"apply_num"`        //
-	EnterpriseId     string             `json:"enterprise_id"`    // 所属企业id
-	ProductId        int                `json:"product_id"`       // 关联商品id
-	WatchedNum       int                `json:"watched_num"`      // 浏览量
-	RecruitStrategys []*RecruitStrategy `orm:"with:project_id=project_id"`
-	Enterprise       *Enterprise        `orm:"with:enterprise_id=enterprise_id"`
-	ProductSnap      string             `orm:"product_snap"         json:"product_snap"`       // 商品信息快照
-	ProductPhotoSnap string             `orm:"product_photo_snap"   json:"product_photo_snap"` // 商品图片快照
+	gmeta.Meta           `orm:"table:project_info"`
+	ProjectId            string                  `json:"project_id"`                // 项目id
+	ProjectName          string                  `json:"project_name"`              // 项目名称
+	ProjectStatus        int                     `json:"project_status"`            // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
+	ProjectPlatform      int                     `json:"project_platform"`          // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
+	ProjectForm          int                     `json:"project_form"`              // 项目形式,1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
+	RecruitDdl           *gtime.Time             `json:"recruit_ddl"`               // 招募截止时间
+	ProjectType          int                     `json:"project_type"`              // 项目类型,1代表全流程项目,2代表专项项目
+	ContentType          int                     `json:"content_type"`              // 内容形式,1代表图文,2代表视频
+	ProjectDetail        string                  `json:"project_detail"`            // 项目详情
+	RecruitNum           int                     `json:"recruit_num"`               //
+	ApplyNum             int                     `json:"apply_num"`                 //
+	EnterpriseId         string                  `json:"enterprise_id"`             // 所属企业id
+	ProductId            int                     `json:"product_id"`                // 关联商品id
+	YounggeeProduct      *YounggeeProduct        `orm:"with:product_id=product_id"` // 商品基本表
+	YounggeeProductPhoto []*YounggeeProductPhoto `orm:"with:product_id=product_id"` // 商品图片表
+	WatchedNum           int                     `json:"watched_num"`               // 浏览量
+	MinFollowers         int                     `json:"min_followers"`             //最低粉丝要求
+	MaxFollowers         int                     `json:"max_followers"`             //最高粉丝要求
+	RecruitStrategys     []*RecruitStrategy      `orm:"with:project_id=project_id"`
+	MinOffer             int                     `json:"min_offer"` //如果有多个一口价的策略,展示最低的offer价格
+	MaxOffer             int                     `json:"max_offer"` //如果有多个一口价的策略,展示最高的offer价格
+	HaveSelfOffer        int                     `json:"have_self_offer"`
+	IsShowOffer          int                     `json:"is_show_offer"`
+	Enterprise           *Enterprise             `orm:"with:enterprise_id=enterprise_id"`
+	ProductSnap          string                  `orm:"product_snap"         json:"product_snap"`       // 商品信息快照
+	ProductPhotoSnap     string                  `orm:"product_photo_snap"   json:"product_photo_snap"` // 商品图片快照
 }
 
 // 种草收藏表信息

+ 14 - 12
app/model/youngee_talent_model/selection.go

@@ -51,18 +51,20 @@ type SelectionCollectionInfoList struct {
 }
 
 type FreeStrategy struct {
-	gmeta.Meta        `orm:"table:free_strategy"`
-	FreeStrategyId    int    `orm:"free_strategy_id" json:"free_strategy_id"`       // 免费领样策略id
-	StrategyId        int    `orm:"strategy_id" json:"strategy_id"`                 // 策略编号
-	SelectionId       string `orm:"selection_id" json:"selection_id"`               // 带货任务id
-	FansNum           int    `orm:"fans_num" json:"fans_num"`                       // 粉丝数量
-	SaleNum           int    `orm:"sale_num" json:"sale_num"`                       // 近30天橱窗销量
-	StrategyStatus    int    `orm:"strategy_status" json:"strategy_status"`         // 策略状态
-	EnrollNum         int    `orm:"enroll_num" json:"enroll_num"`                   // 报名数量
-	ChooseNum         int    `orm:"choose_num" json:"choose_num"`                   // 已选数量
-	BeforeDeliveryNum int    `orm:"before_delivery_num" json:"before_delivery_num"` // 待发货数量
-	DeliveryNum       int    `orm:"delivery_num" json:"delivery_num"`               // 已发货数量
-	AfterDeliveryNum  int    `orm:"after_delivery_num" json:"after_delivery_num"`   // 已签收数量
+	gmeta.Meta     `orm:"table:free_strategy"`
+	FreeStrategyId int    `orm:"free_strategy_id" json:"free_strategy_id"` // 免费领样策略id
+	StrategyId     int    `orm:"strategy_id" json:"strategy_id"`           // 策略编号
+	SelectionId    string `orm:"selection_id" json:"selection_id"`         // 带货任务id
+	//FansNum           int    `orm:"fans_num" json:"fans_num"`                       // 粉丝数量
+	FollowersLow      int `json:"followers_low"`                                 // 达人粉丝数下限
+	FollowersUp       int `json:"followers_up"`                                  // 达人粉丝数上限
+	SaleNum           int `orm:"sale_num" json:"sale_num"`                       // 近30天橱窗销量
+	StrategyStatus    int `orm:"strategy_status" json:"strategy_status"`         // 策略状态
+	EnrollNum         int `orm:"enroll_num" json:"enroll_num"`                   // 报名数量
+	ChooseNum         int `orm:"choose_num" json:"choose_num"`                   // 已选数量
+	BeforeDeliveryNum int `orm:"before_delivery_num" json:"before_delivery_num"` // 待发货数量
+	DeliveryNum       int `orm:"delivery_num" json:"delivery_num"`               // 已发货数量
+	AfterDeliveryNum  int `orm:"after_delivery_num" json:"after_delivery_num"`   // 已签收数量
 }
 
 type RewardStrategy struct {

+ 6 - 2
app/model/youngee_talent_model/selection_task.go

@@ -9,18 +9,21 @@ import (
 type SignSecTaskReq struct {
 	SelectionId string `json:"selection_id"`
 	ProductId   string `json:"product_id"`
+	KsProductId string `json:"ks_product_id"`
 	AddressId   uint64 `json:"address_id"`   //添加橱窗不需要
 	LeadTeamId  string `json:"lead_team_id"` //添加橱窗不需要
 	TeamId      string `json:"team_id"`      //添加橱窗不需要
-	SaleNum     int    `json:"saleNum"`
+	SaleNum     int    `json:"sale_num"`
 	FansNum     int    `json:"fans"`
 	OpenId      string `json:"open_id"` //选中账号的openid
-	//IsOk        int    `json:"is_ok"`   //此快手是否满足领样条件 0不满足,1满足
+	WxNum       string `json:"wx_num"`
+	IsOk        int    `json:"is_ok"` //此快手是否满足领样条件 0不满足,1满足
 }
 
 type SignSecTaskFromWindowReq struct {
 	SelectionId string `json:"selection_id"`
 	ProductId   string `json:"product_id"`
+	KSProductId string `json:"ks_product_id"`
 	OpenId      string `json:"open_id"` //选中账号的openid
 }
 
@@ -76,6 +79,7 @@ type SecTaskInfoDetail struct {
 	PlatformInfo           *PlatformInfo                `orm:"with:platform_id=platform_id"`                    //platform_id=8的是快手平台信息,含有粉丝数和作品数
 	KsUserInfo             []*KuaishouUserInfo          `orm:"with:open_id=open_id"`
 	TaskDdl                *gtime.Time                  `json:"task_ddl"`
+	WxNum                  string                       `orm:"wx_num"                  json:"wx_num"`
 }
 
 type SecTaskInfoWindowDetail struct {

+ 47 - 3
app/model/youngee_talent_model/talent_account.go

@@ -22,7 +22,51 @@ type PlatformAccountInfo struct {
 type AddAccountReq struct {
 	PlatformId int `json:"platform_id"` // 平台id
 	//Nickname           string             `json:"nick_name"`             // 废弃,不填写
-	HomePageUrl        string             `json:"home_page_url"`         // 主页链接
-	HomePageCaptureUrl string             `json:"home_page_capture_url"` // 主页截图链接
-	PlatformInfo       *InfoThirdPlatform `orm:"with:platform_id=platform_id"`
+	HomePageUrl        string `json:"home_page_url"`         // 主页链接
+	HomePageCaptureUrl string `json:"home_page_capture_url"` // 主页截图链接
+}
+
+type DelAccountReq struct {
+	PlatformId int    `json:"platform_id"` // 平台id
+	OpenId     string `json:"open_id"`     // 主页链接
+}
+
+// 定义 BasicInfo 结构体来匹配 JSON 数据
+type XHSBasicInfo struct {
+	Imageb     string `json:"imageb"`
+	Nickname   string `json:"nickname"`
+	Images     string `json:"images"`
+	RedID      string `json:"red_id"`
+	Gender     string `json:"gender"`
+	IPLocation string `json:"ip_location"`
+	Desc       string `json:"desc"`
+	Fans       int    `json:"fans"`
+	LikeNum    int    `json:"like_num"`
+}
+
+// 定义 BasicInfo 结构体来匹配 JSON 数据
+type WBBasicInfo struct {
+	Imageb    string `json:"imageb"`
+	Nickname  string `json:"nickname"`
+	HeadImage string `json:"head_image"`
+	WBID      string `json:"wbid"`
+	Gender    string `json:"gender"`
+	Fans      int    `json:"fans"`
+	PostNum   int    `json:"post_num"` //作品数目
+}
+
+// 定义 BasicInfo 结构体来匹配 JSON 数据
+type BliBasicInfo struct {
+	Nickname  string `json:"nickname"`
+	HeadImage string `json:"head_image"`
+	UID       string `json:"uid"`
+	Gender    string `json:"gender"`
+	Fans      int    `json:"fans"`
+}
+
+type OCRResponse struct {
+	SelfHome int    `json:"self_home"` //0:不是自己的主页, 1:是自己的主页
+	RedId    string `json:"red_id"`    //小红书唯一标识
+	Nickname string `json:"nickname"`  //微博、哔哩哔哩昵称
+	ErrMsg   string `json:"err_msg"`   //错误信息
 }

+ 1 - 1
app/model/youngee_talent_model/talent_bank.go

@@ -8,6 +8,7 @@ type TalentBankInfo struct {
 	gmeta.Meta      `orm:"table:younggee_talent_bank"`
 	TalentId        string `json:"talent_id"`         // 达人id(youngee_talent_info表中的id)
 	Name            string `json:"name"`              // 户主姓名
+	BankCardId      string `json:"bank_card_id"`      //身份证号
 	Phone           string `json:"phone"`             // 手机号
 	Bank            string `json:"bank"`              // 银行
 	BankCardNumber  string `json:"bank_card_number"`  // 银行卡号
@@ -16,7 +17,6 @@ type TalentBankInfo struct {
 	AlipayRealName  string `json:"alipay_real_name"`  // 支付宝真实姓名
 	IsBindBank      int    `json:"is_bind_bank"`      //
 	AlipayCardId    string `json:"alipay_card_id"`    // 支付宝身份证号
-	BankCardId      string `json:"bank_card_id"`      // 银行卡身份证号
 }
 
 type AddBankReq struct {

+ 3 - 3
app/model/youngee_talent_model/talent_income.go

@@ -20,9 +20,9 @@ type TalentIncomeInfoAll struct {
 type TalentIncomeInfo struct {
 	gmeta.Meta      `orm:"table:younggee_talent_income"`
 	Id              int         `orm:"id,primary"      json:"id"`              // 递增id
-	TalentId        string      `orm:"talent_id"       json:"talent_id"`       // 达人id,对应youngee_talent_info中id字段
+	TalentId        string      `orm:"talent_id"       json:"talent_id"`       // 达人id
 	ProjectId       string      `orm:"project_id"      json:"project_id"`      // 项目id
-	SelectionId     string      `orm:"selection_id"    json:"selection_id"`    // 选品id
+	SelectionId     string      `orm:"selection_id"    json:"selection_id"`    // 带货id
 	TaskId          string      `orm:"task_id"         json:"task_id"`         // 任务id
 	SectaskId       string      `orm:"sectask_id"      json:"sectask_id"`      // 选品任务id
 	BrandName       string      `orm:"brand_name"      json:"brand_name"`      // 品牌名称
@@ -34,7 +34,7 @@ type TalentIncomeInfo struct {
 	IncomeAt        *gtime.Time `orm:"income_at"       json:"income_at"`       // 收益产生时间
 	WithdrawAt      *gtime.Time `orm:"withdraw_at"     json:"withdraw_at"`     // 提现时间
 	PhotoUrl        string      `orm:"photo_url"       json:"photo_url"`       // 商品主图
-	Type            int         `orm:"type"            json:"type"`            // 选品or项目,1:项目,2:选品
+	Type            int         `orm:"type"            json:"type"`            // 选品or项目,1:种草,2:带货 3.本地生活
 	PlatformIconUrl string      `json:"platform_icon_url"`
 }
 

+ 38 - 10
app/model/youngee_talent_model/talent_info.go

@@ -16,12 +16,17 @@ type TalentSelfInputInfo struct {
 	IsBindInfo        uint   `json:"is_bind_info"`        // 是否填写个人资料
 }
 
+type UpdateNameReq struct {
+	TalentNickname string `json:"talent_nickname"`
+}
+
 type TalentInfo struct {
 	gmeta.Meta        `orm:"table:youngee_talent_info"`
-	Id                string      `json:"id"`                  // 达人id
-	TalentWxOpenid    string      `json:"talent_wx_openid"`    // 达人的微信openid
-	Avatar            string      `json:"avatar"`              // 达人的头像
-	TalentWxNickname  string      `json:"talent_wx_nickname"`  // 达人的微信昵称
+	Id                string      `json:"id"`                 // 达人id
+	TalentWxOpenid    string      `json:"talent_wx_openid"`   // 达人的微信openid
+	Avatar            string      `json:"avatar"`             // 达人的头像
+	TalentWxNickname  string      `json:"talent_wx_nickname"` // 达人的微信昵称
+	TalentNickname    string      `json:"talent_nickname"`
 	Income            float64     `json:"income"`              // 收益总数
 	Withdrawing       float64     `json:"withdrawing"`         // 提现中金额
 	Canwithdraw       float64     `json:"canwithdraw"`         // 可提现金额
@@ -47,14 +52,37 @@ type TalentInfo struct {
 }
 
 type TalentInfoNum struct {
-	AllTaskNum          int `json:"all_task_num"`
-	ApplyTaskNum        int `json:"apply_task_num"`
-	ExeTaskNum          int `json:"exe_task_num"`
-	EndTaskNum          int `json:"end_task_num"`
-	ExeTeamNum          int `json:"exe_team_num"`
-	EndTeamNum          int `json:"end_team_num"`
+	//种草
+	TaskCountNum *TaskCountNum `json:"task_count_num"`
+	//带货
+	SecTaskCountNum *SecTaskCountNum `json:"sec_task_count_num"`
+	//本地生活
+	LocalTaskCountNum *LocalTaskCountNum `json:"local_task_count_num"`
+}
+
+type TaskCountNum struct {
+	AllTaskNum   int `json:"all_task_num"`   //所有种草
+	ApplyTaskNum int `json:"apply_task_num"` //已报名任务
+	ExeTaskNum   int `json:"exe_task_num"`   //执行中任务
+	ToDealNum    int `json:"to_deal_num"`    //待结算任务
+	EndTaskNum   int `json:"end_task_num"`   //已结束任务
+}
+
+type SecTaskCountNum struct {
 	AllSecTaskNum       int `json:"all_sec_task_num"`        //所有带货
 	GetSampleSecTaskNum int `json:"get_sample_sec_task_num"` //已领样
 	ExeSecTaskNum       int `json:"exe_sec_task_num"`        //已出单
 	EndSecTaskNum       int `json:"end_sec_task_num"`        //已结束
+	InSampleProcessNum  int `json:"in_sample_process"`       //申样中
+	ToGetRewardNum      int `json:"to_get_reward_num"`       //待领悬赏
+	GetRewardNum        int `json:"get_reward_num"`          //已领悬赏
+}
+
+type LocalTaskCountNum struct {
+	AllLocalTaskNum   int `json:"all_task_num"`   //所有种草
+	ApplyLocalTaskNum int `json:"apply_task_num"` //已报名任务
+	ExeLocalTaskNum   int `json:"exe_task_num"`   //执行中任务
+	ToDealLocalNum    int `json:"to_deal_num"`    //待结算任务
+	ToBookLocalNum    int `json:"to_book_num"`    //待预约任务
+	EndLocalTaskNum   int `json:"end_task_num"`   //已结束任务
 }

+ 17 - 14
app/model/youngee_talent_model/task_income.go

@@ -3,7 +3,6 @@ package youngee_talent_model
 import (
 	"github.com/gogf/gf/os/gtime"
 	"github.com/gogf/gf/util/gmeta"
-	"time"
 )
 
 type WithdrawTaskInfo struct {
@@ -32,17 +31,21 @@ type WithdrawInfo struct {
 
 type WithdrawRecord struct {
 	gmeta.Meta     `orm:"table:younggee_withdraw_record"`
-	WithdrawID     string    `orm:"withdraw_id" json:"withdraw_id"`
-	TalentID       string    `orm:"talent_id" json:"talent_id"`
-	WithdrawAmount float64   `orm:"withdraw_amount" json:"withdraw_amount"`
-	AmountPayable  float64   `orm:"amount_payable" json:"amount_payable"`
-	PayPoint       int       `orm:"pay_point" json:"pay_point"`
-	IncomeIDList   string    `orm:"income_id_list" json:"income_id_list"`
-	ReceiveInfo    string    `orm:"receive_info" json:"receive_info"`
-	Status         int       `orm:"status" json:"status"`
-	BankType       int       `orm:"bank_type" json:"bank_type"`
-	SubmitAt       time.Time `orm:"submit_at" json:"submit_at"`
-	WithdrawAt     time.Time `orm:"withdraw_at" json:"withdraw_at"`
-	TaxAmount      float32   `orm:"tax_amount" json:"tax_amount"`
-	RejectReason   string    `orm:"reject_reason" json:"reject_reason"`
+	WithdrawID     string      `orm:"withdraw_id" json:"withdraw_id"`
+	TalentID       string      `orm:"talent_id" json:"talent_id"`
+	WithdrawAmount float64     `orm:"withdraw_amount" json:"withdraw_amount"`
+	AmountPayable  float64     `orm:"amount_payable" json:"amount_payable"`
+	PayPoint       int         `orm:"pay_point" json:"pay_point"`
+	IncomeIDList   string      `orm:"income_id_list" json:"income_id_list"`
+	ReceiveInfo    string      `orm:"receive_info" json:"receive_info"`
+	Status         int         `orm:"status" json:"status"`
+	BankType       int         `orm:"bank_type" json:"bank_type"`
+	SubmitAt       *gtime.Time `orm:"submit_at" json:"submit_at"`
+	WithdrawAt     *gtime.Time `orm:"withdraw_at" json:"withdraw_at"`
+	TaxAmount      float64     `orm:"tax_amount" json:"tax_amount"`
+	RejectReason   string      `orm:"reject_reason" json:"reject_reason"`
+	Name           string      `orm:"name" json:"name"`
+	IdcardNum      string      `orm:"idcard_num" json:"idcard_num"`
+	BankNum        string      `orm:"bank_num" json:"bank_num"`
+	PhoneNum       string      `orm:"phone_num" json:"phone_num"`
 }

+ 72 - 70
app/model/youngee_talent_model/task_info.go

@@ -97,65 +97,65 @@ type YoungeeTaskInfo struct {
 
 type YoungeeLocalTaskInfo struct {
 	gmeta.Meta             `orm:"table:youngee_local_task_info"`
-	TaskId                 string         `json:"task_id"`   // 任务ID
-	LocalId                string         `json:"local_id"`  // 项目ID
-	TalentId               string         `json:"talent_id"` // 达人ID
-	PlatformId             int            `json:"platform_id"`
-	AccountId              int            `json:"account_id"`                // 账号ID
-	OpenId                 string         `json:"open_id"`                   // 快手唯一标识
-	StrategyId             int            `json:"strategy_id"`               // 报名选择的招募策略ID
-	TalentPlatformInfoSnap string         `json:"talent_platform_info_snap"` // 达人平台信息快照
-	TalentPersonalInfoSnap string         `json:"talent_personal_info_snap"` // 达人个人信息快照
-	TalentPostAddrSnap     string         `json:"talent_post_addr_snap"`     // 收货地址快照
-	TaskReward             float64        `json:"task_reward"`               // 达人报酬
-	SettleAmount           float64        `json:"settle_amount"`             // 达人实际所得(扣除违约扣款)
-	AllPayment             float64        `json:"all_payment"`               // 企业支付总额
-	RealPayment            float64        `json:"real_payment"`              // 企业实际支付(扣除违约扣款)
-	ServiceRate            float64        `json:"service_rate"`              // 服务费率(千分比)
-	ServiceCharge          float64        `json:"service_charge"`            // 服务费
-	FeeForm                int            `json:"fee_form"`                  // 稿费形式 1: 产品置换 2: 固定稿费 3: 自报价
-	ErrBreakRate           int            `json:"err_break_rate"`            // 未上传类型违约扣款比例(百分比)
-	ScriptBreakRate        int            `json:"script_break_rate"`         // 脚本超时违约扣款比例(百分比)
-	SketchBreakRate        int            `json:"sketch_break_rate"`         // 初稿超时违约扣款比例(百分比)
-	LinkBreakRate          int            `json:"link_break_rate"`           // 链接超时违约扣款比例(百分比)
-	DataBreakRate          int            `json:"data_break_rate"`           // 数据超时违约扣款比例(百分比)
-	TaskStage              int            `json:"task_stage"`                // 任务阶段
-	TaskStatus             int            `json:"task_status"`               // 商家任务状态 1: 待选 2: 已选 3: 落选
-	LogisticsStatus        int            `json:"logistics_status"`          // 发货状态 1: 待发货 2: 已发货 3: 已签收
-	BookStatus             int            `json:"book_status"`               // 脚本上传状态 1-5 表示各阶段
-	SketchStatus           int            `json:"sketch_status"`             // 初稿上传状态 1-5 表示各阶段
-	LinkStatus             int            `json:"link_status"`               // 链接上传状态 1-5 表示各阶段
-	DataStatus             int            `json:"data_status"`               // 数据上传状态 1-5 表示各阶段
-	CompleteStatus         int            `json:"complete_status"`           // 结束方式 1: 未结束 2: 正常结束 3: 反选失败 4: 被解约
-	UpdateAt               *gtime.Time    `json:"update_at"`                 // 更新时间
-	CreateDate             *gtime.Time    `json:"create_date"`               // 创建时间
-	SelectDate             *gtime.Time    `json:"select_date"`               // 反选时间
-	DeliveryDate           *gtime.Time    `json:"delivery_date"`             // 发货时间
-	CompleteDate           *gtime.Time    `json:"complete_date"`             // 结束时间
-	WithdrawDate           *gtime.Time    `json:"withdraw_date"`             // 提现时间
-	CurDefaultType         int            `json:"cur_default_type"`          // 当前处于的违约类型
-	WithdrawStatus         int            `json:"withdraw_status"`           // 提现状态 1-4 表示不同状态
-	LeadTeamId             string         `json:"lead_team_id"`              // 团长young之团ID
-	TeamId                 string         `json:"team_id"`                   // 团员young之团ID
-	SettleStatus           int            `json:"settle_status"`             // 结算状态 1: 待结算 2: 已结算
-	TeamIncome             float64        `json:"team_income"`               // 团长现金收益
-	TeamPoint              int            `json:"team_point"`                // 团长积分收益
-	CurBreakAt             *gtime.Time    `json:"cur_break_at"`              // 当前阶段截止时间
-	SupplierId             int            `json:"supplier_id"`               // 服务商ID
-	SupplierStatus         int            `json:"supplier_status"`           // 服务商任务状态
-	DraftFee               float64        `json:"draft_fee"`                 // 达人稿费
-	SupportFee             float64        `json:"support_fee"`               //提报价格
-	SignedTime             *gtime.Time    `json:"signed_time"`               // 签收时间
-	FansNum                int            `json:"fans_num"`                  // 粉丝数
-	VoteAvg                int            `json:"vote_avg"`                  // 平均点赞数
-	CommitAvg              int            `json:"commit_avg"`                // 平均评论数
-	BOperator              string         `json:"b_operator"`                // 商家确定达人操作人ID
-	BOperatorType          int            `json:"b_operator_type"`           // 商家操作人类型
-	SOperator              int            `json:"s_operator"`                // 服务商提报达人操作人ID
-	SOperatorType          int            `json:"s_operator_type"`           // 服务商操作人类型
-	SProjectId             int            `json:"s_project_id"`              // 服务商种草任务ID
-	ProjectDetail          *ProjectDetail `json:"project_detail"`            //项目详情
-	WxNum                  string         `json:"wx_num"`
+	TaskId                 string `json:"task_id"`   // 任务ID
+	LocalId                string `json:"local_id"`  // 项目ID
+	TalentId               string `json:"talent_id"` // 达人ID
+	PlatformId             int    `json:"platform_id"`
+	AccountId              int    `json:"account_id"`                // 账号ID
+	OpenId                 string `json:"open_id"`                   // 快手唯一标识
+	StrategyId             int    `json:"strategy_id"`               // 报名选择的招募策略ID
+	TalentPlatformInfoSnap string `json:"talent_platform_info_snap"` // 达人平台信息快照
+	TalentPersonalInfoSnap string `json:"talent_personal_info_snap"` // 达人个人信息快照
+	//TalentPostAddrSnap     string         `json:"talent_post_addr_snap"`     // 收货地址快照
+	TaskReward      float64        `json:"task_reward"`       // 达人报酬
+	SettleAmount    float64        `json:"settle_amount"`     // 达人实际所得(扣除违约扣款)
+	AllPayment      float64        `json:"all_payment"`       // 企业支付总额
+	RealPayment     float64        `json:"real_payment"`      // 企业实际支付(扣除违约扣款)
+	ServiceRate     float64        `json:"service_rate"`      // 服务费率(千分比)
+	ServiceCharge   float64        `json:"service_charge"`    // 服务费
+	FeeForm         int            `json:"fee_form"`          // 稿费形式 1: 产品置换 2: 固定稿费 3: 自报价
+	ErrBreakRate    int            `json:"err_break_rate"`    // 未上传类型违约扣款比例(百分比)
+	ScriptBreakRate int            `json:"script_break_rate"` // 脚本超时违约扣款比例(百分比)
+	SketchBreakRate int            `json:"sketch_break_rate"` // 初稿超时违约扣款比例(百分比)
+	LinkBreakRate   int            `json:"link_break_rate"`   // 链接超时违约扣款比例(百分比)
+	DataBreakRate   int            `json:"data_break_rate"`   // 数据超时违约扣款比例(百分比)
+	TaskStage       int            `json:"task_stage"`        // 任务阶段
+	TaskStatus      int            `json:"task_status"`       // 商家任务状态 1: 待选 2: 已选 3: 落选
+	LogisticsStatus int            `json:"logistics_status"`  // 发货状态 1: 待发货 2: 已发货 3: 已签收
+	BookStatus      int            `json:"book_status"`       // 脚本上传状态 1-5 表示各阶段
+	SketchStatus    int            `json:"sketch_status"`     // 初稿上传状态 1-5 表示各阶段
+	LinkStatus      int            `json:"link_status"`       // 链接上传状态 1-5 表示各阶段
+	DataStatus      int            `json:"data_status"`       // 数据上传状态 1-5 表示各阶段
+	CompleteStatus  int            `json:"complete_status"`   // 结束方式 1: 未结束 2: 正常结束 3: 反选失败 4: 被解约
+	UpdateAt        *gtime.Time    `json:"update_at"`         // 更新时间
+	CreateDate      *gtime.Time    `json:"create_date"`       // 创建时间
+	SelectDate      *gtime.Time    `json:"select_date"`       // 反选时间
+	DeliveryDate    *gtime.Time    `json:"delivery_date"`     // 发货时间
+	CompleteDate    *gtime.Time    `json:"complete_date"`     // 结束时间
+	WithdrawDate    *gtime.Time    `json:"withdraw_date"`     // 提现时间
+	CurDefaultType  int            `json:"cur_default_type"`  // 当前处于的违约类型
+	WithdrawStatus  int            `json:"withdraw_status"`   // 提现状态 1-4 表示不同状态
+	LeadTeamId      string         `json:"lead_team_id"`      // 团长young之团ID
+	TeamId          string         `json:"team_id"`           // 团员young之团ID
+	SettleStatus    int            `json:"settle_status"`     // 结算状态 1: 待结算 2: 已结算
+	TeamIncome      float64        `json:"team_income"`       // 团长现金收益
+	TeamPoint       int            `json:"team_point"`        // 团长积分收益
+	CurBreakAt      *gtime.Time    `json:"cur_break_at"`      // 当前阶段截止时间
+	SupplierId      int            `json:"supplier_id"`       // 服务商ID
+	SupplierStatus  int            `json:"supplier_status"`   // 服务商任务状态
+	DraftFee        float64        `json:"draft_fee"`         // 达人稿费
+	SupportFee      float64        `json:"support_fee"`       //提报价格
+	SignedTime      *gtime.Time    `json:"signed_time"`       // 签收时间
+	FansNum         int            `json:"fans_num"`          // 粉丝数
+	VoteAvg         int            `json:"vote_avg"`          // 平均点赞数
+	CommitAvg       int            `json:"commit_avg"`        // 平均评论数
+	BOperator       string         `json:"b_operator"`        // 商家确定达人操作人ID
+	BOperatorType   int            `json:"b_operator_type"`   // 商家操作人类型
+	SOperator       int            `json:"s_operator"`        // 服务商提报达人操作人ID
+	SOperatorType   int            `json:"s_operator_type"`   // 服务商操作人类型
+	SProjectId      int            `json:"s_project_id"`      // 服务商种草任务ID
+	ProjectDetail   *ProjectDetail `json:"project_detail"`    //项目详情
+	WxNum           string         `json:"wx_num"`
 }
 
 type SignTaskInfo struct {
@@ -163,8 +163,8 @@ type SignTaskInfo struct {
 	SProjectId int     `json:"s_project_id"` //服务商加入商单
 	OpenID     string  `json:"open_id"`      //选中快手账号唯一标识
 	AddressId  uint64  `json:"address_id"`
-	StrategyId int     `json:"strategy_id"`
-	Offer      float64 `json:"offer"` //最终提交时的稿费
+	StrategyId int     `json:"strategy_id"` //达人选择的策略id
+	Offer      float64 `json:"offer"`       //最终提交时的稿费
 	WxNum      string  `json:"wx_num"`
 }
 
@@ -224,18 +224,20 @@ type LocalTaskInfoBrief struct {
 }
 
 type TaskInfoBriefList struct {
-	AllTaskInfoList       []*TaskInfoBrief `json:"all_Task_info_list"`
-	SignUpTaskInfoList    []*TaskInfoBrief `json:"sign_up_Task_info_list"`
-	GoingOnTaskInfoList   []*TaskInfoBrief `json:"going_on_Task_info_list"`
-	CompletedTaskInfoList []*TaskInfoBrief `json:"completed_Task_info_list"`
+	AllTaskInfoList       []*TaskInfoBrief `json:"all_Task_info_list"`       //全部任务
+	SignUpTaskInfoList    []*TaskInfoBrief `json:"sign_up_Task_info_list"`   //已报名
+	GoingOnTaskInfoList   []*TaskInfoBrief `json:"going_on_Task_info_list"`  //执行中
+	WaitToPayInfoList     []*TaskInfoBrief `json:"wait_to_pay_info_list"`    //待结算
+	CompletedTaskInfoList []*TaskInfoBrief `json:"completed_Task_info_list"` //已结束
 }
 
 type LocalTaskInfoBriefList struct {
-	AllTaskInfoList       []*LocalTaskInfoBrief `json:"all_Task_info_list"`
-	WaitBookList          []*LocalTaskInfoBrief `json:"book_Task_info_list"`
-	SignUpTaskInfoList    []*LocalTaskInfoBrief `json:"sign_up_Task_info_list"`
-	GoingOnTaskInfoList   []*LocalTaskInfoBrief `json:"going_on_Task_info_list"`
-	CompletedTaskInfoList []*LocalTaskInfoBrief `json:"completed_Task_info_list"`
+	AllTaskInfoList       []*LocalTaskInfoBrief `json:"all_Task_info_list"`       //全部任务
+	WaitBookList          []*LocalTaskInfoBrief `json:"book_Task_info_list"`      //待预约
+	SignUpTaskInfoList    []*LocalTaskInfoBrief `json:"sign_up_Task_info_list"`   //已报名
+	GoingOnTaskInfoList   []*LocalTaskInfoBrief `json:"going_on_Task_info_list"`  //执行中
+	WaitToPayInfoList     []*LocalTaskInfoBrief `json:"wait_to_pay_info_list"`    //待结算
+	CompletedTaskInfoList []*LocalTaskInfoBrief `json:"completed_Task_info_list"` //已结算
 }
 
 type EXETaskInfoBriefList struct {

+ 7 - 7
app/model/youngee_talent_model/task_script.go

@@ -1,7 +1,7 @@
-package youngee_talent_model
-
-type AddTaskScriptRequest struct {
-	TaskId  string `orm:"task_id"           json:"task_id"` // 任务id
-	Title   string `orm:"title"           json:"title"`     // 脚本标题
-	Content string `orm:"content"           json:"content"` // 脚本内容
-}
+package youngee_talent_model
+
+type AddTaskScriptRequest struct {
+	TaskId  string `orm:"task_id"           json:"task_id"` // 任务id
+	Title   string `orm:"title"           json:"title"`     // 脚本标题
+	Content string `orm:"content"           json:"content"` // 脚本内容
+}

+ 28 - 18
app/service/youngee_sectask_service/seletion_square.go

@@ -54,7 +54,8 @@ func GetSelectionList(r *ghttp.Request) *TalentHttpResult {
 	secForm := r.Get("secform")
 	taskForm := r.Get("taskform")
 	//任务上线时间
-	createTime := r.Get("createTime")
+	createTime := r.Get("createtime")
+	fmt.Println("createTime:----》", createTime)
 	//商品类目 智能家居、食品饮料等20种
 	categoryForm := r.Get("categoryform")
 	//搜索条件
@@ -127,8 +128,9 @@ func GetSelectionList(r *ghttp.Request) *TalentHttpResult {
 
 	// 处理 selectionFormList (创建时间的过滤条件)
 	if createTimeList != nil {
-		whereStr += " AND created_at >= (NOW() - INTERVAL "
+
 		for _, v := range createTimeList {
+			whereStr += " AND created_at >= (NOW() - INTERVAL "
 			switch v.(string) {
 			case "1": // 近7天
 				whereStr += "7 DAY"
@@ -139,8 +141,10 @@ func GetSelectionList(r *ghttp.Request) *TalentHttpResult {
 			default:
 				continue // 无效的过滤条件,跳过
 			}
+			whereStr += ")"
 		}
-		whereStr += ")"
+
+		fmt.Println("createTimeList:---->", whereStr)
 	}
 
 	//商品类目 来自product
@@ -228,6 +232,7 @@ func GetSelectionList(r *ghttp.Request) *TalentHttpResult {
 
 		default:
 			// 如果没有匹配的字段,则不做排序,默认排序
+			fmt.Println("unmarch")
 			return false
 		}
 	})
@@ -593,16 +598,14 @@ func IsCreateSecTask(r *ghttp.Request) *TalentHttpResult {
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	var signSecTaskReq *youngee_talent_model.SignSecTaskFromWindowReq
 	err = r.ParseForm(&signSecTaskReq)
-
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
-	selectionId := r.GetQueryInt("selection_id", -1)
 	//定义接口存该达人所有的报名任务
 	//1.查task表全部数据
 	var task []youngee_talent_model.SecTaskInfoDetail
 	err = g.DB().Model(youngee_talent_model.SecTaskInfoDetail{}).WithAll().
-		Where("talent_id = ? AND selection_id = ? open_id = ?", tid, selectionId, signSecTaskReq.OpenId).
+		Where("talent_id = ? AND selection_id = ? AND open_id = ?", tid, signSecTaskReq.SelectionId, signSecTaskReq.OpenId).
 		Scan(&task)
 	if err != nil {
 		return &TalentHttpResult{Code: 0, Msg: err.Error(), Data: nil}
@@ -643,6 +646,7 @@ func SignUpSecTaskWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 	}
 	//根据freeStrage判断当前的粉丝数是否满足条件
 	//前端传递根据粉丝数目和悬赏策略对比。传递满足条件是否满足。
+	fmt.Println("-->", selectionDetail.YounggeeProduct.KuaishouProductId)
 
 	//获取选品表中的ddl
 	var selectionInfo *model.YounggeeSelectionInfo
@@ -702,6 +706,7 @@ func SignUpSecTaskWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 		SaleNum:                signSecTaskReq.SaleNum,
 		FansNum:                signSecTaskReq.FansNum,
 		OpenId:                 signSecTaskReq.OpenId,
+		WxNum:                  signSecTaskReq.WxNum,
 		TalentId:               tid,
 		TalentPlatformInfoSnap: string(accountSnap),
 		TalentPersonalInfoSnap: string(talentSnap),
@@ -728,17 +733,18 @@ func SignUpSecTaskWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 		TeamPoint:  0,
 		TaskDdl:    selectionInfo.TaskDdl,
 	}
-
 	//加入橱窗逻辑,
-	productId := signSecTaskReq.ProductId
+	productId := selectionDetail.YounggeeProduct.KuaishouProductId
 	pIdSlice := []string{productId}
-	value, err := g.DB().Model("platform_kuaishou_user_info").Fields("open_id").Where("talent_id=? AND open_id = ?", tid, signSecTaskReq.OpenId).Value()
+	value, err := g.DB().Model("platform_kuaishou_user_info").Fields("access_token").Where("talent_id=? AND open_id = ? AND platform_id=?", tid, signSecTaskReq.OpenId, 4).Value()
 	if err != nil {
 		fmt.Println("query db fail")
 	}
 	accessToken := value.String()
+	fmt.Println("access_token:", accessToken)
 	_, err = merchant.AddItemsToShelf(ClientKey, SignSecret, accessToken, pIdSlice)
 	if err != nil {
+		fmt.Println("err-->", err)
 		//表示添加失敗,沒有開通
 		return &TalentHttpResult{Code: -1, Msg: "快手未開通橱窗、商品不存在或已下线", Data: nil}
 	}
@@ -797,6 +803,7 @@ func SignUpSecTaskWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 
 // 加入橱窗--没有报名信息则创建报名信息
 func SignUpSecTaskFromWindow(r *ghttp.Request) *TalentHttpResult {
+	fmt.Println("into here")
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
@@ -824,11 +831,11 @@ func SignUpSecTaskFromWindow(r *ghttp.Request) *TalentHttpResult {
 	//var selectionInfo *model.YounggeeSelectionInfo
 	//err = g.DB().Model("younggee_selection_info").Where("selection_id", signSecTaskReq.SelectionId).Scan(&selectionInfo)
 
-	var product model.YounggeeProduct
-	err = json.Unmarshal([]byte(selectionDetail.ProductSnap), &product)
-	if err != nil {
-		return &TalentHttpResult{Code: -3, Msg: "json Unmarshal failed"}
-	}
+	//var product model.YounggeeProduct
+	//err = json.Unmarshal([]byte(selectionDetail.ProductSnap), &product)
+	//if err != nil {
+	//	return &TalentHttpResult{Code: -3, Msg: "json Unmarshal failed"}
+	//}
 	// 查询达人详情
 	var talentInfo *youngee_talent_model.TalentInfo
 	err = g.DB().Model("youngee_talent_info").WithAll().Where("id", tid).Scan(&talentInfo)
@@ -843,6 +850,9 @@ func SignUpSecTaskFromWindow(r *ghttp.Request) *TalentHttpResult {
 	}
 	var newTaskId string
 	// 首先生成任务id
+	fmt.Println("2fsafj")
+	fmt.Println("selectionDetail.SelectionId:", selectionDetail.SelectionId)
+	fmt.Println("selectionDetail.EnterpriseId:", selectionDetail.EnterpriseId)
 	newTaskId = utils.GetUuid.GetTaskId(selectionDetail.SelectionId, selectionDetail.EnterpriseId, tid)
 	// 生成达人平台账号信息快照
 	accountSnap, err := gjson.Encode(accountInfo)
@@ -867,7 +877,7 @@ func SignUpSecTaskFromWindow(r *ghttp.Request) *TalentHttpResult {
 		TalentPersonalInfoSnap: string(talentSnap),
 		//TalentPostAddrSnap:     string(addrSnap),
 		TaskReward:       selectionDetail.TaskReward,
-		TalentPayment:    product.ProductPrice,
+		TalentPayment:    selectionDetail.YounggeeProduct.ProductPrice,
 		IsPayPayment:     0,
 		IsPayReward:      0,
 		TaskMode:         selectionDetail.TaskMode,
@@ -915,12 +925,12 @@ func SignUpSecTaskFromWindow(r *ghttp.Request) *TalentHttpResult {
 			ProductId:   signSecTaskReq.ProductId,
 			//SaleNum:                signSecTaskReq.SaleNum,
 			//FansNum:                signSecTaskReq.FansNum,
-			TalentId:               tid,
-			TalentPlatformInfoSnap: string(accountSnap),
+			TalentId: tid,
+			//TalentPlatformInfoSnap: string(accountSnap),
 			TalentPersonalInfoSnap: string(talentSnap),
 			//TalentPostAddrSnap:     string(addrSnap),
 			//TaskReward:       selectionInfo.TaskReward,
-			TalentPayment: product.ProductPrice,
+			TalentPayment: selectionDetail.YounggeeProduct.ProductPrice,
 			IsPayPayment:  0,
 			IsPayReward:   0,
 			//TaskMode:         selectionInfo.TaskMode,

+ 1 - 0
app/service/youngee_talent_service/LoginFromSms.go

@@ -36,6 +36,7 @@ func LoginFromSms(r *ghttp.Request) *TalentHttpResult {
 	VcodeKey := fmt.Sprintf("%s%s", "c_user:", l.Phone)
 	//viewCount, err := g.Redis().DoVar("GET", projectViewKey)
 	Vcode, err := g.Redis().DoVar("GET", VcodeKey)
+	r.GetRemoteIp()
 	//验证码正确
 	if Vcode.String() == l.Vcode {
 		//进行微信登录

+ 55 - 29
app/service/youngee_talent_service/log_message.go

@@ -50,29 +50,43 @@ func GetMessageList(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
 
-	// 定义不同类型的消息列表
-	var MessList []youngee_talent_model.YounggeeMutilMessInfo
-	err = g.Model("message_multi_info").Where("talent_id = ? and is_deleted = 0", tid).Order("created_at desc").Scan(&MessList)
-
+	// 获取所有消息数据
+	var notifications []youngee_talent_model.YounggeeMutilMessInfo
+	err = g.DB().Model("message_multi_info").Where("talent_id = ? and is_deleted = 1", tid).Scan(&notifications)
 	if err != nil {
-		log.Println("GetMessage error:", err)
-		return &TalentHttpResult{Code: -2, Msg: "Get task message failed"}
+		return &TalentHttpResult{Code: -2, Msg: "Get notifications failed"}
 	}
-
-	// 使用 map 来按 mess_type 分类
-	messageMap := make(map[int][]youngee_talent_model.YounggeeMutilMessInfo)
-
-	// 遍历消息列表,将消息按类型添加到 map 中
-	for _, message := range MessList {
-		messageMap[message.MessType] = append(messageMap[message.MessType], message)
+	// 定义所有可能的消息类型
+	notificationTypes := []int{1, 2, 3, 4, 5, 6}
+	//最终返回一个数组
+	var result []youngee_talent_model.NotificationTypeResult
+	for _, nt := range notificationTypes {
+		// 获取每种类型的未读数量
+		count, err := g.DB().Model("message_multi_info").Where("talent_id= ? AND mess_type= ? AND is_readed=?", tid, nt, 1).Count()
+		if err != nil {
+			return &TalentHttpResult{Code: -3, Msg: "Failed to get unread count"}
+		}
+		// 获取每种类型的所有消息
+		var typeNotifications []youngee_talent_model.YounggeeMutilMessInfo
+		err = g.DB().Model("message_multi_info").Where("talent_id= ? AND mess_type= ? AND is_readed=?", tid, nt, 1).Scan(&typeNotifications)
+		if err != nil {
+			return &TalentHttpResult{Code: -4, Msg: "Failed to get notifications by type"}
+		}
+		//每种类型最新一条消息
+		var latestMess *youngee_talent_model.YounggeeMutilMessInfo
+		err = g.DB().Model("message_multi_info").Where("talent_id= ? AND mess_type= ? AND is_readed=?", tid, nt, 1).
+			Order("created_at DESC").Limit(1).Scan(&latestMess)
+
+		// 构建每种类型的结果
+		result = append(result, youngee_talent_model.NotificationTypeResult{
+			Type:        nt,
+			UnreadCount: count,
+			LatestInfo:  latestMess,
+			Data:        typeNotifications, // 所有该类型的消息
+		})
 	}
 
-	// 返回按类型分类的消息列表
-	return &TalentHttpResult{
-		Code: 0,
-		Msg:  "success",
-		Data: messageMap,
-	}
+	return &TalentHttpResult{Code: 0, Msg: "success", Data: result}
 }
 
 // 获取消息通知详情页
@@ -82,7 +96,7 @@ func GetMessageDetail(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
 	var taskMessage []*model.YounggeeMessageInfo
-	err = g.Model(dao.YounggeeMessageInfo.Table).Where("talent_id = ? and is_deleted = 0", tid).Order("created_at desc").Scan(&taskMessage)
+	err = g.Model("message_multi_info").Where("talent_id = ? and is_deleted = 1", tid).Order("created_at desc").Scan(&taskMessage)
 	if err != nil {
 		log.Println("GetMessage error:", err)
 		return &TalentHttpResult{Code: -2, Msg: "Get task message failed"}
@@ -92,12 +106,12 @@ func GetMessageDetail(r *ghttp.Request) *TalentHttpResult {
 }
 
 // 设置消息已读
-func SetMessageRead(r *ghttp.Request) *TalentHttpResult {
+func CleanAllUnread(r *ghttp.Request) *TalentHttpResult {
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
-	_, err = g.Model(dao.YounggeeMessageInfo.Table).Where("talent_id = ?", tid).Update(g.Map{"is_readed": 1})
+	_, err = g.Model("message_multi_info").Where("talent_id = ?", tid).Update(g.Map{"is_readed": 2})
 	if err != nil {
 		log.Println("UpdateMessage error:", err)
 		return &TalentHttpResult{Code: -2, Msg: "Update task message failed"}
@@ -106,14 +120,15 @@ func SetMessageRead(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "success"}
 }
 
-// 删除消息
-func DeleteMessage(r *ghttp.Request) *TalentHttpResult {
-	var deleteMessageReq *youngee_talent_model.DeleteMessageReq
-	err := r.ParseForm(&deleteMessageReq)
+// 设置类型消息已读
+func CleanTypeUnread(r *ghttp.Request) *TalentHttpResult {
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	mess_type := r.GetQueryInt("mess_type", -1)
+
 	if err != nil {
-		return &TalentHttpResult{Code: -1, Msg: "params error"}
+		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
-	_, err = g.Model(dao.YounggeeMessageInfo.Table).Where("id = ?", deleteMessageReq.MessageId).Update(g.Map{"is_deleted": 1})
+	_, err = g.Model("message_multi_info").Where("talent_id = ? AND mess_type = ?", tid, mess_type).Update(g.Map{"is_readed": 2})
 	if err != nil {
 		log.Println("UpdateMessage error:", err)
 		return &TalentHttpResult{Code: -2, Msg: "Update task message failed"}
@@ -128,7 +143,7 @@ func HasUnReadMessage(r *ghttp.Request) *TalentHttpResult {
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
-	UnReadMessageNum, err := g.Model(dao.YounggeeMessageInfo.Table).Where("talent_id = ? and is_readed = 0", tid).Count()
+	UnReadMessageNum, err := g.Model("message_multi_info").Where("talent_id = ? and is_readed = 1", tid).Count()
 	if err != nil {
 		log.Println("GetMessage error:", err)
 		return &TalentHttpResult{Code: -2, Msg: "Get task message failed"}
@@ -136,3 +151,14 @@ func HasUnReadMessage(r *ghttp.Request) *TalentHttpResult {
 
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: UnReadMessageNum}
 }
+
+// 删除消息
+func DeleteMessage(r *ghttp.Request) *TalentHttpResult {
+	messId := r.GetQueryInt("mess_id", -1)
+	_, err := g.Model("message_multi_info").Where("id = ?", messId).Update(g.Map{"is_deleted": 2})
+	if err != nil {
+		log.Println("UpdateMessage error:", err)
+		return &TalentHttpResult{Code: -2, Msg: "Update task message failed"}
+	}
+	return &TalentHttpResult{Code: 0, Msg: "success"}
+}

+ 594 - 58
app/service/youngee_talent_service/talent_account.go

@@ -1,17 +1,26 @@
 package youngee_talent_service
 
 import (
+	"bytes"
+	"encoding/json"
 	"fmt"
-	"github.com/gogf/gf/encoding/gjson"
+	"github.com/gogf/gf/os/gtime"
 	"io/ioutil"
 	"net/http"
 	"net/url"
+	"regexp"
+	"strconv"
 	"youngmini_server/app/dao"
 	"youngmini_server/app/model/youngee_talent_model"
 	"youngmini_server/app/utils"
 
 	"github.com/gogf/gf/frame/g"
 	"github.com/gogf/gf/net/ghttp"
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
+	ocr "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1"
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model"
+	region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/region"
+	"strings"
 )
 
 func GetTalentAccount(r *ghttp.Request) *TalentHttpResult {
@@ -54,6 +63,27 @@ func GetTalentAccountKuaishou(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: res}
 }
 
+func DelTalentAccount(r *ghttp.Request) *TalentHttpResult {
+	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	var DelAccountReq *youngee_talent_model.DelAccountReq
+	err := r.ParseForm(&DelAccountReq)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: "Parse form failed"}
+	}
+	if DelAccountReq.PlatformId == 4 || DelAccountReq.PlatformId == 8 { //删除快手
+		_, err := g.Model("platform_kuaishou_user_info").Where("talent_id=? AND platform_id IN (4,8) And open_id=?", tid, DelAccountReq.OpenId).Delete()
+		if err != nil {
+			return &TalentHttpResult{Code: -1, Msg: "delete account failed"}
+		}
+	} else {
+		_, err := g.Model("platform_kuaishou_user_info").Where("talent_id=? AND platform_id =? And open_id=?", tid, DelAccountReq.PlatformId, DelAccountReq.OpenId).Delete()
+		if err != nil {
+			return &TalentHttpResult{Code: -1, Msg: "delete account failed"}
+		}
+	}
+	return &TalentHttpResult{Code: 0, Msg: "success"}
+}
+
 func OnAddTalentAccount(r *ghttp.Request) *TalentHttpResult {
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	if err != nil {
@@ -70,75 +100,396 @@ func OnAddTalentAccount(r *ghttp.Request) *TalentHttpResult {
 
 	//小红书
 	if account.PlatformId == 1 {
-		//获取匿名cookie
-		cookie := getXHSCookie()
-		if cookie == "" {
-			return &TalentHttpResult{Code: -1, Msg: "小红书cookie获取失败"}
+		//获取用户唯一标识
+		shareText := account.HomePageUrl
+		//调用MoreAPI
+		userDetail := getXHSUserDetail(shareText)
+		if userDetail == nil {
+			return &TalentHttpResult{Code: -1, Msg: "MoreApi调用出错"}
 		}
+		//是否被其他人绑定
+		BindCode := CheckAccountBind(account.PlatformId, userDetail.RedID)
+		if BindCode == -1 {
+			return &TalentHttpResult{Code: -1, Msg: "查询账号表出错"}
+		} else if BindCode == 1 {
+			return &TalentHttpResult{Code: -5, Msg: "此小红书Id已经被绑定"}
+		} else { //没有被其他人绑定
+			//调用OCR
+			var orcInfo = getXHSOCRresult(account.HomePageCaptureUrl, account.PlatformId)
+			if orcInfo == nil {
+				return &TalentHttpResult{Code: -1, Msg: "ORC接口出错"}
+			}
+			//小红书id一致且是自己的主页
+			if orcInfo.RedId == userDetail.RedID && orcInfo.SelfHome == 1 {
+				//获取用户基本信息
+				XHSdata := g.Map{
+					"talent_id":             tid,
+					"open_id":               userDetail.RedID,
+					"platform_id":           account.PlatformId,
+					"fan":                   userDetail.Fans,
+					"nick_name":             userDetail.Nickname,
+					"head_uri":              userDetail.Images,
+					"city":                  userDetail.IPLocation,
+					"gender":                userDetail.Gender,
+					"like_num":              userDetail.LikeNum,
+					"create_time":           gtime.Now(),
+					"update_time":           gtime.Now(),
+					"home_page_url":         account.HomePageUrl,
+					"home_page_capture_url": account.HomePageCaptureUrl,
+				}
+				//入库
+				_, err := g.Model("platform_kuaishou_user_info").Insert(XHSdata)
+				if err != nil {
+					return &TalentHttpResult{Code: -1, Msg: "数据入库失败"}
+				}
+				// 修改talent表字段is_bind_account值为1
+				_, err = g.Model(dao.YoungeeTalentInfo.Table).Data("is_bind_account=1").Where("id", tid).Update()
+				if err != nil {
+					return &TalentHttpResult{Code: -2, Msg: err.Error()}
+				}
+				return &TalentHttpResult{Code: 0, Msg: "小红书账号绑定成功"}
+			} else {
+				return &TalentHttpResult{Code: -6, Msg: "图片中小红书ID和主页链接不一致"}
+			}
+		}
+	} else if account.PlatformId == 3 { //微博
 		//获取用户唯一标识
 		shareText := account.HomePageUrl
-		parsedURL, err := url.Parse(shareText)
-		if err != nil {
-			fmt.Println("Error parsing URL:", err)
+		//调用MoreAPI
+		userDetail := getWBUserDetail(shareText)
+		if userDetail == nil {
+			return &TalentHttpResult{Code: -1, Msg: "MoreApi调用出错"}
 		}
-		queryParams := parsedURL.Query()
-		appuid := queryParams.Get("appuid")
-		if appuid != "" {
-			fmt.Println("appuid:", appuid)
+		//是否被其他人绑定
+		BindCode := CheckAccountBind(account.PlatformId, userDetail.WBID)
+		if BindCode == -1 {
+			return &TalentHttpResult{Code: -1, Msg: "查询账号表出错"}
+		} else if BindCode == 1 {
+			return &TalentHttpResult{Code: -5, Msg: "此微博Id已经被绑定"}
 		} else {
-			fmt.Println("AppUID not found")
+			//调用OCR
+			var orcInfo = getWBOCRresult(account.HomePageCaptureUrl, userDetail.Nickname)
+			if orcInfo == nil {
+				return &TalentHttpResult{Code: -1, Msg: "ORC接口出错"}
+			}
+			//orc的昵称和moreapi返回的昵称一致,且主页截图是自己的截图
+			if orcInfo.SelfHome == 1 {
+				//获取用户基本信息
+				WBdata := g.Map{
+					"talent_id":             tid,
+					"open_id":               userDetail.WBID,
+					"platform_id":           account.PlatformId,
+					"fan":                   userDetail.Fans,
+					"nick_name":             userDetail.Nickname,
+					"head_uri":              userDetail.HeadImage,
+					"gender":                userDetail.Gender,
+					"create_time":           gtime.Now(),
+					"update_time":           gtime.Now(),
+					"home_page_url":         account.HomePageUrl,
+					"home_page_capture_url": account.HomePageCaptureUrl,
+				}
+				//入库
+				_, err := g.Model("platform_kuaishou_user_info").Insert(WBdata)
+				if err != nil {
+					return &TalentHttpResult{Code: -1, Msg: "数据入库失败"}
+				}
+				// 修改talent表字段is_bind_account值为1
+				_, err = g.Model(dao.YoungeeTalentInfo.Table).Data("is_bind_account=1").Where("id", tid).Update()
+				if err != nil {
+					return &TalentHttpResult{Code: -2, Msg: err.Error()}
+				}
+				return &TalentHttpResult{Code: 0, Msg: "微博账号绑定成功"}
+			} else {
+				return &TalentHttpResult{Code: -6, Msg: "主页截图非本人主页,获取着与主页链接不匹配"}
+			}
 		}
-		//获取用户基本信息
 
-		//插入平台表
+	} else if account.PlatformId == 5 { //B站
+		//获取用户主页URL以及uid
+		shareText := account.HomePageUrl
+		//调用MoreAPI
+		userDetail := getBiLiUserDetail(shareText)
+		if userDetail == nil {
+			return &TalentHttpResult{Code: -1, Msg: "MoreApi调用出错"}
+		}
+		//是否被其他人绑定
+		BindCode := CheckAccountBind(account.PlatformId, userDetail.UID)
+		if BindCode == -1 {
+			return &TalentHttpResult{Code: -1, Msg: "查询账号表出错"}
+		} else if BindCode == 1 {
+			return &TalentHttpResult{Code: -5, Msg: "此bilibili已经被绑定"}
+		} else {
+			//调用OCR
+			var orcInfo = getBliOCRresult(account.HomePageCaptureUrl, userDetail.Nickname)
+			if orcInfo == nil {
+				return &TalentHttpResult{Code: -1, Msg: "ORC接口出错"}
+			}
+			//orc的昵称和moreapi返回的昵称一致,且主页截图是自己的截图
+			if orcInfo.SelfHome == 1 {
+				//获取用户基本信息
+				Blidata := g.Map{
+					"talent_id":             tid,
+					"open_id":               userDetail.UID,
+					"platform_id":           account.PlatformId,
+					"fan":                   userDetail.Fans,
+					"nick_name":             userDetail.Nickname,
+					"head_uri":              userDetail.HeadImage,
+					"gender":                userDetail.Gender,
+					"create_time":           gtime.Now(),
+					"update_time":           gtime.Now(),
+					"home_page_url":         account.HomePageUrl,
+					"home_page_capture_url": account.HomePageCaptureUrl,
+				}
+				//入库
+				_, err := g.Model("platform_kuaishou_user_info").Insert(Blidata)
+				if err != nil {
+					return &TalentHttpResult{Code: -1, Msg: "数据入库失败"}
+				}
+				// 修改talent表字段is_bind_account值为1
+				_, err = g.Model(dao.YoungeeTalentInfo.Table).Data("is_bind_account=1").Where("id", tid).Update()
+				if err != nil {
+					return &TalentHttpResult{Code: -2, Msg: err.Error()}
+				}
+				return &TalentHttpResult{Code: 0, Msg: "bli账号绑定成功"}
+			} else {
+				return &TalentHttpResult{Code: -6, Msg: "主页截图非本人主页,或者与主页链接不匹配"}
+			}
+		}
 
 	} else {
-		// 插入达人账号信息
-		_, err = g.Model("platform_kuaishou_user_info").Insert(account)
-		if err != nil {
-			return &TalentHttpResult{Code: -2, Msg: err.Error()}
-		}
+		return &TalentHttpResult{Code: -1, Msg: "平台ID有误"}
+	}
+	return &TalentHttpResult{Code: 0, Msg: "success"}
+}
 
-		// 修改talent表字段is_bind_account值为1
-		_, err = g.Model(dao.YoungeeTalentInfo.Table).Data("is_bind_account=1").Where("id", tid).Update()
-		if err != nil {
-			return &TalentHttpResult{Code: -2, Msg: err.Error()}
-		}
+//func OnUpdateTalentAccount(r *ghttp.Request) *TalentHttpResult {
+//	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+//	if err != nil {
+//		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
+//	}
+//	account := youngee_talent_model.PlatformAccountInfo{}
+//	err = r.ParseForm(&account)
+//	if err != nil {
+//		return &TalentHttpResult{Code: -2, Msg: err.Error()}
+//	}
+//	account.TalentId = tid
+//	_, err = g.DB().Model(dao.YoungeePlatformAccountInfo.Table).Update(account, "account_id = ? and talent_id = ?", account.PlatformId, tid)
+//	if err != nil {
+//		return &TalentHttpResult{Code: -3, Msg: "update failed"}
+//	}
+//	return &TalentHttpResult{Code: 0, Msg: "success"}
+//}
 
-		return &TalentHttpResult{Code: 0, Msg: "success"}
+// 检查该账号是否被其他人绑定了
+func CheckAccountBind(pId int, openId string) int {
+	count, err := g.Model("platform_kuaishou_user_info").Where("platform_id = ? and open_id = ?", pId, openId).Count()
+	if err != nil {
+		return -1
+	}
+	if count > 0 { //已经被绑定
+		return 1
+	} else {
+		return 0
+	}
+}
+
+// 用于获取 XHS 用户详细信息的函数
+func getXHSUserDetail(homeURL string) *youngee_talent_model.XHSBasicInfo {
+	cookie := "acw_tc=0a00d7db17326882742197649ed1bf15848a5ff06232f5c37b7eaa2663f722; abRequestId=028b7a52-6c20-5315-aaf5-3bf365d26f20; webBuild=4.35.0; xsecappid=xhs-pc-web; a1=1936c44e2c4IjfanuIengZ3lEpOKmXeKdOan0rcbl50000544495; webId=021b26332dd3b74978a347eb885a1761; gid=yjJJWyiYfKMyyjJJWyiYYVIvqK2EfyMuuyMdE016fE2vSU286k88SE888yKJJq4800jJd8qq; websectiga=16f444b9ff5e3d7e258b5f7674489196303a0b160e16647c6c2b4dcb609f4134; sec_poison_id=58886b56-6f01-4f86-9ea1-0a1febfde070; unread={\\\"ub\\\":\\\"66e2f3690000000012011cb0\\\",\\\"ue\\\":\\\"66e823b9000000001e018443\\\",\\\"uc\\\":14}; web_session=040069b41c29aed16ac492f173354bfc129950"
+	GetDetailUrl := "http://120.46.92.62:6888/api/xhs/user_detail"
 
+	// 构建请求体
+	requestBody := map[string]string{"share_text": homeURL}
+	jsonBody, err := json.Marshal(requestBody)
+	if err != nil {
+		fmt.Println("Error marshalling request body:", err)
+		return nil
 	}
-	return &TalentHttpResult{Code: 0, Msg: "success"}
 
+	// 创建 POST 请求
+	req, err := http.NewRequest("POST", GetDetailUrl, bytes.NewBuffer(jsonBody))
+	if err != nil {
+		fmt.Println("Error creating POST request:", err)
+		return nil
+	}
+
+	// 设置请求头,包括 cookie
+	req.Header.Set("Content-Type", "application/json")
+	req.Header.Set("cookie", cookie)
+
+	// 发送请求
+	client := &http.Client{}
+	resp, err := client.Do(req)
+	if err != nil {
+		fmt.Println("Error sending POST request:", err)
+		return nil
+	}
+	defer resp.Body.Close()
+
+	// 读取响应体
+	body, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		fmt.Println("Error reading response body:", err)
+		return nil
+	}
+
+	// 创建一个空的 map 用于存放解析后的 JSON 数据
+	var responseMap map[string]interface{}
+	err = json.Unmarshal(body, &responseMap)
+	if err != nil {
+		fmt.Println("Error parsing JSON:", err)
+		return nil
+	}
+	// 提取 data.response_body.data.basic_info
+	if responseBody, ok := responseMap["data"].(map[string]interface{}); ok {
+		if responseBodyData, ok := responseBody["response_body"].(map[string]interface{}); ok {
+			if data, ok := responseBodyData["data"].(map[string]interface{}); ok {
+				if basicInfo, ok := data["basic_info"].(map[string]interface{}); ok {
+					// 使用 json.Unmarshal 将 basic_info 直接解析到结构体中
+					var userInfo youngee_talent_model.XHSBasicInfo
+					userInfo.Imageb = fmt.Sprintf("%v", basicInfo["imageb"])
+					userInfo.Nickname = fmt.Sprintf("%v", basicInfo["nickname"])
+					userInfo.Images = fmt.Sprintf("%v", basicInfo["images"])
+					userInfo.RedID = fmt.Sprintf("%v", basicInfo["red_id"])
+					userInfo.Gender = fmt.Sprintf("%v", basicInfo["gender"])
+					userInfo.IPLocation = fmt.Sprintf("%v", basicInfo["ip_location"])
+					userInfo.Desc = fmt.Sprintf("%v", basicInfo["desc"])
+
+					// 提取 interactions
+					if interactions, ok := data["interactions"].([]interface{}); ok {
+						for _, interaction := range interactions {
+							interactionData := interaction.(map[string]interface{})
+							// 提取粉丝数(name 为 "粉丝")
+							if interactionData["name"] == "粉丝" {
+								countStr := fmt.Sprintf("%v", interactionData["count"])
+								countInt, _ := strconv.Atoi(countStr)
+								userInfo.Fans = countInt
+							}
+							// 提取获赞与收藏数(name 为 "获赞与收藏")
+							if interactionData["name"] == "获赞与收藏" {
+								LikeNum := fmt.Sprintf("%v", interactionData["count"])
+								LikeNumInt, _ := strconv.Atoi(LikeNum)
+								userInfo.LikeNum = LikeNumInt
+							}
+						}
+					}
+
+					// 返回 BasicInfo 结构体
+					return &userInfo
+				}
+			}
+		}
+	}
+
+	// 如果没有找到 basic_info,返回错误
+	return nil
 }
 
-func OnUpdateTalentAccount(r *ghttp.Request) *TalentHttpResult {
-	//tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
-	//if err != nil {
-	//	return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
-	//}
-	//account := youngee_talent_model.PlatformAccountInfo{}
-	//err = r.ParseForm(&account)
-	//if err != nil {
-	//	return &TalentHttpResult{Code: -2, Msg: err.Error()}
-	//}
-	//account.TalentId = tid
-	//_, err = g.DB().Model(dao.YoungeePlatformAccountInfo.Table).Update(account, "account_id = ? and talent_id = ?", account.AccountId, tid)
-	//if err != nil {
-	//	return &TalentHttpResult{Code: -3, Msg: "update failed"}
-	//}
-	return &TalentHttpResult{Code: 0, Msg: "success"}
+// 获取WB用户详细信息
+func getWBUserDetail(homeURL string) *youngee_talent_model.WBBasicInfo {
+	GetDetailUrl := "http://120.46.92.62:6888/api/weibo/user_detail"
+	// 构建请求体
+	requestBody := map[string]string{"share_text": homeURL}
+	jsonBody, err := json.Marshal(requestBody)
+	if err != nil {
+		fmt.Println("Error marshalling request body:", err)
+		return nil
+	}
+	// 创建 POST 请求
+	req, err := http.NewRequest("POST", GetDetailUrl, bytes.NewBuffer(jsonBody))
+	if err != nil {
+		fmt.Println("Error creating POST request:", err)
+		return nil
+	}
+	// 设置请求头,包括 cookie
+	req.Header.Set("Content-Type", "application/json")
+
+	// 发送请求
+	client := &http.Client{}
+	resp, err := client.Do(req)
+	if err != nil {
+		fmt.Println("Error sending POST request:", err)
+		return nil
+	}
+	defer resp.Body.Close()
+
+	// 读取响应体
+	body, err := ioutil.ReadAll(resp.Body)
+	if err != nil {
+		fmt.Println("Error reading response body:", err)
+		return nil
+	}
+
+	// 创建一个空的 map 用于存放解析后的 JSON 数据
+	var responseMap map[string]interface{}
+	err = json.Unmarshal(body, &responseMap)
+	if err != nil {
+		fmt.Println("Error parsing JSON:", err)
+		return nil
+	}
+	//提取数据
+	// 提取数据
+	if responseBody, ok := responseMap["data"].(map[string]interface{}); ok {
+		// 提取所需字段 responseBody["id"]
+		openId := fmt.Sprintf("%.0f", responseBody["id"])
+		fmt.Println("openId----->:", openId)
+		followers, _ := utils.TypeTran.AnyToInt(responseBody["followers_count"]) // 粉丝
+		avatarHd, _ := utils.TypeTran.AnyToString(responseBody["avatar_hd"])     //头像
+		nickName, _ := utils.TypeTran.AnyToString(responseBody["screen_name"])   //昵称
+		fmt.Println("nickName----->:", nickName)
+		statusesCount, _ := utils.TypeTran.AnyToInt(responseBody["statuses_count"]) // 作品数目
+		gender, _ := utils.TypeTran.AnyToString(responseBody["gender"])
+		// 创建并返回 BasicInfo 结构体
+		userInfo := youngee_talent_model.WBBasicInfo{
+			WBID:      openId,
+			HeadImage: avatarHd,
+			Fans:      followers,
+			PostNum:   statusesCount,
+			Gender:    gender,
+			Nickname:  nickName,
+		}
+		return &userInfo
+	}
+	// 如果没有找到 basic_info,返回错误
+	return nil
 }
 
-func getXHSCookie() string {
-	// 请求的 URL
-	url := "http://120.46.92.62:6888/api/xhs/any_account"
+func getBiLiUserDetail(homeURL string) *youngee_talent_model.BliBasicInfo {
+	redirectedURL, err := getRedirectedURL(homeURL)
+	if err != nil {
+		fmt.Println("Error:", err)
+		return nil
+	}
+	userID, err := extractUserID(redirectedURL)
+	if err != nil {
+		fmt.Println("Error extracting user ID:", err)
+		return nil
+	}
+	fmt.Println("Extracted user ID:", userID)
+
+	GetDetailUrl := "http://120.46.92.62:6888/api/bilibili/user_info"
+	// 构建请求体
+	requestBody := map[string]string{"uid": userID}
+	jsonBody, err := json.Marshal(requestBody)
+	if err != nil {
+		fmt.Println("Error marshalling request body:", err)
+		return nil
+	}
+	// 创建 POST 请求
+	req, err := http.NewRequest("POST", GetDetailUrl, bytes.NewBuffer(jsonBody))
+	if err != nil {
+		fmt.Println("Error creating POST request:", err)
+		return nil
+	}
+	// 设置请求头,包括 cookie
+	req.Header.Set("Content-Type", "application/json")
 
-	// 创建 POST 请求(无请求体)
-	resp, err := http.Post(url, "application/json", nil)
+	// 发送请求
+	client := &http.Client{}
+	resp, err := client.Do(req)
 	if err != nil {
 		fmt.Println("Error sending POST request:", err)
-		return ""
+		return nil
 	}
 	defer resp.Body.Close()
 
@@ -146,21 +497,206 @@ func getXHSCookie() string {
 	body, err := ioutil.ReadAll(resp.Body)
 	if err != nil {
 		fmt.Println("Error reading response body:", err)
-		return ""
+		return nil
 	}
 
-	// 解析 JSON 响应
-	jsonData, err := gjson.LoadContent(string(body))
+	// 创建一个空的 map 用于存放解析后的 JSON 数据
+	var responseMap map[string]interface{}
+	err = json.Unmarshal(body, &responseMap)
 	if err != nil {
 		fmt.Println("Error parsing JSON:", err)
-		return ""
+		return nil
 	}
+	// 提取数据
+	if responseBody, ok := responseMap["data"].(map[string]interface{}); ok {
+		// 提取 space 信息
+		spaceInfo := responseBody["space"].(map[string]interface{})
+
+		// 提取 space.info 中的字段
+		mid := fmt.Sprintf("%.0f", spaceInfo["info"].(map[string]interface{})["mid"])
+		name, _ := utils.TypeTran.AnyToString(spaceInfo["info"].(map[string]interface{})["name"]) // name
+		sex, _ := utils.TypeTran.AnyToString(spaceInfo["info"].(map[string]interface{})["sex"])   // sex
+		face, _ := utils.TypeTran.AnyToString(spaceInfo["info"].(map[string]interface{})["face"]) // face
+
+		// 提取 stat 信息
+		stat := responseBody["stat"].(map[string]interface{})
+		follower, _ := utils.TypeTran.AnyToInt(stat["follower"]) // follower
+
+		// 创建并返回 BasicInfo 结构体
+		userInfo := youngee_talent_model.BliBasicInfo{
+			UID:       mid,
+			HeadImage: face,
+			Fans:      follower, // 转换为整数
+			Gender:    sex,
+			Nickname:  name,
+		}
+		return &userInfo
+	}
+	// 如果没有找到 basic_info,返回错误
+	return nil
+}
 
-	// 提取 `cookie` 字段的值
-	cookie := jsonData.GetString("data.response_body.data.cookie")
-	if cookie != "" {
-		return cookie
+// *youngee_talent_model.OCRResponse
+func getXHSOCRresult(homePicURL string, platform_id int) *youngee_talent_model.OCRResponse {
+	// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
+	auth := basic.NewCredentialsBuilder().
+		WithAk("YJRGTOWEITSYOXN3YPJY").
+		WithSk("Kd7WDeS2CxlLXjMhGpLW0AmdOZHafitQpBy13a0s").
+		Build()
+
+	client := ocr.NewOcrClient(
+		ocr.OcrClientBuilder().
+			WithRegion(region.ValueOf("cn-north-4")).
+			WithCredential(auth).
+			Build())
+
+	request := &model.RecognizeWebImageRequest{}
+	request.Body = &model.WebImageRequestBody{
+		Url: &homePicURL,
+	}
+	// 发送请求
+	response, err := client.RecognizeWebImage(request)
+	if err != nil {
+		return nil
+	}
+	// 输出返回的完整响应
+	fmt.Printf("%+v\n", response)
+	resultText := response.String()
+	fmt.Println("resultText--->:", resultText)
+	var orcInfo youngee_talent_model.OCRResponse
+	if strings.Contains(resultText, "编辑资料") &&
+		strings.Contains(resultText, "购物车") &&
+		strings.Contains(resultText, "查看我的订单") {
+		orcInfo.SelfHome = 1
 	} else {
-		return ""
+		orcInfo.SelfHome = 0
+	}
+	//获取小红书ID
+	re := regexp.MustCompile(`小红书号:([\w-]+)`) // 匹配字母、数字或破折号的组合
+	match := re.FindStringSubmatch(resultText)
+	if len(match) > 1 {
+		xhsID := match[1] // match[1] 是第一个括号中的内容,即小红书号
+		fmt.Println("xhsID-->:", xhsID)
+		orcInfo.RedId = xhsID
 	}
+
+	return &orcInfo
+}
+
+func getWBOCRresult(homePicURL string, nickName string) *youngee_talent_model.OCRResponse {
+	// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
+	auth := basic.NewCredentialsBuilder().
+		WithAk("YJRGTOWEITSYOXN3YPJY").
+		WithSk("Kd7WDeS2CxlLXjMhGpLW0AmdOZHafitQpBy13a0s").
+		Build()
+
+	client := ocr.NewOcrClient(
+		ocr.OcrClientBuilder().
+			WithRegion(region.ValueOf("cn-north-4")).
+			WithCredential(auth).
+			Build())
+
+	request := &model.RecognizeWebImageRequest{}
+	request.Body = &model.WebImageRequestBody{
+		Url: &homePicURL,
+	}
+	// 发送请求
+	response, err := client.RecognizeWebImage(request)
+	if err != nil {
+		return nil
+	}
+	// 输出返回的完整响应
+	fmt.Printf("%+v\n", response)
+	resultText := response.String()
+	fmt.Println("resultText--->:", resultText)
+	var orcInfo youngee_talent_model.OCRResponse
+	//检测是否是自己的主页
+	//检查是否是自己的首页
+	if strings.Contains(resultText, "编辑个人资料") &&
+		strings.Contains(resultText, "全部微博") &&
+		strings.Contains(resultText, nickName) {
+		orcInfo.SelfHome = 1
+	} else {
+		orcInfo.SelfHome = 0
+	}
+	return &orcInfo
+}
+
+func getBliOCRresult(homePicURL string, nickName string) *youngee_talent_model.OCRResponse {
+	// The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
+	auth := basic.NewCredentialsBuilder().
+		WithAk("YJRGTOWEITSYOXN3YPJY").
+		WithSk("Kd7WDeS2CxlLXjMhGpLW0AmdOZHafitQpBy13a0s").
+		Build()
+
+	client := ocr.NewOcrClient(
+		ocr.OcrClientBuilder().
+			WithRegion(region.ValueOf("cn-north-4")).
+			WithCredential(auth).
+			Build())
+
+	request := &model.RecognizeWebImageRequest{}
+	request.Body = &model.WebImageRequestBody{
+		Url: &homePicURL,
+	}
+	// 发送请求
+	response, err := client.RecognizeWebImage(request)
+	if err != nil {
+		return nil
+	}
+	// 输出返回的完整响应
+	fmt.Printf("%+v\n", response)
+	resultText := response.String()
+	fmt.Println("resultText--->:", resultText)
+	var orcInfo youngee_talent_model.OCRResponse
+	//检测是否是自己的主页
+	if strings.Contains(resultText, "编辑资料") &&
+		strings.Contains(resultText, nickName) {
+		orcInfo.SelfHome = 1
+	} else {
+		orcInfo.SelfHome = 0
+	}
+	return &orcInfo
+}
+
+// 获取WB用户详细信息
+func TestImage(r *ghttp.Request) *TalentHttpResult {
+	one, _ := g.Model("platform_kuaishou_user_info").Where("id", 188).One()
+	return &TalentHttpResult{Code: 0, Msg: "success", Data: one}
+}
+
+func getRedirectedURL(urlStr string) (string, error) {
+	client := &http.Client{
+		CheckRedirect: func(req *http.Request, via []*http.Request) error {
+			if len(via) > 0 { // 如果发生重定向,返回最终的重定向 URL
+				return nil
+			}
+			return fmt.Errorf("final URL: %s", req.URL) // 获取最终的重定向 URL
+		},
+	}
+
+	resp, err := client.Get(urlStr)
+	if err != nil {
+		return "", err
+	}
+	defer resp.Body.Close()
+
+	return resp.Request.URL.String(), nil // 返回最终目标 URL
+}
+
+func extractUserID(urlStr string) (string, error) {
+	// 解析 URL
+	parsedURL, err := url.Parse(urlStr)
+	if err != nil {
+		return "", err
+	}
+
+	// 提取路径部分中的用户 ID
+	// 这里我们假设用户 ID 是 URL 的路径中的一部分(如 space.bilibili.com/29408510)
+	segments := parsedURL.Path
+	var userID string
+	// 假设 ID 是路径中的第二部分,如 /29408510
+	fmt.Sscanf(segments, "/%s", &userID)
+
+	return userID, nil
 }

+ 9 - 6
app/service/youngee_talent_service/talent_address.go

@@ -62,25 +62,28 @@ func OnAddTalentAddress(r *ghttp.Request) *TalentHttpResult {
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: "Add talent address failed"}
 	}
-
 	tAddr := youngee_talent_model.TalentDeliveryAddress{}
 	err = r.ParseForm(&tAddr)
 	info := g.Map{
 		"talent_id":      tid,
 		"door_num":       tAddr.DoorNumber,
 		"detail_address": tAddr.DetailAddr,
-		"receive_name":   tAddr.ReceiverName,
+		"receiver_name":  tAddr.ReceiverName,
+		"phone_number":   tAddr.PhoneNumber,
 		"default_tag":    tAddr.DefaultTag,
 	}
 	count, err := g.DB().Model("youngee_talent_delivery_address").Where("talent_id", tid).Count()
 	if count == 0 {
-		tAddr.DefaultTag = 1
+		// 只有在 count == 0 时,才设置 default_tag 为 1
+		info["default_tag"] = 1
+		_, err = g.DB().Model("youngee_talent_delivery_address").Data(info).Insert()
+		_, err = g.DB().Model("youngee_talent_info").Where("talent_id", tid).Data(g.Map{"is_bind_location": 1}).Update()
 	}
 	if count > 0 {
-		tAddr.DefaultTag = 0
+		info["default_tag"] = 0
+		_, err = g.DB().Model("youngee_talent_delivery_address").Where("talent_id", tid).Data(info).Insert()
 	}
-	_, err = g.DB().Model("youngee_talent_delivery_address").Where("talent_id", tid).Data(info).Update()
-	_, err = g.DB().Model("youngee_talent_info").Where("talent_id", tid).Data(g.Map{"is_bind_location": 1}).Update()
+
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: err.Error()}
 	}

+ 170 - 18
app/service/youngee_talent_service/talent_info.go

@@ -69,6 +69,23 @@ func OnUpdateTalentInfo(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "success"}
 }
 
+func UpdateTalentName(r *ghttp.Request) *TalentHttpResult {
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
+	}
+	var infos *youngee_talent_model.UpdateNameReq
+	err = r.ParseForm(&infos)
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: err.Error()}
+	}
+	_, err = g.DB().Model(dao.YoungeeTalentInfo.Table).Data(g.Map{"talent_nickname": infos.TalentNickname}).Where("id = ?", tid).Update()
+	if err != nil {
+		return &TalentHttpResult{Code: -4, Msg: "update failed"}
+	}
+	return &TalentHttpResult{Code: 0, Msg: "success"}
+}
+
 func GetTalentInfo(r *ghttp.Request) *TalentHttpResult {
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	if err != nil {
@@ -84,65 +101,200 @@ func GetTalentInfo(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: talentInfo}
 }
 
-// 查询任务数量、young之团数量、选品任务数量
+// // 查询任务数量、young之团数量、选品任务数量
+//
+//	func GetMyInfoNum(r *ghttp.Request) *TalentHttpResult {
+//		tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+//		if err != nil {
+//			return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
+//		}
+//		talentInfoNum := &youngee_talent_model.TalentInfoNum{}
+//		// 查询任务相关数量
+//		var endTaskStageList = [3]int{3, 5, 16}
+//
+//		//种草
+//		fmt.Println("1")
+//		talentInfoNum.AllTaskNum, err = g.DB().Model("youngee_task_info").Where("talent_id=?", tid).Count()
+//		fmt.Println("talentInfoNum.AllTaskNum111", talentInfoNum.AllTaskNum)
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.ApplyTaskNum, err = g.DB().Model("youngee_task_info").Where("talent_id = ? and task_stage = 1", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.ExeTaskNum, err = g.DB().Model("youngee_task_info").Where("talent_id = ? and task_stage >= 4 and task_stage <= 14", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.EndTaskNum, err = g.DB().Model("youngee_task_info").Where("talent_id = ? and task_stage in (?)", tid, endTaskStageList).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.ToDealNum, err = g.DB().Model("youngee_task_info").Where("talent_id = ? and task_stage = 15", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//
+//		//带货任务相关数量
+//		fmt.Println("2")
+//		talentInfoNum.AllSecTaskNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ?", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.GetSampleSecTaskNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and free_stage in (3,4, 5)", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.ExeSecTaskNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and sale_num_all > 0", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.EndSecTaskNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and task_ddl < NOW() ", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.InSampleProcessNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and free_stage = 1 ", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.ToGetRewardNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and reward_stage = 1 ", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.GetRewardNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and reward_stage = 2 ", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		//本地生活
+//		fmt.Println("3")
+//		talentInfoNum.AllTaskNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id=?", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.ApplyTaskNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage = 1", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.ToBookLocalNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage = 4", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.ExeTaskNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage >= 4 and task_stage <= 14", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.ToDealLocalNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage >= 4 and task_stage <= 14", tid).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//		talentInfoNum.EndTaskNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage in (?)", tid, endTaskStageList).Count()
+//		if err != nil {
+//			return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+//		}
+//
+//		return &TalentHttpResult{Code: 0, Msg: "success1", Data: &talentInfoNum}
+//	}
 func GetMyInfoNum(r *ghttp.Request) *TalentHttpResult {
+	// 获取 talentId
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
-	talentInfoNum := youngee_talent_model.TalentInfoNum{}
+
+	// 初始化 talentInfoNum
+	talentInfoNum := &youngee_talent_model.TalentInfoNum{
+		TaskCountNum:      &youngee_talent_model.TaskCountNum{},
+		SecTaskCountNum:   &youngee_talent_model.SecTaskCountNum{},
+		LocalTaskCountNum: &youngee_talent_model.LocalTaskCountNum{},
+	}
+
 	// 查询任务相关数量
 	var endTaskStageList = [3]int{3, 5, 16}
-	whereCondition := g.Map{
-		dao.YoungeeTaskInfo.Columns.TalentId: tid,
-	}
 
-	talentInfoNum.AllTaskNum, err = g.DB().Model(dao.YoungeeTaskInfo.Table).Where(whereCondition).Count()
+	// 种草任务相关数量
+	fmt.Println("1")
+	talentInfoNum.TaskCountNum.AllTaskNum, err = g.DB().Model("youngee_task_info").Where("talent_id=?", tid).Count()
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+	}
+	talentInfoNum.TaskCountNum.ApplyTaskNum, err = g.DB().Model("youngee_task_info").Where("talent_id = ? and task_stage = 1", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.ApplyTaskNum, err = g.DB().Model(dao.YoungeeTaskInfo.Table).Where("talent_id = ? and task_stage = 1", tid).Count()
+	talentInfoNum.TaskCountNum.ExeTaskNum, err = g.DB().Model("youngee_task_info").Where("talent_id = ? and task_stage >= 4 and task_stage <= 14", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.ExeTaskNum, err = g.DB().Model(dao.YoungeeTaskInfo.Table).Where("talent_id = ? and task_stage >= 4 and task_stage <= 14", tid).Count()
+	talentInfoNum.TaskCountNum.EndTaskNum, err = g.DB().Model("youngee_task_info").Where("talent_id = ? and task_stage in (?)", tid, endTaskStageList).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.EndTaskNum, err = g.DB().Model(dao.YoungeeTaskInfo.Table).Where("talent_id = ? and task_stage in (?)", tid, endTaskStageList).Count()
+	talentInfoNum.TaskCountNum.ToDealNum, err = g.DB().Model("youngee_task_info").Where("talent_id = ? and task_stage = 15", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
 
-	// 查询young之团相关数量
-	talentInfoNum.ExeTeamNum, err = g.DB().Model(dao.YounggeeTalentTeam.Table).Where("talent_id = ? and team_status = 2", tid).Count()
+	// 带货任务相关数量
+	fmt.Println("2")
+	talentInfoNum.SecTaskCountNum.AllSecTaskNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ?", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.EndTeamNum, err = g.DB().Model(dao.YounggeeTalentTeam.Table).Where("talent_id = ? and team_status = 3", tid).Count()
+	talentInfoNum.SecTaskCountNum.GetSampleSecTaskNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and free_stage in (3,4, 5)", tid).Count()
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+	}
+	talentInfoNum.SecTaskCountNum.ExeSecTaskNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and sale_num_all > 0", tid).Count()
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+	}
+	talentInfoNum.SecTaskCountNum.EndSecTaskNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and task_ddl < NOW() ", tid).Count()
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+	}
+	talentInfoNum.SecTaskCountNum.InSampleProcessNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and free_stage = 1 ", tid).Count()
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+	}
+	talentInfoNum.SecTaskCountNum.ToGetRewardNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and reward_stage = 1 ", tid).Count()
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+	}
+	talentInfoNum.SecTaskCountNum.GetRewardNum, err = g.DB().Model("younggee_sec_task_info").Where("talent_id = ? and reward_stage = 2 ", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
 
-	// 查询选品任务相关数量
-	talentInfoNum.AllSecTaskNum, err = g.DB().Model(youngee_talent_model.SecTaskInfoDetail{}).Where("talent_id = ?", tid).Count()
+	// 本地生活任务相关数量
+	fmt.Println("3")
+	talentInfoNum.LocalTaskCountNum.AllLocalTaskNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id=?", tid).Count()
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+	}
+	talentInfoNum.LocalTaskCountNum.ApplyLocalTaskNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage = 1", tid).Count()
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
+	}
+	talentInfoNum.LocalTaskCountNum.ToBookLocalNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage = 4", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.GetSampleSecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ? and free_stage in (3,4, 5)", tid).Count()
+	talentInfoNum.LocalTaskCountNum.ExeLocalTaskNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage >= 4 and task_stage <= 14", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.ExeSecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ? and sale_num_all > 0", tid).Count()
+	talentInfoNum.LocalTaskCountNum.ToDealLocalNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage >= 4 and task_stage <= 14", tid).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
-	talentInfoNum.EndSecTaskNum, err = g.DB().Model(dao.YounggeeSecTaskInfo.Table).Where("talent_id = ? and task_ddl < NOW() ", tid).Count()
+	talentInfoNum.LocalTaskCountNum.EndLocalTaskNum, err = g.DB().Model("youngee_local_task_info").Where("talent_id = ? and task_stage in (?)", tid, endTaskStageList).Count()
 	if err != nil {
 		return &TalentHttpResult{Code: -2, Msg: "Get task num failed"}
 	}
 
-	return &TalentHttpResult{Code: 0, Msg: "success", Data: talentInfoNum}
+	// 返回填充好的 talentInfoNum
+	return &TalentHttpResult{Code: 0, Msg: "success1", Data: talentInfoNum}
 }
 
 func AddTalentSkill(r *ghttp.Request) *TalentHttpResult {

+ 241 - 173
app/service/youngee_talent_service/talent_ks_auth.go

@@ -13,7 +13,6 @@ import (
 	"github.com/lin-jim-leon/kuaishou/open/user"
 	"log"
 	"strings"
-	"sync"
 	"time"
 	"youngmini_server/app/model/youngee_talent_model"
 	"youngmini_server/app/service/youngee_sectask_service"
@@ -35,22 +34,8 @@ const (
 	//SignSecret1   = "bf6393dce0a2b669ee348bebb837b0da"
 )
 
-// 定义全局变量保存上下文
-var ctx context.Context
-var cancel context.CancelFunc
-var once sync.Once // 确保上下文只被初始化一次
-
-// 初始化 chromedp 上下文的函数
-func initChromedpContext() {
-	once.Do(func() {
-		// 初始化 chromedp 上下文
-		ctx, cancel = chromedp.NewContext(context.Background())
-		fmt.Println("Chromedp 上下文已初始化")
-	})
-}
-
 // 清理上下文的函数,用于关闭浏览器和取消上下文
-func CleanupChromedpContext() {
+func CleanupChromedpContext(cancel context.CancelFunc) {
 	if cancel != nil {
 		cancel()
 		fmt.Println("Chromedp 上下文已关闭")
@@ -68,13 +53,15 @@ func GetQrcode(r *ghttp.Request) *TalentHttpResult {
 	startTime := time.Now()
 	// 创建一个新的上下文
 	// 确保 chromedp 上下文已初始化
-	initChromedpContext()
-	//ctx, cancel := chromedp.NewContext(context.Background())
+	//initChromedpContext()
+	ctx, cancel := chromedp.NewContext(context.Background()) //每个请求有独立的上下文,而不是共享的
+	fmt.Println("上下文初始化成功")
+
 	// 构建包含 tid 的 urlstr
 	var urlstr string
 	typePlatform := r.GetInt("platform_id")
 	if typePlatform == 8 { //快手平台
-		urlstr = fmt.Sprintf("https://open.kuaishou.com/oauth2/connect?state=%s&app_id=ks671599294546520767&redirect_uri=https://younggee.com/kuaishouVideoVideo&scope=user_video_info,user_info&response_type=code", tid)
+		urlstr = fmt.Sprintf("https://open.kuaishou.com/oauth2/connect?state=%s&app_id=ks671599294546520767&redirect_uri=https://younggee.com/kuaishouVideo&scope=user_video_info,user_info&response_type=code", tid)
 	} else if typePlatform == 2 { //抖音平台
 		urlstr = fmt.Sprintf("https://open.douyin.com/platform/oauth/connect/?state=%s&client_key=awi77xl5kpl16hmi&response_type=code&scope=user_info,data.external.user,video.list.bind&redirect_uri=https://www.younggee.com/douyinauth", tid)
 	} else {
@@ -109,7 +96,13 @@ func GetQrcode(r *ghttp.Request) *TalentHttpResult {
 	println("ok----->", ok)
 	println("url----->", urlstr)
 	fmt.Println("代码运行时间:", time.Since(startTime))
+	// 设置定时器,100秒后关闭上下文
+	go func() {
+		<-time.After(100 * time.Second)
+		CleanupChromedpContext(cancel)
+	}()
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: text}
+
 }
 
 func GetKsEcomQrcode(r *ghttp.Request) *TalentHttpResult {
@@ -121,13 +114,14 @@ func GetKsEcomQrcode(r *ghttp.Request) *TalentHttpResult {
 	}
 	// 记录开始时间
 	startTime := time.Now()
-	// 确保上下文只初始化一次
-	once.Do(func() {
-		ctx, _ = chromedp.NewContext(context.Background())
-		fmt.Println("Chromedp 上下文已初始化")
-	})
 	// 创建一个新的上下文
-	//ctx, _ := chromedp.NewContext(context.Background())
+	ctx, cancel := chromedp.NewContext(context.Background())
+	//ctx, cancel := chromedp.NewContext(context.Background(), chromedp.WithDebugf(log.Printf))
+	// 设置定时器,100秒后关闭上下文
+	//go func() {
+	//	<-time.After(100 * time.Second)
+	//	CleanupChromedpContext(cancel)
+	//}()
 	//需要访问的网址,无state,扫码后跳转到订购页面
 	urlstr := fmt.Sprintf("https://login.kwaixiaodian.com/?biz=fuwu&redirect_url=https://fuwu.kwaixiaodian.com/new/detail?id=22328015871939")
 	// 执行任务
@@ -148,19 +142,15 @@ func GetKsEcomQrcode(r *ghttp.Request) *TalentHttpResult {
 	if err != nil {
 		fmt.Println("errInfo---", err.Error())
 	}
-	println("text----->", text)
-	println("ok----->", ok)
-	println("url----->", urlstr)
 	fmt.Println("代码运行时间:", time.Since(startTime))
 	// 返回二维码的操作已经完成,后续操作(go fun)在后台继续进行
 	// 启动后台 goroutine 监听重定向并处理
-	go HandleAfterRedirect(r)
-
+	go HandleAfterRedirect(r, ctx, cancel)
 	return &TalentHttpResult{Code: 0, Msg: "二维码已生成", Data: text}
 }
 
 // 此函数执行完毕后
-func HandleAfterRedirect(r *ghttp.Request) *TalentHttpResult {
+func HandleAfterRedirect(r *ghttp.Request, ctx context.Context, cancel context.CancelFunc) *TalentHttpResult {
 	fmt.Println("HandleAfterRedirect-----")
 	//达人id获取
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
@@ -168,26 +158,31 @@ func HandleAfterRedirect(r *ghttp.Request) *TalentHttpResult {
 	var isChecked1, isChecked2 bool
 	//var isChecked1 bool
 	var currentURL string
+	var subscribeURL string
+
 	authURL := fmt.Sprintf("https://open.kwaixiaodian.com/oauth/authorize?app_id=ks651333097154138217&redirectUri=https://younggee.com/kuaishouauth&scope=merchant_distribution,merchant_refund,merchant_item,merchant_order,user_info,merchant_servicemarket,merchant_user,merchant_logistics&state=%s", tid)
 	// 执行任务
+	fmt.Println("扫码跳转成功,正在提交订单...")
 	err = chromedp.Run(ctx, chromedp.Tasks{
 		// 等待用户扫码并跳转后,点击“立即购买”按钮,在这识别用户是否扫码完成
-		chromedp.WaitVisible(`#main_root > div > div.yPXHTHq9cx_6vEhWohw_ > div.Jb15b0XMeXvmyWfEfrvq > div.m5IIGVbmvqsfZdb00GFO > div.JktibAFTihy_wzOaJXHl > div.Cbz2c2xjrwvEPJnVK4iA > div.KY1LeQ_L_xVgT9RzkLow.cgxWbYdA4fs28QuNN36F > button`),
-		chromedp.Click(`#main_root > div > div.yPXHTHq9cx_6vEhWohw_ > div.Jb15b0XMeXvmyWfEfrvq > div.m5IIGVbmvqsfZdb00GFO > div.JktibAFTihy_wzOaJXHl > div.Cbz2c2xjrwvEPJnVK4iA > div.KY1LeQ_L_xVgT9RzkLow.cgxWbYdA4fs28QuNN36F > button`),
+		chromedp.WaitVisible(`#main_root > div > div.yPXHTHq9cx_6vEhWohw_ > div.Jb15b0XMeXvmyWfEfrvq > div.m5IIGVbmvqsfZdb00GFO > div.JktibAFTihy_wzOaJXHl > div.Cbz2c2xjrwvEPJnVK4iA > div.KY1LeQ_L_xVgT9RzkLow.cgxWbYdA4fs28QuNN36F > button`, chromedp.ByQuery),
+		chromedp.Click(`#main_root > div > div.yPXHTHq9cx_6vEhWohw_ > div.Jb15b0XMeXvmyWfEfrvq > div.m5IIGVbmvqsfZdb00GFO > div.JktibAFTihy_wzOaJXHl > div.Cbz2c2xjrwvEPJnVK4iA > div.KY1LeQ_L_xVgT9RzkLow.cgxWbYdA4fs28QuNN36F > button`, chromedp.ByQuery),
 		// 等待第一个 checkbox 元素可见
-		chromedp.WaitVisible(`#app > div > section > main > div.cart-container > div.price-content > div.checkbox > label > span.ant-checkbox > input`),
-
+		chromedp.WaitVisible(`#app > div > section > main > div.cart-container > div.price-content > div.checkbox > label > span.ant-checkbox > input`, chromedp.ByQuery),
 		// 检查第一个 checkbox 是否已选中
 		chromedp.EvaluateAsDevTools(`document.querySelector('#app > div > section > main > div.cart-container > div.price-content > div.checkbox > label > span.ant-checkbox > input').checked`, &isChecked1),
+		chromedp.Location(&subscribeURL),
 	})
+
 	if err != nil {
 		log.Fatalf("任务1执行失败:%v", err)
 	}
-	fmt.Println("*****")
-	// 如果第一个 checkbox 没有选中,则点击选中
+	fmt.Println("订阅页面---->", subscribeURL)
+
 	if !isChecked1 {
 		fmt.Println("第一个 Checkbox 未选中。现在选中...")
-		err = chromedp.Run(ctx, chromedp.Click(`#app > div > section > main > div.cart-container > div.price-content > div.checkbox > label > span.ant-checkbox > input`))
+		err = chromedp.Run(ctx, chromedp.Click(`#app > div > section > main > div.cart-container > div.price-content > div.checkbox > label > span.ant-checkbox > input`, chromedp.ByQuery))
+		fmt.Println("选中成功")
 		if err != nil {
 			log.Fatalf("点击第一个 checkbox 失败:%v", err)
 		}
@@ -195,49 +190,86 @@ func HandleAfterRedirect(r *ghttp.Request) *TalentHttpResult {
 		fmt.Println("第一个 Checkbox 已经选中。")
 	}
 
+	// 确认订单  拆分
+	fmt.Println("这一步进行服务的订阅...")
 	err = chromedp.Run(ctx, chromedp.Tasks{
-		// 点击提交订单按钮
-		chromedp.Click(`#app > div > section > main > div.cart-container > div.price-content > div.checkout > button`),
-		chromedp.Sleep(2 * time.Second),
-		//服务已购买,进行授权
+		chromedp.Click(`#app > div > section > main > div.cart-container > div.price-content > div.checkout > button`, chromedp.ByQuery),
 		chromedp.Navigate(authURL),
-		chromedp.Sleep(5 * time.Second),
+		chromedp.Location(&currentURL),
 	})
-	//获取url
+	//出现点击服务订阅,失败的问题,等不到下一个页面的出现
+
+	//// Step 1: 点击按钮
+	//fmt.Println("1")
+	//err = chromedp.Run(ctx, chromedp.Tasks{
+	//	chromedp.Click(`#app > div > section > main > div.cart-container > div.price-content > div.checkout > button`, chromedp.ByQuery), // 点击按钮
+	//})
+	//fmt.Println("2")
+	//if err != nil {
+	//	log.Fatalf("获取 afterbuyURL 失败: %v", err)
+	//}
+	// Step 4: 跳转到授权页面
+	//err = chromedp.Run(ctx, chromedp.WaitVisible(`#app > div > section > main > div.paid-container > div.title`, chromedp.ByQuery))
+	//if err != nil {
+	//	log.Fatalf("跳转到授权页面失败:%v", err)
+	//}
+	//fmt.Println("3")
+
+	// Step 4: 跳转到授权页面
+	//err = chromedp.Run(ctx, chromedp.Navigate(authURL))
+	//if err != nil {
+	//	log.Fatalf("跳转到授权页面失败:%v", err)
+	//}
+
+	// Step 5: 获取授权页面 URL
 	err = chromedp.Run(ctx, chromedp.Location(&currentURL))
+	if err != nil {
+		log.Fatalf("获取 currentURL 失败:%v", err)
+	}
+	if err != nil {
+		fmt.Println("提交订单失败---", err.Error())
+	}
+	fmt.Println("当前授权地址url---》:", currentURL)
+	fmt.Println("服务的订阅成功...")
+	//提交订单需要时间处理
+	//time.Sleep(3 * time.Second)
+	//跳转到授权页面
+	//err = chromedp.Run(ctx, chromedp.Tasks{
+	//	chromedp.Navigate(authURL),
+	//	chromedp.Location(&currentURL),
+	//})
 	//期望含code
-	fmt.Println("currentURL-----:", currentURL)
-
-	// 检查当前 URL 是否包含指定字符串 "https://open.kwaixiaodian.com/oauth/authorize"
+	//不管是否订购过 , 肯定会包含 ,需要手动点击则点击,  不需要手动点击直接授权成功
 	if strings.Contains(currentURL, "https://open.kwaixiaodian.com/oauth/authorize") {
-		// 等待第二个 checkbox 元素可见
+		log.Println("into https://open.kwaixiaodian.com/oauth/authorize")
 		err = chromedp.Run(ctx, chromedp.WaitVisible(`#root > div > div > div > div > div.flex.f-jc-c.UcUNDIrRp1R3a9EnEbQE > div > div.f-1.f-fs-0.Zcms9k6vZGxKICWMIrdG > div.wNrvV7C_9L5FB2oxmyLe > div > div:nth-child(2) > label > span.ant-checkbox > input`, chromedp.ByQuery))
+		if err != nil {
+			log.Println("WaitVisible执行失败:%v", err)
+		}
+		log.Println("等待第二个 checkbox 元素可见")
 		// 检查第二个 checkbox 获得选中情况
 		err = chromedp.Run(ctx, chromedp.EvaluateAsDevTools(`document.querySelector('#root > div > div > div > div > div.flex.f-jc-c.UcUNDIrRp1R3a9EnEbQE > div > div.f-1.f-fs-0.Zcms9k6vZGxKICWMIrdG > div.wNrvV7C_9L5FB2oxmyLe > div > div:nth-child(2) > label > span.ant-checkbox > input').checked`, &isChecked2))
 		if err != nil {
-			log.Fatalf("检查第二个 checkbox 状态失败:%v", err)
+			log.Println("EvaluateAsDevTools执行失败:%v", err)
 		}
-
+		log.Println("检查第二个 checkbox 获得选中情况")
 		// 如果第二个 checkbox 没有选中,则点击选中
 		if !isChecked2 {
 			//选中同意
-			err = chromedp.Run(ctx, chromedp.Click(`#root > div > div > div > div > div.flex.f-jc-c.UcUNDIrRp1R3a9EnEbQE > div > div.f-1.f-fs-0.Zcms9k6vZGxKICWMIrdG > div.wNrvV7C_9L5FB2oxmyLe > div > div:nth-child(2) > label > span.ant-checkbox > input`))
+			err = chromedp.Run(ctx, chromedp.Click(`#root > div > div > div > div > div.flex.f-jc-c.UcUNDIrRp1R3a9EnEbQE > div > div.f-1.f-fs-0.Zcms9k6vZGxKICWMIrdG > div.wNrvV7C_9L5FB2oxmyLe > div > div:nth-child(2) > label > span.ant-checkbox > input`, chromedp.ByQuery))
 			//点击授权按钮,肯定重定向过去了
 		} else {
 			fmt.Println("第二个 Checkbox 已经选中。")
 		}
 		//点击后授权成功
-		err = chromedp.Run(ctx, chromedp.Click(`#root > div > div > div > div > div.flex.f-jc-c.UcUNDIrRp1R3a9EnEbQE > div > div.f-1.f-fs-0.Zcms9k6vZGxKICWMIrdG > div.wNrvV7C_9L5FB2oxmyLe > button`))
+		err = chromedp.Run(ctx, chromedp.Click(`#root > div > div > div > div > div.flex.f-jc-c.UcUNDIrRp1R3a9EnEbQE > div > div.f-1.f-fs-0.Zcms9k6vZGxKICWMIrdG > div.wNrvV7C_9L5FB2oxmyLe > button`, chromedp.ByQuery))
+		//等待跳转并且授权
+		time.Sleep(10 * time.Second)
+		CleanupChromedpContext(cancel)
 		fmt.Println("ok")
-
-	} else {
-		fmt.Println("已经被后端API捕捉。")
-		fmt.Println("currentURL-----:", currentURL)
 	}
-
 	// 输出执行完成的日志
 	fmt.Println("授权完成")
-
 	return &TalentHttpResult{Code: 0, Msg: "已重定向到kuaishouauth接口", Data: nil}
 }
 
@@ -272,101 +304,108 @@ func CheckAccount(r *ghttp.Request) *TalentHttpResult {
 }
 
 // / 抖音二维码绑定,轮询此接口,
-func CheckDyNewAccount(r *ghttp.Request) *TalentHttpResult {
-	//check到了更新时间在两秒内的插入的数据。则说明已绑定。弹窗消失。
-	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
-	redisDyBindStatusKey := fmt.Sprintf("DyBind:%s", tid)
-	bindStatus, err := g.Redis().DoVar("GET", redisDyBindStatusKey)
-	if bindStatus.String() == "bound_to_other" {
-		return &TalentHttpResult{Code: -1, Msg: "此账号已被其他达人绑定", Data: nil}
-	}
-	if err != nil {
-		return &TalentHttpResult{Code: -1, Msg: "Get talent id failed"}
-	}
-	// 获取当前时间
-	currentTime := gtime.Now()
-	// 查询数据库中符合条件的所有记录
-	var userInfos []youngee_talent_model.KuaishouUserInfo
-	err = g.DB().Model("platform_kuaishou_user_info").
-		Where("talent_id = ?", tid).
-		Scan(&userInfos)
-	if err != nil {
-		return &TalentHttpResult{Code: -4, Msg: "Database query failed"}
-	}
-
-	if len(userInfos) == 0 {
-		// 如果没有符合条件的数据,返回失败
-		return &TalentHttpResult{Code: -5, Msg: "No valid data found"}
-	}
-
-	// 找到 CreateTime 最新的记录
-	latestUserInfo := userInfos[0]
-	for _, info := range userInfos[1:] {
-		if info.CreateTime.After(latestUserInfo.CreateTime) {
-			latestUserInfo = info
-		}
-	}
-
-	// 计算创建时间与当前时间的差值
-	timeDiff := currentTime.Sub(latestUserInfo.CreateTime)
-	if timeDiff <= 3*time.Second {
-		return &TalentHttpResult{Code: 0, Msg: "success"}
-	}
-
-	// 超过时间差,返回失败
-	return &TalentHttpResult{Code: -6, Msg: "Time difference exceeds 3 seconds"}
-}
+//func CheckDyNewAccount(r *ghttp.Request) *TalentHttpResult {
+//	//check到了更新时间在两秒内的插入的数据。则说明已绑定。弹窗消失。
+//	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+//	redisDyBindStatusKey := fmt.Sprintf("Bind:%s", tid)
+//	bindStatus, err := g.Redis().DoVar("GET", redisDyBindStatusKey)
+//	if bindStatus.String() == "bound_to_other" {
+//		return &TalentHttpResult{Code: -1, Msg: "此账号已被其他达人绑定", Data: nil}
+//	}
+//	if err != nil {
+//		return &TalentHttpResult{Code: -1, Msg: "Get talent id failed"}
+//	}
+//	// 获取当前时间
+//	currentTime := gtime.Now()
+//	// 查询数据库中符合条件的所有记录
+//	var userInfos []youngee_talent_model.KuaishouUserInfo
+//	err = g.DB().Model("platform_kuaishou_user_info").
+//		Where("talent_id = ?", tid).
+//		Scan(&userInfos)
+//	if err != nil {
+//		return &TalentHttpResult{Code: -4, Msg: "Database query failed"}
+//	}
+//
+//	if len(userInfos) == 0 {
+//		// 如果没有符合条件的数据,返回失败
+//		return &TalentHttpResult{Code: -5, Msg: "No valid data found"}
+//	}
+//
+//	// 找到 CreateTime 最新的记录
+//	latestUserInfo := userInfos[0]
+//	for _, info := range userInfos[1:] {
+//		if info.CreateTime.After(latestUserInfo.CreateTime) {
+//			latestUserInfo = info
+//		}
+//	}
+//
+//	// 计算创建时间与当前时间的差值
+//	timeDiff := currentTime.Sub(latestUserInfo.CreateTime)
+//	if timeDiff <= 3*time.Second {
+//		return &TalentHttpResult{Code: 0, Msg: "success"}
+//	}
+//
+//	// 超过时间差,返回失败
+//	return &TalentHttpResult{Code: -6, Msg: "Time difference exceeds 3 seconds"}
+//}
 
 // 用于轮询,检查数据库表中是否有达人对应的数据,有就删掉,/kuaishouath中会插入。
-func CheckKsNewAccount(r *ghttp.Request) *TalentHttpResult {
+func CheckNewAccount(r *ghttp.Request) *TalentHttpResult {
 	//check到了更新时间在两秒内的插入的数据。则说明已绑定。弹窗消失。
-	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
-	redisKsBindStatusKey := fmt.Sprintf("KsBind:%s", tid)
-	bindStatus, err := g.Redis().DoVar("GET", redisKsBindStatusKey)
-	//if bindStatus == nil {
-	//
-	//}
-	if bindStatus != nil && bindStatus.String() == "bound_to_other" {
-		return &TalentHttpResult{Code: -1, Msg: "此快手账号已被其他达人绑定", Data: nil}
-	}
-	if err != nil {
-		return &TalentHttpResult{Code: -3, Msg: "Get talent id failed"}
-	}
+	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	platformId := r.GetQueryInt("platform_id", 0)
+	if platformId == 0 {
+		return &TalentHttpResult{Code: -1, Msg: "参数格式有误", Data: nil}
+	}
+	if platformId == 4 || platformId == 8 || platformId == 2 {
+		redisKsBindStatusKey := fmt.Sprintf("Bind:%s", tid)
+		bindStatus, err := g.Redis().DoVar("GET", redisKsBindStatusKey)
+		if bindStatus != nil && bindStatus.String() == "bound_to_other" {
+			return &TalentHttpResult{Code: -1, Msg: "此快手账号已被其他达人绑定", Data: nil}
+		}
+		if err != nil {
+			return &TalentHttpResult{Code: -3, Msg: "Get talent id failed"}
+		}
 
-	// 获取当前时间
-	currentTime := gtime.Now()
-	// 查询数据库中符合条件的所有记录
-	var userInfos []youngee_talent_model.KuaishouUserInfo
-	err = g.DB().Model("platform_kuaishou_user_info").
-		Where("talent_id = ?", tid).
-		Scan(&userInfos)
-	if err != nil {
-		return &TalentHttpResult{Code: -4, Msg: "Database query failed"}
-	}
+		// 获取当前时间
+		currentTime := gtime.Now()
+		// 查询数据库中符合条件的所有记录
+		var userInfos []youngee_talent_model.KuaishouUserInfo
+		err = g.DB().Model("platform_kuaishou_user_info").
+			Where("talent_id = ? AND platform_id=?", tid, platformId).
+			Scan(&userInfos)
+		if err != nil {
+			return &TalentHttpResult{Code: -4, Msg: "Database query failed"}
+		}
 
-	//当前达人没有绑定过账号
-	if len(userInfos) == 0 {
-		// 如果没有符合条件的数据,返回失败
-		// 如果没有符合条件的数据,返回继续轮询的提示
-		return &TalentHttpResult{Code: -5, Msg: "没有数据,继续轮询"}
-	}
+		//当前达人没有绑定过账号
+		if len(userInfos) == 0 {
+			// 如果没有符合条件的数据,返回失败
+			// 如果没有符合条件的数据,返回继续轮询的提示
+			return &TalentHttpResult{Code: -5, Msg: "没有数据,继续轮询"}
+		}
 
-	// 找到 CreateTime 最新的记录
-	latestUserInfo := userInfos[0]
-	for _, info := range userInfos[1:] {
-		if info.CreateTime.After(latestUserInfo.CreateTime) {
-			latestUserInfo = info
+		// 找到 CreateTime 最新的记录
+		latestUserInfo := userInfos[0]
+		for _, info := range userInfos[1:] {
+			if info.CreateTime.After(latestUserInfo.CreateTime) {
+				latestUserInfo = info
+			}
 		}
-	}
 
-	// 计算创建时间与当前时间的差值
-	timeDiff := currentTime.Sub(latestUserInfo.CreateTime)
-	if timeDiff <= 3*time.Second {
-		return &TalentHttpResult{Code: 0, Msg: "授权完成,数据已入库"}
+		// 计算创建时间与当前时间的差值
+		timeDiff := currentTime.Sub(latestUserInfo.CreateTime)
+		if timeDiff <= 5*time.Second {
+			return &TalentHttpResult{Code: 0, Msg: "授权完成,数据已入库"}
+		}
+
+		// 超过时间差,返回失败
+		return &TalentHttpResult{Code: -2, Msg: "数据还没进来,继续轮训"}
+
+	} else {
+		return &TalentHttpResult{Code: -2, Msg: "platform_id只能是2,4,8"}
 	}
 
-	// 超过时间差,返回失败
-	return &TalentHttpResult{Code: -2, Msg: "数据还没进来,继续轮训"}
 }
 
 func CheckTokenExp(openId string, platformId int, talentId string) int {
@@ -503,6 +542,7 @@ func AddWindowKuaishouList(r *ghttp.Request) *TalentHttpResult {
 	for _, record := range resInfo {
 		// 调用 CheckKuaishouTokenExp 函数,检查 openId 是否过期
 		expired := CheckKuaishouTokenExp(record.OpenId)
+		fmt.Println()
 		// 将过期检查结果赋值给 expired 属性 ,过期则不能被选中用于加入橱窗
 		record.Expired = expired
 	}
@@ -511,10 +551,9 @@ func AddWindowKuaishouList(r *ghttp.Request) *TalentHttpResult {
 
 func SignUpSecKuaishouList(r *ghttp.Request) *TalentHttpResult {
 	selectionId := r.GetString("selection_id")
-	//领样条件
-	//todo
-	var recruitStrategies []*youngee_talent_model.FreeStrategy
-	err := g.DB().Model("free_strategy").Where("selection_id = ?", selectionId).Scan(&recruitStrategies)
+	//判断是否满足领样条件
+	var freeStrategies []*youngee_talent_model.FreeStrategy
+	err := g.DB().Model("free_strategy").Where("selection_id = ?", selectionId).Scan(&freeStrategies)
 
 	var results []*youngee_talent_model.KuaishouUserInfo
 	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
@@ -556,16 +595,28 @@ func SignUpSecKuaishouList(r *ghttp.Request) *TalentHttpResult {
 		// 将过期检查结果赋值给 expired 属性 ,过期则不能被选中用于加入橱窗
 		record.Expired = expired
 		//是否报名
-		isSignResult, err := g.DB().Model("younggee_sec_task_info").Where("selection_id=? AND open_id=? talent_id=? sample_mode=?", selectionId, record.OpenId, tid, 1).One()
+		isSignResult, err := g.DB().Model("younggee_sec_task_info").Where("selection_id=? AND open_id=? AND talent_id=? AND sample_mode=?", selectionId, record.OpenId, tid, 1).One()
 		// 根据查询结果设置 IsSign 属性
 		if err != nil || isSignResult.IsEmpty() {
 			record.IsSign = 0 // 没有查到数据,设置为 0
 		} else {
 			record.IsSign = 1 // 查到数据,设置为 1
 		}
-		//fanNum := record.Fan
-		//saleNum30 := record.SaleNum30day
-		//todo
+		//
+		fanNum := record.Fan
+		fmt.Println("我的粉丝数", fanNum)
+		saleNum30 := record.SaleNum30day
+		for _, strategy := range freeStrategies {
+			// 判断粉丝数是否满足当前策略的要求
+			if fanNum >= strategy.FollowersLow && saleNum30 >= strategy.SaleNum {
+				// 如果粉丝数满足策略的范围,设置 is_fit 为 1
+				record.IsOk = 1
+				break
+			} else {
+				// 否则设置 is_fit 为 0
+				record.IsOk = 0
+			}
+		}
 
 	}
 	return &TalentHttpResult{Code: 0, Msg: "列表展示成功", Data: resInfo}
@@ -580,29 +631,35 @@ func AddWindowWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 	err := r.ParseForm(&signSecTaskReq)
 
 	if err != nil {
-		fmt.Println("err--", err.Error())
 		return &TalentHttpResult{Code: -1, Msg: "POST参数解析失败", Data: err.Error()}
 	}
 
-	value, err := g.DB().Model("platform_kuaishou_user_info").Fields("access_token").Where("talent_id=? AND open_id = ?", tid, signSecTaskReq.OpenId).Value()
+	value, err := g.DB().Model("platform_kuaishou_user_info").Fields("access_token").Where("talent_id=? AND open_id = ? AND platform_id = 4 ", tid, signSecTaskReq.OpenId).Value()
 	if err != nil {
 		fmt.Println("query db fail")
 	}
 	accessToken := value.String()
-	pIdSlice := []string{signSecTaskReq.ProductId}
+	fmt.Println("access_token:--->", accessToken)
+	pIdSlice := []string{signSecTaskReq.KSProductId}
 	httpResult := youngee_sectask_service.IsCreateSecTask(r)
+	fmt.Println("httpResult--->", httpResult)
 
 	if httpResult.Code == 1 { //存在报名信息,仅添加橱窗
+		fmt.Println("大人id", tid)
+		fmt.Println("accessToken--->", accessToken)
 		_, err := merchant.AddItemsToShelf(ClientKey, SignSecret, accessToken, pIdSlice)
+
 		if err != nil {
 			//表示添加失敗,沒有開通
-			return &TalentHttpResult{Code: -1, Msg: "快手未開通橱窗、商品不存在或已下线", Data: nil}
+			fmt.Println("假如橱窗错误信息为---", err.Error())
+			return &TalentHttpResult{Code: -1, Msg: "存在报名信息,快手未開通橱窗、商品不存在或已下线", Data: err.Error()}
 		}
 		// 查询成功,返回成功结果和数据
 		return &TalentHttpResult{Code: 0, Msg: "无需创建任务,加入橱窗成功", Data: nil}
 	} else { //不存在报名信息
 		//创建并插入报名信息
 		code := youngee_sectask_service.SignUpSecTaskFromWindow(r).Code
+		fmt.Println("滴滴答答啦放假啦", code)
 		if code != 0 {
 			return &TalentHttpResult{Code: -1, Msg: "创建报名信息失败", Data: nil}
 		}
@@ -610,7 +667,7 @@ func AddWindowWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 		_, err := merchant.AddItemsToShelf(ClientKey, SignSecret, accessToken, pIdSlice)
 		if err != nil {
 			//表示添加失敗,沒有開通
-			return &TalentHttpResult{Code: -1, Msg: "快手未開通橱窗、商品不存在或已下线", Data: nil}
+			return &TalentHttpResult{Code: -1, Msg: "不存在报名信息,快手未開通橱窗、商品不存在或已下线", Data: err.Error()}
 		}
 		//报名人数加一
 		_, err = g.DB().Model("younggee_selection_info").
@@ -903,14 +960,14 @@ func GetKuaishouList(r *ghttp.Request) *TalentHttpResult {
 			}
 		}
 	}
-
 	// 构建 UserInfo 列表  参数分别表示初始长度和容量
 	userInfoList := make([]*youngee_talent_model.KuaishouUserInfo, 0, len(userInfoMap))
 	for _, info := range userInfoMap {
+		expStatus := CheckKuaishouTokenExp(info.OpenId)
+		info.Status = expStatus
 		//将 info 添加到 userInfoList 列表的末尾。
 		userInfoList = append(userInfoList, info)
 	}
-
 	// 计算不同的 open_id 的个数
 	uniqueOpenIDCount := len(openIDSet)
 
@@ -934,9 +991,9 @@ func CheckKuaishouTokenExp(openId string) int {
 		return -1
 	}
 	AccessToken := key.String()
-	_, err = douyinUser.GetUserInfo(openId, AccessToken)
+	_, err = user.GetUserinfo(ClientKey, AccessToken)
 	if err != nil { //过期
-		fmt.Println("平台accessToken过期")
+		fmt.Println("平台accessToken过期", err.Error())
 		return 1
 	} else {
 		fmt.Println("未过期")
@@ -966,23 +1023,20 @@ func GetDouyinList(r *ghttp.Request) *TalentHttpResult {
 	// 获取达人对应的平台为2的列表,含基本信息
 	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	userInfo := &youngee_talent_model.KuaishouUserInfo{}
-	results, err := g.DB().Model(userInfo).Where("talent_id = ?", tid).
-		Where("platform_Id IN (?)", 2).
+	results, err := g.DB().Model(userInfo).Where("talent_id = ? AND platform_Id = ? ", tid, 2).
 		All()
 	if err != nil {
 		fmt.Println("Error querying ", err)
 		return &TalentHttpResult{Code: 0, Msg: "查询抖音列表失败", Data: nil}
 	}
-
 	// 创建一个存储用户信息的切片
-	updatedUserInfoList := []*youngee_talent_model.KuaishouUserInfo{}
+	UserInfoList := []*youngee_talent_model.KuaishouUserInfo{}
 
 	// 遍历列表,判断是否过期并更新 Expired 属性
 	for _, record := range results.List() {
 		openID := gconv.String(record["open_id"])
 		// 调用 CheckDouyinTokenExp 函数,获取过期状态 0/1
 		expiredStatus := CheckDouyinTokenExp(openID)
-
 		// 更新 record 中的 Expired 字段值
 		record["Expired"] = expiredStatus
 		err := gconv.Struct(record, userInfo)
@@ -991,17 +1045,31 @@ func GetDouyinList(r *ghttp.Request) *TalentHttpResult {
 		} // 将 map 转换为 KuaishouUserInfo 结构体
 
 		// 添加到用户信息列表
-		updatedUserInfoList = append(updatedUserInfoList, userInfo)
-
-		// 如果需要将更新后的 record 保存到数据库中,请取消注释以下代码
-		// if _, err := g.DB().Model(userInfo).Where("open_id = ?", openID).Data(record).Update(); err != nil {
-		//     fmt.Println("Error updating Expired status: ", err)
-		// }
+		UserInfoList = append(UserInfoList, userInfo)
 	}
 	// 返回 DYListResult 类型
 	return &TalentHttpResult{Code: 1, Msg: "返回抖音列表成功", Data: &youngee_talent_model.DYListResult{
-		Count:    len(updatedUserInfoList),
-		UserInfo: updatedUserInfoList,
+		Count:    len(UserInfoList),
+		UserInfo: UserInfoList,
+	}}
+}
+
+func GetMyAccountList(r *ghttp.Request) *TalentHttpResult {
+	// 获取达人对应的平台为2的列表,含基本信息
+	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	pId := r.GetQueryInt("platform_id", 0)
+	fmt.Println("PlatformId:", pId)
+	if pId != 1 && pId != 3 && pId != 5 {
+		return &TalentHttpResult{Code: -1, Msg: "platform_id无效"}
+	}
+	AccountList := []*youngee_talent_model.KuaishouUserInfo{}
+	g.Model("platform_kuaishou_user_info").Where("talent_id=? AND platform_id=? AND is_delete = ?", tid, pId, 0).Scan(&AccountList)
+	if len(AccountList) == 0 {
+		return &TalentHttpResult{Code: 0, Msg: "无内容", Data: nil}
+	}
+	return &TalentHttpResult{Code: 1, Msg: "返回列表成功", Data: &youngee_talent_model.AccountListResult{
+		Count:    len(AccountList),
+		UserInfo: AccountList,
 	}}
 }
 

+ 1 - 1
app/service/youngee_talent_service/wxlogin.go

@@ -153,7 +153,7 @@ func WxLogin(r *ghttp.Request) *TalentHttpResult {
 	}
 	res.Token = token
 
-	// 以token为键保存session 存储在服务器中
+	//以token为键保存session 存储在服务器中
 	//自动生成一个 session ID 并通过 Cookie 将其发送给客户端,以便在后续请求中识别该客户端的会话
 	//自动生成一个 session ID,并通过 `Set-Cookie` 头将其发送给客户端,前端可以通过r.header['Set-Cookie']获取cookie
 	err = r.Session.Set(token, g.Map{

+ 134 - 42
app/service/youngee_task_service/local_life_info.go

@@ -7,13 +7,13 @@ import (
 	"github.com/gogf/gf/os/glog"
 	"github.com/gogf/gf/os/gtime"
 	"github.com/gogf/gf/util/gconv"
+	"math"
 	"reflect"
 	"sort"
 	"strconv"
 	"youngmini_server/app/dao"
 	"youngmini_server/app/model"
 	"youngmini_server/app/model/youngee_talent_model"
-	"youngmini_server/app/service/youngee_talent_service"
 	"youngmini_server/app/utils"
 )
 
@@ -21,10 +21,10 @@ func GetLocalLifeList(r *ghttp.Request) *TalentHttpResult {
 	pageIndex := r.GetQueryInt("idx", -1)
 	cntPerPage := r.GetQueryInt("cnt", -1)
 	//组合筛选
-	platform := r.Get("platform", "")       //抖音、快手、红Book、B站、微博
-	taskForm := r.Get("task_form", "")      //任务形式,1-2分别代表线下探店,素材分发
-	contentType := r.Get("contenttype", "") //图文形式、视频形式
-	createTime := r.Get("createTime", "")   //任务上线时间
+	platform := r.Get("platform", nil) //抖音、快手、红Book、B站、微博
+	//taskForm := r.Get("task_form", nil)      //任务形式,1-2分别代表线下探店,素材分发
+	contentType := r.Get("contenttype", nil) //图文形式、视频形式
+	createTime := r.Get("createTime", nil)   //任务上线时间
 	//categoryForm := r.Get("categoryform", "") ////商品类目 智能家居、食品饮料等20种
 	//todo 城市参数?
 	//Location := r.GetQueryString("city", "")  //门店store所属城市,
@@ -40,17 +40,19 @@ func GetLocalLifeList(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -1, Msg: "参数错误"}
 	}
 	// 如果有任务形式的过滤条件,则将过滤条件保存于taskModeList
-	var taskFormList []interface{}
-	if taskForm != nil {
-		if reflect.TypeOf(taskForm).Kind() != reflect.Slice {
-			return &TalentHttpResult{Code: -2, Msg: "搜索条件任务形式错误"}
-		}
-
-		taskFormList = make([]interface{}, 0)
-		taskFormList = taskForm.([]interface{})
-	} else {
-		taskFormList = make([]interface{}, 0)
-	}
+	//var taskFormList []interface{}
+	//taskFormList = nil
+	//if taskForm != nil {
+	//
+	//	if reflect.TypeOf(taskForm).Kind() != reflect.Slice {
+	//		return &TalentHttpResult{Code: -2, Msg: "搜索条件任务形式错误"}
+	//	}
+	//
+	//	taskFormList = make([]interface{}, 0)
+	//	taskFormList = taskForm.([]interface{})
+	//} else {
+	//	taskFormList = make([]interface{}, 0)
+	//}
 
 	// 如果有平台的过滤条件,则将平台列表保存于platformList
 	var platformList []interface{}
@@ -141,15 +143,16 @@ func GetLocalLifeList(r *ghttp.Request) *TalentHttpResult {
 		whereStr += ")"
 	}
 
-	if taskFormList != nil {
-		whereStr += " and task_form in ("
-		for _, v := range taskFormList {
-			whereStr += v.(string) + ", "
-		}
-
-		whereStr = whereStr[0 : len(whereStr)-2]
-		whereStr += ")"
-	}
+	//if taskFormList != nil {
+	//	fmt.Println("????")
+	//	whereStr += " and task_form in ("
+	//	for _, v := range taskFormList {
+	//		whereStr += v.(string) + ", "
+	//	}
+	//
+	//	whereStr = whereStr[0 : len(whereStr)-2]
+	//	whereStr += ")"
+	//}
 
 	if searchValue != nil {
 		whereStr += " and local_name like '%" + searchValue.(string) + "%'"
@@ -159,7 +162,7 @@ func GetLocalLifeList(r *ghttp.Request) *TalentHttpResult {
 
 	// 查询所有project
 	var localList = []youngee_talent_model.YounggeeLocalLifeInfo{}
-	err := g.Model(dao.ProjectInfo.Table).Where(whereStr).Scan(&localList)
+	err := g.Model("younggee_local_life_info").Where(whereStr).Scan(&localList)
 	if err != nil {
 		return &TalentHttpResult{Code: -3, Msg: "查询数据库失败"}
 	}
@@ -185,7 +188,7 @@ func GetLocalLifeList(r *ghttp.Request) *TalentHttpResult {
 		Order("task_status ASC,recruit_ddl DESC").Limit(startId, cntPerPage).Scan(&localInfoList.LocalInfos)
 
 	if err != nil {
-		return &TalentHttpResult{Code: -6, Msg: "查询数据库失败"}
+		return &TalentHttpResult{Code: -6, Msg: err.Error()}
 	}
 
 	// 遍历projectList
@@ -205,6 +208,63 @@ func GetLocalLifeList(r *ghttp.Request) *TalentHttpResult {
 				return localInfoList.LocalInfos[i].WatchNum > localInfoList.LocalInfos[j].WatchNum
 			})
 		}
+
+		// 统计 RecruitStrategys 数组中的最低粉丝量和最高粉丝量
+		var minFollowers, maxFollowers int
+		// 初始值可以设为极大/极小值
+		minFollowers = math.MaxInt32
+		maxFollowers = math.MinInt32
+
+		// 遍历 RecruitStrategys,找出最低粉丝量和最高粉丝量
+		for _, strategy := range local.RecruitStrategys {
+			if strategy.FollowersLow < minFollowers {
+				minFollowers = strategy.FollowersLow
+			}
+			if strategy.FollowersUp > maxFollowers {
+				maxFollowers = strategy.FollowersUp
+			}
+		}
+
+		// 如果需要,可以将这些值保存到 ProjectInfo 中,供后续使用
+		localInfoList.LocalInfos[i].MinFollowers = minFollowers
+		localInfoList.LocalInfos[i].MaxFollowers = maxFollowers
+
+		//稿费的展示情况
+		allFeeFormNoFee := true // 假设都是无费置换
+		var hasSelfPrice bool
+		var minOffer, maxOffer int
+
+		for _, strategy := range local.RecruitStrategys {
+			if strategy.FeeForm != 1 { // 如果存在非无费置换的策略
+				allFeeFormNoFee = false
+			}
+			if strategy.FeeForm == 3 { // 存在自报价
+				hasSelfPrice = true
+			}
+			if strategy.FeeForm == 2 { // 一口价策略
+				if strategy.Offer < minOffer || minOffer == 0 {
+					minOffer = strategy.Offer
+				}
+				if strategy.Offer > maxOffer {
+					maxOffer = strategy.Offer
+				}
+			}
+		}
+
+		// 根据判断结果设置 IsShowOffer 和 HaveSelfPrice
+		if allFeeFormNoFee {
+			local.IsShowOffer = 2 // 不展示稿费
+		} else {
+			local.IsShowOffer = 1 // 展示稿费
+			if hasSelfPrice {
+				local.HaveSelfOffer = 1 //存在自报价
+			} else {
+				local.HaveSelfOffer = 2 //不存在自报价
+			}
+			localInfoList.LocalInfos[i].MaxOffer = maxOffer
+			localInfoList.LocalInfos[i].MinOffer = minOffer
+		}
+
 	}
 	localInfoList.MaxPage = maxPage
 	var filteredLocalInfo []*youngee_talent_model.YounggeeLocalLifeInfo
@@ -235,7 +295,7 @@ func GetLocalLifeList(r *ghttp.Request) *TalentHttpResult {
 
 func GetLocalLifeDetail(r *ghttp.Request) *TalentHttpResult {
 	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
-	local_id := r.GetQueryInt("id", 0)
+	local_id := r.GetQueryString("id", "")
 	//通过首页进入的详情页,获取服务商id,younggee_supplier表
 	enterprise_id := r.GetQueryString("enterprise_id", "")
 	//通过扫服务商码进入的详情页,获取服务商id,younggee_supplier表
@@ -250,9 +310,9 @@ func GetLocalLifeDetail(r *ghttp.Request) *TalentHttpResult {
 		}
 	}
 	// Redis key
-	loalViewKey := "local:view:" + strconv.Itoa(local_id)
-	userViewedKey := "user:viewed:" + tid + ":" + strconv.Itoa(local_id)
-	if local_id == 0 {
+	loalViewKey := "local:view:" + local_id
+	userViewedKey := "user:viewed:" + tid + ":" + local_id
+	if local_id == "" {
 		return &TalentHttpResult{Code: -2, Msg: "parse param error"}
 	}
 	//在redis中增加浏览量
@@ -269,15 +329,45 @@ func GetLocalLifeDetail(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -3, Msg: err.Error()}
 	}
 
+	//var younggeeProductPhoto []*youngee_talent_model.YounggeeProductPhoto
+	//err = g.DB().Model(youngee_talent_model.YounggeeProductPhoto{}).WithAll().Where("product_id", pid).Scan(&younggeeProductPhoto)
+	//if err != nil {
+	//	return &TalentHttpResult{Code: -3, Msg: err.Error()}
+	//}
+
+	var younggeePhoto []*youngee_talent_model.YounggeeProductPhoto
+
+	teamBuyingId := LocalDetail.TeamBuyingId
+	if teamBuyingId != 0 {
+		err := g.DB().Model("younggee_product_photo").Where("team_buying_id", teamBuyingId).Scan(&younggeePhoto)
+		if err != nil {
+			return &TalentHttpResult{Code: -3, Msg: err.Error()}
+		}
+	}
+
+	StoreId := LocalDetail.StoreId
+	if StoreId != 0 {
+		err := g.DB().Model("younggee_product_photo").Where("store_id", StoreId).Scan(&younggeePhoto)
+		if err != nil {
+			return &TalentHttpResult{Code: -3, Msg: err.Error()}
+		}
+		fmt.Println("younggeePhoto", younggeePhoto)
+	}
+
+	fmt.Println("younggeePhoto", younggeePhoto)
+	LocalDetail.YounggeeProductPhoto = younggeePhoto
+
 	//违约
-	one, err := g.DB().Model("info_auto_default_handle").Where("auto_default_id=?", LocalDetail.AutoDefaultId).One()
-	one2, err := g.DB().Model("info_auto_task").Where("auto_task_id=?", LocalDetail.AutoTaskId).One()
-	LocalDetail.DraftDefault.BreakPecent = one["sketch_replace_not_upload"].Int()
-	LocalDetail.LinkDefault.BreakPecent = one["link_replace_not_upload"].Int()
-	LocalDetail.DataDefault.BreakPecent = one["data_replace_not_upload"].Int()
-	LocalDetail.DraftDefault.BreakTime = one2["draft_default"].Int()
-	LocalDetail.DraftDefault.BreakTime = one2["link_breach"].Int()
-	LocalDetail.DraftDefault.BreakTime = one2["case_close_default"].Int()
+	//if LocalDetail.AutoTaskId != 0 && LocalDetail.AutoDefaultId != 0 {
+	//	one, _ := g.DB().Model("info_auto_default_handle").Where("auto_default_id=?", LocalDetail.AutoDefaultId).One()
+	//	one2, _ := g.DB().Model("info_auto_task").Where("auto_task_id=?", LocalDetail.AutoTaskId).One()
+	//	LocalDetail.DraftDefault.BreakPecent = one["sketch_replace_not_upload"].Int()
+	//	LocalDetail.LinkDefault.BreakPecent = one["link_replace_not_upload"].Int()
+	//	LocalDetail.DataDefault.BreakPecent = one["data_replace_not_upload"].Int()
+	//	LocalDetail.DraftDefault.BreakTime = one2["draft_default"].Int()
+	//	LocalDetail.DraftDefault.BreakTime = one2["link_breach"].Int()
+	//	LocalDetail.DraftDefault.BreakTime = one2["case_close_default"].Int()
+	//}
 
 	if viewed.IsNil() {
 		// User hasn't viewed this product yet, increase the view count
@@ -383,13 +473,13 @@ func GetLocalTaskBriefList(r *ghttp.Request) *TalentHttpResult {
 		fmt.Println("openid---->", v.OpenId)
 		err = g.Model("platform_kuaishou_user_info").Where("platform_id = ? and talent_id = ? and open_id = ?", localDetail.LocalPlatform, tid, v.OpenId).Scan(&account)
 		//拿快手平台验证是否过期
-		expired := youngee_talent_service.CheckKuaishouTokenExp(account.OpenId)
-		account.Expired = expired
-
+		//expired := youngee_talent_service.CheckKuaishouTokenExp(account.OpenId)
+		//account.Expired = expired
 		if err != nil {
 			return &TalentHttpResult{Code: -1, Msg: "Get account info failed"}
 		}
 		//taskInfoBrief含需要展示在页面的内容,被加入各阶段List
+
 		taskInfoBrief := &youngee_talent_model.LocalTaskInfoBrief{
 			TaskId:          v.TaskId,
 			PlatformIconUrl: platformMap[strconv.Itoa(localDetail.PlatformInfo.PlatformId)].PlatformIcon,
@@ -421,6 +511,8 @@ func GetLocalTaskBriefList(r *ghttp.Request) *TalentHttpResult {
 			taskBriefList.WaitBookList = append(taskBriefList.WaitBookList, taskInfoBrief)
 		} else if v.TaskStage <= 14 && v.TaskStage >= 5 {
 			taskBriefList.GoingOnTaskInfoList = append(taskBriefList.GoingOnTaskInfoList, taskInfoBrief)
+		} else if v.TaskStage == 15 {
+			taskBriefList.WaitToPayInfoList = append(taskBriefList.WaitToPayInfoList, taskInfoBrief)
 		} else {
 			taskBriefList.CompletedTaskInfoList = append(taskBriefList.CompletedTaskInfoList, taskInfoBrief)
 		}

+ 253 - 36
app/service/youngee_task_service/project_info.go

@@ -5,11 +5,10 @@ import (
 	"github.com/gogf/gf/os/glog"
 	"github.com/gogf/gf/os/gtime"
 	"github.com/gogf/gf/util/gconv"
+	"math"
 	"reflect"
 	"sort"
-	"strconv"
 	"youngmini_server/app/dao"
-	"youngmini_server/app/model"
 	"youngmini_server/app/model/youngee_talent_model"
 	"youngmini_server/app/service/youngee_talent_service"
 	"youngmini_server/app/utils"
@@ -35,15 +34,14 @@ const (
 
 // 获取项目信息列表service
 func GetProjectInfoList(r *ghttp.Request) *TalentHttpResult {
-	fmt.Println("进入种草主页")
 	pageIndex := r.GetQueryInt("idx", -1)
 	cntPerPage := r.GetQueryInt("cnt", -1)
 	//组合筛选
-	platform := r.Get("platform", "")         //抖音、快手、红Book、B站、微博
-	projectForm := r.Get("projectform")       //1.商品寄拍、3.虚拟产品评测、2.素材分发
-	contentType := r.Get("contenttype", "")   //图文形式、视频形式
-	createTime := r.Get("createTime", "")     //任务上线时间
-	categoryForm := r.Get("categoryform", "") ////商品类目 智能家居、食品饮料等20种
+	platform := r.Get("platform", nil)         //抖音、快手、红Book、B站、微博
+	projectForm := r.Get("projectform", nil)   //1.商品寄拍、3.虚拟产品评测、2.素材分发
+	contentType := r.Get("contenttype", nil)   //图文形式、视频形式
+	createTime := r.Get("createTime", nil)     //任务上线时间
+	categoryForm := r.Get("categoryform", nil) ////商品类目 智能家居、食品饮料等20种
 
 	//排根据浏览量排序
 	viewOrder := r.GetQueryInt("pageViewOrder", -1) //根据哪个字段排序
@@ -51,7 +49,7 @@ func GetProjectInfoList(r *ghttp.Request) *TalentHttpResult {
 	//仅稿费”+“稿费+赠品"。这个在recruit表中,得到列表之后进行排序
 	feeForm := r.GetInt("feeform", 0)
 
-	searchValue := r.Get("searchvalue")
+	searchValue := r.Get("searchvalue", nil)
 	if pageIndex == -1 || cntPerPage == -1 || cntPerPage == 0 {
 		return &TalentHttpResult{Code: -1, Msg: "参数错误"}
 	}
@@ -193,11 +191,11 @@ func GetProjectInfoList(r *ghttp.Request) *TalentHttpResult {
 	fmt.Println("whereStr:-----》 ", whereStr)
 
 	// 查询所有project
-	var projectList = []model.ProjectInfo{}
-	err := g.Model(dao.ProjectInfo.Table).Where(whereStr).Scan(&projectList)
-	if err != nil {
-		return &TalentHttpResult{Code: -3, Msg: "查询数据库失败"}
-	}
+	//var projectList = []model.ProjectInfo{}
+	//err := g.Model(dao.ProjectInfo.Table).Where(whereStr).Scan(&projectList)
+	//if err != nil {
+	//	return &TalentHttpResult{Code: -3, Msg: "查询数据库失败"}
+	//}
 
 	// 判断请求页面是否超过最大页面
 	c, err := g.DB().Model(dao.ProjectInfo.Table).Fields("project_id").Where(whereStr).Count()
@@ -216,12 +214,17 @@ func GetProjectInfoList(r *ghttp.Request) *TalentHttpResult {
 	}
 
 	var projectInfoList = youngee_talent_model.ProjectInfoList{}
+
+	fmt.Println("test")
 	err = g.DB().Model("project_info").WithAll().Where(whereStr).
 		Order("project_status ASC,recruit_ddl DESC").Limit(startId, cntPerPage).Scan(&projectInfoList.ProjectInfos)
-
+	fmt.Println("test over")
 	if err != nil {
 		return &TalentHttpResult{Code: -6, Msg: "查询数据库失败"}
 	}
+	for _, project := range projectInfoList.ProjectInfos {
+		fmt.Println("ids---->", project.ProjectId)
+	}
 
 	// 遍历projectList
 	for i, project := range projectInfoList.ProjectInfos {
@@ -241,13 +244,71 @@ func GetProjectInfoList(r *ghttp.Request) *TalentHttpResult {
 				return projectInfoList.ProjectInfos[i].WatchedNum > projectInfoList.ProjectInfos[j].WatchedNum
 			})
 		}
+
+		// 统计 RecruitStrategys 数组中的最低粉丝量和最高粉丝量
+		var minFollowers, maxFollowers int
+		// 初始值可以设为极大/极小值
+		minFollowers = math.MaxInt32
+		maxFollowers = math.MinInt32
+
+		// 遍历 RecruitStrategys,找出最低粉丝量和最高粉丝量
+		for _, strategy := range project.RecruitStrategys {
+			if strategy.FollowersLow < minFollowers {
+				minFollowers = strategy.FollowersLow
+			}
+			if strategy.FollowersUp > maxFollowers {
+				maxFollowers = strategy.FollowersUp
+			}
+		}
+
+		// 打印最低粉丝量和最高粉丝量
+		fmt.Printf("ProjectId: %d, MinFollowers: %d, MaxFollowers: %d\n", project.ProjectId, minFollowers, maxFollowers)
+
+		// 如果需要,可以将这些值保存到 ProjectInfo 中,供后续使用
+		projectInfoList.ProjectInfos[i].MinFollowers = minFollowers
+		projectInfoList.ProjectInfos[i].MaxFollowers = maxFollowers
+
+		//稿费的展示情况
+		allFeeFormNoFee := true // 假设都是无费置换
+		var hasSelfPrice bool
+		var minOffer, maxOffer int
+
+		for _, strategy := range project.RecruitStrategys {
+			if strategy.FeeForm != 1 { // 如果存在非无费置换的策略
+				allFeeFormNoFee = false
+			}
+			if strategy.FeeForm == 3 { // 存在自报价
+				hasSelfPrice = true
+			}
+			if strategy.FeeForm == 2 { // 一口价策略
+				if strategy.Offer < minOffer || minOffer == 0 {
+					minOffer = strategy.Offer
+				}
+				if strategy.Offer > maxOffer {
+					maxOffer = strategy.Offer
+				}
+			}
+		}
+
+		// 根据判断结果设置 IsShowOffer 和 HaveSelfPrice
+		if allFeeFormNoFee {
+			project.IsShowOffer = 2 // 不展示稿费
+		} else {
+			project.IsShowOffer = 1 // 展示稿费
+			if hasSelfPrice {
+				project.HaveSelfOffer = 1 //存在自报价
+			} else {
+				project.HaveSelfOffer = 2 //存在自报价
+			}
+			projectInfoList.ProjectInfos[i].MaxOffer = maxOffer
+			projectInfoList.ProjectInfos[i].MinOffer = minOffer
+		}
 	}
 	projectInfoList.MaxPage = maxPage
 	var filteredProjects []*youngee_talent_model.ProjectInfo
 	//筛选出“仅稿费”+“稿费+赠品”任务,
 	//只要策略中有 无费置换 之外的fee_form就是有稿费,projectform是 商品寄拍 和 虚拟产品测评 ,就是有赠品
 	if feeForm != 0 {
-
 		for _, project := range projectInfoList.ProjectInfos {
 			// 条件1:筛选出所有 project_form 为 1 或 3 的项目
 			if project.ProjectForm == 1 || project.ProjectForm == 3 {
@@ -273,16 +334,21 @@ func GetProjectInfoList(r *ghttp.Request) *TalentHttpResult {
 // 获取单个项目详情service
 func GetProjectDetail(r *ghttp.Request) *TalentHttpResult {
 	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
-	pid := r.GetQueryInt("project_id", 0)
+	//pid := r.GetQueryInt("project_id", 0)
+	pid := r.GetQueryString("project_id", "")
+	fmt.Println("project id----", pid)
 	//通过首页进入的详情页,获取服务商id,younggee_supplier表
 	enterprise_id := r.GetQueryString("enterprise_id", "")
+	fmt.Println("enterprise_id:----》", enterprise_id)
 	//通过扫服务商码进入的详情页,获取服务商id,younggee_supplier表
 	s_project_id := r.GetQueryInt("s_project_id", 0)
 
 	// Redis key
-	projectViewKey := "project:view:" + strconv.Itoa(pid)
-	userViewedKey := "user:viewed:" + tid + ":" + strconv.Itoa(pid)
-	if pid == 0 {
+	//projectViewKey := "project:view:" + strconv.Itoa(pid)
+	projectViewKey := "project:view:" + pid
+	//userViewedKey := "user:viewed:" + tid + ":" + strconv.Itoa(pid)
+	userViewedKey := "user:viewed:" + tid + ":" + pid
+	if pid == "" {
 		return &TalentHttpResult{Code: -2, Msg: "parse param error"}
 	}
 	//在redis中增加浏览量
@@ -298,15 +364,33 @@ func GetProjectDetail(r *ghttp.Request) *TalentHttpResult {
 	if err != nil {
 		return &TalentHttpResult{Code: -3, Msg: err.Error()}
 	}
-	//违约
-	one, err := g.DB().Model("info_auto_default_handle").Where("auto_default_id=?", ProjectDetail.AutoDefaltId).One()
+	//违约在这里
+	//各阶段扣款比例
+	one, err := g.DB().Model("info_auto_default_handle").Where("auto_default_id=?", ProjectDetail.AutoDefaultId).One()
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: err.Error()}
+	}
+	//各阶段扣款时间
 	one2, err := g.DB().Model("info_auto_task").Where("auto_task_id=?", ProjectDetail.AutoTaskId).One()
-	ProjectDetail.DraftDefault.BreakPecent = one["sketch_replace_not_upload"].Int()
-	ProjectDetail.LinkDefault.BreakPecent = one["link_replace_not_upload"].Int()
-	ProjectDetail.DataDefault.BreakPecent = one["data_replace_not_upload"].Int()
-	ProjectDetail.DraftDefault.BreakTime = one2["draft_default"].Int()
-	ProjectDetail.DraftDefault.BreakTime = one2["link_breach"].Int()
-	ProjectDetail.DraftDefault.BreakTime = one2["case_close_default"].Int()
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: err.Error()}
+	}
+
+	if one != nil {
+		ProjectDetail.DraftBreakPercent = one["sketch_replace_not_upload"].Int()
+		ProjectDetail.LinkBreakPercent = one["link_replace_not_upload"].Int()
+		ProjectDetail.DataBreakPercent = one["data_replace_not_upload"].Int()
+	} else {
+		return &TalentHttpResult{Code: 0, Msg: "one is nil"}
+	}
+
+	if one2 != nil {
+		ProjectDetail.DraftBreakTime = one2["draft_default"].Int()
+		ProjectDetail.LinkBreakTime = one2["link_breach"].Int()
+		ProjectDetail.DataBreakTime = one2["case_close_default"].Int()
+	} else {
+		return &TalentHttpResult{Code: 0, Msg: "one2 is nil"}
+	}
 
 	if viewed.IsNil() {
 		// User hasn't viewed this product yet, increase the view count
@@ -347,6 +431,23 @@ func GetProjectDetail(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: 0, Msg: "Redis 设置过期时间失败"}
 	}
 
+	//填充收藏信息
+	collectionInfo := []youngee_talent_model.ProjectCollection{}
+	err = g.DB().Model("younggee_project_collect_info").Where("project_id=? and talent_id = ?", pid, tid).Scan(&collectionInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: err.Error()}
+	}
+	//已被收藏
+	if len(collectionInfo) != 0 && collectionInfo[0].Deleted == 0 { //有数据  且   没取消收藏
+		ProjectDetail.IsCollected = 1
+	} else {
+		ProjectDetail.IsCollected = 0 //没数据  或  有数据但取消了收藏
+	}
+	//返回的data作为收藏接口的is_collect字段传入
+	if err != nil {
+		return &TalentHttpResult{Code: -3, Msg: err.Error()}
+	}
+
 	// 来自服务商
 	if s_project_id != 0 {
 		projectInfoSupplier := youngee_talent_model.ProjectInfoSupplier{}
@@ -362,8 +463,9 @@ func GetProjectDetail(r *ghttp.Request) *TalentHttpResult {
 		ProjectDetail.YounggeeSupplier = younggeeSupplier
 		ProjectDetail.ProjectInfoSupplier = &projectInfoSupplier
 	} else {
+		//商家发布的
 		var enterprise *youngee_talent_model.Enterprise
-		err = g.DB().Model("enterprise").WithAll().Where("enterprise_id", enterprise_id).Scan(&enterprise)
+		err = g.DB().Model("enterprise").Where("enterprise_id", enterprise_id).Scan(&enterprise)
 		if err != nil {
 			return &TalentHttpResult{Code: -3, Msg: err.Error()}
 		}
@@ -398,14 +500,14 @@ func GetProjectDetailFromBrowse(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -3, Msg: err.Error()}
 	}
 	//违约
-	one, err := g.DB().Model("info_auto_default_handle").Where("auto_default_id=?", ProjectDetail.AutoDefaltId).One()
+	one, err := g.DB().Model("info_auto_default_handle").Where("auto_default_id=?", ProjectDetail.AutoDefaultId).One()
 	one2, err := g.DB().Model("info_auto_task").Where("auto_task_id=?", ProjectDetail.AutoTaskId).One()
-	ProjectDetail.DraftDefault.BreakPecent = one["sketch_replace_not_upload"].Int()
-	ProjectDetail.LinkDefault.BreakPecent = one["link_replace_not_upload"].Int()
-	ProjectDetail.DataDefault.BreakPecent = one["data_replace_not_upload"].Int()
-	ProjectDetail.DraftDefault.BreakTime = one2["draft_default"].Int()
-	ProjectDetail.DraftDefault.BreakTime = one2["link_breach"].Int()
-	ProjectDetail.DraftDefault.BreakTime = one2["case_close_default"].Int()
+	ProjectDetail.DraftBreakPercent = one["sketch_replace_not_upload"].Int()
+	ProjectDetail.LinkBreakPercent = one["link_replace_not_upload"].Int()
+	ProjectDetail.DataBreakPercent = one["data_replace_not_upload"].Int()
+	ProjectDetail.DraftBreakTime = one2["draft_default"].Int()
+	ProjectDetail.DraftBreakTime = one2["link_breach"].Int()
+	ProjectDetail.DraftBreakTime = one2["case_close_default"].Int()
 
 	if s_project_id != "" { // 来自服务商
 		var younggeeSupplier *youngee_talent_model.YounggeeSupplier
@@ -482,3 +584,118 @@ func SignUpProjKuaishouList(r *ghttp.Request) *TalentHttpResult {
 
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: resInfo}
 }
+
+// 根据project的平台出现对应的社媒账号列表
+func SignUpProjAccountList(r *ghttp.Request) *TalentHttpResult {
+	tid, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	pid := r.GetQueryString("project_id", "")
+	platformId := r.GetInt("platform_id", 0)
+	if pid == "" || platformId == 0 {
+		return &TalentHttpResult{Code: -1, Msg: "参数有误", Data: nil}
+	}
+	//快手平台
+	if platformId == 4 {
+		// 定义用于存储查询结果的结构体切片
+		var results []*youngee_talent_model.KuaishouUserInfo
+		// 查询此达人下,platform_id 为 8 或 4 的所有数据,并将结果扫描到结构体切片中
+		err := g.DB().Model(&youngee_talent_model.KuaishouUserInfo{}).
+			Where("talent_id = ?", tid).
+			Where("platform_id IN (?, ?)", 4, 8).
+			Order("open_id ASC, platform_id DESC"). // 按 open_id 排序,确保每组的数据连续,并且 platform_id=4 的数据排在前面
+			Scan(&results)
+		if err != nil {
+			return &TalentHttpResult{Code: 1, Msg: "查询失败", Data: nil}
+		}
+
+		// 创建一个 map,用于记录每个 open_id 对应的记录
+		//key是openid,value是数组,从而实现一对多
+		openIdMap := make(map[string][]*youngee_talent_model.KuaishouUserInfo)
+
+		// 将查询结果按 open_id 分组
+		for _, record := range results {
+			openIdMap[record.OpenId] = append(openIdMap[record.OpenId], record)
+		}
+
+		// 筛选出 open_id 对应两条数据且 platform_id = 4 的记录
+		var resInfo []*youngee_talent_model.KuaishouUserInfo
+		for _, records := range openIdMap {
+			if len(records) == 2 { // 确保有两条数据,排除只有一个 platform_id 的情况
+				for _, record := range records {
+					if record.PlatformId == 4 { // 选取 platform_id = 4(电商) 的记录,含有粉丝数就好,因为需要加入橱窗
+						resInfo = append(resInfo, record)
+						break
+					}
+				}
+			}
+		}
+		// 遍历 resInfo 检查过期和是否报名
+		for _, record := range resInfo {
+			// 调用 CheckKuaishouTokenExp 函数,检查 openId 是否过期
+			expired := youngee_talent_service.CheckKuaishouTokenExp(record.OpenId)
+			// 将过期检查结果赋值给 expired 属性 ,过期则不能被选中用于加入橱窗
+			record.Expired = expired
+			//是否报名
+			isSignResult, err := g.DB().Model("younggee_task_info").Where("project_id=? AND open_id=? talent_id=?", pid, record.OpenId, tid).One()
+			// 根据查询结果设置 IsSign 属性
+			if err != nil || isSignResult.IsEmpty() {
+				record.IsSign = 0 // 没有查到数据,设置为 0
+			} else {
+				record.IsSign = 1 // 查到数据,设置为 1
+			}
+
+		}
+		return &TalentHttpResult{Code: 0, Msg: "success", Data: resInfo}
+	} else if platformId == 2 { //抖音
+		//获取列表
+		var results2 []*youngee_talent_model.KuaishouUserInfo
+		err := g.DB().Model(&youngee_talent_model.KuaishouUserInfo{}).
+			Where("talent_id = ?", tid).
+			Where("platform_id = ? ", 2).
+			Scan(&results2)
+		if err != nil {
+			return &TalentHttpResult{Code: 1, Msg: "查询失败", Data: nil}
+		}
+		// 遍历 resInfo 检查过期和是否报名
+		for _, record := range results2 {
+			// 调用 CheckKuaishouTokenExp 函数,检查 openId 是否过期
+			expired := youngee_talent_service.CheckDouyinTokenExp(record.OpenId)
+			// 将过期检查结果赋值给 expired 属性 ,过期则不能被选中用于加入橱窗
+			record.Expired = expired
+			//是否报名
+			isSignResult, err := g.DB().Model("younggee_task_info").Where("project_id=? AND open_id=? talent_id=?", pid, record.OpenId, tid).One()
+			// 根据查询结果设置 IsSign 属性
+			if err != nil || isSignResult.IsEmpty() {
+				record.IsSign = 0 // 没有查到数据,设置为 0
+			} else {
+				record.IsSign = 1 // 查到数据,设置为 1
+			}
+
+		}
+		return &TalentHttpResult{Code: 0, Msg: "success", Data: results2}
+
+	} else { //小红书 、 b站  、 微博
+		//获取列表
+		var results2 []*youngee_talent_model.KuaishouUserInfo
+		err := g.DB().Model(&youngee_talent_model.KuaishouUserInfo{}).
+			Where("talent_id = ?", tid).
+			Where("platform_id = ? ", platformId).
+			Scan(&results2)
+		if err != nil {
+			return &TalentHttpResult{Code: 1, Msg: "查询失败", Data: nil}
+		}
+		// 遍历 resInfo 是否报名
+		for _, record := range results2 {
+			//是否报名
+			isSignResult, err := g.DB().Model("younggee_task_info").Where("project_id=? AND open_id=? talent_id=?", pid, record.OpenId, tid).One()
+			// 根据查询结果设置 IsSign 属性
+			if err != nil || isSignResult.IsEmpty() {
+				record.IsSign = 0 // 没有查到数据,设置为 0
+			} else {
+				record.IsSign = 1 // 查到数据,设置为 1
+			}
+
+		}
+		return &TalentHttpResult{Code: 0, Msg: "success", Data: results2}
+	}
+
+}

+ 4 - 1
app/service/youngee_task_service/task_data.go

@@ -234,7 +234,10 @@ func GetUnSubmitTaskData(r *ghttp.Request) *TalentHttpResult {
 // 收藏种草项目
 func ProjectCollection(r *ghttp.Request) *TalentHttpResult {
 	tId, _ := utils.SessionTalentInfo.GetTalentIdFromSession(r)
-	pId := r.GetQueryString("project_id")
+	pId := r.GetQueryString("project_id", "")
+	if pId == "" {
+		return &TalentHttpResult{Code: -1, Msg: "参数传递有误"}
+	}
 	record, err := g.DB().Model("younggee_project_collect_info").Where("talent_id = ? and project_id = ?", tId, pId).One()
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: err.Error()}

+ 11 - 6
app/service/youngee_task_service/task_income.go

@@ -108,8 +108,8 @@ func Withdraw(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -3, Msg: "Req IncomeIdList Error"}
 	}
 
-	var talentBank model.YounggeeTalentBank
-	err = g.Model(dao.YounggeeTalentBank.Table).Where("talent_id = ?", tid).Scan(&talentBank)
+	var talentBank youngee_talent_model.TalentBankInfo
+	err = g.Model("younggee_talent_bank").Where("talent_id = ?", tid).Scan(&talentBank)
 	if err != nil {
 		return &TalentHttpResult{Code: -5, Msg: "Get Bank Info failed"}
 	}
@@ -127,17 +127,21 @@ func Withdraw(r *ghttp.Request) *TalentHttpResult {
 		RealAmount := math.Floor(float64(DataInfoReq.TotalAmount) * (1 - 0.05))
 		taxAmount := math.Floor(float64(DataInfoReq.TotalAmount) * 0.05)
 		// 插入提现记录
-		_, err1 := tx.Ctx(ctx).Model(dao.YounggeeWithdrawRecord.Table).Data(model.YounggeeWithdrawRecord{
-			WithdrawId:     s,
-			TalentId:       tid,
+		_, err1 := tx.Ctx(ctx).Model("younggee_withdraw_record").Data(youngee_talent_model.WithdrawRecord{
+			WithdrawID:     s,
+			TalentID:       tid,
 			WithdrawAmount: float64(DataInfoReq.TotalAmount), //全部金额
 			AmountPayable:  RealAmount,                       //实际到账
-			IncomeIdList:   DataInfoReq.IncomeIdList,
+			IncomeIDList:   DataInfoReq.IncomeIdList,
 			ReceiveInfo:    string(bankJsons),
 			BankType:       2,
 			Status:         1,
 			SubmitAt:       gtime.Now(),
 			TaxAmount:      taxAmount, //税
+			Name:           talentBank.Name,
+			IdcardNum:      talentBank.BankCardId,
+			BankNum:        talentBank.BankCardNumber,
+			PhoneNum:       talentBank.Phone,
 		}).InsertAndGetId()
 		if err1 != nil {
 			fmt.Printf("[Withdraw Transaction] Error:%+v\n", err1)
@@ -207,6 +211,7 @@ func GetWithdrawList(r *ghttp.Request) *TalentHttpResult {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
 	}
 	queryInt := r.GetQueryInt("status", -1)
+
 	var Records []*youngee_talent_model.WithdrawRecord
 	if queryInt == 0 {
 		g.DB().Model("younggee_withdraw_record").Where("talent_id = ? ", tid).Scan(&Records)

+ 302 - 10
app/service/youngee_task_service/task_info.go

@@ -242,7 +242,6 @@ func IsSignUpTask(r *ghttp.Request) *TalentHttpResult {
 
 // 查询所有任务
 func GetTaskBriefList(r *ghttp.Request) *TalentHttpResult {
-	fmt.Println("getTaskBriefList-----")
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
@@ -253,7 +252,7 @@ func GetTaskBriefList(r *ghttp.Request) *TalentHttpResult {
 
 	// 获取任务列表
 	var taskList []*youngee_talent_model.YoungeeTaskInfo
-	//此达人下,所有快手账号的任务都展示
+	//此达人下,所有账号的任务都展示
 	err = g.Model(dao.YoungeeTaskInfo.Table).Where(whereStr).Scan(&taskList)
 	if err != nil {
 		return &TalentHttpResult{Code: -1, Msg: "Get task list failed"}
@@ -272,33 +271,37 @@ func GetTaskBriefList(r *ghttp.Request) *TalentHttpResult {
 			platformMap[strconv.Itoa(platformInfo[i].PlatformId)] = *platformInfo[i]
 		}
 	}
-
 	//为每个任务根据项目id查询项目名称和主图
 	//taskBriefList存了各个阶段的tasklist
 	taskBriefList := youngee_talent_model.TaskInfoBriefList{}
 	fmt.Println("taskList----的长度为:", len(taskList))
 	for _, v := range taskList { //taskList含所有任务
 		//获取具体的招募策略,taskInfo中
+		fmt.Println("遍历tasklist---", v)
 		var projectDetail *youngee_talent_model.ProjectDetail
+		fmt.Println("v.ProjectId:", v.ProjectId)
 		err := g.Model("project_info").WithAll().Where("project_id = ?", v.ProjectId).Scan(&projectDetail)
 		fmt.Println("projectDetail-----", projectDetail)
+		fmt.Println("project--name---", projectDetail.ProjectName)
 		if err != nil {
 			return &TalentHttpResult{Code: -1, Msg: "Get fullproject info failed"}
 		}
 		var account *youngee_talent_model.KuaishouUserInfo
 		fmt.Println("openid---->", v.OpenId)
-		err = g.Model("platform_kuaishou_user_info").Where("platform_id = ? and talent_id = ? and open_id = ?", 8, tid, v.OpenId).Scan(&account)
+		err = g.Model("platform_kuaishou_user_info").Where("platform_id = ? and talent_id = ? and open_id = ?", v.PlatformId, tid, v.OpenId).Scan(&account)
 		//拿快手平台验证是否过期
-		expired := youngee_talent_service.CheckKuaishouTokenExp(account.OpenId)
-		account.Expired = expired
+		if v.PlatformId == 2 || v.PlatformId == 4 {
+			expired := youngee_talent_service.CheckKuaishouTokenExp(account.OpenId)
+			account.Expired = expired
+		}
 
 		if err != nil {
 			return &TalentHttpResult{Code: -1, Msg: "Get account info failed"}
 		}
 		//taskInfoBrief含需要展示在页面的内容,被加入各阶段List
 		taskInfoBrief := &youngee_talent_model.TaskInfoBrief{
-			TaskId:          v.TaskId,
-			PlatformIconUrl: platformMap[strconv.Itoa(projectDetail.PlatformInfo.PlatformId)].PlatformIcon,
+			TaskId: v.TaskId,
+			//PlatformIconUrl: platformMap[strconv.Itoa(projectDetail.PlatformInfo.PlatformId)].PlatformIcon,
 			//PlatformName:     platformMap[projectInfo[dao.ProjectInfo.Columns.ProjectPlatform].String()].PlatformName,
 			//PlatformNickName: account[dao.YoungeePlatformAccountInfo.Columns.PlatformNickname].String(),
 
@@ -325,6 +328,8 @@ func GetTaskBriefList(r *ghttp.Request) *TalentHttpResult {
 			taskBriefList.SignUpTaskInfoList = append(taskBriefList.SignUpTaskInfoList, taskInfoBrief)
 		} else if v.TaskStage <= 14 && v.TaskStage >= 4 {
 			taskBriefList.GoingOnTaskInfoList = append(taskBriefList.GoingOnTaskInfoList, taskInfoBrief)
+		} else if v.TaskStage == 15 {
+			taskBriefList.WaitToPayInfoList = append(taskBriefList.WaitToPayInfoList, taskInfoBrief)
 		} else {
 			taskBriefList.CompletedTaskInfoList = append(taskBriefList.CompletedTaskInfoList, taskInfoBrief)
 		}
@@ -530,7 +535,7 @@ func GetTaskDetail(r *ghttp.Request) *TalentHttpResult {
 func GetProjRecruitList(r *ghttp.Request) *TalentHttpResult {
 	fanNum := r.GetQueryInt("fan_num", -1)
 	projectId := r.GetQueryString("project_id", -1)
-	SProjectId := r.GetQueryInt("project_id", 0)
+	SProjectId := r.GetQueryInt("s_project_id", 0)
 	var recruitStrategies []*youngee_talent_model.RecruitStrategy
 	//不经过服务商
 	if SProjectId == 0 {
@@ -556,6 +561,36 @@ func GetProjRecruitList(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: recruitStrategies}
 }
 
+// 匹配种草策略,含是否可选属性
+//func GetLocalRecruitList(r *ghttp.Request) *TalentHttpResult {
+//	fanNum := r.GetQueryInt("fan_num", -1)
+//	projectId := r.GetQueryString("project_id", -1)
+//	SProjectId := r.GetQueryInt("s_project_id", 0)
+//	var recruitStrategies []*youngee_talent_model.RecruitStrategy
+//	//不经过服务商
+//	if SProjectId == 0 {
+//		err := g.DB().Model("recruit_strategy").Where("project_id = ? and strategy_type=?", projectId, 1).Scan(&recruitStrategies)
+//		if err != nil {
+//			fmt.Println(err.Error())
+//		}
+//	} else { //经过服务商
+//		_ = g.DB().Model("recruit_strategy").Where("s_project_id = ?", SProjectId).Scan(&recruitStrategies)
+//	}
+//	for _, strategy := range recruitStrategies {
+//		// 判断粉丝数是否满足当前策略的要求
+//		if fanNum >= strategy.FollowersLow {
+//			// 如果粉丝数满足策略的范围,设置 is_fit 为 1
+//			strategy.IsFit = 1
+//		} else {
+//			// 否则设置 is_fit 为 0
+//			strategy.IsFit = 0
+//		}
+//	}
+//
+//	//根据projectId获取招募策略表多条策略,
+//	return &TalentHttpResult{Code: 0, Msg: "success", Data: recruitStrategies}
+//}
+
 // 报名种草任务
 func SignUpTaskWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
@@ -812,6 +847,263 @@ func SignUpTaskWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: newTaskId}
 }
 
+func SignUpTaskWithAccount(r *ghttp.Request) *TalentHttpResult {
+	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
+	if err != nil {
+		return &TalentHttpResult{Code: -1, Msg: "Get talent info failed"}
+	}
+
+	//POST请求体信息
+	var signTaskInfo *youngee_talent_model.SignTaskInfo
+	err = r.ParseForm(&signTaskInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -2, Msg: "data query failed"}
+	}
+
+	//种草详情信息
+	var projectDetail *youngee_talent_model.ProjectDetail
+	err = g.DB().Model(youngee_talent_model.ProjectDetail{}).WithAll().Where("project_id", signTaskInfo.ProjectId).Scan(&projectDetail)
+	if err != nil {
+		return &TalentHttpResult{Code: -3, Msg: err.Error()}
+	}
+
+	//达人用户信息
+	var talentInfo *youngee_talent_model.TalentInfo
+	err = g.DB().Model("youngee_talent_info").WithAll().Where("id", tid).Scan(&talentInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -4, Msg: "Get talent info failed"}
+	}
+
+	//达人社媒信息
+	var platform_id = projectDetail.ProjectPlatform
+	var accountInfo *youngee_talent_model.KuaishouUserInfo
+	err = g.DB().Model("platform_kuaishou_user_info").WithAll().Where("talent_id = ? AND open_id = ? AND platform_id = ? ", tid, signTaskInfo.OpenID, platform_id).Scan(&accountInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -5, Msg: err.Error()}
+	}
+
+	//var accountInfo *youngee_talent_model.PlatformAccountInfo
+	//err = g.DB().Model("youngee_platform_account_info").WithAll().Where("talent_id = ? and platform_id = ?", tid, projectDetail.ProjectPlatform).Scan(&accountInfo)
+	//if err != nil {
+	//	return &TalentHttpResult{Code: -5, Msg: err.Error()}
+	//}
+
+	//project_form=1寄拍需要填写地址
+	var address *model.YoungeeTalentDeliveryAddress
+	if projectDetail.ProjectForm == 1 {
+		err := g.DB().Model(dao.YoungeeTalentDeliveryAddress.Table).Where("talent_id = ? and address_id = ?", tid, signTaskInfo.AddressId).Scan(&address)
+		if err != nil {
+			return &TalentHttpResult{Code: -6, Msg: err.Error()}
+		}
+	} else {
+		address = new(model.YoungeeTalentDeliveryAddress) //赋空值
+	}
+	var newTaskId string
+	// 首先生成任务id
+	newTaskId = utils.GetUuid.GetTaskId(projectDetail.ProjectId, projectDetail.EnterpriseId, tid)
+	//// 生成达人平台账号信息快照
+	accountSnap, err := gjson.Encode(accountInfo)
+	//if err != nil {
+	//	return &TalentHttpResult{Code: -7, Msg: "encode platform snap failed"}
+	//}
+
+	// 生成达人信息快照
+	talentSnap, err := gjson.Encode(talentInfo)
+	if err != nil {
+		return &TalentHttpResult{Code: -8, Msg: "encode talent info snap failed"}
+	}
+
+	// 生成收货地址快照
+	addrSnap, err := gjson.Encode(address)
+	if err != nil {
+		return &TalentHttpResult{Code: -9, Msg: "encode delivery address snap failed"}
+	}
+	taskInfo := youngee_talent_model.YoungeeTaskInfo{}
+	// 公开任务
+	if projectDetail.ProjectType == 1 {
+		//经过服务商
+		if signTaskInfo.SProjectId != 0 {
+			var strategy *youngee_talent_model.RecruitStrategy
+			err = g.DB().Model("recruit_strategy").WithAll().Where("strategy_id = ? and project_id= ?", signTaskInfo.StrategyId, signTaskInfo.ProjectId).Scan(&strategy)
+			var ServiceChargePrice = 0.0      //服务费
+			var SupporPricer = 0.0            //提报价
+			if signTaskInfo.StrategyId == 3 { //自报价
+				ServiceChargePrice = signTaskInfo.Offer * strategy.ServiceRate * 0.01
+				SupporPricer = signTaskInfo.Offer * (1 + strategy.ServiceRate*0.01)
+
+			} else if signTaskInfo.StrategyId == 2 { //一口价
+				ServiceChargePrice = strategy.ServiceCharge
+				SupporPricer = signTaskInfo.Offer
+			} else { //无费置换
+				ServiceChargePrice = 0.0
+				SupporPricer = 0.0
+			}
+			if err != nil {
+				return &TalentHttpResult{Code: -10, Msg: err.Error()}
+			}
+			taskInfo = youngee_talent_model.YoungeeTaskInfo{
+				TaskId:                 newTaskId,
+				ProjectId:              signTaskInfo.ProjectId,
+				SProjectId:             signTaskInfo.SProjectId,
+				TalentId:               tid,
+				OpenId:                 signTaskInfo.OpenID,
+				TalentPlatformInfoSnap: string(accountSnap),
+				TalentPersonalInfoSnap: string(talentSnap),
+				TalentPostAddrSnap:     string(addrSnap),
+				StrategyId:             signTaskInfo.StrategyId,
+				TaskStage:              1,
+				FeeForm:                strategy.FeeForm,
+				ServiceCharge:          ServiceChargePrice,              //服务费(自报价要计算,一口价直接从strategy中取得,无非置换为0)
+				ServiceRate:            projectDetail.ServiceChargeRate, //公开服务费率,projectinfo和recruit 表中是一样的
+				SupportFee:             SupporPricer,
+				CreateDate:             gtime.Now(),
+				TaskStatus:             1,
+				LogisticsStatus:        1,
+				LinkStatus:             1,
+				DataStatus:             1,
+				ScriptStatus:           1,
+				SketchStatus:           1,
+				CompleteStatus:         1,
+				CurDefaultType:         0,
+				WithdrawStatus:         1,
+				SettleStatus:           1,
+				DraftFee:               signTaskInfo.Offer, //商家或者服务商可以看到的稿费价格,无非置换为空,一口价为策略表中的t_offer,自报价是达人添加的也是t_offer,
+				SettleAmount:           signTaskInfo.Offer,
+				SupplierStatus:         1,
+				WxNum:                  signTaskInfo.WxNum,
+			}
+
+		} else {
+			//不经过服务商
+			var strategy *youngee_talent_model.RecruitStrategy
+			//err = g.DB().Model("recruit_strategy").WithAll().Where("strategy_id = ? and s_project_id= ?", signTaskInfo.StrategyId, signTaskInfo.SProjectId).Scan(&strategy)
+			err = g.DB().Model("recruit_strategy").WithAll().Where("strategy_id = ? ", signTaskInfo.StrategyId).Scan(&strategy)
+			if err != nil {
+				return &TalentHttpResult{Code: -10, Msg: err.Error()}
+			}
+			taskInfo = youngee_talent_model.YoungeeTaskInfo{
+				TaskId:                 newTaskId,
+				ProjectId:              signTaskInfo.ProjectId,
+				TalentId:               tid,
+				OpenId:                 signTaskInfo.OpenID,
+				TalentPlatformInfoSnap: string(accountSnap),
+				TalentPersonalInfoSnap: string(talentSnap),
+				TalentPostAddrSnap:     string(addrSnap),
+				StrategyId:             signTaskInfo.StrategyId,
+				TaskStage:              1,
+				FeeForm:                strategy.FeeForm,
+				ServiceCharge:          0,                               //不经过服务商则为0
+				ServiceRate:            projectDetail.ServiceChargeRate, //公开服务费率
+				SupportFee:             signTaskInfo.Offer,
+				CreateDate:             gtime.Now(),
+				TaskStatus:             1,
+				LogisticsStatus:        1,
+				LinkStatus:             1,
+				DataStatus:             1,
+				ScriptStatus:           1,
+				SketchStatus:           1,
+				CompleteStatus:         1,
+				CurDefaultType:         0,
+				WithdrawStatus:         1,
+				SettleStatus:           1,
+				DraftFee:               signTaskInfo.Offer, //商家或者服务商可以看到的稿费价格,无非置换为空,一口价为策略表中的t_offer,自报价是达人添加的也是t_offer,
+				SettleAmount:           signTaskInfo.Offer,
+				WxNum:                  signTaskInfo.WxNum,
+			}
+
+		}
+	} else if projectDetail.ProjectType == 2 { //定向任务
+		//经过服务商
+		if signTaskInfo.SProjectId != 0 {
+			//查找服务商定义的策略
+			var strategy *youngee_talent_model.RecruitStrategy
+			err = g.DB().Model("recruit_strategy").WithAll().Where("strategy_id = ? and s_project_id= ?", signTaskInfo.StrategyId, signTaskInfo.SProjectId).Scan(&strategy)
+			taskInfo = youngee_talent_model.YoungeeTaskInfo{
+				TaskId:                 newTaskId,
+				ProjectId:              signTaskInfo.ProjectId,
+				TalentId:               tid,
+				OpenId:                 signTaskInfo.OpenID,
+				TalentPlatformInfoSnap: string(accountSnap),
+				TalentPersonalInfoSnap: string(talentSnap),
+				TalentPostAddrSnap:     string(addrSnap),
+				TaskStage:              1,
+				CreateDate:             gtime.Now(),
+				TaskStatus:             1,
+				LogisticsStatus:        1,
+				LinkStatus:             1,
+				DataStatus:             1,
+				ScriptStatus:           1,
+				SketchStatus:           1,
+				CompleteStatus:         1,
+				CurDefaultType:         0,
+				WithdrawStatus:         1,
+				ServiceCharge:          0,                  //不经过服务商,无服务费
+				ServiceRate:            0,                  //服务费率
+				SupportFee:             signTaskInfo.Offer, //不经过服务商,  提报价格=一口价*(1+服务费率)
+				DraftFee:               signTaskInfo.Offer, //稿费价格,一口价
+				WxNum:                  signTaskInfo.WxNum,
+			}
+
+		} else {
+			//不经过服务商
+
+		}
+
+		//定向任务,服务费在哪设置
+		taskInfo = youngee_talent_model.YoungeeTaskInfo{
+			TaskId:                 newTaskId,
+			ProjectId:              signTaskInfo.ProjectId,
+			TalentId:               tid,
+			OpenId:                 signTaskInfo.OpenID,
+			TalentPlatformInfoSnap: string(accountSnap),
+			TalentPersonalInfoSnap: string(talentSnap),
+			TalentPostAddrSnap:     string(addrSnap),
+			TaskStage:              1,
+			CreateDate:             gtime.Now(),
+			TaskStatus:             1,
+			LogisticsStatus:        1,
+			LinkStatus:             1,
+			DataStatus:             1,
+			ScriptStatus:           1,
+			SketchStatus:           1,
+			CompleteStatus:         1,
+			CurDefaultType:         0,
+			WithdrawStatus:         1,
+			SupportFee:             signTaskInfo.Offer, //不经过服务商,  提报价格=一口价*(1+服务费率)
+			DraftFee:               signTaskInfo.Offer, //稿费价格,一口价
+			WxNum:                  signTaskInfo.WxNum,
+		}
+
+	}
+	err = g.DB().Transaction(context.TODO(), func(ctx context.Context, tx *gdb.TX) error {
+		// 在task_info表中插入任务
+		_, err = tx.Ctx(ctx).Model(dao.YoungeeTaskInfo.Table).Data(&taskInfo).Insert()
+		if err != nil {
+			return err
+		}
+
+		// 对应项目的报名人数自增
+		_, err = tx.Ctx(ctx).Model(dao.ProjectInfo.Table).Where(dao.ProjectInfo.Columns.ProjectId, projectDetail.ProjectId).Increment(dao.ProjectInfo.Columns.ApplyNum, 1)
+		if err != nil {
+			return err
+		}
+		//如果经过服务商,服务younggee_s_project_info中报名人数加一
+		if signTaskInfo.SProjectId != 0 {
+			_, err = tx.Ctx(ctx).Model("younggee_s_project_info").Where("s_project_id = ? ", signTaskInfo.SProjectId).Increment("apply_num", 1)
+			if err != nil {
+				return err
+			}
+		}
+
+		return nil
+	})
+	if err != nil {
+		return &TalentHttpResult{Code: -18, Msg: "add Task data failed"}
+	}
+
+	return &TalentHttpResult{Code: 0, Msg: "success", Data: newTaskId}
+}
+
 // 本地生活报名
 func SignUpLocalWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 	tid, err := utils.SessionTalentInfo.GetTalentIdFromSession(r)
@@ -1043,7 +1335,7 @@ func SignUpLocalWithKsAccount(r *ghttp.Request) *TalentHttpResult {
 		return nil
 	})
 	if err != nil {
-		return &TalentHttpResult{Code: -18, Msg: "add Task data failed"}
+		return &TalentHttpResult{Code: -18, Msg: err.Error()}
 	}
 
 	return &TalentHttpResult{Code: 0, Msg: "success", Data: newTaskId}

+ 15 - 16
app/system/wxpay/wxpay_model.go

@@ -1,16 +1,15 @@
-package wxpay
-
-type WxPayRequestData struct {
-	Description string `json:"description"`
-	Amount      int64  `json:"amount"`
-}
-
-type WxPayResponseData struct {
-	PaySign   string `json:"pay_sign"`
-	Package   string `json:"package"`
-	TimeStamp string `json:"time_stamp"`
-	NonceStr  string `json:"nonce_str"`
-}
-
-type WxPayNotifyData struct {
-}
+package wxpay
+
+type WxPayRequestData struct {
+	Description string `json:"description"` //购买的产品的描述
+	Amount      int64  `json:"amount"`      //产品金额,单位是分
+}
+type WxPayResponseData struct {
+	PaySign   string `json:"pay_sign"`   //签名
+	Package   string `json:"package"`    //随机字符串
+	TimeStamp string `json:"time_stamp"` //时间戳
+	NonceStr  string `json:"nonce_str"`  //随机字符串
+}
+
+type WxPayNotifyData struct {
+}

+ 5 - 3
app/system/wxpay/wxpay_service.go

@@ -18,10 +18,11 @@ var service = new(wxPayService)
 type wxPayService struct {
 }
 
-// 给结构体绑定一个方法,相当于类方法,
+// 前端点击支付,post请求到此,请求体包括:产品id ,订单金额(单位是分),订单包含的积分等
 func (s *wxPayService) WxPayRequest(r *ghttp.Request, req WxPayRequestData) (WxPayResponseData, error) {
-
+	//通过session获取openId
 	openId, err := utils.SessionTalentInfo.GetOpenIdFromSession(r)
+	//配置文件中获取其他
 	if err != nil {
 		log.Fatalf("get WxOpenId error:%s", err)
 	}
@@ -48,6 +49,7 @@ func (s *wxPayService) WxPayRequest(r *ghttp.Request, req WxPayRequestData) (WxP
 
 	svc := jsapi.JsapiApiService{Client: client}
 	// 得到prepay_id,以及调起支付所需的参数和签名
+	//我自己定义的订单id。微信会把这个也响应回来
 	var tradeId = utils.GetUuid.GetRandomString(32)
 	resp, result, err := svc.PrepayWithRequestPayment(ctx,
 		jsapi.PrepayRequest{
@@ -55,7 +57,7 @@ func (s *wxPayService) WxPayRequest(r *ghttp.Request, req WxPayRequestData) (WxP
 			Mchid:       core.String(mchID),
 			Description: core.String(req.Description),
 			OutTradeNo:  core.String(tradeId),
-			NotifyUrl:   core.String("https://www.weixin.qq.com/wxpay/pay.php"),
+			NotifyUrl:   core.String("https://younggee.com/wxPayCallBack"), //微信支付回调地址 需要通过nginx重定向给后端接口
 			Amount: &jsapi.Amount{
 				Total: core.Int64(req.Amount),
 			},

+ 61 - 18
app/utils/type_transform.go

@@ -1,18 +1,61 @@
-package utils
-
-import "strconv"
-
-var TypeTran = typeTran{}
-
-type typeTran struct {
-}
-
-func (*typeTran) String2Int(strArr []string) []int {
-	res := make([]int, len(strArr))
-
-	for index, val := range strArr {
-		res[index], _ = strconv.Atoi(val)
-	}
-
-	return res
-}
+package utils
+
+import (
+	"fmt"
+	"strconv"
+)
+
+var TypeTran = typeTran{}
+
+type typeTran struct {
+}
+
+func (*typeTran) String2Int(strArr []string) []int {
+	res := make([]int, len(strArr))
+
+	for index, val := range strArr {
+		res[index], _ = strconv.Atoi(val)
+	}
+	return res
+}
+
+func (*typeTran) AnyToInt(value interface{}) (int, error) {
+	// 将任意类型转换为 string
+	strValue := fmt.Sprintf("%v", value)
+
+	// 将 string 转换为 int
+	intValue, err := strconv.Atoi(strValue)
+	if err != nil {
+		return 0, fmt.Errorf("cannot convert '%v' to int: %v", value, err)
+	}
+
+	return intValue, nil
+}
+
+func (*typeTran) AnyToFloat64(value interface{}) (float64, error) {
+	// 直接判断 value 的类型并进行转换
+	switch v := value.(type) {
+	case float64:
+		return v, nil
+	case int:
+		return float64(v), nil
+	case string:
+		return strconv.ParseFloat(v, 64) // 字符串转 float64
+	default:
+		return 0, fmt.Errorf("cannot convert to float64: %v", v)
+	}
+}
+
+func (*typeTran) AnyToString(value interface{}) (string, error) {
+	// 直接判断 value 的类型并进行转换
+	switch v := value.(type) {
+	case string:
+		return v, nil
+	case int:
+		return strconv.Itoa(v), nil // int 转字符串
+	case float64:
+		return fmt.Sprintf("%v", v), nil // float64 转字符串
+	default:
+		return "", fmt.Errorf("cannot convert to string: %v", v)
+	}
+}

二进制
bin/main


二进制
bin/v4.1.4/.DS_Store


二进制
bin/v4.1.4/linux_amd64/.DS_Store


二进制
bin/v4.1.4/linux_amd64/youngmini_server


+ 2 - 1
config/config.toml

@@ -19,7 +19,7 @@ name = "youngmini_server"
 output = "./bin"
 pack = ""
 system = "linux"
-version = "v4.1.3"
+version = "v4.1.4"
 [gfcli.gen.dao]
 jsonCase = "Snake"
 link = "mysql:root:Younggee_root_DB_123@tcp(1.92.142.62:3306)/youngmini"
@@ -59,3 +59,4 @@ appsecret = "c82ae9e75b4ed7d8022db5bda5371892"
 mchid = "1615933939"
 mchCertificateSerialNumber = "33DDFEC51BF5412F663B9B56510FD567B625FC68"
 mchAPIv3Key = "V12345678910Younggee10987654321V"
+

+ 29 - 0
deploy.sh

@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# 设置相关路径
+PROJECT_PATH="/Users/yankun/YGCode/youngee_mc_api"
+BIN_PATH="$PROJECT_PATH/bin/v4.1.4/linux_amd64"
+SERVER_PATH="/root/app/v2_server"
+SERVER_IP="1.92.142.62"  # 目标服务器 IP 地址
+
+# 1. 进入项目目录
+cd $PROJECT_PATH || { echo "Failed to change directory to $PROJECT_PATH"; exit 1; }
+
+# 2. 执行 gf build 命令
+echo "Running gf build..."
+gf build || { echo "gf build failed!"; exit 1; }
+
+# 3. 检查并删除目标服务器上的 old youngmini_server 文件(如果存在)
+echo "Checking if youngmini_server exists on server..."
+ssh root@$SERVER_IP "[ -f $SERVER_PATH/youngmini_server ] && rm -f $SERVER_PATH/youngmini_server && echo 'Removed old youngmini_server'" || { echo "Failed to check or remove old youngmini_server"; exit 1; }
+
+# 4. 将文件移动到服务器
+echo "Copying youngmini_server to $SERVER_IP:$SERVER_PATH..."
+scp $BIN_PATH/youngmini_server root@$SERVER_IP:$SERVER_PATH || { echo "Failed to copy file to server"; exit 1; }
+
+# 5. 在后台执行服务器上的 startup.sh 脚本
+echo "Executing startup.sh on server in the background..."
+ssh root@$SERVER_IP "cd $SERVER_PATH && nohup bash startup.sh > startup.log 2>&1 &" || { echo "Failed to execute startup.sh on server"; exit 1; }
+
+# 打印成功消息
+echo "Deployment and startup successful!"

+ 43 - 31
router/router.go

@@ -12,7 +12,6 @@ import (
 	_ "github.com/lin-jim-leon/kuaishou/open/oauth"
 	"github.com/lin-jim-leon/kuaishou/open/user"
 	_ "github.com/lin-jim-leon/kuaishou/open/user"
-	"strconv"
 	youngeetalentapi "youngmini_server/app/api/youngee_talent_api"
 	"youngmini_server/app/model/youngee_talent_model"
 	"youngmini_server/app/service/youngee_talent_service"
@@ -135,23 +134,25 @@ func init() {
 			}
 			//来自达人授权,获取accesstoken
 			res_auth, _ := oauth.GetAccessToken(ClientKey, ClientSecret, code)
+			r.Response.WriteJson("输出用户授权信息")
 			r.Response.WriteJson(res_auth)
-
 			//防止一个快手账号重复绑定
 			userInfo := youngee_talent_model.KuaishouUserInfo{}
 			//这个openid存在(如果对应到两条数据,只保留一条) 且对应的达人不是我,
 			err := g.DB().Model("platform_kuaishou_user_info").Where("open_id = ? ", res_auth.OpenId).Order("platform_id DESC").Scan(&userInfo)
 			if err != nil {
-				fmt.Println("查询数据库失败")
+				r.Response.WriteJson(err)
+				fmt.Println("查询数据库失败:", err)
 			}
 			//快手电商账号重复绑定,提示前端
-			//此openId在表中有对应数据,且对应的达人不是当前达人
+			//此openId在表中有对应数据,且对应的达人不是当前达人
 			if userInfo.TalentId != "" && userInfo.TalentId != state {
-				redisKsBindStatusKey := fmt.Sprintf("KsBind:%s", state)
+				redisKsBindStatusKey := fmt.Sprintf("Bind:%s", state)
 				//redis设置绑定状态为
-				_, err := g.Redis().Do("SETEX", 10, redisKsBindStatusKey, "bound_to_other")
+				_, err := g.Redis().Do("SETEX", redisKsBindStatusKey, 10, "bound_to_other")
 				if err != nil {
 					fmt.Println("redis出错")
+					fmt.Println("err---->", err.Error())
 				}
 				return
 			}
@@ -165,7 +166,9 @@ func init() {
 			}
 			AccessToken := res_auth.AccessToken
 			//获取基本信息
-			res_info, _ := user.GetUserinfo(ClientKey, AccessToken)
+			res_info, err := user.GetUserinfo(ClientKey, AccessToken)
+			r.Response.WriteJson("输出用户基本信息")
+			r.Response.WriteJson(res_info)
 			//30天销量不在扫码时获取。
 			err_auth := r.Response.WriteJson(res_auth)
 			err_info := r.Response.WriteJson(res_info)
@@ -225,7 +228,7 @@ func init() {
 			//抖音账号重复绑定,提示前端
 			//此openId在表中有对应数据,且对应的达人不是当前达人,
 			if userInfo.TalentId != "" && userInfo.TalentId != state {
-				redisKsBindStatusKey := fmt.Sprintf("KsBind:%s", state)
+				redisKsBindStatusKey := fmt.Sprintf("Bind:%s", state)
 				//redis设置绑定状态为
 				_, err := g.Redis().Do("SETEX", 10, redisKsBindStatusKey, "bound_to_other")
 				if err != nil {
@@ -289,8 +292,8 @@ func init() {
 		})
 		//用于抖音平台:nignx转发含code的请求到此处
 		s.BindHandler("/douyinauth", func(r *ghttp.Request) {
-			ClientKey := "ks671599294546520767"
-			ClientSecret := "8VSrp3O09nunjLMXR1uotg"
+			ClientKey := "awi77xl5kpl16hmi"
+			ClientSecret := "7ce6d2531bd4489122d89658063fd76e"
 			code := r.GetString("code")
 			state := r.GetString("state")
 			//获取accesstoken
@@ -298,14 +301,14 @@ func init() {
 			douyinOpenId := res_auth.Data.OpenId
 			userInfo := youngee_talent_model.KuaishouUserInfo{}
 			//这个openid存在 且对应的达人不是我,
-			err := g.DB().Model("platform_kuaishou_user_info").Where("open_id = ? ", douyinOpenId).Scan(&userInfo)
+			err := g.DB().Model("platform_kuaishou_user_info").Where("open_id = ? and platform_id = ? ", douyinOpenId, 2).Scan(&userInfo)
 			if err != nil {
 				fmt.Println("查询数据库失败")
 			}
 			//抖音账号重复绑定,提示前端
 			//此openId在表中有对应数据,且对应的达人不是当前达人,
 			if userInfo.TalentId != "" && userInfo.TalentId != state {
-				redisDyBindStatusKey := fmt.Sprintf("DyBind:%s", state)
+				redisDyBindStatusKey := fmt.Sprintf("Bind:%s", state)
 				//redis设置绑定状态为  10s过期
 				_, err := g.Redis().Do("SETEX", 10, redisDyBindStatusKey, "bound_to_other")
 				if err != nil {
@@ -324,19 +327,19 @@ func init() {
 			//获取基本信息
 			res_info, _ := douyinUser.GetUserInfo(res_auth.Data.OpenId, AccessToken)
 			//获取用户粉丝数  千粉以上
-			res_fans, _ := douyinUser.GetUserFans(AccessToken, "7", douyinOpenId) //近7天,返回一个列表每天都有总粉丝数
-			errCode := res_fans.Data.ErrorCode
-			var fansNumStr string
-			if errCode == 0 { // 满足千粉以上
-				fansNumStr = res_fans.Data.ResultList[0].TotalFans
-			} else {
-				fansNumStr = "0"
-			}
-			fansNum, err := strconv.Atoi(fansNumStr)
-			if err != nil {
-				fmt.Println("Error converting string to int:", err)
-				// 可以在这里添加错误处理逻辑
-			}
+			//res_fans, _ := douyinUser.GetUserFans(AccessToken, "7", douyinOpenId) //近7天,返回一个列表每天都有总粉丝数
+			//errCode := res_fans.Data.ErrorCode
+			//var fansNumStr string
+			//if errCode == 0 { // 满足千粉以上
+			//	fansNumStr = res_fans.Data.ResultList[0].TotalFans
+			//} else {
+			//	fansNumStr = "0"
+			//}
+			//fansNum, err := strconv.Atoi(fansNumStr)
+			//if err != nil {
+			//	fmt.Println("Error converting string to int:", err)
+			//	// 可以在这里添加错误处理逻辑
+			//}
 			//获取抖音作品数目和点赞数目
 			VideoInfo, _ := youngee_talent_service.GetDyVideoInfo(douyinOpenId, AccessToken)
 			//用户进入主页获取,并存入数据库中
@@ -364,11 +367,11 @@ func init() {
 				RefreshToken: res_auth.Data.RefreshToken,
 				HeadUri:      res_info.Data.Avatar,
 				NickName:     res_info.Data.Nickname,
-				Fan:          fansNum, //专门获取粉丝数的接口,默认为0。
-				VideoNum:     VideoInfo.VideoCount,
-				LikeNum:      VideoInfo.LikeCount,
-				UpdateTime:   gtime.Now(),
-				CreateTime:   gtime.Now(),
+				//Fan:          fansNum, //专门获取粉丝数的接口,默认为0。
+				VideoNum:   VideoInfo.VideoCount,
+				LikeNum:    VideoInfo.LikeCount,
+				UpdateTime: gtime.Now(),
+				CreateTime: gtime.Now(),
 			}
 			//sava,有数据则更新,没有数据则插入
 			if _, err := g.DB().Model("platform_kuaishou_user_info").Save(authInfo); err != nil {
@@ -378,7 +381,16 @@ func init() {
 				return
 			}
 		})
-
+		//微信支付的回调,被nginx重定向到此
+		s.BindHandler("/WxPayCallBack", func(r *ghttp.Request) {
+			//微信响应回来的请求头和请求体中有 是否支付成功的内容
+			//if 支付成功
+			//1. 构造生产者的消息
+			//2. 发送消息给MQ的指定topic 消费者监听这个topic进行订单表、支付表、用户表的更新操作【异步 , 解耦 】
+			//3. 返回给前端支付成功的标识
+			//else 支付失败
+			//响应支付失败
+		})
 		// 达人不需要鉴权的接口
 		group.GET("/g", youngeetalentapi.TalentGetApi)
 		group.POST("/p", youngeetalentapi.TalentPostApi)

+ 26 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_acceptance_bill_request_body.go

@@ -0,0 +1,26 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// AcceptanceBillRequestBody
+type AcceptanceBillRequestBody struct {
+
+	// 与url二选一。图像数据,base64编码,要求base64编码后大小不超过10M。 图片最小边不小于15像素,最长边不超过8192像素。支持JPG/PNG/BMP/TIFF格式。 图片Base64编码示例如/9j/4AAQSkZJRgABAg...,带有多余前缀会产生The image format is not supported报错。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一。 图片的url路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)>。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+}
+
+func (o AcceptanceBillRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "AcceptanceBillRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"AcceptanceBillRequestBody", string(data)}, " ")
+}

+ 151 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_acceptance_bill_result.go

@@ -0,0 +1,151 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type AcceptanceBillResult struct {
+
+	// 出票日期。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 汇票到期日。
+	DueDate *string `json:"due_date,omitempty"`
+
+	// 票据状态。
+	BillStatus *string `json:"bill_status,omitempty"`
+
+	// 票据号码。
+	BillNumber *string `json:"bill_number,omitempty"`
+
+	// 出票人全称。
+	IssuerFullName *string `json:"issuer_full_name,omitempty"`
+
+	// 出票人账号。
+	IssuerAccount *string `json:"issuer_account,omitempty"`
+
+	// 出票人开户银行。
+	IssuerBankName *string `json:"issuer_bank_name,omitempty"`
+
+	// 出票人开户行号。
+	IssuerBankNumber *string `json:"issuer_bank_number,omitempty"`
+
+	// 收款人全称。
+	PayeeFullName *string `json:"payee_full_name,omitempty"`
+
+	// 收款人账号。
+	PayeeAccount *string `json:"payee_account,omitempty"`
+
+	// 收款人开户银行。
+	PayeeBankName *string `json:"payee_bank_name,omitempty"`
+
+	// 收款人开户行号。
+	PayeeBankNumber *string `json:"payee_bank_number,omitempty"`
+
+	// 出票保证人名称。
+	IssuanceGuarantorName *string `json:"issuance_guarantor_name,omitempty"`
+
+	// 出票保证人地址。
+	IssuanceGuarantorAddress *string `json:"issuance_guarantor_address,omitempty"`
+
+	// 出票保证人账号。
+	IssuanceGuarantorAccount *string `json:"issuance_guarantor_account,omitempty"`
+
+	// 出票保证日期。
+	IssuanceGuaranteeDate *string `json:"issuance_guarantee_date,omitempty"`
+
+	// 出票保证人开户行行号。
+	IssuanceGuarantorBankNumber *string `json:"issuance_guarantor_bank_number,omitempty"`
+
+	// 出票保证人开户行名称。
+	IssuanceGuarantorBankName *string `json:"issuance_guarantor_bank_name,omitempty"`
+
+	// 大写票据金额。
+	AmountInWords *string `json:"amount_in_words,omitempty"`
+
+	// 小写票据金额。
+	AmountInFigures *string `json:"amount_in_figures,omitempty"`
+
+	// 承兑人全称。
+	AcceptorFullName *string `json:"acceptor_full_name,omitempty"`
+
+	// 承兑人账号。
+	AcceptorAccount *string `json:"acceptor_account,omitempty"`
+
+	// 承兑人开户行行号。
+	AcceptorBankNumber *string `json:"acceptor_bank_number,omitempty"`
+
+	// 承兑人开户行名称。
+	AcceptorBankName *string `json:"acceptor_bank_name,omitempty"`
+
+	// 交易合同号。
+	ContractNumber *string `json:"contract_number,omitempty"`
+
+	// 能否转让。
+	Assignability *string `json:"assignability,omitempty"`
+
+	// 出票人承诺。
+	IssuerCommitment *string `json:"issuer_commitment,omitempty"`
+
+	// 承兑人承诺。
+	AcceptorCommitment *string `json:"acceptor_commitment,omitempty"`
+
+	// 承兑日期。
+	AcceptanceDate *string `json:"acceptance_date,omitempty"`
+
+	// 承兑保证人名称。
+	AcceptanceGuarantorName *string `json:"acceptance_guarantor_name,omitempty"`
+
+	// 承兑保证人地址。
+	AcceptanceGuarantorAddress *string `json:"acceptance_guarantor_address,omitempty"`
+
+	// 承兑保证人账号。
+	AcceptanceGuarantorAccount *string `json:"acceptance_guarantor_account,omitempty"`
+
+	// 承兑保证日期。
+	AcceptanceGuaranteeDate *string `json:"acceptance_guarantee_date,omitempty"`
+
+	// 承兑保证人开户行行号。
+	AcceptanceGuarantorBankNumber *string `json:"acceptance_guarantor_bank_number,omitempty"`
+
+	// 承兑保证人开户行名称。
+	AcceptanceGuarantorBankName *string `json:"acceptance_guarantor_bank_name,omitempty"`
+
+	// 出票人评级主体。
+	IssuerRatingEntity *string `json:"issuer_rating_entity,omitempty"`
+
+	// 出票人信用等级。
+	IssuerCreditRating *string `json:"issuer_credit_rating,omitempty"`
+
+	// 出票人评级到期日。
+	IssuerRatingDueDate *string `json:"issuer_rating_due_date,omitempty"`
+
+	// 承兑人评级主体。
+	AcceptorRatingEntity *string `json:"acceptor_rating_entity,omitempty"`
+
+	// 承兑人信用等级。
+	AcceptorCreditRating *string `json:"acceptor_credit_rating,omitempty"`
+
+	// 承兑人评级到期日。
+	AcceptorRatingDueDate *string `json:"acceptor_rating_due_date,omitempty"`
+
+	// 票据包号。
+	BillPackageNumber *string `json:"bill_package_number,omitempty"`
+
+	// 备注。
+	Remarks *string `json:"remarks,omitempty"`
+
+	// 各个字段的置信度。
+	Confidence *interface{} `json:"confidence,omitempty"`
+}
+
+func (o AcceptanceBillResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "AcceptanceBillResult struct{}"
+	}
+
+	return strings.Join([]string{"AcceptanceBillResult", string(data)}, " ")
+}

+ 35 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_auto_classification_request_body.go

@@ -0,0 +1,35 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// AutoClassificationRequestBody
+type AutoClassificationRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于15px,最长边不超过8000px,支持JPEG、JPG、PNG、BMP、TIFF、PDF格式。  图片文件Base64编码字符串,点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 可以指定要识别的票证,指定后不出现在此List的票证不识别。不指定时默认返回所有支持类别票证的识别信息。
+	TypeList *[]string `json:"type_list,omitempty"`
+
+	// 可指定需要识别票证的传入参数,具体参数可参考各票证API文档。若不指定则默认传入image 。 当前版本支持票证类型如下: - vat_invoice:增值税发票  - quota_invoice:定额发票  - taxi_invoice:出租车票  - train_ticket:火车票  - flight_itinerary:飞机行程单  - toll_invoice:车辆通行费发票  - mvs_invoice:机动车销售发票  - id_card:身份证  - passport:护照  - driver_license:驾驶证  - vehicle_license:行驶证  - transportation_license:道路运输证  - bankcard:银行卡  - bus_ship_ticket:车船票  - ride_hailing_itinerary:网约车行程单  - machine_printed_invoice:通用机打发票 > 说明: - 若指定票证参数填写错误会导致该票证识别错误,会提示\"AIS.0101\":\"The input parameter is invalid.\"报错。
+	ExtendedParameters *interface{} `json:"extended_parameters,omitempty"`
+
+	// 检测印章开关,开启时则返回单张票证是否含有印章,否则不返回是否含有印章。可选值包括: - true:开启检测票证是否含有印章功能。  - false:关闭检测票证是否含有印章功能。 > 说明: - 该功能仅检测判断有无印章,不返回印章具体内容。
+	DetectSeal *bool `json:"detect_seal,omitempty"`
+}
+
+func (o AutoClassificationRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "AutoClassificationRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"AutoClassificationRequestBody", string(data)}, " ")
+}

+ 33 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_auto_classification_result.go

@@ -0,0 +1,33 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// AutoClassificationResult
+type AutoClassificationResult struct {
+	Status *AutoClassificationResultStatus `json:"status"`
+
+	// 对应票证具体结构化识别的结果。
+	Content *interface{} `json:"content"`
+
+	// 对应票证的类别。
+	Type string `json:"type"`
+
+	// 文字块的区域位置信息,列表形式,包含文字区域四个顶点的二维坐标(x,y);坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	Location [][]int32 `json:"location"`
+
+	// 对应票证中是否含有印章。可选值包括: -  true:该票证中含有印章。 -  false:该票证中不含有印章。
+	SealMark *bool `json:"seal_mark,omitempty"`
+}
+
+func (o AutoClassificationResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "AutoClassificationResult struct{}"
+	}
+
+	return strings.Join([]string{"AutoClassificationResult", string(data)}, " ")
+}

+ 26 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_auto_classification_result_status.go

@@ -0,0 +1,26 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// AutoClassificationResultStatus 对应票证的状态信息及状态码
+type AutoClassificationResultStatus struct {
+
+	// 指示各对应票证的状态码
+	ErrorCode *string `json:"error_code,omitempty"`
+
+	// 指示各对应票证的状态信息
+	ErrorMsg *string `json:"error_msg,omitempty"`
+}
+
+func (o AutoClassificationResultStatus) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "AutoClassificationResultStatus struct{}"
+	}
+
+	return strings.Join([]string{"AutoClassificationResultStatus", string(data)}, " ")
+}

+ 28 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bank_receipt_dict.go

@@ -0,0 +1,28 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type BankReceiptDict struct {
+
+	// 键值对数量
+	KvPairCount *int32 `json:"kv_pair_count,omitempty"`
+
+	// 银行回单的区域位置信息,列表形式,包含文字区域四个顶点的二维坐标(x,y);坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	BankReceiptLocation *[][]int32 `json:"bank_receipt_location,omitempty"`
+
+	// 键值对识别结果列表。
+	KvPairList *[]BankReceiptKvPair `json:"kv_pair_list,omitempty"`
+}
+
+func (o BankReceiptDict) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BankReceiptDict struct{}"
+	}
+
+	return strings.Join([]string{"BankReceiptDict", string(data)}, " ")
+}

+ 25 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bank_receipt_kv_pair.go

@@ -0,0 +1,25 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type BankReceiptKvPair struct {
+
+	// key-value对(键值对)中的key,例如\"币别:人民币\"中的\"币别\"。
+	Key *string `json:"key,omitempty"`
+
+	// key-value对(键值对)中的value,例如\"币别:人民币\"中的“人民币”
+	Value *string `json:"value,omitempty"`
+}
+
+func (o BankReceiptKvPair) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BankReceiptKvPair struct{}"
+	}
+
+	return strings.Join([]string{"BankReceiptKvPair", string(data)}, " ")
+}

+ 29 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bank_receipt_request_body.go

@@ -0,0 +1,29 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// BankReceiptRequestBody
+type BankReceiptRequestBody struct {
+
+	// 该参数与url二选一。 图片或PDF格式,base64编码,要求base64编码后大小不超过10M。 图像尺寸不小于15×15像素,最长边不超过8192像素,支持JPG/PNG/BMP/TIFF格式。 PDF以144dpi的分辨率转为图像进行识别,需符合上述图像尺寸规定。若PDF有多页,当前仅对第1页进行识别。
+	Data *string `json:"data,omitempty"`
+
+	// 与data二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 指定PDF页码识别。传入该参数时,则识别指定页码的内容。如果不传该参数,则默认识别第1页,该参数仅在文件为PDF格式时有效。
+	PageNum *int32 `json:"page_num,omitempty"`
+}
+
+func (o BankReceiptRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BankReceiptRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"BankReceiptRequestBody", string(data)}, " ")
+}

+ 25 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bank_receipt_result.go

@@ -0,0 +1,25 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type BankReceiptResult struct {
+
+	// 银行回单数量
+	BankReceiptCount *int32 `json:"bank_receipt_count,omitempty"`
+
+	// 银行回单键值对提取结果。
+	BankReceiptList *[]BankReceiptDict `json:"bank_receipt_list,omitempty"`
+}
+
+func (o BankReceiptResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BankReceiptResult struct{}"
+	}
+
+	return strings.Join([]string{"BankReceiptResult", string(data)}, " ")
+}

+ 29 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bankcard_request_body.go

@@ -0,0 +1,29 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// BankcardRequestBody
+type BankcardRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于15px,最长边不超过8192px,支持JPEG、JPG、PNG、BMP、TIFF格式。  图片文件Base64编码字符串,点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 返回文本块坐标及单元格坐标信息,可选值包括: - true:返回文本块和单元格坐标; - false:不返回。  > 说明: - 未传入该参数时默认为false,即不返回。
+	ReturnTextLocation *bool `json:"return_text_location,omitempty"`
+}
+
+func (o BankcardRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BankcardRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"BankcardRequestBody", string(data)}, " ")
+}

+ 41 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_bankcard_result.go

@@ -0,0 +1,41 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// BankcardResult
+type BankcardResult struct {
+
+	// 发卡行。
+	BankName *string `json:"bank_name,omitempty"`
+
+	// 银行卡号。
+	CardNumber *string `json:"card_number,omitempty"`
+
+	// 有效期开始日期。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 有效期截止日期。
+	ExpiryDate *string `json:"expiry_date,omitempty"`
+
+	// 银行卡类别,如:储蓄卡,信用卡。
+	Type *string `json:"type,omitempty"`
+
+	// 相关字段的置信度信息,置信度越大,表示本次识别的对应字段的可靠性越高,在统计意义上,置信度越大,准确率越高。 置信度由算法给出,不直接等价于对应字段的准确率。
+	Confidence *interface{} `json:"confidence,omitempty"`
+
+	// 对应所有在原图上识别到的字段位置信息,包含所有文字区域四个顶点的二维坐标(x,y)。采用图像坐标系,坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	TextLocation *interface{} `json:"text_location,omitempty"`
+}
+
+func (o BankcardResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BankcardResult struct{}"
+	}
+
+	return strings.Join([]string{"BankcardResult", string(data)}, " ")
+}

+ 47 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_belong_item_list.go

@@ -0,0 +1,47 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// BelongItemList
+type BelongItemList struct {
+
+	// 货物或应税劳务、服务名称。
+	Name *string `json:"name,omitempty"`
+
+	// 序号。
+	ItemNumber *string `json:"item_number,omitempty"`
+
+	// 规格型号。
+	Specification *string `json:"specification,omitempty"`
+
+	// 单位。
+	Unit *string `json:"unit,omitempty"`
+
+	// 数量。
+	Quantity *string `json:"quantity,omitempty"`
+
+	// 单价。
+	UnitPrice *string `json:"unit_price,omitempty"`
+
+	// 金额。
+	Amount *string `json:"amount,omitempty"`
+
+	// 税率。
+	TaxRate *string `json:"tax_rate,omitempty"`
+
+	// 税额。
+	Tax *string `json:"tax,omitempty"`
+}
+
+func (o BelongItemList) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BelongItemList struct{}"
+	}
+
+	return strings.Join([]string{"BelongItemList", string(data)}, " ")
+}

+ 26 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_beneficiary_item.go

@@ -0,0 +1,26 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type BeneficiaryItem struct {
+	BeneficiaryName *InsurancePolicyDetail `json:"beneficiary_name,omitempty"`
+
+	BeneficiaryType *InsurancePolicyDetail `json:"beneficiary_type,omitempty"`
+
+	BeneficiaryOrder *InsurancePolicyDetail `json:"beneficiary_order,omitempty"`
+
+	BeneficiaryShare *InsurancePolicyDetail `json:"beneficiary_share,omitempty"`
+}
+
+func (o BeneficiaryItem) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BeneficiaryItem struct{}"
+	}
+
+	return strings.Join([]string{"BeneficiaryItem", string(data)}, " ")
+}

+ 32 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_business_card_request_body.go

@@ -0,0 +1,32 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// BusinessCardRequestBody
+type BusinessCardRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于15px,最长边不超过8192px,支持JPEG、JPG、PNG、BMP、TIFF格式。  图片文件Base64编码字符串,点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 图片朝向检测开关,可选值包括: - true:检测图片朝向; - false:不检测图片朝向。  > 说明: - 支持任意角度的图片朝向检测。未传入该参数时默认为false,即不检测图片朝向。
+	DetectDirection *bool `json:"detect_direction,omitempty"`
+
+	// 返回矫正后的名片图像的BASE64编码的开关,可选值包括: - true:返回BASE64编码; - false:不返回BASE64编码。  > 说明: - 未传入该参数时默认为false,即不返回BASE64编码。
+	ReturnAdjustedImage *bool `json:"return_adjusted_image,omitempty"`
+}
+
+func (o BusinessCardRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BusinessCardRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"BusinessCardRequestBody", string(data)}, " ")
+}

+ 56 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_business_card_result.go

@@ -0,0 +1,56 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// BusinessCardResult
+type BusinessCardResult struct {
+
+	// 姓名列表。
+	Name *[]string `json:"name,omitempty"`
+
+	// 职位头衔列表。
+	Title *[]string `json:"title,omitempty"`
+
+	// 公司列表。
+	Company *[]string `json:"company,omitempty"`
+
+	// 部门列表。
+	Department *[]string `json:"department,omitempty"`
+
+	// 联系方式列表。
+	Phone *[]string `json:"phone,omitempty"`
+
+	// 地址列表。
+	Address *[]string `json:"address,omitempty"`
+
+	// 邮箱列表。
+	Email *[]string `json:"email,omitempty"`
+
+	// 传真列表。
+	Fax *[]string `json:"fax,omitempty"`
+
+	// 邮编列表。
+	Postcode *[]string `json:"postcode,omitempty"`
+
+	// 公司网址列表。
+	Website *[]string `json:"website,omitempty"`
+
+	// 其余信息列表。
+	ExtraInfoList *[]ExtraInfoList `json:"extra_info_list,omitempty"`
+
+	// 返回矫正后的名片图像的BASE64编码。
+	AdjustedImage *string `json:"adjusted_image,omitempty"`
+}
+
+func (o BusinessCardResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BusinessCardResult struct{}"
+	}
+
+	return strings.Join([]string{"BusinessCardResult", string(data)}, " ")
+}

+ 26 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_business_license_request_body.go

@@ -0,0 +1,26 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// BusinessLicenseRequestBody
+type BusinessLicenseRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于15px,最长边不超过8192px,支持JPEG、JPG、PNG、BMP、TIFF、PDF格式。多页PDF仅识别第一页。  图片文件Base64编码字符串,点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+}
+
+func (o BusinessLicenseRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BusinessLicenseRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"BusinessLicenseRequestBody", string(data)}, " ")
+}

+ 56 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_business_license_result.go

@@ -0,0 +1,56 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// BusinessLicenseResult
+type BusinessLicenseResult struct {
+
+	// - 老版本营业执照对应注册号。 - 新三证合一版本营业执照对应社会保障号。
+	RegistrationNumber *string `json:"registration_number,omitempty"`
+
+	// 企业名称。
+	Name *string `json:"name,omitempty"`
+
+	// 公司/企业类型/主体类型/类型。
+	Type *string `json:"type,omitempty"`
+
+	// 住所/营业场所/企业住所/主要经营场所/经营场所。
+	Address *string `json:"address,omitempty"`
+
+	// 法定代表人/负责人/执行事务合伙人/投资人/经营者。
+	LegalRepresentative *string `json:"legal_representative,omitempty"`
+
+	// 注册资本/出资额。
+	RegisteredCapital *string `json:"registered_capital,omitempty"`
+
+	// 组成形式。
+	OrganizationForm *string `json:"organization_form,omitempty"`
+
+	// 成立日期/注册日期。
+	FoundDate *string `json:"found_date,omitempty"`
+
+	// 营业期限。
+	BusinessTerm *string `json:"business_term,omitempty"`
+
+	// 经营范围。
+	BusinessScope *string `json:"business_scope,omitempty"`
+
+	// 发照日期。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 相关字段的置信度信息,置信度越大,表示本次识别的对应字段的可靠性越高,在统计意义上,置信度越大,准确率越高。 置信度由算法给出,不直接等价于对应字段的准确率。
+	Confidence *interface{} `json:"confidence,omitempty"`
+}
+
+func (o BusinessLicenseResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "BusinessLicenseResult struct{}"
+	}
+
+	return strings.Join([]string{"BusinessLicenseResult", string(data)}, " ")
+}

+ 55 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_cambodian_id_card_request_body.go

@@ -0,0 +1,55 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type CambodianIdCardRequestBody struct {
+
+	// 与url二选一。图像数据,base64编码。图片尺寸不小于15像素,最长边不超过8192像素,支持JPG/PNG/BMP/TIF格式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一。 图片的url路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/intl/zh-cn/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 是否返回头像内容开关,可选值如下所示: - true: 返回身份证头像照片的 base64 编码 - false: 不返回身份证头像照片的 base64 编码 未传入该参数时默认为“false”,即不返回身份证头像照片的 base64 编码。
+	ReturnPortraitImage *bool `json:"return_portrait_image,omitempty"`
+
+	// 是否返回头像坐标的开关,可选值如下所示: - true: 返回身份证头像的位置坐标 - false: 不返回身份证头像的位置坐标 未传入该参数时默认为“false”,即不返回身份证的头像坐标。
+	ReturnPortraitLocation *bool `json:"return_portrait_location,omitempty"`
+
+	// 是否返回身份证类型的开关,可选值如下所示: - true:返回身份证的类型,类型包括身份证原件以及身份证复印件 - false:不返回身份证的类型
+	ReturnIdcardType *bool `json:"return_idcard_type,omitempty"`
+
+	// 返回身份证边框完整性的告警结果的开关,可选值如下所示 - true:打开身份证图像边框完整性告警功能  - false:关闭身份证图像边框完整性告警功能
+	DetectBorderIntegrity *bool `json:"detect_border_integrity,omitempty"`
+
+	// 返回身份证内部是否有被遮挡的告警结果的开关,可选值如下所示 - true:打开身份证内部是否有被遮挡的告警功能  - false:关闭身份证内部是否有被遮挡的告警功能
+	DetectBlockingWithinBorder *bool `json:"detect_blocking_within_border,omitempty"`
+
+	// 返回身份证模糊告警结果的开关,可选值如下所示 - true:打开身份证是否模糊的告警功能 - false:关闭身份证是否模糊的告警功能
+	DetectBlur *bool `json:"detect_blur,omitempty"`
+
+	// 返回身份证是否反光的告警结果的开关,可选值如下所示 - true:打开身份证是否反光的告警功能  - false:关闭身份证是否反光的告警功能
+	DetectGlare *bool `json:"detect_glare,omitempty"`
+
+	// 返回身份证四点原图的base64编码 - true: 返回身份证原图的base64编码  - false:不返回身份证原图的base64编码
+	ReturnAdjustedImage *bool `json:"return_adjusted_image,omitempty"`
+
+	// 返回身份证人像是否被篡改的告警结果的开关,可选值如下所示 - true:  打开身份证人像是否被篡改的告警功能  - false:关闭身份证人像被篡改的告警功能 不支持精细化的P图
+	DetectTampering *bool `json:"detect_tampering,omitempty"`
+
+	// 返回判断身份证图像是否经过翻拍告警的开关,可选值如下所示 - true:打开判断身份证图像是否经过翻拍告警的功能  - false:关闭判断身份证图像是否经过翻拍告警的功能
+	DetectReproduce *bool `json:"detect_reproduce,omitempty"`
+}
+
+func (o CambodianIdCardRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "CambodianIdCardRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"CambodianIdCardRequestBody", string(data)}, " ")
+}

+ 96 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_cambodian_id_card_result.go

@@ -0,0 +1,96 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type CambodianIdCardResult struct {
+
+	// 身份证号码。
+	IdNumber *string `json:"id_number,omitempty"`
+
+	// 高棉语版姓名。
+	NameKh *string `json:"name_kh,omitempty"`
+
+	// 英文姓名。
+	NameEn *string `json:"name_en,omitempty"`
+
+	// 出生日期。
+	BirthDate *string `json:"birth_date,omitempty"`
+
+	// 性别。
+	Sex *string `json:"sex,omitempty"`
+
+	// 身高。
+	Height *string `json:"height,omitempty"`
+
+	// 出生地。
+	BirthPlace *string `json:"birth_place,omitempty"`
+
+	// 地址,以空格分隔。
+	Address *string `json:"address,omitempty"`
+
+	// 签发起始日期。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 签发结束日期。
+	ExpiryDate *string `json:"expiry_date,omitempty"`
+
+	// 图片中的个人特征。
+	Description *string `json:"description,omitempty"`
+
+	// 机器码第一行。
+	MachineCode1 *string `json:"machine_code1,omitempty"`
+
+	// 机器码第二行。
+	MachineCode2 *string `json:"machine_code2,omitempty"`
+
+	// 机器码第三行。
+	MachineCode3 *string `json:"machine_code3,omitempty"`
+
+	// 头像的base64编码。 当输入参数“return_portrait_image”为“true”时,才返回该参数。
+	PortraitImage *string `json:"portrait_image,omitempty"`
+
+	// 头像在原图上的位置。 当输入参数“return_portrait_location”为“true”时,才返回该参数。以列表形式显示,包含头像区域四个顶点的二维坐标(x,y),坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	PortraitLocation *[][]int32 `json:"portrait_location,omitempty"`
+
+	// 身份证的类型。当输入参数\"idcard_type \"为\"true\"时,才返回该参数。取值如下所示: - normal:身份证原件 - copy:复印的身份证
+	IdcardType *string `json:"idcard_type,omitempty"`
+
+	// 身份证原图的base64编码。 当输入参数\"return_adjusted_image\"为\"true\"时,才返回该参数。
+	AdjustedImage *string `json:"adjusted_image,omitempty"`
+
+	// 身份证图片边框完整性告警结果,\"true\"表示边框不完整,\"false\"表示边框完整。仅在输入参数detect_border_integrity为true时,返回该字段。
+	DetectBorderIntegrityResult *bool `json:"detect_border_integrity_result,omitempty"`
+
+	// 身份证图像框内是否存在遮挡的告警结果,\"true\"表示边框内部存在遮挡,\"false\"表示边框内部完整。仅在输入参数detect_blocking_within_border为true时,返回该字段。
+	DetectBlockingWithinBorderResult *bool `json:"detect_blocking_within_border_result,omitempty"`
+
+	// 身份证模糊告警结果,\"true\"表示图片模糊,\"false\"表示身份证清晰。仅在输入参数detect_blur为true时,返回该字段。
+	DetectBlurResult *bool `json:"detect_blur_result,omitempty"`
+
+	// 身份证反光告警结果,\"true\"表示身份证反光,\"false\"表示是身份证无反光。仅在输入参数detect_glare为true时,返回该字段。
+	DetectGlareResult *bool `json:"detect_glare_result,omitempty"`
+
+	// 身份证人像被篡改的告警结果,\"true\"表示身份证人像被篡改,\"false\"表示是身份证人像未被篡改。仅在输入参数detect_tampering为true时,返回该字段。
+	DetectTamperingResult *bool `json:"detect_tampering_result,omitempty"`
+
+	// 身份证是否经过翻拍的告警结果,“true”表示身份证经过翻拍,“false”表示身份证未经过翻拍。仅在输入参数detect_reproduce为true时,返回该字段。
+	DetectReproduceResult *bool `json:"detect_reproduce_result,omitempty"`
+
+	ScoreInfo *CambodianIdCardScoreInformationResult `json:"score_info,omitempty"`
+
+	// 相关字段的置信度信息,置信度越大,表示本次识别的对应字段的可靠性越高,在统计意义上,置信度越大,准确率越高。 置信度由算法给出,不直接等价于对应字段的准确率。
+	Confidence *interface{} `json:"confidence,omitempty"`
+}
+
+func (o CambodianIdCardResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "CambodianIdCardResult struct{}"
+	}
+
+	return strings.Join([]string{"CambodianIdCardResult", string(data)}, " ")
+}

+ 40 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_cambodian_id_card_score_information_result.go

@@ -0,0 +1,40 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type CambodianIdCardScoreInformationResult struct {
+
+	// 告警分数,字段取值范围[0, 99]值大于50表示复印件,小于等于50表示原件,值越靠近99,表示复印件的可能性越大,值越靠近0,表示原件的可能性越大。  仅在传入参数return_idcard_type为true时,返回该字段。
+	IdcardTypeScore *int32 `json:"idcard_type_score,omitempty"`
+
+	// 告警分数,字段取值范围[0, 99]值大于50表示边框不完整,小于50表示边框完整,值越靠近99,表示边框不完整的可能性越大,值越靠近0,表示边框完整的可能性越大。 仅在传入参数detect_border_integrity为true时,返回该字段。
+	BorderIntegrityScore *int32 `json:"border_integrity_score,omitempty"`
+
+	// 告警分数,字段取值范围[0, 99]值大于50表示框内有遮挡,小于50表示框内无遮挡,值越靠近99,表示框内有遮挡的可能性越大,值越靠近0,表示框内无遮挡的可能性越大。 仅在传入参数detect_blocking_within_border为true时,返回该字段。
+	BlockingWithinBorderScore *int32 `json:"blocking_within_border_score,omitempty"`
+
+	// 告警分数,字段取值范围[0, 99]值大于50表示身份证模糊,小于50表示身份证清晰,值越靠近99,表示身份证模糊的可能性越大,值越靠近0,表示身份证清晰的可能性越大。 仅在传入参数detect_blur为true时,返回该字段。
+	BlurScore *int32 `json:"blur_score,omitempty"`
+
+	// 告警分数,字段取值范围[0, 99]值大于50表示身份证反光,小于50表示身份证不反光,值越靠近99,表示身份证反光的可能性越大,值越靠近0,表示身份证不反光的可能性越大。 仅在传入参数detect_glare为true时,返回该字段。
+	GlareScore *int32 `json:"glare_score,omitempty"`
+
+	// 告警分数,字段取值范围[0, 99]值大于50表示身份证人像被其他非身份证人像篡改过,小于50表示身份证人像未被篡改,值越靠近99,表示身份证人像被篡改的可能性越大,值越靠近0,表示身份证未人像被篡改的可能性越大。 仅在传入参数detect_tampering为true时,返回该字段。
+	TamperingScore *int32 `json:"tampering_score,omitempty"`
+
+	// 告警分数,字段取值范围[0, 99]值大于50表示身份证经过翻拍,小于50表示身份证未经过翻拍,值越靠近99,表示身份证图像被翻拍过的可能性越大,值越靠近0,表示身份证图像未被翻拍的可能性越大。 仅在传入参数detect_reproduce为true时,返回该字段。
+	ReproduceScore *int32 `json:"reproduce_score,omitempty"`
+}
+
+func (o CambodianIdCardScoreInformationResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "CambodianIdCardScoreInformationResult struct{}"
+	}
+
+	return strings.Join([]string{"CambodianIdCardScoreInformationResult", string(data)}, " ")
+}

+ 28 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_char_list_iem.go

@@ -0,0 +1,28 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type CharListIem struct {
+
+	// 单字符识别结果。
+	Char *string `json:"char,omitempty"`
+
+	// 单字符的置信度,置信度越大,表示本次识别的文字的可靠性越高,在统计意义上,置信度越大,准确率越高。置信度由算法给出,不直接等价于对应字段的准确率。
+	CharConfidence *float32 `json:"char_confidence,omitempty"`
+
+	// 单字符的位置信息,列表形式,分别表示文字块4个顶点的x, y坐标;坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	CharLocation *[][]int32 `json:"char_location,omitempty"`
+}
+
+func (o CharListIem) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "CharListIem struct{}"
+	}
+
+	return strings.Join([]string{"CharListIem", string(data)}, " ")
+}

+ 46 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_chile_id_card_confidence.go

@@ -0,0 +1,46 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type ChileIdCardConfidence struct {
+
+	// 姓氏置信度。
+	Surname *float32 `json:"surname,omitempty"`
+
+	// 名置信度。
+	GivenName *float32 `json:"given_name,omitempty"`
+
+	// 国籍置信度。
+	Nationality *float32 `json:"nationality,omitempty"`
+
+	// 性别置信度。
+	Sex *float32 `json:"sex,omitempty"`
+
+	// 出生日置信度。
+	Birth *float32 `json:"birth,omitempty"`
+
+	// 发行日置信度。
+	IssueDate *float32 `json:"issue_date,omitempty"`
+
+	// 有效期置信度。
+	ExpiryDate *float32 `json:"expiry_date,omitempty"`
+
+	// 文档编号置信度。
+	DocumentNumber *float32 `json:"document_number,omitempty"`
+
+	// 身份证号置信度。
+	Number *float32 `json:"number,omitempty"`
+}
+
+func (o ChileIdCardConfidence) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ChileIdCardConfidence struct{}"
+	}
+
+	return strings.Join([]string{"ChileIdCardConfidence", string(data)}, " ")
+}

+ 25 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_chile_id_card_request_body.go

@@ -0,0 +1,25 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type ChileIdCardRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于15px,最长边不超过4096px,支持JPEG、JPG、PNG、BMP、TIFF格式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/intl/zh-cn/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+}
+
+func (o ChileIdCardRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ChileIdCardRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"ChileIdCardRequestBody", string(data)}, " ")
+}

+ 48 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_chile_id_card_result.go

@@ -0,0 +1,48 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type ChileIdCardResult struct {
+
+	// 姓氏。
+	Surname *[]string `json:"surname,omitempty"`
+
+	// 名。
+	GivenName *string `json:"given_name,omitempty"`
+
+	// 国籍。
+	Nationality *string `json:"nationality,omitempty"`
+
+	// 性别。
+	Sex *string `json:"sex,omitempty"`
+
+	// 出生日。
+	Birth *string `json:"birth,omitempty"`
+
+	// 发行日。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 有效期。
+	ExpiryDate *string `json:"expiry_date,omitempty"`
+
+	// 文档编号。
+	DocumentNumber *string `json:"document_number,omitempty"`
+
+	// 身份证号。
+	Number *string `json:"number,omitempty"`
+
+	Confidence *ChileIdCardConfidence `json:"confidence,omitempty"`
+}
+
+func (o ChileIdCardResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ChileIdCardResult struct{}"
+	}
+
+	return strings.Join([]string{"ChileIdCardResult", string(data)}, " ")
+}

+ 25 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_colombia_id_card_request_body.go

@@ -0,0 +1,25 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type ColombiaIdCardRequestBody struct {
+
+	// 与url二选一。 图像数据,base64编码,要求base64编码后大小不超过10M。图片最短边不小于15像素,最长边不超过8192像素,支持JPG/PNG/BMP/TIFF格式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一。 图片的url路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)>。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+}
+
+func (o ColombiaIdCardRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ColombiaIdCardRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"ColombiaIdCardRequestBody", string(data)}, " ")
+}

+ 64 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_colombia_id_card_result.go

@@ -0,0 +1,64 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type ColombiaIdCardResult struct {
+
+	// 证件图片正反面信息。可选值包括: - front: 证件图片正面 - back:  证件图片反面
+	Side *string `json:"side,omitempty"`
+
+	// 卡证编号。当响应字段\"side\"为front时,返回此字段。
+	Number *string `json:"number,omitempty"`
+
+	// 名。当响应字段\"side\"为front时,返回此字段。
+	Name *string `json:"name,omitempty"`
+
+	// 姓。当响应字段\"side\"为front时,返回此字段。
+	LastName *string `json:"last_name,omitempty"`
+
+	// 出生日期。
+	BirthDate *string `json:"birth_date,omitempty"`
+
+	// 出生地。
+	BirthPlace *string `json:"birth_place,omitempty"`
+
+	// 性别。
+	Gender *string `json:"gender,omitempty"`
+
+	// 血型。
+	BloodType *string `json:"blood_type,omitempty"`
+
+	// 签发日期。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 签发地区。
+	IssueAuthority *string `json:"issue_authority,omitempty"`
+
+	// 身高。
+	Height *string `json:"height,omitempty"`
+
+	// 公民编码一。
+	CitizenCode1 *string `json:"citizen_code1,omitempty"`
+
+	// 公民编码二。
+	CitizenCode2 *string `json:"citizen_code2,omitempty"`
+
+	// 公民编码三。
+	CitizenCode3 *string `json:"citizen_code3,omitempty"`
+
+	// 相关字段的置信度信息,置信度越大,表示本次识别的对应字段的可靠性越高,在统计意义上,置信度越大,准确率越高。注:置信度由算法给出,不直接等价于对应字段的准确率。
+	Confidence map[string]float32 `json:"confidence,omitempty"`
+}
+
+func (o ColombiaIdCardResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ColombiaIdCardResult struct{}"
+	}
+
+	return strings.Join([]string{"ColombiaIdCardResult", string(data)}, " ")
+}

+ 35 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_custom_template_request_body.go

@@ -0,0 +1,35 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// CustomTemplateRequestBody 自定义模板OCR请求体
+type CustomTemplateRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于15px,最长边不超过8192px,支持JPEG、JPG、PNG、BMP、TIFF、GIF、WEBP格式。  图片文件Base64编码字符串,点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 该参数与classifier_id二选一。 模板id,如果传入,启用单模板识别模式。
+	TemplateId *string `json:"template_id,omitempty"`
+
+	// 该参数与template_id二选一。 分类器id,如果传入,启用多模板识别模式。
+	ClassifierId *string `json:"classifier_id,omitempty"`
+
+	// 该参数与classifier_id参数配合使用,可选值如下所示: - true:仅返回模板分类结果 - false:正常返回多模板识别结果 > 说明: - 如果未传入该参数时默认为false,即正常返回多模板识别结果。
+	ClassifierMode *bool `json:"classifier_mode,omitempty"`
+}
+
+func (o CustomTemplateRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "CustomTemplateRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"CustomTemplateRequestBody", string(data)}, " ")
+}

+ 43 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_driver_license_back.go

@@ -0,0 +1,43 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type DriverLicenseBack struct {
+
+	// 驾驶证类型。 normal:纸质驾驶证 electronic:电子驾驶证
+	Type *string `json:"type,omitempty"`
+
+	// 驾驶证号。
+	Number *string `json:"number,omitempty"`
+
+	// 姓名。
+	Name *string `json:"name,omitempty"`
+
+	// 发证机关。
+	IssuingAuthority *string `json:"issuing_authority,omitempty"`
+
+	// 住址。
+	Address *string `json:"address,omitempty"`
+
+	// 档案编号。 > 说明:当驾驶证类型为纸质驾驶证时才返回。
+	FileNumber *string `json:"file_number,omitempty"`
+
+	// 记录。
+	Record *string `json:"record,omitempty"`
+
+	// 对应所有在原图上识别到的字段位置信息,包含所有文字区域四个顶点的二维坐标(x,y)。采用图像坐标系,坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	TextLocation *interface{} `json:"text_location,omitempty"`
+}
+
+func (o DriverLicenseBack) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "DriverLicenseBack struct{}"
+	}
+
+	return strings.Join([]string{"DriverLicenseBack", string(data)}, " ")
+}

+ 73 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_driver_license_front.go

@@ -0,0 +1,73 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type DriverLicenseFront struct {
+
+	// 驾驶证类型。 normal:纸质驾驶证 electronic:电子驾驶证
+	Type *string `json:"type,omitempty"`
+
+	// 驾驶证号。
+	Number *string `json:"number,omitempty"`
+
+	// 姓名。
+	Name *string `json:"name,omitempty"`
+
+	// 性别。
+	Sex *string `json:"sex,omitempty"`
+
+	// 国籍。
+	Nationality *string `json:"nationality,omitempty"`
+
+	// 住址。
+	Address *string `json:"address,omitempty"`
+
+	// 出生日期。
+	Birth *string `json:"birth,omitempty"`
+
+	// 初次领证日期。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 准驾类型。
+	Class *string `json:"class,omitempty"`
+
+	// 有效起始日期。
+	ValidFrom *string `json:"valid_from,omitempty"`
+
+	// 有效结束日期。
+	ValidTo *string `json:"valid_to,omitempty"`
+
+	// 发证机关。
+	IssuingAuthority *string `json:"issuing_authority,omitempty"`
+
+	// 累积记分。
+	AccumulatedScores *string `json:"accumulated_scores,omitempty"`
+
+	// 状态。
+	Status *[]string `json:"status,omitempty"`
+
+	// 生成时间。
+	GenerationDate *string `json:"generation_date,omitempty"`
+
+	// 当前时间。
+	CurrentTime *string `json:"current_time,omitempty"`
+
+	// 档案编号。  > 说明:当驾驶证类型为电子驾驶证时才返回。
+	FileNumber *string `json:"file_number,omitempty"`
+
+	// 对应所有在原图上识别到的字段位置信息,包含所有文字区域四个顶点的二维坐标(x,y)。采用图像坐标系,坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	TextLocation *interface{} `json:"text_location,omitempty"`
+}
+
+func (o DriverLicenseFront) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "DriverLicenseFront struct{}"
+	}
+
+	return strings.Join([]string{"DriverLicenseFront", string(data)}, " ")
+}

+ 35 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_driver_license_request_body.go

@@ -0,0 +1,35 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// DriverLicenseRequestBody
+type DriverLicenseRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于100px,最长边不超过8000px。支持JPEG、JPG、PNG、BMP、TIFF格式。  图片文件Base64编码字符串,点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 检测场景: - front:驾驶证主页。 - back:驾驶证副页。 - double_side:驾驶证双页信息  > 说明:如果参数值为空或无该参数,系统默认识别主页,建议填写,准确率更高。
+	Side *string `json:"side,omitempty"`
+
+	// 是否返回发证机关的开关,可选值包括: true:返回发证机关 false:不返回发证机关  如果无该参数,系统默认不返回发证机关。如果输入参数不是Boolean类型,则会报非法参数错误。
+	ReturnIssuingAuthority *bool `json:"return_issuing_authority,omitempty"`
+
+	// 识别到的文字块的区域位置信息。可选值包括: - true:返回各个文字块区域 - false:不返回各个文字块区域  如果无该参数,系统默认不返回文字块区域。如果输入参数不是Boolean类型,则会报非法参数错误。
+	ReturnTextLocation *bool `json:"return_text_location,omitempty"`
+}
+
+func (o DriverLicenseRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "DriverLicenseRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"DriverLicenseRequestBody", string(data)}, " ")
+}

+ 80 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_driver_license_result.go

@@ -0,0 +1,80 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type DriverLicenseResult struct {
+
+	// 驾驶证类型。 normal:纸质驾驶证 electronic:电子驾驶证
+	Type *string `json:"type,omitempty"`
+
+	// 驾驶证号。
+	Number *string `json:"number,omitempty"`
+
+	// 姓名。
+	Name *string `json:"name,omitempty"`
+
+	// 性别。
+	Sex *string `json:"sex,omitempty"`
+
+	// 国籍。
+	Nationality *string `json:"nationality,omitempty"`
+
+	// 住址。
+	Address *string `json:"address,omitempty"`
+
+	// 出生日期。
+	Birth *string `json:"birth,omitempty"`
+
+	// 初次领证日期。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 准驾类型。
+	Class *string `json:"class,omitempty"`
+
+	// 有效起始日期。
+	ValidFrom *string `json:"valid_from,omitempty"`
+
+	// 有效结束日期。
+	ValidTo *string `json:"valid_to,omitempty"`
+
+	// 发证机关。
+	IssuingAuthority *string `json:"issuing_authority,omitempty"`
+
+	// 档案编号。
+	FileNumber *string `json:"file_number,omitempty"`
+
+	// 记录。
+	Record *string `json:"record,omitempty"`
+
+	// 累积记分。
+	AccumulatedScores *string `json:"accumulated_scores,omitempty"`
+
+	// 状态。
+	Status *[]string `json:"status,omitempty"`
+
+	// 生成时间。
+	GenerationDate *string `json:"generation_date,omitempty"`
+
+	// 当前时间。
+	CurrentTime *string `json:"current_time,omitempty"`
+
+	// 对应所有在原图上识别到的字段位置信息,包含所有文字区域四个顶点的二维坐标(x,y)。采用图像坐标系,坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	TextLocation *interface{} `json:"text_location,omitempty"`
+
+	Front *DriverLicenseFront `json:"front,omitempty"`
+
+	Back *DriverLicenseBack `json:"back,omitempty"`
+}
+
+func (o DriverLicenseResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "DriverLicenseResult struct{}"
+	}
+
+	return strings.Join([]string{"DriverLicenseResult", string(data)}, " ")
+}

+ 61 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_exit_entry_permit_confidence.go

@@ -0,0 +1,61 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type ExitEntryPermitConfidence struct {
+
+	// 姓名的置信度。
+	Name *float32 `json:"name,omitempty"`
+
+	// 英文姓名的置信度。
+	NameEn *float32 `json:"name_en,omitempty"`
+
+	// 出生日期的置信度。
+	BirthDate *float32 `json:"birth_date,omitempty"`
+
+	// 性别的置信度
+	Sex *float32 `json:"sex,omitempty"`
+
+	// 证件号的置信度。
+	Number *float32 `json:"number,omitempty"`
+
+	// 有效期限的置信度。
+	ValidPeriod *float32 `json:"valid_period,omitempty"`
+
+	// 签发机关的置信度。
+	IssuingAuthority *float32 `json:"issuing_authority,omitempty"`
+
+	// 签发地点的置信度。
+	IssuePlace *float32 `json:"issue_place,omitempty"`
+
+	// 机器码的置信度。
+	MachineCode *float32 `json:"machine_code,omitempty"`
+
+	// 证件类型的置信度。
+	Type *float32 `json:"type,omitempty"`
+
+	// 证件图片正反面信息的置信度。
+	Side *float32 `json:"side,omitempty"`
+
+	// 香港签注信息的置信度。
+	EndorsementInfoHk *interface{} `json:"endorsement_info_hk,omitempty"`
+
+	// 澳门签注信息的置信度。
+	EndorsementInfoMo *interface{} `json:"endorsement_info_mo,omitempty"`
+
+	// 台湾签注信息的置信度。
+	EndorsementInfoTw *interface{} `json:"endorsement_info_tw,omitempty"`
+}
+
+func (o ExitEntryPermitConfidence) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ExitEntryPermitConfidence struct{}"
+	}
+
+	return strings.Join([]string{"ExitEntryPermitConfidence", string(data)}, " ")
+}

+ 34 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_exit_entry_permit_endorsement_info.go

@@ -0,0 +1,34 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type ExitEntryPermitEndorsementInfo struct {
+
+	// 签注种类。
+	EndorsementType *string `json:"endorsement_type,omitempty"`
+
+	// 签注往返有效次数。
+	ValidRoundTrips *string `json:"valid_round_trips,omitempty"`
+
+	// 签注有效期。
+	EndorsementValidPeriod *string `json:"endorsement_valid_period,omitempty"`
+
+	// 签注备注。
+	Remark *string `json:"remark,omitempty"`
+
+	// 签注签发信息。
+	IssueInfo *string `json:"issue_info,omitempty"`
+}
+
+func (o ExitEntryPermitEndorsementInfo) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ExitEntryPermitEndorsementInfo struct{}"
+	}
+
+	return strings.Join([]string{"ExitEntryPermitEndorsementInfo", string(data)}, " ")
+}

+ 31 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_exit_entry_permit_request_body.go

@@ -0,0 +1,31 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type ExitEntryPermitRequestBody struct {
+
+	// 与url二选一。图像数据,base64编码,要求base64编码后大小不超过10M。图片最小边不小于15像素,最长边不超过8192像素。支持JPG/PNG/BMP/TIFF格式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一。 图片的url路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/intl/zh-cn/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 是否返回头像内容开关,可选值如下所示: - true: 返回通行证头像照片的 base64 编码 - false: 不返回通行证头像照片的 base64 编码 未传入该参数时默认为“false”,即不返回身份证头像照片的 base64 编码。
+	ReturnPortraitImage *bool `json:"return_portrait_image,omitempty"`
+
+	// 是否返回头像坐标的开关,可选值如下所示: - true: 返回通行证头像的位置坐标 - false: 不返回通行证头像的位置坐标 未传入该参数时默认为“false”,即不返回身份证的头像坐标。
+	ReturnPortraitLocation *bool `json:"return_portrait_location,omitempty"`
+}
+
+func (o ExitEntryPermitRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ExitEntryPermitRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"ExitEntryPermitRequestBody", string(data)}, " ")
+}

+ 66 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_exit_entry_permit_result.go

@@ -0,0 +1,66 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type ExitEntryPermitResult struct {
+
+	// 姓名。
+	Name *string `json:"name,omitempty"`
+
+	// 英文姓名。
+	NameEn *string `json:"name_en,omitempty"`
+
+	// 性别。
+	Sex *string `json:"sex,omitempty"`
+
+	// 出生日期。
+	BirthDate *string `json:"birth_date,omitempty"`
+
+	// 证件号。
+	Number *string `json:"number,omitempty"`
+
+	// 签发机关。
+	IssuingAuthority *string `json:"issuing_authority,omitempty"`
+
+	// 签发地点。
+	IssuePlace *string `json:"issue_place,omitempty"`
+
+	// 有效期限。
+	ValidPeriod *string `json:"valid_period,omitempty"`
+
+	// 机器码。
+	MachineCode *string `json:"machine_code,omitempty"`
+
+	// 头像的base64编码。当输入参数“return_portrait_image”为“true”时,才返回该参数。
+	PortraitImage *string `json:"portrait_image,omitempty"`
+
+	// 头像在原图上的位置。 当输入参数“return_portrait_location”为“true”时,才返回该参数。以列表形式显示,包含头像区域四个顶点的二维坐标(x,y),坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	PortraitLocation *[][]int32 `json:"portrait_location,omitempty"`
+
+	// 证件类型。可选值包括: - \"往来港澳通行证 \" - \"往来台湾通行证\"
+	Type *string `json:"type,omitempty"`
+
+	// 证件图片正反面信息。可选值包括: - \"front\":证件图片为正面 - \"back\":证件图片为反面
+	Side *string `json:"side,omitempty"`
+
+	EndorsementInfoHk *ExitEntryPermitEndorsementInfo `json:"endorsement_info_hk,omitempty"`
+
+	EndorsementInfoMo *ExitEntryPermitEndorsementInfo `json:"endorsement_info_mo,omitempty"`
+
+	EndorsementInfoTw *ExitEntryPermitEndorsementInfo `json:"endorsement_info_tw,omitempty"`
+
+	Confidence *ExitEntryPermitConfidence `json:"confidence,omitempty"`
+}
+
+func (o ExitEntryPermitResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ExitEntryPermitResult struct{}"
+	}
+
+	return strings.Join([]string{"ExitEntryPermitResult", string(data)}, " ")
+}

+ 29 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_extra_info_list.go

@@ -0,0 +1,29 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// ExtraInfoList
+type ExtraInfoList struct {
+
+	// 表示key值,可能是qq, wechat, alipay及bank等。
+	Item *string `json:"item,omitempty"`
+
+	// 表示value值,对应qq, wechat, alipay及bank等的账号。
+	Value *string `json:"value,omitempty"`
+
+	// 对应item关联的额外信息,为bank时第一个默认为户名,第二个为开户行,为alipay时第一个默认为账号名。
+	Note *[]string `json:"note,omitempty"`
+}
+
+func (o ExtraInfoList) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "ExtraInfoList struct{}"
+	}
+
+	return strings.Join([]string{"ExtraInfoList", string(data)}, " ")
+}

+ 44 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_request_body.go

@@ -0,0 +1,44 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// FinancialStatementRequestBody
+type FinancialStatementRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于15px,最长边不超过8192px,支持JPEG、JPG、PNG、BMP、TIFF格式。  图片文件Base64编码字符串,点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 返回文本块坐标及单元格坐标信息,可选值包括: - true:返回文本块和单元格坐标; - false:不返回。  > 说明: - 未传入该参数时默认为false,即不返回。
+	ReturnTextLocation *bool `json:"return_text_location,omitempty"`
+
+	// 返回字段识别置信度,小数点后四位。可选值包括: - true:返回字段置信度; - false:不返回。  > 说明: - 未传入该参数时默认为false,即不返回字段置信度。
+	ReturnConfidence *bool `json:"return_confidence,omitempty"`
+
+	// 是否返回表格转换Microsoft Excel的base64编码字段。可选值包括: - true:返回’excel’字段,表示xlsx格式的表格识别结果的base64编码; - false:不返回。  > 说明: - 对返回的Excel编码,可用Python函数 base64.b64decode解码后保存为xlsx文件。
+	ReturnExcel *bool `json:"return_excel,omitempty"`
+
+	// 返回表格坐标,可选值包括: - true:返回表格坐标; - false:不返回。  > 说明: - 未传入该参数时默认为false,即不返回。
+	ReturnTableLocation *bool `json:"return_table_location,omitempty"`
+
+	// 返回矫正后的图像大小,可选值包括: - true:返回矫正图像大小; - false:不返回。  > 说明: - 未传入该参数时默认为false,即不返回。
+	ReturnImageSize *bool `json:"return_image_size,omitempty"`
+
+	// 透视变换矩阵,可选值包括: - true:返回透视变换矩阵; - false:不返回。  > 说明: - 未传入该参数时默认为false,即不返回透视变换矩阵。
+	ReturnRectificationMatrix *bool `json:"return_rectification_matrix,omitempty"`
+}
+
+func (o FinancialStatementRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "FinancialStatementRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"FinancialStatementRequestBody", string(data)}, " ")
+}

+ 34 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_result.go

@@ -0,0 +1,34 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// FinancialStatementResult
+type FinancialStatementResult struct {
+
+	// 识别出来的表格、文本区域个数。
+	WordsRegionCount int32 `json:"words_region_count"`
+
+	// 返回的表格、文本区域列表。输出顺序从左到右,从上到下。
+	WordsRegionList []FinancialStatementWordsRegionList `json:"words_region_list"`
+
+	// 表格图像转换为excel的base64编码,图像中的文字和表格按位置写入excel,可编辑。对返回的excel编码,可用base64.b64decode解码并保存为xlsx文件。
+	Excel *string `json:"excel,omitempty"`
+
+	ImageSize *FinancialStatementResultImageSize `json:"image_size,omitempty"`
+
+	// 返回透视变换矩阵
+	RectificationMatrix *[][]float32 `json:"rectification_matrix,omitempty"`
+}
+
+func (o FinancialStatementResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "FinancialStatementResult struct{}"
+	}
+
+	return strings.Join([]string{"FinancialStatementResult", string(data)}, " ")
+}

+ 26 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_result_image_size.go

@@ -0,0 +1,26 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// FinancialStatementResultImageSize 图像信息
+type FinancialStatementResultImageSize struct {
+
+	// 矫正后图像的高。
+	Height *int32 `json:"height,omitempty"`
+
+	// 矫正后图像的宽。
+	Width *int32 `json:"width,omitempty"`
+}
+
+func (o FinancialStatementResultImageSize) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "FinancialStatementResultImageSize struct{}"
+	}
+
+	return strings.Join([]string{"FinancialStatementResultImageSize", string(data)}, " ")
+}

+ 38 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_words_block_list.go

@@ -0,0 +1,38 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// FinancialStatementWordsBlockList
+type FinancialStatementWordsBlockList struct {
+
+	// 文字块内容。当入参\"return_text_location\"为false时,每个单元格返回一个文本值,不同行文本由换行符 \"\\n\" 拼接。
+	Words *string `json:"words,omitempty"`
+
+	// 文字块位置信息,列表形式,分别表示文字块4个顶点的x, y坐标;坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	Location *[][]int32 `json:"location,omitempty"`
+
+	// 文字块识别结果置信度信息,置信度越大,表示本次识别的对应字段的可靠性越大,在统计意义上,置信度越大正确率越高。注:置信度由算法给出,其不直接等价于对应字段的精度。
+	Confidence *float32 `json:"confidence,omitempty"`
+
+	// 单元格行信息,列表形式。多个连续值表示单元格垮多行。
+	Rows *[]int32 `json:"rows,omitempty"`
+
+	// 单元格列信息,列表形式。多个连续值表示单元格垮多列。
+	Columns *[]int32 `json:"columns,omitempty"`
+
+	// 单元格位置信息,列表形式,分别表示单元格4个顶点的x, y坐标;坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	CellLocation *[][]int32 `json:"cell_location,omitempty"`
+}
+
+func (o FinancialStatementWordsBlockList) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "FinancialStatementWordsBlockList struct{}"
+	}
+
+	return strings.Join([]string{"FinancialStatementWordsBlockList", string(data)}, " ")
+}

+ 32 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_financial_statement_words_region_list.go

@@ -0,0 +1,32 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// FinancialStatementWordsRegionList
+type FinancialStatementWordsRegionList struct {
+
+	// 区域属性:文本或表格。
+	Type *string `json:"type,omitempty"`
+
+	// 区域内文字块数目。对文本区,文字块以文本字段为单位;对表格区,文字块以单元格内所有字段为单位。
+	WordsBlockCount *float32 `json:"words_block_count,omitempty"`
+
+	// 表格位置信息,列表形式,分别表示表格4个顶点的x, y坐标;坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	TableLocation *[][]int32 `json:"table_location,omitempty"`
+
+	// 区域内文字块列表,输出顺序从左到右,从上到下。
+	WordsBlockList *[]FinancialStatementWordsBlockList `json:"words_block_list,omitempty"`
+}
+
+func (o FinancialStatementWordsRegionList) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "FinancialStatementWordsRegionList struct{}"
+	}
+
+	return strings.Join([]string{"FinancialStatementWordsRegionList", string(data)}, " ")
+}

+ 26 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_flight_itinerary_request_body.go

@@ -0,0 +1,26 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// FlightItineraryRequestBody
+type FlightItineraryRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于15px,最长边不超过8192px,支持JPEG、JPG、PNG、BMP、TIFF格式。  图片文件Base64编码字符串,点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+}
+
+func (o FlightItineraryRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "FlightItineraryRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"FlightItineraryRequestBody", string(data)}, " ")
+}

+ 98 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_flight_itinerary_result.go

@@ -0,0 +1,98 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// FlightItineraryResult
+type FlightItineraryResult struct {
+
+	// 印刷序号。
+	SerialNumber *string `json:"serial_number,omitempty"`
+
+	// 旅客姓名。
+	PassengerName *string `json:"passenger_name,omitempty"`
+
+	// 有效身份证件号码。
+	IdNumber *string `json:"id_number,omitempty"`
+
+	// 备注。
+	EndorsementsRestrictions *string `json:"endorsements_restrictions,omitempty"`
+
+	// 订单号。
+	OrderNumber *string `json:"order_number,omitempty"`
+
+	// 票价。
+	Fare *string `json:"fare,omitempty"`
+
+	// 民航(CAAC)发展基金。
+	CaacDevelopmentFund *string `json:"caac_development_fund,omitempty"`
+
+	// 燃油附加费。
+	FuelSurcharge *string `json:"fuel_surcharge,omitempty"`
+
+	// 其他税费。
+	OtherTaxes *string `json:"other_taxes,omitempty"`
+
+	// 合计。
+	Total *string `json:"total,omitempty"`
+
+	// 电子客票号码。
+	ETicketNumber *string `json:"e_ticket_number,omitempty"`
+
+	// 验证码。
+	CheckCode *string `json:"check_code,omitempty"`
+
+	// 提示信息。
+	ReferenceInformation *string `json:"reference_information,omitempty"`
+
+	// 保险费。
+	Insurance *string `json:"insurance,omitempty"`
+
+	// 销售单位代号。
+	AgentCode *string `json:"agent_code,omitempty"`
+
+	// 填开单位。
+	IssueOrganization *string `json:"issue_organization,omitempty"`
+
+	// 填开日期。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 增值税税额
+	Tax *string `json:"tax,omitempty"`
+
+	// 增值税税率
+	TaxRate *string `json:"tax_rate,omitempty"`
+
+	// 购买方名称
+	BuyerName *string `json:"buyer_name,omitempty"`
+
+	// 购买方纳税人识别号
+	BuyerId *string `json:"buyer_id,omitempty"`
+
+	// 发票号码
+	Number *string `json:"number,omitempty"`
+
+	// 国内国际标签
+	InternationalFlag *string `json:"international_flag,omitempty"`
+
+	// 开具状态
+	IssueStatus *string `json:"issue_status,omitempty"`
+
+	// 机票行程列表。
+	ItineraryList *[]ItineraryList `json:"itinerary_list,omitempty"`
+
+	// 相关字段的置信度信息,取值范围0~1。  置信度越大,表示本次识别的对应字段的可靠性越高,在统计意义上,置信度越大,准确率越高。 置信度由算法给出,不直接等价于对应字段的准确率。  > 说明:  - (1)置信度中的相关字段均与返回值中的相关字段一一对应;  - (2)置信度中的itinerary_list的顺序与返回值中的itinerary_list的顺序是一致的。
+	Confidence *interface{} `json:"confidence,omitempty"`
+}
+
+func (o FlightItineraryResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "FlightItineraryResult struct{}"
+	}
+
+	return strings.Join([]string{"FlightItineraryResult", string(data)}, " ")
+}

+ 44 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_table_request_body.go

@@ -0,0 +1,44 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// GeneralTableRequestBody
+type GeneralTableRequestBody struct {
+
+	// 与url二选一  图片最小边不小于15px,最长边不超过8192px,支持JPEG、JPG、PNG、BMP、TIFF格式。  图片文件Base64编码字符串,[点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)](tag:hc)[点击[这里](https://support.huaweicloud.com/intl/zh-cn/ocr_faq/ocr_01_0032.html)](tag:hk)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,[详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。](tag:hc)[详情参见[配置OBS访问权限](https://support.huaweicloud.com/intl/zh-cn/api-ocr/ocr_03_0132.html)。](tag:hk) > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 返回文本块坐标及单元格坐标信息,可选值如下所示: - true:返回文本块和单元格坐标 - false:不返回  > 说明: - 如果未传入该参数时默认为false,即不返回。
+	ReturnTextLocation *bool `json:"return_text_location,omitempty"`
+
+	// 返回单字符的坐标信息,可选值包括: - true:返回单字符的坐标 - false:不返回  未传入该参数时默认为false,即不返回。如果此参数为true时,return_text_loaction必须为true
+	ReturnCharLocation *bool `json:"return_char_location,omitempty"`
+
+	// 是否返回置信度的开关,可选值包括: - true:返回置信度 - false:不返回置信度  > 说明: - 如果未传入该参数,系统默认为“false”,即不返回置信度。
+	ReturnConfidence *bool `json:"return_confidence,omitempty"`
+
+	// 是否返回表格转换Microsoft Excel的base64编码字段。可选值包括: - true:返回'excel'字段,表示xlsx格式的表格识别结果的base64编码 - false:不返回。默认为false  > 说明: - 对返回的Excel编码,可用Python函数 base64.b64decode解码后保存为.xlsx文件。
+	ReturnExcel *bool `json:"return_excel,omitempty"`
+
+	// 可选值包括: - true:返回透视变换矩阵 - false:不返回  未传入该参数时默认为false,即不返回透视变换矩阵。
+	ReturnRectificationMatrix *bool `json:"return_rectification_matrix,omitempty"`
+
+	// 可选值包括: - true:输入图像仅包含有线表格,仅进行有线表格识别。 - false: 输入图像可能包含无线表格,同时进行有线表格与无线表格识别。  未传入该参数时默认为false,即同时进行有线表格与无线表格识别。当确认输入仅包含有线表格时,该参数设为true可达到更优识别效果。
+	WithBorders *bool `json:"with_borders,omitempty"`
+}
+
+func (o GeneralTableRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "GeneralTableRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"GeneralTableRequestBody", string(data)}, " ")
+}

+ 29 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_table_result.go

@@ -0,0 +1,29 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// GeneralTableResult
+type GeneralTableResult struct {
+
+	// 文字区域数目。
+	WordsRegionCount int32 `json:"words_region_count"`
+
+	// 文字区域识别结果列表,输出顺序从左到右,先上后下。
+	WordsRegionList []WordsRegionList `json:"words_region_list"`
+
+	// 表格图像转换为excel的base64编码,图像中的文字和表格按位置写入excel。对返回的excel编码可用base64.b64decode解码并保存为.xlsx文件。
+	Excel *string `json:"excel,omitempty"`
+}
+
+func (o GeneralTableResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "GeneralTableResult struct{}"
+	}
+
+	return strings.Join([]string{"GeneralTableResult", string(data)}, " ")
+}

+ 41 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_table_words_block_list.go

@@ -0,0 +1,41 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// GeneralTableWordsBlockList 子区域识别文字块列表,输出顺序从左到右,先上后下。
+type GeneralTableWordsBlockList struct {
+
+	// 文字块识别结果。
+	Words *string `json:"words,omitempty"`
+
+	// 字段的平均置信度,置信度越大,表示本次识别的对应字段的可靠性越高,在统计意义上,置信度越大,准确率越高。置信度由算法给出,不直接等价于对应字段的准确率。
+	Confidence *float32 `json:"confidence,omitempty"`
+
+	// 文字块位置信息,列表形式,分别表示文字块4个顶点的x, y坐标;坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	Location *[][]int32 `json:"location,omitempty"`
+
+	// 单元格内文字段列表。输出顺序从左到右,从上到下。仅当入参\"return_text_location\"为true时存在。
+	WordsList *[]WordsListIem `json:"words_list,omitempty"`
+
+	// 文字块占用的行信息,编号从0开始,列表形式,数据类型为Integer。仅在表格区域内有效,即type字段为\"table\"时该字段有效。
+	Rows *[]int32 `json:"rows,omitempty"`
+
+	// 文字块占用的列信息,编号从0开始,列表形式,数据类型为Integer。仅在表格区域内有效,即type字段为\"table\"时该字段有效。
+	Columns *[]int32 `json:"columns,omitempty"`
+
+	// 单元格位置信息,列表形式,分别表示单元格4个顶点的x, y坐标;坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	CellLocation *[][]int32 `json:"cell_location,omitempty"`
+}
+
+func (o GeneralTableWordsBlockList) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "GeneralTableWordsBlockList struct{}"
+	}
+
+	return strings.Join([]string{"GeneralTableWordsBlockList", string(data)}, " ")
+}

+ 28 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_text_char_list.go

@@ -0,0 +1,28 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type GeneralTextCharList struct {
+
+	// 单字符识别结果。
+	Char *string `json:"char,omitempty"`
+
+	// 单字符的区域位置信息,列表形式,包含字符区域四个顶点的二维坐标(x,y);坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	CharLocation *[][]int32 `json:"char_location,omitempty"`
+
+	// 单字符识别结果的置信度。
+	CharConfidence *float32 `json:"char_confidence,omitempty"`
+}
+
+func (o GeneralTextCharList) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "GeneralTextCharList struct{}"
+	}
+
+	return strings.Join([]string{"GeneralTextCharList", string(data)}, " ")
+}

+ 41 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_text_request_body.go

@@ -0,0 +1,41 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// GeneralTextRequestBody
+type GeneralTextRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于15px,最长边不超过4096px。支持JPEG、JPG、PNG、BMP、TIFF格式。  图片文件Base64编码字符串,[点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)](tag:hc)[点击[这里](https://support.huaweicloud.com/intl/zh-cn/ocr_faq/ocr_01_0032.html)](tag:hk)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,[详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。](tag:hc)[详情参见[配置OBS访问权限](https://support.huaweicloud.com/intl/zh-cn/api-ocr/ocr_03_0132.html)。](tag:hk)  > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 图片朝向检测开关,可选值包括: - true:检测图片朝向; - false:不检测图片朝向。  > 说明: - 支持任意角度的图片朝向检测。未传入该参数时默认为false,即不检测图片朝向。
+	DetectDirection *bool `json:"detect_direction,omitempty"`
+
+	// 快速模式开关,针对单行文字图片(要求图片只包含一行文字,且文字区域占比超过50%),打开时可以更快返回识别。可选值包括: - true:打开快速模式; - false:关闭快速模式。  > 说明: - 未传入该参数时默认为false,即关闭快速模式。
+	QuickMode *bool `json:"quick_mode,omitempty"`
+
+	// 单字符模式开关。可选值包括: - true:打开单字符模式 - false:关闭单字符模式  未传入该参数时默认为false,即不返回单个文本行的单字符信息。
+	CharacterMode *bool `json:"character_mode,omitempty"`
+
+	// 语种选择,可选值可参考表1中英文列。未传入该参数时默认为中英文识别模式。 **表1* 语种选择说明 | 英文 |     中文     | | :--: | :----------: | | auto | 自动语种分类 | |  ms  |    马来语    | |  uk  |   乌克兰语   | |  hi  |    印地语    | |  ru  |     俄语     | |  vi  |    越南语    | |  id  |    印尼语    | |  th  |     泰语     | |  zh  |    中英文    | |  ar  |   阿拉伯语   | |  de  |     德语     | |  la  |    拉丁语    | |  fr  |     法语     | |  it  |   意大利语   | |  es  |   西班牙语   | |  pt  |   葡萄牙语   | |  ro  |  罗马尼亚语  | |  pl  |    波兰语    | |  am  |  阿姆哈拉语  | |  ja  |     日语     | |  ko  |     韩语     | |  tr  |   土耳其语   | |  no  |   挪威语     | |  da  |   丹麦语     | |  sv  |   瑞典语     | |  km  |   柬埔寨语   | |  he  |   希伯来语   |
+	Language *string `json:"language,omitempty"`
+
+	// 单朝向模式开关。可选值包括: - true:打开单朝向模式 - false:关闭单朝向模式  未传入该参数时默认为false,即默认图片中的字段为多朝向。
+	SingleOrientationMode *bool `json:"single_orientation_mode,omitempty"`
+}
+
+func (o GeneralTextRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "GeneralTextRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"GeneralTextRequestBody", string(data)}, " ")
+}

+ 29 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_text_result.go

@@ -0,0 +1,29 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// GeneralTextResult
+type GeneralTextResult struct {
+
+	// 图片朝向,仅当detect_direction为true时,该字段有效。返回图片逆时针旋转角度,值区间为[0, 359],保留四位小数。 当detect_direction为false时,该字段值为 -1。
+	Direction float32 `json:"direction"`
+
+	// 识别文字块数目。
+	WordsBlockCount int32 `json:"words_block_count"`
+
+	// 识别文字块列表,输出顺序从左到右,先上后下。
+	WordsBlockList []GeneralTextWordsBlockList `json:"words_block_list"`
+}
+
+func (o GeneralTextResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "GeneralTextResult struct{}"
+	}
+
+	return strings.Join([]string{"GeneralTextResult", string(data)}, " ")
+}

+ 32 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_general_text_words_block_list.go

@@ -0,0 +1,32 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// GeneralTextWordsBlockList 识别文字块列表,输出顺序从左到右,先上后下。
+type GeneralTextWordsBlockList struct {
+
+	// 文字块识别结果。
+	Words string `json:"words"`
+
+	// 文字块的区域位置信息,列表形式,包含文字区域四个顶点的二维坐标(x,y);坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	Location [][]int32 `json:"location"`
+
+	// 文字块识别结果的置信度。
+	Confidence float32 `json:"confidence"`
+
+	// 文字块对应的单字符识别列表,输出顺序从左到右,先上后下。
+	CharList []GeneralTextCharList `json:"char_list"`
+}
+
+func (o GeneralTextWordsBlockList) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "GeneralTextWordsBlockList struct{}"
+	}
+
+	return strings.Join([]string{"GeneralTextWordsBlockList", string(data)}, " ")
+}

+ 35 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_handwriting_request_body.go

@@ -0,0 +1,35 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// HandwritingRequestBody
+type HandwritingRequestBody struct {
+
+	// 与url二选一  图像数据,base64编码,要求base64编码后大小不超过10MB。图片最小边不小于8px,最长边不超过8192px,支持JPEG、JPG、PNG、BMP、TIFF格式。  图片文件Base64编码字符串,点击[这里](https://support.huaweicloud.com/ocr_faq/ocr_01_0032.html)查看详细获取方式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 快速模式开关,针对单行文字图片(要求图片只包含一行文字,且文字区域占比超过50%),打开时可以更快返回识别内容。可选值包括: - true:打开快速模式; - false:关闭快速模式。  > 说明: - 未传入该参数时默认为false,即关闭快速模式
+	QuickMode *bool `json:"quick_mode,omitempty"`
+
+	// 字符集设置,用户可以根据实际需要限定输出字符集范围。可选值如下所示。  - \"digit\": 数字模式;  - \"letter\": 大小写字母模式;  - \"digit_letter\": 数字+字母模式;  - \"general\": 数字+字母+中文模式;  > 说明: - 未传入该参数时,默认为“general”模式。
+	CharSet *string `json:"char_set,omitempty"`
+
+	// 校正图片的倾斜角度开关,可选值如下所示。 - true:校正图片的倾斜角度; - false:不校正图片的倾斜角度。  > 说明: - 支持任意角度的校正,未传入该参数时默认为“false”。
+	DetectDirection *bool `json:"detect_direction,omitempty"`
+}
+
+func (o HandwritingRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "HandwritingRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"HandwritingRequestBody", string(data)}, " ")
+}

+ 26 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_handwriting_result.go

@@ -0,0 +1,26 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// HandwritingResult
+type HandwritingResult struct {
+
+	// 代表检测识别出来的文字块数目。 \"segment_digit\" 和\"segment\"默认为1。
+	WordsBlockCount int32 `json:"words_block_count"`
+
+	// 识别文字块列表,输出顺序从左到右,从上到下。
+	WordsBlockList []HandwritingWordsBlockList `json:"words_block_list"`
+}
+
+func (o HandwritingResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "HandwritingResult struct{}"
+	}
+
+	return strings.Join([]string{"HandwritingResult", string(data)}, " ")
+}

+ 32 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_handwriting_words_block_list.go

@@ -0,0 +1,32 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// HandwritingWordsBlockList
+type HandwritingWordsBlockList struct {
+
+	// 文字块识别结果。
+	Words *string `json:"words,omitempty"`
+
+	// 说明该识别结果所属类型,例如:handwriting。
+	Type *string `json:"type,omitempty"`
+
+	// 文字块words的置信度。
+	Confidence *float32 `json:"confidence,omitempty"`
+
+	// 文字块words的区域位置信息,列表形式,分别表示文字块顶点的x, y坐标;坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	Location *[][]int32 `json:"location,omitempty"`
+}
+
+func (o HandwritingWordsBlockList) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "HandwritingWordsBlockList struct{}"
+	}
+
+	return strings.Join([]string{"HandwritingWordsBlockList", string(data)}, " ")
+}

+ 29 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_health_code_request_body.go

@@ -0,0 +1,29 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// HealthCodeRequestBody
+type HealthCodeRequestBody struct {
+
+	// 图像数据,base64编码,图片尺寸不小于15×15像素,最长边不超过8192像素,支持JPG/PNG/BMP/TIFF格式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一 图片的URL路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 校正图片的倾斜角度开关,可选值如下所示: - true:校正图片的倾斜角度 - false:不校正图片的倾斜角度  支持任意角度的校正,未传入该参数时默认为“false”。
+	DetectDirection *bool `json:"detect_direction,omitempty"`
+}
+
+func (o HealthCodeRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "HealthCodeRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"HealthCodeRequestBody", string(data)}, " ")
+}

+ 74 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_health_code_result.go

@@ -0,0 +1,74 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// HealthCodeResult
+type HealthCodeResult struct {
+
+	// 防疫码类别: - 健康码:health_code - 核酸检测记录:pcr_test_record - 通信行程卡:travel_card - 其他:other
+	Type string `json:"type"`
+
+	// 姓名
+	Name string `json:"name"`
+
+	// 身份证号码
+	IdcardNumber string `json:"idcard_number"`
+
+	// 手机号码
+	PhoneNumber string `json:"phone_number"`
+
+	// 省份
+	Province string `json:"province"`
+
+	// 城市
+	City string `json:"city"`
+
+	// 健康码或行程卡的更新时间
+	Time string `json:"time"`
+
+	// 健康码或行程卡颜色。 健康码颜色可选值包括:  - \"green\",绿码 - \"yellow\",黄码 - \"red\",红码 - \"gray\",灰码  行程卡颜色可选值包括:  - \"green\",绿码 - \"yellow\",黄码 - \"red\",红码
+	Color string `json:"color"`
+
+	// 疫苗接种情况,可选值包括:  - 未接种 - 接种中 - 无接种记录 - 已接种1针 - 已接种2针 - 已接种3针 - 已完成新冠疫苗接种
+	VaccinationStatus string `json:"vaccination_status"`
+
+	// 核酸检测间隔时长,可选值包括: - 24小时内 - 48小时内 - 72小时内 - 5天内 - 7天内 - 7天外
+	TestInterval string `json:"test_interval"`
+
+	// 核酸检测结果,可选值包括: - \"positive\",即阳性 - \"negative\",即阴性 - \"unknown\",未知
+	PcrTestResult string `json:"pcr_test_result"`
+
+	// 核酸检测机构
+	PcrTestOrganization string `json:"pcr_test_organization"`
+
+	// 核酸检测结果更新时间
+	PcrTestTime string `json:"pcr_test_time"`
+
+	// 核酸检测采样时间
+	PcrSamplingTime string `json:"pcr_sampling_time"`
+
+	// 行程卡的途径地址
+	ReachedCity []string `json:"reached_city"`
+
+	// 各个字段的置信度。
+	Confidence *interface{} `json:"confidence"`
+
+	// 代表检测识别出来的文字块数目。
+	WordsBlockCount int32 `json:"words_block_count"`
+
+	// 识别文字块列表,输出顺序从左到右,从上到下。
+	WordsBlockList []HealthCodeWordsBlockList `json:"words_block_list"`
+}
+
+func (o HealthCodeResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "HealthCodeResult struct{}"
+	}
+
+	return strings.Join([]string{"HealthCodeResult", string(data)}, " ")
+}

+ 29 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_health_code_words_block_list.go

@@ -0,0 +1,29 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+// HealthCodeWordsBlockList
+type HealthCodeWordsBlockList struct {
+
+	// 文字块识别结果。
+	Words *string `json:"words,omitempty"`
+
+	// 识别到的文字块的区域位置信息,列表形式,分别表示文字块4个顶点的(x,y)坐标。采用图像坐标系,图像坐标原点为图像左上角,x轴沿水平方向,y轴沿竖直方向。
+	Location *[][]int32 `json:"location,omitempty"`
+
+	// 各个字段的置信度
+	Confidence *float32 `json:"confidence,omitempty"`
+}
+
+func (o HealthCodeWordsBlockList) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "HealthCodeWordsBlockList struct{}"
+	}
+
+	return strings.Join([]string{"HealthCodeWordsBlockList", string(data)}, " ")
+}

+ 31 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_hk_id_card_request_body.go

@@ -0,0 +1,31 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type HkIdCardRequestBody struct {
+
+	// 与url二选一。图像数据,base64编码,要求base64编码后大小不超过10M。图片最小边不小于15像素,最长边不超过8192像素。支持JPG/PNG/BMP/TIFF格式。
+	Image *string `json:"image,omitempty"`
+
+	// 与image二选一。 图片的url路径,目前支持: - 公网http/https url - OBS提供的url,使用OBS数据需要进行授权。包括对服务授权、临时授权、匿名公开授权,详情参见[配置OBS访问权限](https://support.huaweicloud.com/intl/zh-cn/api-ocr/ocr_03_0132.html)。 > 说明: - 接口响应时间依赖于图片的下载时间,如果图片下载时间过长,会返回接口调用失败。 - 请保证被检测图片所在的存储服务稳定可靠,推荐使用OBS服务存储图片数据。 - url中不能存在中文字符,若存在,中文需要进行utf8编码。
+	Url *string `json:"url,omitempty"`
+
+	// 是否返回头像内容开关,可选值如下所示: - true: 返回身份证头像照片的 base64 编码 - false: 不返回身份证头像照片的 base64 编码 未传入该参数时默认为“false”,即不返回身份证头像照片的 base64 编码。
+	ReturnPortraitImage *bool `json:"return_portrait_image,omitempty"`
+
+	// 是否返回头像坐标的开关,可选值如下所示: - true: 返回身份证头像的位置坐标 - false: 不返回身份证头像的位置坐标 未传入该参数时默认为“false”,即不返回身份证的头像坐标。
+	ReturnPortraitLocation *bool `json:"return_portrait_location,omitempty"`
+}
+
+func (o HkIdCardRequestBody) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "HkIdCardRequestBody struct{}"
+	}
+
+	return strings.Join([]string{"HkIdCardRequestBody", string(data)}, " ")
+}

+ 58 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_hk_id_card_result.go

@@ -0,0 +1,58 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type HkIdCardResult struct {
+
+	// 中文姓名。
+	Name *string `json:"name,omitempty"`
+
+	// 英文姓名。
+	NameEn *string `json:"name_en,omitempty"`
+
+	// 性别。  男: value值为:M 女: value值为:F
+	Sex *string `json:"sex,omitempty"`
+
+	// 出生日期。
+	BirthDate *string `json:"birth_date,omitempty"`
+
+	// 身份证号。
+	Number *string `json:"number,omitempty"`
+
+	// 证件符号。
+	Symbols *string `json:"symbols,omitempty"`
+
+	// 中文姓名对应电码。
+	NameTelegraphCode *string `json:"name_telegraph_code,omitempty"`
+
+	// 是否永久性居民身份证。  永久:value值为true 非永久:value值为false
+	Permanent *bool `json:"permanent,omitempty"`
+
+	// 首次领用日期。
+	InitialIssueDate *string `json:"initial_issue_date,omitempty"`
+
+	// 签发日期。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 头像在原图上的位置。 当输入参数“return_portrait_location”为“true”时,才返回该参数。以列表形式显示,包含头像区域四个顶点的二维坐标(x,y),坐标原点为图片左上角,x轴沿水平方向,y轴沿竖直方向。
+	PortraitLocation *[][]int32 `json:"portrait_location,omitempty"`
+
+	// 头像的base64编码,默认返回尺寸较大的头像。 当输入参数“return_portrait_image”为true时,才返回该参数。
+	PortraitImage *string `json:"portrait_image,omitempty"`
+
+	// 各个字段的置信度。
+	Confidence *interface{} `json:"confidence,omitempty"`
+}
+
+func (o HkIdCardResult) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "HkIdCardResult struct{}"
+	}
+
+	return strings.Join([]string{"HkIdCardResult", string(data)}, " ")
+}

+ 106 - 0
vendor/github.com/huaweicloud/huaweicloud-sdk-go-v3/services/ocr/v1/model/model_household_register_content.go

@@ -0,0 +1,106 @@
+package model
+
+import (
+	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"
+
+	"strings"
+)
+
+type HouseholdRegisterContent struct {
+
+	// 姓名。
+	Name *string `json:"name,omitempty"`
+
+	// 户主或与户主关系。
+	HouseholderRelationship *string `json:"householder_relationship,omitempty"`
+
+	// 曾用名。
+	FormerName *string `json:"former_name,omitempty"`
+
+	// 性别。
+	Sex *string `json:"sex,omitempty"`
+
+	// 出生地。
+	Birthplace *string `json:"birthplace,omitempty"`
+
+	// 民族。
+	Ethnicity *string `json:"ethnicity,omitempty"`
+
+	// 籍贯。
+	OriginPlace *string `json:"origin_place,omitempty"`
+
+	// 出生日期。
+	BirthDate *string `json:"birth_date,omitempty"`
+
+	// 本市(县)其他住址。
+	OtherAddress *string `json:"other_address,omitempty"`
+
+	// 宗教信仰。
+	ReligiousBelief *string `json:"religious_belief,omitempty"`
+
+	// 公民身份证件编号。
+	IdCardNumber *string `json:"id_card_number,omitempty"`
+
+	// 身高。
+	Height *string `json:"height,omitempty"`
+
+	// 血型。
+	BloodType *string `json:"blood_type,omitempty"`
+
+	// 文化程度。
+	Education *string `json:"education,omitempty"`
+
+	// 婚姻状况。
+	MaritalStatus *string `json:"marital_status,omitempty"`
+
+	// 兵役情况。
+	MilitaryServiceStatus *string `json:"military_service_status,omitempty"`
+
+	// 服务处所。
+	WorkPlace *string `json:"work_place,omitempty"`
+
+	// 职业。
+	Occupation *string `json:"occupation,omitempty"`
+
+	// 何时由何地迁来本市(县)。
+	MigratedToCity *string `json:"migrated_to_city,omitempty"`
+
+	// 何时由何地迁来本址。
+	MigratedToAddress *string `json:"migrated_to_address,omitempty"`
+
+	// 承办人签章。
+	RegistrarSignatureSeal *string `json:"registrar_signature_seal,omitempty"`
+
+	// 登记日期。
+	RegistrationDate *string `json:"registration_date,omitempty"`
+
+	// 户别。
+	HouseholdType *string `json:"household_type,omitempty"`
+
+	// 户号。
+	HouseholdNumber *string `json:"household_number,omitempty"`
+
+	// 户主姓名。当type参数为“首页”时,返回此参数。
+	HouseholderName *string `json:"householder_name,omitempty"`
+
+	// 社区。当type参数为“首页”时,返回此参数。
+	Community *string `json:"community,omitempty"`
+
+	// 住址。当type参数为“首页”时,返回此参数。
+	Address *string `json:"address,omitempty"`
+
+	// 签发日期。当type参数为“首页”时,返回此参数。
+	IssueDate *string `json:"issue_date,omitempty"`
+
+	// 户口登记机关。当type参数为“首页”时,返回此参数。
+	PoliceStation *string `json:"police_station,omitempty"`
+}
+
+func (o HouseholdRegisterContent) String() string {
+	data, err := utils.Marshal(o)
+	if err != nil {
+		return "HouseholdRegisterContent struct{}"
+	}
+
+	return strings.Join([]string{"HouseholdRegisterContent", string(data)}, " ")
+}

部分文件因为文件数量过多而无法显示