11 |
14 |
15 | {{template "menu.html" .}}
16 |
17 |
18 |
19 |
20 |
21 |
22 | -
23 |
24 | Home
25 |
26 | - Dashboard
27 |
28 |
29 |
30 |
31 |
32 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/vendor/github.com/smartystreets/assertions/internal/oglematchers/greater_than.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Aaron Jacobs. All Rights Reserved.
2 | // Author: aaronjjacobs@gmail.com (Aaron Jacobs)
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | package oglematchers
17 |
18 | import (
19 | "fmt"
20 | "reflect"
21 | )
22 |
23 | // GreaterThan returns a matcher that matches integer, floating point, or
24 | // strings values v such that v > x. Comparison is not defined between numeric
25 | // and string types, but is defined between all integer and floating point
26 | // types.
27 | //
28 | // x must itself be an integer, floating point, or string type; otherwise,
29 | // GreaterThan will panic.
30 | func GreaterThan(x interface{}) Matcher {
31 | desc := fmt.Sprintf("greater than %v", x)
32 |
33 | // Special case: make it clear that strings are strings.
34 | if reflect.TypeOf(x).Kind() == reflect.String {
35 | desc = fmt.Sprintf("greater than \"%s\"", x)
36 | }
37 |
38 | return transformDescription(Not(LessOrEqual(x)), desc)
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/toolbox/healthcheck.go:
--------------------------------------------------------------------------------
1 | // Copyright 2014 beego Author. All Rights Reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | // Package toolbox healthcheck
16 | //
17 | // type DatabaseCheck struct {
18 | // }
19 | //
20 | // func (dc *DatabaseCheck) Check() error {
21 | // if dc.isConnected() {
22 | // return nil
23 | // } else {
24 | // return errors.New("can't connect database")
25 | // }
26 | // }
27 | //
28 | // AddHealthCheck("database",&DatabaseCheck{})
29 | //
30 | // more docs: http://beego.me/docs/module/toolbox.md
31 | package toolbox
32 |
33 | // AdminCheckList holds health checker map
34 | var AdminCheckList map[string]HealthChecker
35 |
36 | // HealthChecker health checker interface
37 | type HealthChecker interface {
38 | Check() error
39 | }
40 |
41 | // AddHealthCheck add health checker with name string
42 | func AddHealthCheck(name string, hc HealthChecker) {
43 | AdminCheckList[name] = hc
44 | }
45 |
46 | func init() {
47 | AdminCheckList = make(map[string]HealthChecker)
48 | }
49 |
--------------------------------------------------------------------------------
/vendor/golang.org/x/net/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2009 The Go Authors. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
--------------------------------------------------------------------------------
/controllers/UserInfoController.go:
--------------------------------------------------------------------------------
1 | package controllers
2 |
3 | import (
4 | "github.com/astaxie/beego/logs"
5 | "github.com/astaxie/beego"
6 | "github.com/golangpkg/go-admin/models"
7 | )
8 |
9 | type UserInfoController struct {
10 | beego.Controller
11 | }
12 |
13 | //修改
14 | func (c *UserInfoController) Edit() {
15 | //获得id
16 | id, _ := c.GetInt64("Id", 0)
17 | userInfo, err := models.GetUserInfoById(id)
18 | if err == nil {
19 | c.Data["UserInfo"] = userInfo
20 | } else {
21 | tmpUserInfo := &models.UserInfo{}
22 | tmpUserInfo.Status = -1
23 | tmpUserInfo.Gender = -1
24 | c.Data["UserInfo"] = tmpUserInfo
25 | }
26 | c.TplName = "userInfo/edit.html"
27 | }
28 |
29 | //删除
30 | func (c *UserInfoController) Delete() {
31 | //获得id
32 | id, _ := c.GetInt64("Id", 0)
33 | if err := models.DeleteUserInfo(id); err == nil {
34 | c.Data["json"] = "ok"
35 | } else {
36 | c.Data["json"] = "error"
37 | }
38 | c.ServeJSON()
39 | }
40 |
41 | //保存
42 | func (c *UserInfoController) Save() {
43 | //自动解析绑定到对象中
44 | userInfo := models.UserInfo{}
45 | if err := c.ParseForm(&userInfo); err == nil {
46 | if err := models.SaveUserInfoById(&userInfo); err == nil {
47 | c.Data["json"] = ""
48 | } else {
49 | c.Data["json"] = "error"
50 | }
51 | } else {
52 | c.Data["json"] = "error"
53 | }
54 | c.ServeJSON()
55 | }
56 |
57 | //返回全部数据
58 | func (c *UserInfoController) List() {
59 |
60 | dataList, err := models.QueryAllUserInfo()
61 | if err == nil {
62 | c.Data["List"] = dataList
63 | }
64 | logs.Info("dataList :", dataList)
65 | c.TplName = "userInfo/list.html"
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/vendor/github.com/smartystreets/assertions/internal/oglematchers/greater_or_equal.go:
--------------------------------------------------------------------------------
1 | // Copyright 2011 Aaron Jacobs. All Rights Reserved.
2 | // Author: aaronjjacobs@gmail.com (Aaron Jacobs)
3 | //
4 | // Licensed under the Apache License, Version 2.0 (the "License");
5 | // you may not use this file except in compliance with the License.
6 | // You may obtain a copy of the License at
7 | //
8 | // http://www.apache.org/licenses/LICENSE-2.0
9 | //
10 | // Unless required by applicable law or agreed to in writing, software
11 | // distributed under the License is distributed on an "AS IS" BASIS,
12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | // See the License for the specific language governing permissions and
14 | // limitations under the License.
15 |
16 | package oglematchers
17 |
18 | import (
19 | "fmt"
20 | "reflect"
21 | )
22 |
23 | // GreaterOrEqual returns a matcher that matches integer, floating point, or
24 | // strings values v such that v >= x. Comparison is not defined between numeric
25 | // and string types, but is defined between all integer and floating point
26 | // types.
27 | //
28 | // x must itself be an integer, floating point, or string type; otherwise,
29 | // GreaterOrEqual will panic.
30 | func GreaterOrEqual(x interface{}) Matcher {
31 | desc := fmt.Sprintf("greater than or equal to %v", x)
32 |
33 | // Special case: make it clear that strings are strings.
34 | if reflect.TypeOf(x).Kind() == reflect.String {
35 | desc = fmt.Sprintf("greater than or equal to \"%s\"", x)
36 | }
37 |
38 | return transformDescription(Not(LessThan(x)), desc)
39 | }
40 |
--------------------------------------------------------------------------------
/vendor/github.com/astaxie/beego/logs/slack.go:
--------------------------------------------------------------------------------
1 | package logs
2 |
3 | import (
4 | "encoding/json"
5 | "fmt"
6 | "net/http"
7 | "net/url"
8 | "time"
9 | )
10 |
11 | // SLACKWriter implements beego LoggerInterface and is used to send jiaoliao webhook
12 | type SLACKWriter struct {
13 | WebhookURL string `json:"webhookurl"`
14 | Level int `json:"level"`
15 | }
16 |
17 | // newSLACKWriter create jiaoliao writer.
18 | func newSLACKWriter() Logger {
19 | return &SLACKWriter{Level: LevelTrace}
20 | }
21 |
22 | // Init SLACKWriter with json config string
23 | func (s *SLACKWriter) Init(jsonconfig string) error {
24 | return json.Unmarshal([]byte(jsonconfig), s)
25 | }
26 |
27 | // WriteMsg write message in smtp writer.
28 | // it will send an email with subject and only this message.
29 | func (s *SLACKWriter) WriteMsg(when time.Time, msg string, level int) error {
30 | if level > s.Level {
31 | return nil
32 | }
33 |
34 | text := fmt.Sprintf("{\"text\": \"%s %s\"}", when.Format("2006-01-02 15:04:05"), msg)
35 |
36 | form := url.Values{}
37 | form.Add("payload", text)
38 |
39 | resp, err := http.PostForm(s.WebhookURL, form)
40 | if err != nil {
41 | return err
42 | }
43 | defer resp.Body.Close()
44 | if resp.StatusCode != http.StatusOK {
45 | return fmt.Errorf("Post webhook failed %s %d", resp.Status, resp.StatusCode)
46 | }
47 | return nil
48 | }
49 |
50 | // Flush implementing method. empty.
51 | func (s *SLACKWriter) Flush() {
52 | }
53 |
54 | // Destroy implementing method. empty.
55 | func (s *SLACKWriter) Destroy() {
56 | }
57 |
58 | func init() {
59 | Register(AdapterSlack, newSLACKWriter)
60 | }
61 |
--------------------------------------------------------------------------------
/vendor/github.com/mattn/go-sqlite3/sqlite3_type.go:
--------------------------------------------------------------------------------
1 | package sqlite3
2 |
3 | /*
4 | #ifndef USE_LIBSQLITE3
5 | #include