main_test.go 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/flipped-aurora/gin-vue-admin/server/core"
  5. "github.com/flipped-aurora/gin-vue-admin/server/global"
  6. "github.com/flipped-aurora/gin-vue-admin/server/initialize"
  7. "github.com/silenceper/wechat/v2/officialaccount/menu"
  8. "go.uber.org/zap"
  9. "strconv"
  10. "testing"
  11. )
  12. func TestName(t *testing.T) {
  13. //ssk:="4Iki42L+u5IYKcYABCDe/A=="
  14. //r:="K8yfw2N2JjgdoYwxSvTq39dKEYRruSftVIZHQQEAs9Kh3XRazd1wArh0kkvWKLvxySX/xLI68p973ea9f4cevYPeMENLX/6dFEyCbxv2dcZlKh8sFSi4rqDXuPf36Hayf024ek/35EylDt8n+XqqUfKv1RZePQYZuxThsQ92yba4FB4Nh2VHC7GFoIRQEkOBCq9sTqjX0IAVrUxhs0hz092+1AMZv+pptw9hjYv144/OIzmwxV97H9svAjVvqYbeWexlIocbAp7Z6+dmyHyQILpKFFgWlUE5vVZkDQAAeh+KcV//7aShZu+l7az1er3B5AOkNQ8UJX85Ux5wyCeduxbmOzGdViycrFQVa86r0cEGVFcNWmyGElUse5jzU3H+P/XMJ9AiZZ2ybvT3NrwgdBck49iulEXoWQKjczTGBIE="
  15. //vi:="gIEEvlb9cEjErJxZ5sflrw=="
  16. //phone , _ := weapp.DecryptMobile(ssk, r, vi)
  17. //fmt.Print(phone)
  18. global.GVA_VP = core.Viper() // 初始化Viper
  19. global.GVA_LOG = core.Zap() // 初始化zap日志库
  20. //global.GVA_DB = initialize.Gorm() // gorm连接数据库
  21. //initialize.Redis() //连接redis
  22. initialize.Wechat() //初始化微信公众服务
  23. //_, resysDictionaryDetail := dictionaryDetailService.GetSysDictionaryDetail(8)
  24. //fmt.Printf("\t%v", resysDictionaryDetail)
  25. var menuAA []*menu.Button
  26. menuAA = append(menuAA, &menu.Button{Type: "miniprogram", Name: "崇礼创城小程序", URL: "http://zk1006.cn", AppID: "wxa675b666f6f9fddb", PagePath: "/pages/checking"})
  27. //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"})
  28. err := global.GVA_WECHAT.GetMenu().SetMenu(menuAA)
  29. global.GVA_LOG.Info("错误", zap.Any("err", err))
  30. //var dictionaryDetailService = service.ServiceGroupApp.SystemServiceGroup.DictionaryDetailService
  31. //f,_:=excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\21类.xlsx")
  32. //files := f.GetSheetList()
  33. //s:= true
  34. //var ss *bool
  35. //ss=&s
  36. //j:=10
  37. //for _, sheet := range files {
  38. // rows,_:=f.GetRows(sheet)
  39. // fmt.Println(j)
  40. // i:=0
  41. // for _, row := range rows {
  42. // if len(row)>1&& row[1]!="" {
  43. // fmt.Printf("\t%v",i )
  44. //
  45. // ditc:=system.SysDictionaryDetail{Label:strings.Replace(strings.Replace(row[1], "\n", "", -1),"◎","",-1),
  46. // Value: i,Status: ss ,Sort: i,SysDictionaryID: j}
  47. // dictionaryDetailService.CreateSysDictionaryDetail(ditc)
  48. // fmt.Println()
  49. // i++
  50. // }
  51. // //for index, value := range row {
  52. //
  53. // // fmt.Printf("\t%v", index)
  54. // //
  55. // //}
  56. //
  57. // }
  58. // j++
  59. // fmt.Println()
  60. //}
  61. //var places = service.ServiceGroupApp.AutoCodeServiceGroup.PlaceService
  62. //f, _ := excelize.OpenFile("C:\\Users\\ice\\Documents\\WeChat Files\\zk1006\\FileStorage\\File\\2021-09\\点位信息(经开区).xlsx")
  63. //files := f.GetSheetList()
  64. //for _, sheet := range files {
  65. // rows, _ := f.GetRows(sheet)
  66. // for _, row := range rows {
  67. // if len(row) > 1 && row[1] != "" {
  68. // fmt.Printf("\t%v", row[0])
  69. // places.CreatePlace(autocode.Place{Name: strings.Replace(row[0], "\n", "", -1), Position: strings.Replace(row[1], "\n", "", -1),
  70. // Type: strings.Replace(row[2], "\n", "", -1), Region: strings.Replace(row[3], "\n", "", -1)})
  71. // fmt.Println()
  72. // }
  73. // }
  74. // fmt.Println()
  75. //}
  76. }
  77. func TestAaaa(t *testing.T) {
  78. id, _ := strconv.Atoi("37")
  79. fmt.Println(uint(id))
  80. }