saturday

command module
v0.0.0-...-827ba16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 6 Imported by: 0

README

Saturday

still relaxing

简介

  • 使用 Golang,gin 搭建的维修队后端
  • API文档
  • 使用此后端服务的项目

如何运行

  1. 安装 Golang , Mysql

  2. 安装项目依赖

    在项目根目录下运行

    go get
    
  3. 导入数据库

    Mysql中新建数据库,并将assets/saturday.sql导入

  4. 添加配置文件

    在项目根目录下新建.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>
    
  5. 启动服务 在项目根目录下运行

    go run main.go
    
  6. 服务运行在8080端口

测试

  1. 安装 Docker

  2. 运行测试

    go test <floder>
    

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
dto

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL