Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
golang_framework_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d57c000f
authored
Sep 27, 2021
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
c03cd3f2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
34 deletions
README.md
README.md
View file @
d57c000f
# golang_framework_demo
功能描述:异步任务转发
该示例的项目名称为 : golang_framework_demo , 如果你要使用,请自行替换成你的项目名称
gitlab地址:
gitlab:http://119.23.72.7/sunlong_v5/golang_framework_demo
1.
clone项目
git clone http://git.ichunt.net/sunlong_v5/golang_framework_demo.git
api接口:post
url:http://192.168.1.252:8700/callback
| 参数 | 值类型 | eg | 备注
| ------ | ------ | ------ | ------ |
| callbackDomain | string | crm.liexin.net | 域名domain
| callbackUri | string| api/test5566?a=123&b=456 | uri
| requestType | string | http | 回调请求类型:目前仅支持http/hprose
| callback_func | string | xxoo |hproserpc回调的方法 |
| data | json字符串 | {"user_id":44574} | 回调请求的formdata参数
| method | string | post | http请求类型 支持大小写post/get |
| serviceType | int | 1 | 业务编号,不同业务指定不同的编号,方便与检索 |
| header | json字符串 | {"api-key":"crm a1b2c3d4e5f6g7h8i9jk"} | 回调请求header参数 |
| isHttpJson | int | 0 | http请求是否是json请求方式 1是 0否 |
| remark | string | 测试备注文字 |备注 |
返回:
```
{
"err_code": 0,
"err_msg": "",
"data": []
}
```
2.
删除.git文件夹,重新初始化git
注意:所有回调接口的返回参数必须以下面格式为主:
```
{
"err_code": 0,
"err_msg": "",
"data": []
}
```
3.
修改项目文件夹名称
1.
将 golang_framework_demo 改成 golang_framework_xxxxxxx
2.
编辑器批量修改包名 : golang_framework_demo => golang_framework_xxxxxxx
4.
修改go.mod文件(重要)
一定要修改go.mod文件,要不然无法跑起来
把go.mod的第一行 : golang_framework_demo 修改成 golang_framework_xxxxxxx
5.
修改http监听地址
config/proxy.toml.http.addr 修改成你的ip地址或者本地127.0.0.1
### .项目启动
http:
go run ./cmd/http/main.go -config=./config/dev/ -logdir=./logs/
队列
监听:
脚本
监听:
go run ./cmd/task/main.go -config=./config/dev/ -logdir=./logs/
##项目的目录结构
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment