pull/4/head
away 4 years ago
parent 24a44114c1
commit d01403e6fb

@ -4,16 +4,27 @@ import (
apiAuth "Open_IM/src/api/auth" apiAuth "Open_IM/src/api/auth"
apiChat "Open_IM/src/api/chat" apiChat "Open_IM/src/api/chat"
"Open_IM/src/api/friend" "Open_IM/src/api/friend"
"Open_IM/src/api/group"
apiThird "Open_IM/src/api/third" apiThird "Open_IM/src/api/third"
"Open_IM/src/api/user" "Open_IM/src/api/user"
"Open_IM/src/common/log" "Open_IM/src/common/log"
"Open_IM/src/utils" "Open_IM/src/utils"
"flag" "flag"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"os"
"strconv" "strconv"
"syscall"
) )
func main() { func main() {
logFile, err := os.OpenFile("./fatal.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0660)
if err != nil {
return
}
syscall.Dup2(int(logFile.Fd()), int(os.Stderr.Fd()))
log.Info("", "", "api server running...") log.Info("", "", "api server running...")
r := gin.Default() r := gin.Default()
r.Use(utils.CorsHandler()) r.Use(utils.CorsHandler())
@ -26,9 +37,10 @@ func main() {
//friend routing group //friend routing group
friendRouterGroup := r.Group("/friend") friendRouterGroup := r.Group("/friend")
{ {
friendRouterGroup.POST("/search_friend", friend.SearchFriend) friendRouterGroup.POST("/get_friends_info", friend.GetFriendsInfo)
friendRouterGroup.POST("/add_friend", friend.AddFriend) friendRouterGroup.POST("/add_friend", friend.AddFriend)
friendRouterGroup.POST("/get_friend_apply_list", friend.GetFriendApplyList) friendRouterGroup.POST("/get_friend_apply_list", friend.GetFriendApplyList)
friendRouterGroup.POST("/get_self_apply_list", friend.GetSelfApplyList)
friendRouterGroup.POST("/get_friend_list", friend.GetFriendList) friendRouterGroup.POST("/get_friend_list", friend.GetFriendList)
friendRouterGroup.POST("/add_blacklist", friend.AddBlacklist) friendRouterGroup.POST("/add_blacklist", friend.AddBlacklist)
friendRouterGroup.POST("/get_blacklist", friend.GetBlacklist) friendRouterGroup.POST("/get_blacklist", friend.GetBlacklist)
@ -36,20 +48,25 @@ func main() {
friendRouterGroup.POST("/delete_friend", friend.DeleteFriend) friendRouterGroup.POST("/delete_friend", friend.DeleteFriend)
friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse) friendRouterGroup.POST("/add_friend_response", friend.AddFriendResponse)
friendRouterGroup.POST("/set_friend_comment", friend.SetFriendComment) friendRouterGroup.POST("/set_friend_comment", friend.SetFriendComment)
friendRouterGroup.POST("/is_friend", friend.IsFriend)
} }
//group related routing group //group related routing group
/*groupRouterGroup := r.Group("/group") groupRouterGroup := r.Group("/group")
{ {
groupRouterGroup.POST("/create_group", group.CreateGroup) groupRouterGroup.POST("/create_group", group.CreateGroup)
groupRouterGroup.POST("/get_group_list", group.GetGroupList) groupRouterGroup.POST("/set_group_info", group.SetGroupInfo)
groupRouterGroup.POST("/get_group_info", group.GetGroupInfo) groupRouterGroup.POST("join_group", group.JoinGroup)
groupRouterGroup.POST("/delete_group_member", group.DeleteGroupMember) groupRouterGroup.POST("/quit_group", group.QuitGroup)
groupRouterGroup.POST("/set_group_name", group.SetGroupName) groupRouterGroup.POST("/group_application_response", group.ApplicationGroupResponse)
groupRouterGroup.POST("/set_group_bulletin", group.SetGroupBulletin) groupRouterGroup.POST("/transfer_group", group.TransferGroupOwner)
groupRouterGroup.POST("/set_owner_group_nickname", group.SetOwnerGroupNickname) groupRouterGroup.POST("/get_group_applicationList", group.GetGroupApplicationList)
groupRouterGroup.POST("/set_group_head_image", group.SetGroupHeadImage) groupRouterGroup.POST("/get_groups_info", group.GetGroupsInfo)
groupRouterGroup.POST("/member_exit_group", group.MemberExitGroup) groupRouterGroup.POST("/kick_group", group.KickGroupMember)
}*/ groupRouterGroup.POST("/get_group_member_list", group.GetGroupMemberList)
groupRouterGroup.POST("/get_group_members_info", group.GetGroupMembersInfo)
groupRouterGroup.POST("/invite_user_to_group", group.InviteUserToGroup)
groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList)
}
//certificate //certificate
authRouterGroup := r.Group("/auth") authRouterGroup := r.Group("/auth")
{ {

@ -56,6 +56,8 @@ func TencentCloudStorageCredential(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"errCode": config.ErrTencentCredential.ErrCode, "errCode": config.ErrTencentCredential.ErrCode,
"errMsg": err.Error(), "errMsg": err.Error(),
"bucket": "",
"region": "",
"data": res, "data": res,
}) })
return return
@ -65,6 +67,8 @@ func TencentCloudStorageCredential(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
"errCode": 0, "errCode": 0,
"errMsg": "", "errMsg": "",
"region": config.Config.Credential.Tencent.Region,
"bucket": config.Config.Credential.Tencent.Bucket,
"data": res, "data": res,
}) })
} }

Loading…
Cancel
Save