Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

Commit 2d6b247

Browse files
committed
规范目录名称
1 parent 28ccb8d commit 2d6b247

File tree

11 files changed

+21
-21
lines changed

11 files changed

+21
-21
lines changed

comment/logger.go common/logger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: gphper
44
* @Date: 2021-11-08 20:59:00
55
*/
6-
package comment
6+
package common
77

88
import (
99
"go.uber.org/zap"

comment/redislog.go common/redislog.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: gphper
44
* @Date: 2021-11-07 13:23:38
55
*/
6-
package comment
6+
package common
77

88
import (
99
"context"

comment/ssh.go common/ssh.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: gphper
44
* @Date: 2021-11-07 10:43:45
55
*/
6-
package comment
6+
package common
77

88
import (
99
"fmt"

comment/tree.go common/tree.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: gphper
44
* @Date: 2021-09-23 21:07:01
55
*/
6-
package comment
6+
package common
77

88
import "sort"
99

comment/util.go common/util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: gphper
44
* @Date: 2021-07-04 11:58:45
55
*/
6-
package comment
6+
package common
77

88
import (
99
"crypto/md5"

comment/util_test.go common/util_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: gphper
44
* @Date: 2021-08-03 20:56:00
55
*/
6-
package comment
6+
package common
77

88
import (
99
"testing"

comment/validator.go common/validator.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @Author: gphper
44
* @Date: 2021-07-13 20:46:10
55
*/
6-
package comment
6+
package common
77

88
import (
99
"fmt"

controllers/base_controller.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package controllers
88

99
import (
1010
"errors"
11-
"goredismanager/comment"
11+
"goredismanager/common"
1212
"net/http"
1313

1414
"github.com/gin-gonic/gin"
@@ -47,7 +47,7 @@ func (Base *BaseController) AjaxReturn(c *gin.Context, code int, obj interface{}
4747

4848
func (Base *BaseController) FormBind(c *gin.Context, obj interface{}) error {
4949

50-
trans, err := comment.InitTrans("zh")
50+
trans, err := common.InitTrans("zh")
5151

5252
if err != nil {
5353
return err

controllers/index_controller.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"net/http"
1111
"strings"
1212

13-
"goredismanager/comment"
13+
"goredismanager/common"
1414
"goredismanager/global"
1515
"goredismanager/model"
1616
"goredismanager/service"
@@ -117,7 +117,7 @@ func (con *indexController) SearchKey(c *gin.Context) {
117117

118118
type ResultStruct struct {
119119
Course uint64
120-
ResultSlice []comment.Node
120+
ResultSlice []common.Node
121121
Key string
122122
}
123123

@@ -142,7 +142,7 @@ func (con *indexController) SearchKey(c *gin.Context) {
142142
return
143143
}
144144

145-
gen := comment.NewTrie()
145+
gen := common.NewTrie()
146146

147147
for _, v := range result {
148148

@@ -152,7 +152,7 @@ func (con *indexController) SearchKey(c *gin.Context) {
152152

153153
}
154154

155-
rs.ResultSlice = comment.GetOne(gen.Root.Children, "")
155+
rs.ResultSlice = common.GetOne(gen.Root.Children, "")
156156
rs.Course = course
157157
rs.Key = req.SearchKey
158158

global/default.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package global
88
import (
99
"context"
1010
"flag"
11-
"goredismanager/comment"
11+
"goredismanager/common"
1212
"goredismanager/model"
1313
"net"
1414
"path"
@@ -94,7 +94,7 @@ func init() {
9494

9595
if vv["usessh"] == 1 {
9696
sshConfig := vv["sshconfig"].(map[interface{}]interface{})
97-
cli, err := comment.GetSSHClient(sshConfig["sshusername"].(string), sshConfig["sshpassword"].(string), sshConfig["sshhost"].(string)+":"+sshConfig["sshport"].(string))
97+
cli, err := common.GetSSHClient(sshConfig["sshusername"].(string), sshConfig["sshpassword"].(string), sshConfig["sshhost"].(string)+":"+sshConfig["sshport"].(string))
9898
if nil != err {
9999
panic(err)
100100
}
@@ -105,8 +105,8 @@ func init() {
105105

106106
client := redis.NewClient(optionConfig)
107107

108-
client.AddHook(comment.RedisLog{
109-
Logger: comment.NewLogger(vv["servicename"].(string)),
108+
client.AddHook(common.RedisLog{
109+
Logger: common.NewLogger(vv["servicename"].(string)),
110110
})
111111

112112
_, err := client.Ping(context.Background()).Result()

service/service.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package service
88
import (
99
"context"
1010
"encoding/json"
11-
"goredismanager/comment"
11+
"goredismanager/common"
1212
"goredismanager/global"
1313
"goredismanager/model"
1414
"net"
@@ -30,7 +30,7 @@ func AddServiceConf(conf model.ServiceConfigReq) (err error) {
3030

3131
ctx := context.Background()
3232
if conf.UseSsh == 1 {
33-
cli, err = comment.GetSSHClient(conf.SSHConfig.SshUsername, conf.SSHConfig.SshPassword, conf.SSHConfig.SshHost+":"+conf.SSHConfig.SshPort)
33+
cli, err = common.GetSSHClient(conf.SSHConfig.SshUsername, conf.SSHConfig.SshPassword, conf.SSHConfig.SshHost+":"+conf.SSHConfig.SshPort)
3434
if nil != err {
3535
return
3636
}
@@ -41,8 +41,8 @@ func AddServiceConf(conf model.ServiceConfigReq) (err error) {
4141

4242
client := redis.NewClient(optionConfig)
4343

44-
client.AddHook(comment.RedisLog{
45-
Logger: comment.NewLogger(conf.ServiceName),
44+
client.AddHook(common.RedisLog{
45+
Logger: common.NewLogger(conf.ServiceName),
4646
})
4747

4848
_, err = client.Ping(ctx).Result()

0 commit comments

Comments
 (0)