package mtwmapi

import (
	"fmt"
	"git.rosy.net.cn/baseapi/utils"
	"git.rosy.net.cn/jx-callback/globals"
	"io/ioutil"
	"net/http"
	"sort"
	"strings"
	"testing"
)

func TestCommentQuery(t *testing.T) {
	result, err := api.CommentQuery("7070710", "20250820", "20250824", 0, 20, CommentReplyStatusAll)
	if err != nil {
		t.Fatal(err)
	}
	for _, mtwmComment := range result {
		foodNameList := make(map[string]int, 0)
		skuIdMap := make(map[string]int, 0)
		for _, fn := range mtwmComment.PraiseRetailList {
			skuIdMap[fn.SkuId] = 1
			foodNameList[fn.Name] = 1
		}
		for _, fn := range mtwmComment.CriticRetailList {
			skuIdMap[fn.SkuId] = 1
			foodNameList[fn.Name] = 1
		}

		for _, fn := range mtwmComment.CommentOrderDetail {
			if len(fn.FoodName)-strings.LastIndex(fn.FoodName, "）") > 3 {
				foodNameList[strings.TrimSpace(fn.FoodName)] = 1
			} else {
				foodNameList[strings.TrimSpace(fn.FoodName[0:strings.LastIndex(fn.FoodName, "（")])] = 1
			}
		}
		nameList := make([]string, 0, 0)
		skuIdList := make([]int, 0, 0)
		for k, _ := range foodNameList {
			nameList = append(nameList, k)
		}
		for k, _ := range skuIdMap {
			skuIdList = append(skuIdList, utils.Str2Int(k))
		}

		globals.SugarLogger.Debugf("----------nameList:= %s", utils.Format4Output(nameList, false))
		globals.SugarLogger.Debugf("----------skuIdList:= %s", utils.Format4Output(skuIdList, false))
		break
	}

}

func TestCommentAddReply(t *testing.T) {
	err := api.CommentAddReply("23932637", 2947288966, "非常抱歉让您没有得到十分满意的购物体验，我们会及时与您联系进行确认并解决问题！")
	if err != nil {
		t.Fatal(err)
	}
}

func TestGetCommonList(t *testing.T) {
	var page = 1
	param := map[string]interface{}{
		"wmPoiId":   -1,
		"appType":   3,
		"pageNum":   page,
		"rate":      0,
		"reply":     -1,
		"context":   -1,
		"startDate": "2024-09-15",
		"endDate":   "2024-09-28",
		"timeType":  4,
	}
	cookie := `uuid_update=true; _lxsdk_cuid=18a8c469cebc8-0d5443d9234ef1-26021051-240000-18a8c469cebc8; uuid=19f97d5039dc40979c40.1701152326.1.0.0; device_uuid=!303ca77f-1f5c-4db9-8beb-2140b78696e2; pushToken=01YLhAxagh8b3tlBORRhDbRt9URjGhSdCG84G5-PA1w0*; WEBDFPID=29z4yy3y961959z509u92w75626y558381x7618yx56979584y00uw64-2016762763564-1701402763564QQKUMAGfd79fef3d01d5e9aadc18ccd4d0c95073707; iuuid=6150CECD00F8926053D5784EE8E108EC3F622CECA73B5042408DE46AB37C3D80; _lxsdk=6150CECD00F8926053D5784EE8E108EC3F622CECA73B5042408DE46AB37C3D80; _ga=GA1.2.2133425411.1707118186; userTicket=ABDdQinAblqsCpXDsEdtLNYrSpYSSlbRWYlhFyUm; u=893483812; n=tel1808018; lt=AgFCI__eFEzarguG6ly07rQWhiJFBEsWRgxUWRQPXLNOqeBN-U1C0hQ56pWpHL4sm50cGWeduIqVQwAAAAC4IQAAxbA-z1YAE9bBoB64Id-_ZJV3tTdf3aKBnn8v3h5o6AOWhEVtVcGjAr7ax5V84Mej; mt_c_token=AgFCI__eFEzarguG6ly07rQWhiJFBEsWRgxUWRQPXLNOqeBN-U1C0hQ56pWpHL4sm50cGWeduIqVQwAAAAC4IQAAxbA-z1YAE9bBoB64Id-_ZJV3tTdf3aKBnn8v3h5o6AOWhEVtVcGjAr7ax5V84Mej; e_u_id_3299326472=cbee20e50a13edae555928828ac9a4e7; wpush_server_url=wss://wpush.meituan.com; acctId=153777781; token=0cSZGM67D09VO9ClvtADEzCIjLMOw2CGn_4MQWm9ibzw*; brandId=-1; isOfflineSelfOpen=0; city_id=0; isChain=1; existBrandPoi=true; ignore_set_router_proxy=true; region_id=; region_version=0; newCategory=true; bsid=lSg67HMA65ECvqW64OXHytqqEUUkaE6e76uMEsQN9bOYypnyCk2wZ93YcmUMSjlmGGWTfxunJwrlD5b8rb-_Bw; grayPath=newRoot; cityId=510100; provinceId=510000; city_location_id=0; location_id=0; _gw_ab_call_29945_47=TRUE; _gw_ab_29945_47=406; gatherPoi=; cacheTimeMark=2024-09-29; pharmacistAccount=0; igateApp=shangouepc; timeout=2000; accessToken=lSg67HMA65ECvqW64OXHytqqEUUkaE6e76uMEsQN9bOYypnyCk2wZ93YcmUMSjlmGGWTfxunJwrlD5b8rb-_Bw; wmPoiId=18008153; wmPoiName=%E5%A5%BD%E8%8F%9C%E9%B2%9C%E7%94%9F%EF%BC%88%E5%96%9C%E6%A0%91%E8%A1%97%E5%BA%97%EF%BC%89; shopCategory=market; signToken="SfXluRoKbUIYhAXOZ2lnREldOl/FiRC3BtxdSIs+H9OcKSp1VxIsjQtBtvzXNQYGWy55xTwVPGJ+M2A9HrPc8MF1j/qPAlXFaZD+UF2LZx1+CnovGmmvhvhu9HOcA7Unzzn38KlXCkH15kR/0Upt5g=="; logistics_support=1; logan_session_token=jsn5bb361mrf4xk4rsm3; set_info=%7B%22wmPoiId%22%3A18008153%2C%22ignoreSetRouterProxy%22%3Atrue%7D; _lxsdk_s=1923ba14185-065-195-8b5%7C%7C488`

	for {
		param["pageNum"] = page
		result, err := api.GetComment4ShanGou(param, true, cookie)
		if err != nil {
			fmt.Println(err)
			return
		}
		globals.SugarLogger.Debugf("-------------len := %d", len(result))
		for _, mtwmComment := range result {
			// 商品的名称集合
			foodNameList := make(map[string]int, 0)
			// 好评商品
			for _, fn := range mtwmComment.PraiseFoodList {
				foodNameList[fn] = 1
			}
			// 差评商品
			for _, fn := range mtwmComment.CriticFoodList {
				foodNameList[fn] = 1
			}
			// 列表商品
			for _, fn := range mtwmComment.SpuCommentList {
				foodNameList[fn.SpuName] = 1
			}
			// 包含（）中文括号的商品
			for _, fn := range mtwmComment.OrderStatus.Details {
				if len(fn.FoodName)-strings.LastIndex(fn.FoodName, "）") > 3 {
					foodNameList[strings.TrimSuffix(fn.FoodName, " ")] = 1
				} else {
					foodNameList[strings.TrimSuffix(fn.FoodName[0:strings.LastIndex(fn.FoodName, "（")], " ")] = 1
				}
			}

			foodName := make([]string, 0, len(foodNameList))
			for fnl, _ := range foodNameList {
				foodName = append(foodName, fnl)
			}

			globals.SugarLogger.Debugf("vendorStoreId :%d , skuName: %s", mtwmComment.WmPoiId, strings.Join(foodName, ","))
		}

		if len(result) >= 10 {
			page += 1
		} else {
			break
		}

	}

}

func TestLen(t *testing.T) {
	aa := []string{
		"盘谷银行", "临夏县农村信用合作联社", "湖南银行", "茌平沪农商村镇银行", "农村商业银行", "山东农村信用社", "徽商银行", "大新银行", "漯河市商业银行", "赣州银行", "黄河农村商业银行", "日本住友信托银行", "河北迁安农村商业银行", "意大利联合商业银行", "葫芦岛银行", "九江银行",
		"济南长清沪农商村镇银行", "中国工商银行", "武汉众邦银行", "马来亚银行", "吉林银行", "中国农业银行", "温州民商银行", "纽约银行", "江口长征村镇银行", "长安银行", "北京顺义银座村镇银行", "遂宁银行", "韩国外换银行", "三菱东京日联银行", "邯郸银行", "建水沪农商村镇银行", "福建农村信用社",
		"宁波海曙国民村镇银行", "辽沈银行", "浙江民泰商业银行", "新韩银行", "大连银行", "北京中关村银行", "莱商银行", "广西浦北国民村镇银行", "内蒙古自治区农村信用社联合社", "华侨银行", "德意志银行", "上饶银行", "兴业银行", "哈密市商业银行", "乌鲁木齐市商业银行", "宁乡沪农商村镇银行",
		"泰安沪农商村镇银行", "深圳光明沪农商村镇银行", "农村信用合作社", "保山隆阳沪农商村镇银行", "江苏省农村信用社联合社", "建东银行", "荷兰银行", "双峰沪农商村镇银行", "广东南粤银行", "无锡锡商银行", "葡国储蓄信贷银行", "韩国国民银行", "东兴国民村镇银行", "阳谷沪农商村镇银行",
		"日照银行", "成都农商银行", "郑州银行", "石门沪农商村镇银行", "深圳南山宝生村镇银行股份有限公司", "长沙银行", "保定银行", "江西省农村信用社联合社", "烟台银行", "陕西秦农农村商业银行", "梅州客商银行", "支付机构备付金集中存管账户", "河北滦州农村商业银行", "上海浦东发展银行",
		"江西裕民银行", "沧州银行", "河北省农村信用社联合社", "浙江三门银座村镇银行", "永隆银行", "乐亭县农村信用合作联社", "德累斯顿银行", "浙江稠州商业银行", "法国里昂信贷银行", "鄞州银行", "聊城沪农商村镇银行", "山西银行", "达州银行", "广州农村商业银行", "张家口银行",
		"宁夏中宁青银村镇银行", "河北唐山曹妃甸农村商业银行", "锦州银行", "潍坊银行", "集友银行", "河北唐山农村商业银行", "福建海峡银行", "桂阳沪农商村镇银行", "山口银行", "甘肃银行", "南阳市商业银行", "临沧临翔沪农商村镇银行", "东营莱商村镇银行", "重庆渝北银座村镇银行",
		"陕西省农村信用社联合社", "四川银行", "东平沪农商村镇银行", "泰安市商业银行", "友利银行", "山西省农村信用社联合", "哈密红星国民村镇银行", "比利时富通银行", "浙江泰隆商业银行", "德富泰银行", "济宁银行", "珠海南通银行", "河北滦南农村商业银行", "浙江景宁银座村镇银行",
		"上海农商银行", "昆山农村商业银行", "鄂尔多斯银行", "新网银行", "嘉兴银行", "上海崇明沪农商村镇银行", "昆仑银行", "桂林银行", "深圳宝安桂银村镇银行", "安徽农村信用社", "德国北德意志州银行", "开封市商业银行", "光大银行", "东营银行", "深圳福田银座村镇银行", "湖南省农村信用社联合社",
		"代收付清算组织", "韩国企业银行", "乐亭舜丰村镇银行", "法国兴业银行", "太仓农村商业银行", "石嘴山银行股份有限公司", "海口联合农村商业银行", "日照沪农商村镇银行", "韩亚银行", "蒙商银行", "深圳前海微众银行", "天津金城银行", "德州银行", "招商银行", "黑龙江省农村信用社联合社", "贵阳银行",
		"常熟农村商业银行", "新疆伊犁国民村镇银行", "乌海银行", "张家港农村商业银行", "上海华瑞银行", "比利时联合银行", "广西农村信用社", "齐商银行", "玉山银行", "永丰银行（中国）有限公司", "玉田大商村镇银行", "无锡农村商业银行", "汉口银行", "醴陵沪农商村镇银行", "瑞典商业银行", "天津滨海农村商业银行",
		"辽宁振兴银行", "开远沪农商村镇银行", "新疆奎屯国民村镇银行", "南洋商业银行", "华侨永亨银行", "东莞农村商业银行", "四川农村信用社", "河南省农村信用社联合社", "贵州银行", "广发银行", "吉林九台农村商业银行", "北京房山沪农商村镇银行", "昆明官渡沪农商村镇银行", "贵阳农村商业银行", "涟源沪农商村镇银行",
		"吉林亿联银行", "重庆富民银行股份有限公司", "平安银行", "美一银行", "长城华西银行", "长春朝阳和润村镇银行", "重庆农村商业银行", "上海商业银行", "广东华兴银行", "宁波东海银行", "星展银行", "金华银行", "杭州银行", "江苏苏商银行", "丰业银行", "浙商银行", "北京银行", "福建亚洲银行", "浙江商业银行",
		"瑞士信贷第一波士顿", "首都银行及信托公司", "荷兰万贝银行", "绍兴银行", "珠海华润银行", "瑞穗实业银行", "温州银行", "中信百信银行", "兰州银行", "民生银行", "顺德农村商业银行", "法国巴黎银行", "深圳农村商业银行", "吴江农村商业银行", "中信嘉华银行", "弥勒沪农商村镇银行", "江西银行", "丹东银行股份有限公司",
		"德国商业银行", "青海银行", "齐鲁银行", "罗马银行", "城市商业银行", "内蒙古银行", "恒丰银行", "中原银行", "广西北部湾银行", "营口银行", "厦门银行", "福建华通银行股份有限公司", "三峡银行", "美国银行", "富滇银行", "衡阳县沪农商村镇银行", "海南农村信用社", "浙江农商银行", "奥地利中央合作银行", "吉林农村信用社",
		"河北银行", "东亚银行", "兰州农村商业银行", "中国进出口银行", "鞍山市商业银行", "协和银行", "华商银行", "遵化市农村信用合作联社", "巴伐利亚州银行", "创兴银行", "慈利沪农商村镇银行", "天津农商银行", "西德意志银行", "国泰君安证券", "江苏江南农村商业银行", "苏格兰皇家银行", "摩根大通银行", "临清沪农商村镇银行",
		"防城港国民村镇银行", "邢台银行", "柳州银行", "瑞士银行", "东莞银行", "重庆银行", "华夏银行", "台州银行", "唐山银行", "韩国产业银行", "乐山市商业银行", "广西钦州市钦南国民村镇银行", "宁阳沪农商村镇银行", "荷兰商业银行", "贵州省农村信用社联合社", "浙江网商银行", "曲靖市商业银行", "三井住友银行", "泰华农民银行",
		"厦门国际银行", "渣打银行", "滦州中成村镇银行", "朝兴银行", "湖北银行", "滦南中成村镇银行", "蓝海银行", "蒙自沪农商村镇银行", "泸州市商业银行", "衡水银行", "中信银行", "日联银行", "湖南三湘银行", "广东省农村信用社联合社", "遵化融和村镇银行", "城市信用合作社", "荷兰合作银行中国公司", "临商银行",
		"江西瑞金光大村镇银行", "抚顺银行", "渤海银行", "民营银行", "江苏江阴农村商业银行", "唐山市开平汇金村镇银行", "西安银行", "廊坊银行", "四川天府银行股份有限公司", "泉州银行", "海南银行股份有限公司", "迁西县农村信用合作联社", "石河子国民村镇银行", "晋商银行", "中国建设银行", "江苏银行", "河北玉田农村商业银行",
		"湖北省农村信用社联合社", "江苏民丰农村商业银行", "武汉农村商业银行", "新疆银行", "交通银行", "上海银行", "瑞丽沪农商村镇银行", "国泰世华商业银行", "恒生银行", "重庆黔江银座村镇银行", "青岛银行", "唐山市丰南舜丰村镇银行", "花旗银行", "威海市商业银行", "中国银行", "自贡市商业银行", "辽宁农村商业银行",
		"广东南海农村商业银行", "个旧沪农商村镇银行", "哈尔滨银行", "法国外贸银行", "上海-巴黎国际银行", "江苏长江银行", "澳新银行", "蒙特利尔银行", "宁波银行", "宜宾市商业银行", "云南红塔银行", "甘肃省农村信用社", "中国农业发展银行", "汇丰银行", "阜新银行", "国家开发银行", "中德住房储蓄银行", "绵阳市商业银行",
		"新联商业银行", "宁波通商银行", "安徽新安银行", "宁夏银行", "南京银行", "广州银行", "长沙星沙沪农商村镇银行", "澧县沪农商村镇银行", "苏州银行", "东方汇理银行", "村镇银行", "湖州银行", "富邦华一银行", "新疆绿洲国民村镇银行有限责任公司", "泰京银行", "商丘市商业银行", "直销银行", "龙江银行", "枣庄银行",
		"广西上林国民村镇银行", "中邮邮惠万家银行", "承德银行", "农村合作银行", "盛京银行", "临澧沪农商村镇银行", "迁安襄隆村镇银行", "天津银行", "嵩明沪农商村镇银行", "济南槐荫沪农商村镇银行", "江西赣州银座村镇银行", "成都银行", "中国邮政储蓄银行", "瑞典北欧斯安银行", "北京农村商业银行", "云南农村信用社", "大华银行", "浙江泰顺温银村镇银行", "中银香港", "亚洲商业银行", "西藏银行", "永兴沪农商村镇银行",
	}
	fmt.Println(len(aa))
	for _, v := range aa {
		sql := `INSERT INTO new_config VALUES(null,'2024-09-30 00:00:00','2024-09-30 00:00:00','liulei','1970-01-01 00:00:00','Bank'` + fmt.Sprintf(`,'%s','%s');`, v, v)
		t.Log(sql)
	}
}

//2024-09-14T10:54:11.724+0800	DEBUG	mtwmapi/comment_test.go:94	vendorStoreId :17916252 , skuName: 【剥肉】红心柚子肉.250g,【抢鲜吃】泰国椰                  子/椰肉 水果切盒-250g,【爆品】缤纷酸奶水果捞 200g
//2024-09-14T10:54:11.725+0800	DEBUG	mtwmapi/comment_test.go:94	vendorStoreId :21752676 , skuName: 【冰镇】8424西瓜半个约3斤（切块）,红毛桃                  1个
//2024-09-14T10:54:11.725+0800	DEBUG	mtwmapi/comment_test.go:94	vendorStoreId :17916252 , skuName: 【代餐轻食】混合水果捞.300g
//2024-09-14T10:54:11.725+0800	DEBUG	mtwmapi/comment_test.go:94	vendorStoreId :5943132 , skuName: 《力荐》超甜黄金百香果 《一盒4粒》表皮褶皱                    正常现象介意勿拍160克左右,【整果】金枕榴莲1个装(约3.3-4斤)《保好》,4A麻竹山竹福                                 利【质量好.不好联系返差价】500g,《冰镇嘎嘎凉》｛新北海不甜不要钱｝甜王西瓜【3斤                                     左右】大小块不定按分量走
//2024-09-14T10:54:11.725+0800	DEBUG	mtwmapi/comment_test.go:94	vendorStoreId :24330787 , skuName: 超大份低脂水果捞（800g）约1005ml【免费加                伴侣】
//2024-09-14T10:54:11.725+0800	DEBUG	mtwmapi/comment_test.go:94	vendorStoreId :5943132 , skuName: 【新上市】红油桃质量一级好【嘎嘎甜】400克                    左右
//2024-09-14T10:54:11.725+0800	DEBUG	mtwmapi/comment_test.go:94	vendorStoreId :2370192 , skuName: 草莓味酸奶水果捞485ml,【果切】赔本赚吆喝缤                  纷水果随机切200ml盒,【果切】赔本赚吆喝缤纷水果随机切200ml盒 （200毫升）,【果切】                                番茄+乌梅400ml
//2024-09-14T10:54:11.725+0800	DEBUG	mtwmapi/comment_test.go:94	vendorStoreId :21490215 , skuName: 都乐（Dole） 欢乐果园 来一碗超甜凤梨切 200                克(g),【活动爆品】麒麟西瓜切盒约400g,精品海南小台切盒400g

func TestCommonList2(t *testing.T) {
	url := "https://shangoue.meituan.com/api/support/customer/comment/r/list"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"wmPoiId\"\r\n\r\n-1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"appType\"\r\n\r\n3\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"pageNum\"\r\n\r\n1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rate\"\r\n\r\n0\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"reply\"\r\n\r\n-1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"context\"\r\n\r\n-1\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"startDate\"\r\n\r\n2024-07-29\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"endDate\"\r\n\r\n2024-07-31\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timeType\"\r\n\r\n4\r\n-----011000010111000001101001--\r\n\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Cookie", `uuid_update=true; _lxsdk_cuid=18a8c469cebc8-0d5443d9234ef1-26021051-240000-18a8c469cebc8; uuid=19f97d5039dc40979c40.1701152326.1.0.0; device_uuid=!303ca77f-1f5c-4db9-8beb-2140b78696e2; pushToken=01YLhAxagh8b3tlBORRhDbRt9URjGhSdCG84G5-PA1w0*; WEBDFPID=29z4yy3y961959z509u92w75626y558381x7618yx56979584y00uw64-2016762763564-1701402763564QQKUMAGfd79fef3d01d5e9aadc18ccd4d0c95073707; epassport_token=oekR9LsWaVAP0AUg0Z6l85HJoHP0OliCE3WcoMW3Xcluu9DZWqGb3SooLjItdc4BDgNRgeGKKLZYqAtpYp3CuQ; iuuid=6150CECD00F8926053D5784EE8E108EC3F622CECA73B5042408DE46AB37C3D80; _lxsdk=6150CECD00F8926053D5784EE8E108EC3F622CECA73B5042408DE46AB37C3D80; _ga=GA1.2.2133425411.1707118186; e_u_id_3299326472=a22cdb4f9c9a66958f72f3fe4d99aba6; isNewCome=1; userTicket=ABDdQinAblqsCpXDsEdtLNYrSpYSSlbRWYlhFyUm; u=893483812; n=tel1808018; lt=AgFCI__eFEzarguG6ly07rQWhiJFBEsWRgxUWRQPXLNOqeBN-U1C0hQ56pWpHL4sm50cGWeduIqVQwAAAAC4IQAAxbA-z1YAE9bBoB64Id-_ZJV3tTdf3aKBnn8v3h5o6AOWhEVtVcGjAr7ax5V84Mej; mt_c_token=AgFCI__eFEzarguG6ly07rQWhiJFBEsWRgxUWRQPXLNOqeBN-U1C0hQ56pWpHL4sm50cGWeduIqVQwAAAAC4IQAAxbA-z1YAE9bBoB64Id-_ZJV3tTdf3aKBnn8v3h5o6AOWhEVtVcGjAr7ax5V84Mej; wpush_server_url=wss://wpush.meituan.com; acctId=57396785; token=07_OvFPg_ZTHgLwGngAZTjwG214Gt4Yxh5HMgvCfYcas*; brandId=-1; isOfflineSelfOpen=0; city_id=0; isChain=1; existBrandPoi=true; ignore_set_router_proxy=true; region_id=; region_version=0; newCategory=true; bsid=GqPMJNy9tK3SglBZptuLYqkzKquaUJg2vmQCBLmZyMxhiHF4l44JeZRFxbW5eud8t7Ejzrsq2tHbHMnJ65_prw; grayPath=newRoot; cityId=510100; provinceId=510000; city_location_id=0; location_id=0; cacheTimeMark=2024-08-02; igateApp=shangouepc; pharmacistAccount=0; timeout=2000; accessToken=GqPMJNy9tK3SglBZptuLYqkzKquaUJg2vmQCBLmZyMxhiHF4l44JeZRFxbW5eud8t7Ejzrsq2tHbHMnJ65_prw; wmPoiName=京西菜市·新生鲜（珍珠园市场店）; shopCategory=market; logistics_support=1; _gw_ab_call_43208_4=TRUE; _gw_ab_43208_4=434; wmPoiId=-1; signToken="L5bPEb0sVnqry/aUnAJMgoY7TH3sRjc6Vh3YXkAPPT1V79wwnQZTpV+zNJc4Zp5bDrwDP07NvrMICxPIAYJW4ztXmoL/p3JuZ28PaGGJ1AkaN5ogSY2xA1K1HOTia30DEMB3DbmR+tLgmCqm3oQd6w=="; logan_session_token=y0ktraxb5ilbbvjryqzn; set_info={"wmPoiId":-1,"ignoreSetRouterProxy":true}; _lxsdk_s=191109f37ec-af3-533-8d7||38`)
	req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

func TestCommonList3(t *testing.T) {
	param := map[string]interface{}{
		"wmPoiId":   -1,
		"appType":   3,
		"pageNum":   1,
		"rate":      0,
		"reply":     -1,
		"context":   -1,
		"startDate": "2024-07-30",
		"endDate":   "2024-07-31",
		"timeType":  4,
	}
	api.AccessStoreComment2(param)
}

func TestMNMath(t *testing.T) {

	mathProbability := map[string]float64{
		"order1": 0.800,
		"order2": 0.750,
		"order3": 0.900,
		"order4": 0.981,
		"order5": 0.230,
	}

	var values []float64
	for _, v := range mathProbability {
		values = append(values, v)
	}
	sort.Slice(values, func(i, j int) bool {
		if values[i] > values[j] {
			return true
		}
		return false
	})
	for k, v := range mathProbability {
		if v == values[0] {
			fmt.Println(k)
		}
	}
}
