Browse Source

refactor: format code

pull/7/head
konenet 4 years ago
parent
commit
fca251a0d8
  1. 4
      api/v1/file_controller.go
  2. 2
      api/v1/group_controller.go
  3. 4
      api/v1/message_controller.go
  4. 4
      api/v1/user_controller.go
  5. 2
      internal/router/router.go
  6. 2
      internal/router/socket.go
  7. 2
      internal/service/group_service.go
  8. 4
      internal/service/message_service.go
  9. 4
      internal/service/user_service.go

4
api/v1/file_controller.go

@ -35,10 +35,10 @@ func SaveFile(c *gin.Context) {
newFileName := namePreffix + suffix newFileName := namePreffix + suffix
log.Info("file", log.Any("file name", config.GetConfig().StaticPath.FilePath + newFileName)) log.Info("file", log.Any("file name", config.GetConfig().StaticPath.FilePath+newFileName))
log.Info("userUuid", log.Any("userUuid name", userUuid)) log.Info("userUuid", log.Any("userUuid name", userUuid))
c.SaveUploadedFile(file, config.GetConfig().StaticPath.FilePath + newFileName) c.SaveUploadedFile(file, config.GetConfig().StaticPath.FilePath+newFileName)
err := service.UserService.ModifyUserAvatar(newFileName, userUuid) err := service.UserService.ModifyUserAvatar(newFileName, userUuid)
if err != nil { if err != nil {
c.JSON(http.StatusOK, response.FailMsg(err.Error())) c.JSON(http.StatusOK, response.FailMsg(err.Error()))

2
api/v1/group_controller.go

@ -2,8 +2,8 @@ package v1
import ( import (
"chat-room/internal/model" "chat-room/internal/model"
"chat-room/pkg/common/response"
"chat-room/internal/service" "chat-room/internal/service"
"chat-room/pkg/common/response"
"net/http" "net/http"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"

4
api/v1/message_controller.go

@ -3,10 +3,10 @@ package v1
import ( import (
"net/http" "net/http"
"chat-room/pkg/global/log" "chat-room/internal/service"
"chat-room/pkg/common/request" "chat-room/pkg/common/request"
"chat-room/pkg/common/response" "chat-room/pkg/common/response"
"chat-room/internal/service" "chat-room/pkg/global/log"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

4
api/v1/user_controller.go

@ -3,11 +3,11 @@ package v1
import ( import (
"net/http" "net/http"
"chat-room/pkg/global/log"
"chat-room/internal/model" "chat-room/internal/model"
"chat-room/internal/service"
"chat-room/pkg/common/request" "chat-room/pkg/common/request"
"chat-room/pkg/common/response" "chat-room/pkg/common/response"
"chat-room/internal/service" "chat-room/pkg/global/log"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

2
internal/router/router.go

@ -2,8 +2,8 @@ package router
import ( import (
"chat-room/api/v1" "chat-room/api/v1"
"chat-room/pkg/global/log"
"chat-room/pkg/common/response" "chat-room/pkg/common/response"
"chat-room/pkg/global/log"
"net/http" "net/http"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"

2
internal/router/socket.go

@ -1,8 +1,8 @@
package router package router
import ( import (
"chat-room/pkg/global/log"
"chat-room/internal/server" "chat-room/internal/server"
"chat-room/pkg/global/log"
"net/http" "net/http"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"

2
internal/service/group_service.go

@ -2,8 +2,8 @@ package service
import ( import (
"chat-room/internal/dao/pool" "chat-room/internal/dao/pool"
"chat-room/pkg/errors"
"chat-room/pkg/common/response" "chat-room/pkg/common/response"
"chat-room/pkg/errors"
"chat-room/internal/model" "chat-room/internal/model"

4
internal/service/message_service.go

@ -1,11 +1,11 @@
package service package service
import ( import (
"chat-room/pkg/common/constant"
"chat-room/internal/dao/pool" "chat-room/internal/dao/pool"
"chat-room/pkg/common/constant"
"chat-room/pkg/common/response"
"chat-room/pkg/errors" "chat-room/pkg/errors"
"chat-room/pkg/global/log" "chat-room/pkg/global/log"
"chat-room/pkg/common/response"
"chat-room/pkg/protocol" "chat-room/pkg/protocol"
"chat-room/internal/model" "chat-room/internal/model"

4
internal/service/user_service.go

@ -3,12 +3,12 @@ package service
import ( import (
"time" "time"
"chat-room/internal/dao/pool"
"chat-room/internal/model"
"chat-room/pkg/common/request" "chat-room/pkg/common/request"
"chat-room/pkg/common/response" "chat-room/pkg/common/response"
"chat-room/internal/dao/pool"
"chat-room/pkg/errors" "chat-room/pkg/errors"
"chat-room/pkg/global/log" "chat-room/pkg/global/log"
"chat-room/internal/model"
"github.com/google/uuid" "github.com/google/uuid"
) )

Loading…
Cancel
Save