mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-24 10:22:36 +08:00
Refactor code
This commit is contained in:
parent
b90bb10a3f
commit
da5e60a009
@ -167,6 +167,7 @@ func GetGroupAllMemberList(c *gin.Context) {
|
|||||||
|
|
||||||
func GetJoinedGroupList(c *gin.Context) {
|
func GetJoinedGroupList(c *gin.Context) {
|
||||||
params := api.GetJoinedGroupListReq{}
|
params := api.GetJoinedGroupListReq{}
|
||||||
|
err := c.BindJSON(¶ms)
|
||||||
if err := c.BindJSON(¶ms); err != nil {
|
if err := c.BindJSON(¶ms); err != nil {
|
||||||
log.NewError("0", "BindJSON failed ", err.Error())
|
log.NewError("0", "BindJSON failed ", err.Error())
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
|
||||||
|
@ -90,7 +90,7 @@ type CreateGroupReq struct {
|
|||||||
}
|
}
|
||||||
type CreateGroupResp struct {
|
type CreateGroupResp struct {
|
||||||
CommResp
|
CommResp
|
||||||
GroupInfo open_im_sdk.GroupInfo `jason:-`
|
GroupInfo open_im_sdk.GroupInfo `json:-`
|
||||||
Data map[string]interface{} `json:"data"`
|
Data map[string]interface{} `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ func initMysqlDB() {
|
|||||||
db.Close()
|
db.Close()
|
||||||
|
|
||||||
dsn = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=true&loc=Local",
|
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)
|
db, err = gorm.Open("mysql", dsn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError("0", "Open failed ", err.Error(), dsn)
|
log.NewError("0", "Open failed ", err.Error(), dsn)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user