🚀 快速入门

安装 (Centos Docker安装,已安装Docker可跳过)

1、安装gcc相关

yum -y install gcc
yum -y install gcc-c++

2、配置镜像

yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast

3、安装docker

yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

4、启动docker

systemctl start docker
//将docker设置成开机自启动
systemctl enable docker.service
如何使用

1、导入镜像

docker pull registry.cn-hangzhou.aliyuncs.com/gewe/gewe:latest
 
 docker tag registry.cn-hangzhou.aliyuncs.com/gewe/gewe gewe

2、运行镜像容器

mkdir -p /root/temp
docker run -itd -v /root/temp:/root/temp -p 2531:2531 -p 2532:2532 --privileged=true --name=gewe gewe /usr/sbin/init

3、将容器设置成开机运行

docker update --restart=always gewe

4、API服务调用

Api服务调用地址
http://ip+":2531/v2/api"  

文件下载地址
http://ip+":2532/download"

项目架构设计

基本用法(java示例)

  • 其他语言执行restful接口可实现相同功能,支持各类语言接入。
//1、程序部署完成后先获取接口token
 JSONObject token = LoginApi.getToken();
 
 //2、token获取成功后将token值放入header即可访问api,每个api都需要校验token
 header.put("X-GEWE-TOKEN",token);
 
 /**
  *3、 获取登录二维码
  * @param appId   设备id 首次登录传空,后续登录传返回的appid
  */
 JSONObject qr = LoginApi.getQr(appid, proxy);
 
 /**
  * 4、确认登陆
  * @param appId

  * @param uuid       取码返回的uuid
  * @param captchCode 登录验证码(必须同省登录才能避免此问题,也能使账号更加稳定)
  */
  JSONObject jsonObject = LoginApi.checkQr(appId, proxyIp, uuid, captchCode);
  
  //5、第四步执行完成则表示微信已登录,执行下列类中的方法可实现不同功能
  LoginApi.class     //登录模块
  PersonalApi.class  //个人账号模块
  ContactApi.class   //联系人模块
  GroupApi.class     //微信群模块
  MessageApi.class   //消息模块
  LabelApi.class     //标签模块
  FavorApi.class     //收藏夹模块

注意事项:

  • 1、由于容器需要用到 2531和2532端口,要保证服务器这两个端口没有被占用
  • 2、容器启动后会访问腾讯服务器,因此要保证服务器能够访问外网,并且出网没有被限制,否则会导致容器无法正常启动
  • 3、使用者须搭建框架到同城市服务器或者电脑里
  • 4、服务器环境建议 4h8g环境Linux Centos7/8。
  • 5、本框架面向个人娱乐使用,请勿用于任何商用场景。企业咨询可email至:shangwu919@gmail.com

Github开源地址:https://github.com/Devo919/Gewechat