Giter Site home page Giter Site logo

znyy's Introduction

ZNYY 创新工具

使用方法

按需修改配置

更新 src/config/production.py(生产环境配置文件)或 src/config/development.py(开发环境配置文件)

# 监听 URL
HOST: str = '0.0.0.0'
# 监听 端口
PORT: int = 8001
# 日志目录
LOG_PATH = os.getcwd()
# 数据库配置
DRIVER = 'mysql'
SOURCE = 'root:root@tcp(127.0.0.1:3306)/test'

运行

# 初始化运行环境
make init
# 开发环境运行
make run-dev
# 生产环境运行
# make run

目录结构

znyy tree -L 1 
.
├── Makefile            # 运维脚本
├── README.md           # 说明文档
├── bin                 # 可执行文件目录
├── docs                # 文档
├── requirements.txt    # 依赖包版本
├── src                 # 源码
znyy tree src -L 1 
src
├── biz             # 领域层
├── config          # 配置
├── data            # DB层
├── main.py         # 入口代码(编写 API url 的入口)
├── service         # Api层
├── tests           # 测试
└── utils           # 工具

访问链路

main.py (入口函数) -> 
service (注册的API方法 / API 层,会对请求体做校验和默认值填充) -> 
biz (执行具体逻辑的方法 / 领域层) ->
data (使用 repo 执行访问外部(DB)获取 DO 对象 / DB层) ->
data (DB 层将 DO 对象转换为 领域对象 entity)->
biz (获取到 entity,可能需要再做一些操作,将 entity 返回给 API 层)->
service (将 entity 转换为 DTO 对象)->
main.py 
DTO: API 层的对象,所在目录(service/dto/)
entity:领域层对象,所在目录(biz/model/)
DO:DB 层的对象,所在目录(data/do/)
VO:第三方的对象(比如 ssh 返回的话单)

znyy's People

Watchers

James Cloos avatar Yang.Sijie avatar

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.