|
@@ -1,14 +1,11 @@
|
|
|
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/flipped-aurora/gin-vue-admin/server/model/autocode"
|
|
|
- "github.com/flipped-aurora/gin-vue-admin/server/service"
|
|
|
- "github.com/xuri/excelize/v2"
|
|
|
- "strings"
|
|
|
+ "github.com/silenceper/wechat/v2/officialaccount/menu"
|
|
|
+ "go.uber.org/zap"
|
|
|
"testing"
|
|
|
)
|
|
|
|
|
@@ -18,9 +15,18 @@ func TestName(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
- global.GVA_VP = core.Viper()
|
|
|
- global.GVA_LOG = core.Zap()
|
|
|
- global.GVA_DB = initialize.Gorm()
|
|
|
+ global.GVA_VP = core.Viper()
|
|
|
+ global.GVA_LOG = core.Zap()
|
|
|
+
|
|
|
+
|
|
|
+ initialize.Wechat()
|
|
|
+
|
|
|
+
|
|
|
+ var menuAA []*menu.Button
|
|
|
+ menuAA = append(menuAA, &menu.Button{Type: "miniprogram", Name: "小程序", URL: "http://zk1006.cn", AppID: "wx0dc3e4978f919285", 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))
|
|
|
|
|
|
|
|
|
|
|
@@ -52,19 +58,19 @@ func TestName(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
- 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()
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|