庄逸洲 пре 5 година
комит
8c5d9e0fdb
8 измењених фајлова са 277 додато и 0 уклоњено
  1. 107 0
      conf/app.conf
  2. 15 0
      controllers/default.go
  3. 11 0
      main.go
  4. 0 0
      models/default.go
  5. 11 0
      routers/router.go
  6. 1 0
      static/js/reload.min.js
  7. 37 0
      tests/default_test.go
  8. 95 0
      views/index.tpl

+ 107 - 0
conf/app.conf Прегледај датотеку

@@ -0,0 +1,107 @@
1
+appname = SCRM
2
+httpport = 9534
3
+runmode = dev
4
+
5
+copyrequestbody = true
6
+sessionon = true
7
+sessiongcmaxlifetime = 64800
8
+
9
+tokencookiemaxlifetime = 7200
10
+
11
+enablexsrf = false
12
+xsrfkey = 61oETzKXQAGaYdkL5gEmGeJJFuYh7EQnp2XdTP1o
13
+xsrfexpire = 3600
14
+
15
+qiniu_accesskey = -l_Pcc1YJs0gh3w0YwN2uoaZO_5fY5J9SIYnSjg0
16
+qiniu_secretkey = DmZSp_Bmnp-9aUB7xUvoyViZpzmx1Rs2RL69GvlW
17
+qiniu_domain = https://images.shengws.com/
18
+qiniu_bucket = syhclub-storage
19
+
20
+aes_key = "shengws201804238"
21
+
22
+wxtoken = gh_ac6cd0cdde3d
23
+wxoriId = gh_ac6cd0cdde3d
24
+wxappId = wxbb9223f20bc11612
25
+# wxappsecret = a78c793c377268db25dde2eb971a2ebb
26
+# wxEncodingAESKey = 1vRDzqltXYOc9iMqhsQT7AkIRRpUaGl8MZlUcP7x4UK
27
+
28
+sms_appId = dcabb3aa7afd402794046ebbbf652bce
29
+sms_sid = a26cb0ceb3a811ca82143972f4ef38a4
30
+sms_token = ea475ed8d3de6c54c2b3f9d78db76d1e
31
+sms_baseUrl = https://open.ucpaas.com/ol/sms/
32
+ip_max_send_count = 20
33
+moblie_max_send_count = 5
34
+sms_verification_code_templateid = 329532
35
+
36
+appid = "wx43ad410d9eef426e"
37
+mchid = "1509573721"
38
+key = "e4SHrkiZu0pQEwVoGBapDBTf9N1Q6MxV"
39
+appsecret="61ee2e6268497d5aa9de0b0187c39aea"
40
+
41
+[prod]
42
+httpdomain = http://api.xt.kuyicloud.com
43
+sso_domain = http://sso.kuyicloud.com
44
+front_end_domain = "http://xt.kuyicloud.com/#"
45
+
46
+readmysqlhost = shengws1.mysql.rds.aliyuncs.com
47
+readmysqlport = 3306
48
+readmysqluser = syh
49
+readmysqlpass = xhPECP2nFObR8aUK
50
+readmysqlname = sgj_xt
51
+
52
+writemysqlhost = shengws1.mysql.rds.aliyuncs.com
53
+writemysqlport = 3306
54
+writemysqluser = syh
55
+writemysqlpass = xhPECP2nFObR8aUK
56
+writemysqlname = sgj_xt
57
+
58
+readuserhost = shengws1.mysql.rds.aliyuncs.com
59
+readuserport = 3306
60
+readuseruser = syh
61
+readuserpass = xhPECP2nFObR8aUK
62
+readusername = sgj_users
63
+
64
+writeuserhost = shengws1.mysql.rds.aliyuncs.com
65
+writeuserport = 3306
66
+writeuseruser = syh
67
+writeuserpass = xhPECP2nFObR8aUK
68
+writeusername = sgj_users
69
+
70
+redishost = 349e580b2a524290.redis.rds.aliyuncs.com
71
+redisport = 6379
72
+redispasswrod = TZtBW098WId3i27clkpj3q8dnUaVFP
73
+redisdb = 0
74
+
75
+[dev]
76
+httpdomain = http://api.xt.test.sgjyun.com
77
+sso_domain = http://testsso.sgjyun.com
78
+front_end_domain = "http://xt.test.sgjyun.com/#"
79
+
80
+readmysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
81
+readmysqlport = 3306
82
+readmysqluser = root
83
+readmysqlpass = 1Q2W3e4r!@#$
84
+readmysqlname = sgj_xt
85
+
86
+writemysqlhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
87
+writemysqlport = 3306
88
+writemysqluser = root
89
+writemysqlpass = 1Q2W3e4r!@#$
90
+writemysqlname = sgj_xt
91
+
92
+readuserhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
93
+readuserport = 3306
94
+readuseruser = root
95
+readuserpass = 1Q2W3e4r!@#$
96
+readusername = sgj_users
97
+
98
+writeuserhost = rm-wz9rg531npf61q03tro.mysql.rds.aliyuncs.com
99
+writeuserport = 3306
100
+writeuseruser = root
101
+writeuserpass = 1Q2W3e4r!@#$
102
+writeusername = sgj_users
103
+
104
+redishost = 120.77.235.13
105
+redisport = 6379
106
+redispasswrod = syh@#$%123456!
107
+redisdb = 0

+ 15 - 0
controllers/default.go Прегледај датотеку

@@ -0,0 +1,15 @@
1
+package controllers
2
+
3
+import (
4
+	"github.com/astaxie/beego"
5
+)
6
+
7
+type MainController struct {
8
+	beego.Controller
9
+}
10
+
11
+func (c *MainController) Get() {
12
+	c.Data["Website"] = "beego.me"
13
+	c.Data["Email"] = "astaxie@gmail.com"
14
+	c.TplName = "index.tpl"
15
+}

+ 11 - 0
main.go Прегледај датотеку

@@ -0,0 +1,11 @@
1
+package main
2
+
3
+import (
4
+	_ "SCRM/routers"
5
+
6
+	"github.com/astaxie/beego"
7
+)
8
+
9
+func main() {
10
+	beego.Run()
11
+}

+ 0 - 0
models/default.go Прегледај датотеку


+ 11 - 0
routers/router.go Прегледај датотеку

@@ -0,0 +1,11 @@
1
+package routers
2
+
3
+import (
4
+	"SCRM/controllers"
5
+
6
+	"github.com/astaxie/beego"
7
+)
8
+
9
+func init() {
10
+	beego.Router("/", &controllers.MainController{})
11
+}

+ 1 - 0
static/js/reload.min.js Прегледај датотеку

@@ -0,0 +1 @@
1
+function b(a){var c=new WebSocket(a);c.onclose=function(){setTimeout(function(){b(a)},2E3)};c.onmessage=function(){location.reload()}}try{if(window.WebSocket)try{b("ws://localhost:12450/reload")}catch(a){console.error(a)}else console.log("Your browser does not support WebSockets.")}catch(a){console.error("Exception during connecting to Reload:",a)};

+ 37 - 0
tests/default_test.go Прегледај датотеку

@@ -0,0 +1,37 @@
1
+package test
2
+
3
+import (
4
+	_ "SCRM/routers"
5
+	"net/http"
6
+	"net/http/httptest"
7
+	"path/filepath"
8
+	"runtime"
9
+	"testing"
10
+
11
+	"github.com/astaxie/beego"
12
+	. "github.com/smartystreets/goconvey/convey"
13
+)
14
+
15
+func init() {
16
+	_, file, _, _ := runtime.Caller(1)
17
+	apppath, _ := filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
18
+	beego.TestBeegoInit(apppath)
19
+}
20
+
21
+// TestBeego is a sample to run an endpoint test
22
+func TestBeego(t *testing.T) {
23
+	r, _ := http.NewRequest("GET", "/", nil)
24
+	w := httptest.NewRecorder()
25
+	beego.BeeApp.Handlers.ServeHTTP(w, r)
26
+
27
+	beego.Trace("testing", "TestBeego", "Code[%d]\n%s", w.Code, w.Body.String())
28
+
29
+	Convey("Subject: Test Station Endpoint\n", t, func() {
30
+		Convey("Status Code Should Be 200", func() {
31
+			So(w.Code, ShouldEqual, 200)
32
+		})
33
+		Convey("The Result Should Not Be Empty", func() {
34
+			So(w.Body.Len(), ShouldBeGreaterThan, 0)
35
+		})
36
+	})
37
+}

Разлика између датотеке није приказан због своје велике величине
+ 95 - 0
views/index.tpl