Code Monkey home page Code Monkey logo

im_api's Introduction

简介

  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"
}

im_api's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.