Refactor code

pull/141/head
wenxu12345 3 years ago
parent b90bb10a3f
commit da5e60a009

@ -167,6 +167,7 @@ func GetGroupAllMemberList(c *gin.Context) {
func GetJoinedGroupList(c *gin.Context) {
params := api.GetJoinedGroupListReq{}
err := c.BindJSON(&params)
if err := c.BindJSON(&params); err != nil {
log.NewError("0", "BindJSON failed ", err.Error())
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})

@ -90,7 +90,7 @@ type CreateGroupReq struct {
}
type CreateGroupResp struct {
CommResp
GroupInfo open_im_sdk.GroupInfo `jason:-`
GroupInfo open_im_sdk.GroupInfo `json:-`
Data map[string]interface{} `json:"data"`
}

@ -44,7 +44,7 @@ func initMysqlDB() {
db.Close()
dsn = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local",
config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], config.Config.Mysql.DBDatabaseName+"test1")
config.Config.Mysql.DBUserName, config.Config.Mysql.DBPassword, config.Config.Mysql.DBAddress[0], config.Config.Mysql.DBDatabaseName)
db, err = gorm.Open("mysql", dsn)
if err != nil {
log.NewError("0", "Open failed ", err.Error(), dsn)

Loading…
Cancel
Save