command
module
Version:
v0.0.0-...-295e33c
Opens a new window with list of versions in this module.
Published: Dec 2, 2024
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Saturday
still relaxing
简介
- 使用 Golang,gin 搭建的维修队后端
- API文档
- 使用此后端服务的项目
如何运行
-
安装 Golang
, Mysql
-
安装项目依赖
在项目根目录下运行
go get
-
导入数据库
在Mysql
中新建数据库,并将assets/saturday.sql
导入
-
添加配置文件
在项目根目录下新建.env
文件,添加配置
DB_URL=<USER>:<PASSWORD>@(<ADDRESS>:<PORT>)/<DATABASE>
ACCESS_KEY_ID=<YOUR_ACCESS_KEY_ID>
ACCESS_KEY_SECRET=<YOUR_ACCESS_KEY_SECRET>
MAIL_HOST=<YOUR_MAIL_HOST>
MAIL_PORT=<YOUR_MAIL_PORT>
MAIL_USERNAME=<YOUR_MAIL_USERNAME>
MAIL_PASSWORD=<YOUR_MAIL_PASSWORD>
PORT=<PORT_TO_LISTEN>
# 以下为可选配置
NSQ_HOST=<YOUR_NSQD_HOST>:<YOUR_NSQD_TCP_PORT (4150 IN COMMON)>
NSQ_SECRET=<YOUR_NSQ_SECRET>
EVENT_TOPIC=<YOUR_NSQ_EVENT_TOPIC_NAME>
LOG_TOPIC=<YOUR_NSQ_LOG_TOPIC_NAME>
RPC_PORT=<YOUR_RPC_PORT>
-
启动服务
在项目根目录下运行
go run main.go
-
服务运行在8080
端口
测试
-
安装 Docker
-
运行测试
go test <floder>
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.