package main

import (
	"fmt"
	"github.com/flipped-aurora/gin-vue-admin/server/core"
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"github.com/flipped-aurora/gin-vue-admin/server/initialize"
	"github.com/silenceper/wechat/v2/officialaccount/menu"
	"go.uber.org/zap"
	"strconv"
	"testing"
)

func TestName(t *testing.T) {
	//ssk:="4Iki42L+u5IYKcYABCDe/A=="
	//r:="K8yfw2N2JjgdoYwxSvTq39dKEYRruSftVIZHQQEAs9Kh3XRazd1wArh0kkvWKLvxySX/xLI68p973ea9f4cevYPeMENLX/6dFEyCbxv2dcZlKh8sFSi4rqDXuPf36Hayf024ek/35EylDt8n+XqqUfKv1RZePQYZuxThsQ92yba4FB4Nh2VHC7GFoIRQEkOBCq9sTqjX0IAVrUxhs0hz092+1AMZv+pptw9hjYv144/OIzmwxV97H9svAjVvqYbeWexlIocbAp7Z6+dmyHyQILpKFFgWlUE5vVZkDQAAeh+KcV//7aShZu+l7az1er3B5AOkNQ8UJX85Ux5wyCeduxbmOzGdViycrFQVa86r0cEGVFcNWmyGElUse5jzU3H+P/XMJ9AiZZ2ybvT3NrwgdBck49iulEXoWQKjczTGBIE="
	//vi:="gIEEvlb9cEjErJxZ5sflrw=="
	//phone , _ := weapp.DecryptMobile(ssk, r, vi)
	//fmt.Print(phone)
	global.GVA_VP = core.Viper() // 初始化Viper
	global.GVA_LOG = core.Zap()  // 初始化zap日志库
	//global.GVA_DB = initialize.Gorm() // gorm连接数据库
	//initialize.Redis()  //连接redis
	initialize.Wechat() //初始化微信公众服务
	//_, resysDictionaryDetail := dictionaryDetailService.GetSysDictionaryDetail(8)
	//fmt.Printf("\t%v", resysDictionaryDetail)
	var menuAA []*menu.Button
	menuAA = append(menuAA, &menu.Button{Type: "miniprogram", Name: "崇礼创城小程序", URL: "http://zk1006.cn", AppID: "wxa675b666f6f9fddb", PagePath: "/pages/checking"})
	//menuAA = append(menuAA, &menu.Button{Type: "view", Name: "小程序授权登录", URL: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx66e0fbb5a735bcc4&redirect_uri=https://cc.zjkduoduo.com/api/wechat/auth&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect"})
	err := global.GVA_WECHAT.GetMenu().SetMenu(menuAA)
	global.GVA_LOG.Info("错误", zap.Any("err", err))
	//var dictionaryDetailService = service.ServiceGroupApp.SystemServiceGroup.DictionaryDetailService
	//f,_:=excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\21类.xlsx")
	//files := f.GetSheetList()
	//s:= true
	//var ss *bool
	//ss=&s
	//j:=10
	//for _, sheet := range files {
	//	rows,_:=f.GetRows(sheet)
	//	fmt.Println(j)
	//	i:=0
	//	for _, row := range rows {
	//		if len(row)>1&& row[1]!="" {
	//			fmt.Printf("\t%v",i )
	//
	//			ditc:=system.SysDictionaryDetail{Label:strings.Replace(strings.Replace(row[1], "\n", "", -1),"◎","",-1),
	//				Value: i,Status: ss ,Sort: i,SysDictionaryID: j}
	//			dictionaryDetailService.CreateSysDictionaryDetail(ditc)
	//			fmt.Println()
	//			i++
	//		}
	//		//for index, value := range row {
	//
	//		//	fmt.Printf("\t%v", index)
	//		//
	//		//}
	//
	//	}
	//	j++
	//	fmt.Println()
	//}
	//var places = service.ServiceGroupApp.AutoCodeServiceGroup.PlaceService
	//f, _ := excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\点位信息(经开区).xlsx")
	//files := f.GetSheetList()
	//for _, sheet := range files {
	//	rows, _ := f.GetRows(sheet)
	//	for _, row := range rows {
	//		if len(row) > 1 && row[1] != "" {
	//			fmt.Printf("\t%v", row[0])
	//			places.CreatePlace(autocode.Place{Name: strings.Replace(row[0], "\n", "", -1), Position: strings.Replace(row[1], "\n", "", -1),
	//				Type: strings.Replace(row[2], "\n", "", -1), Region: strings.Replace(row[3], "\n", "", -1)})
	//			fmt.Println()
	//		}
	//	}
	//	fmt.Println()
	//}
}

func TestAaaa(t *testing.T) {
	id, _ := strconv.Atoi("37")
	fmt.Println(uint(id))
}
