Skip to content

Commit

Permalink
misc: 升级到go 1.18 & 修复css 定位问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hezhizheng committed Jun 16, 2022
1 parent 5e7029d commit e1c14ea
Show file tree
Hide file tree
Showing 21 changed files with 444 additions and 49 deletions.
16 changes: 8 additions & 8 deletions controller/IndexController.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ func Room(c *gin.Context) {
msgList := message_service.GetLimitMsg(roomId, 0)

c.HTML(http.StatusOK, "room.html", gin.H{
"user_info": userInfo,
"msg_list": msgList,
"msg_list_count": len(msgList),
"room_id": roomId,
"user_info": userInfo,
"msg_list": msgList,
"msg_list_count": len(msgList),
"room_id": roomId,
})
}

Expand All @@ -80,7 +80,7 @@ func PrivateChat(c *gin.Context) {

uid := strconv.Itoa(int(userInfo["uid"].(uint)))

msgList := message_service.GetLimitPrivateMsg(uid, toUid,0)
msgList := message_service.GetLimitPrivateMsg(uid, toUid, 0)

c.HTML(http.StatusOK, "private_chat.html", gin.H{
"user_info": userInfo,
Expand Down Expand Up @@ -111,13 +111,13 @@ func Pagination(c *gin.Context) {
}

msgList := []map[string]interface{}{}
if toUid != ""{
if toUid != "" {
userInfo := user_service.GetUserInfo(c)

uid := strconv.Itoa(int(userInfo["uid"].(uint)))

msgList = message_service.GetLimitPrivateMsg(uid, toUid,offsetInt)
}else{
msgList = message_service.GetLimitPrivateMsg(uid, toUid, offsetInt)
} else {
msgList = message_service.GetLimitMsg(roomId, offsetInt)
}

Expand Down
77 changes: 51 additions & 26 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,41 +1,66 @@
module go-gin-chat

go 1.16
go 1.18

require (
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gin-contrib/sessions v0.0.3
github.com/gin-gonic/gin v1.6.3
github.com/go-playground/validator/v10 v10.3.0 // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/gorilla/websocket v1.4.2
github.com/gin-contrib/sessions v0.0.5
github.com/gin-gonic/gin v1.8.1
github.com/gorilla/websocket v1.5.0
github.com/spf13/viper v1.12.0
github.com/valyala/fasthttp v1.37.0
gorm.io/driver/mysql v1.3.4
gorm.io/gorm v1.23.6
)

require (
github.com/andybalholm/brotli v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.11.0 // indirect
github.com/go-sql-driver/mysql v1.6.0 // indirect
github.com/goccy/go-json v0.9.7 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/gorilla/context v1.1.1 // indirect
github.com/gorilla/securecookie v1.1.1 // indirect
github.com/gorilla/sessions v1.2.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/howeyc/fsnotify v0.9.0 // indirect
github.com/jessevdk/go-assets v0.0.0-20160921144138-4f4301a06e15 // indirect
github.com/jessevdk/go-assets-builder v0.0.0-20130903091706-b8483521738f // indirect
github.com/jessevdk/go-flags v1.4.0 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/klauspost/compress v1.11.0 // indirect
github.com/magiconair/properties v1.8.4 // indirect
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.6 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/mitchellh/gox v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/pilu/config v0.0.0-20131214182432-3eb99e6c0b9a // indirect
github.com/pilu/fresh v0.0.0-20190826141211-0fa698148017 // indirect
github.com/spf13/afero v1.4.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.1
github.com/ugorji/go v1.1.8 // indirect
github.com/valyala/fasthttp v1.16.0
golang.org/x/sys v0.0.0-20200926100807-9d91bd62050c // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/ini.v1 v1.61.0 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
gorm.io/driver/mysql v1.0.1
gorm.io/driver/sqlite v1.1.3 // indirect
gorm.io/gorm v1.20.1
github.com/subosito/gotenv v1.4.0 // indirect
github.com/ugorji/go v1.2.7 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/net v0.0.0-20220615171555-694bf12d69de // indirect
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gorm.io/driver/sqlite v1.1.4 // indirect
)
Loading

0 comments on commit e1c14ea

Please sign in to comment.