Skip to content
Terry-Ye/im 系统对应的api接口
Go
Branch: master
Clone or download
terry
Latest commit 9cc5572 Mar 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
conf 修复auth验证的bug Mar 8, 2019
controllers 更新conf信息 Dec 6, 2018
libs 修复auth验证的bug Mar 8, 2019
logic/userLogic 修复auth验证的bug Mar 8, 2019
models 更新文档 Dec 18, 2018
module 更新conf信息 Dec 6, 2018
routers 修复auth验证的bug Mar 8, 2019
tests 更新conf信息 Dec 6, 2018
README.md 更新文档 Dec 19, 2018
main.go 更新conf信息 Dec 6, 2018

README.md

简介

  1. im_api 是im中需要的一些简单接口,基于beego框架

部署

mysql执行,创建用户表

CREATE TABLE `tb_user` (
  `id` varchar(32) NOT NULL,
  `user_name` varchar(16) NOT NULL,
  `password` varchar(32) NOT NULL,
  `create_time` int(10) NOT NULL,
  `update_time` int(10) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT;

部署项目

cd $GOPATH/src/
go get github.com/beego/bee
git clone https://github.com/Terry-Ye/im_api.git
cd im_api
mv conf/dev/database_example.conf conf/dev/database.conf // 根据自身情况修改配置

$GOPATH/bin/bee run

部署注意事项

  1. 部署服务器注意防火墙是否开放对应的端口(本地不需要,具体需要的端口在各层的配置文件)

api 文档

注册接口

{
    "UserName":"terry4444",
    "Password":"terry4444"
}
  • 返回数据格式(示例)
{
    "code":0,
    "msg":"success"
}

登录接口

{
    "UserName":"terry4444",
    "Password":"terry4444"
}
  • 返回数据格式(示例)
{
    "code":0,
    "msg":"success"
}

检查auth接口

{
    "Auth":"8e11412585c38a7d"
}
  • 返回数据格式(示例)
{
  "code": 0,
  "msg": "请求成功",
  "data": {
    "Auth": "5fee48a98f1c78f5",
    "UserId": "863440c38d717354",
    "UserName": "terry4444"
  }
}

更新在线人数(由ws推送)

{
    "code":0,
    "msg":"success"
}
You can’t perform that action at this time.