• 请不要在回答技术问题时复制粘贴 AI 生成的内容
DoctorCat
V2EX  ›  程序员

求问:有没有开源的基于 Python 或 Go 的 CRUD 代码生成工具?

  •  
  •   DoctorCat · Oct 11, 2020 · 5512 views
    This topic created in 2216 days ago, the information mentioned may be changed or developed.

    意图:想快速的实现基本的系统功能,基本上针对几个对象 CRUD 操作,需要生成 Rest 接口。

    大家伙儿有没有推荐的类似工具呀?

    20 replies  •  2020-10-12 13:50:58 +08:00
    zachlhb
    zachlhb
    Oct 11, 2020 via Android
    1
    写好基类继承一下就好了啊
    ynkkdev
    ynkkdev
    Oct 11, 2020
    2
    DRF 的话,只要数据库建好模,几乎两三行代码就可以 CURD 的接口了
    DoctorCat
    DoctorCat
    OP
    Oct 11, 2020
    3
    @zachlhb 兄弟,请审题哇。
    DoctorCat
    DoctorCat
    OP
    Oct 11, 2020
    4
    @youngce 不想自己写那么多 code
    renmu123
    renmu123
    Oct 11, 2020 via Android
    5
    每个框架的语法都不一样,建议自己去 github 找找,大概率有人造过轮子
    zhoudian64
    zhoudian64
    Oct 12, 2020
    6
    可以看看我们的项目 https://github.com/SHUReeducation/autoAPI
    DoctorCat
    DoctorCat
    OP
    Oct 12, 2020
    7
    @zhoudian64 文档加个生成后的 API 路由的例子就好了…
    di94sh
    di94sh
    Oct 12, 2020 via iPhone
    8
    pydantic orm
    fy
    fy
    Oct 12, 2020 via Android
    9
    https://github.com/fy0/slim

    已经稳定用了很久。最近会对各种历史遗留问题做一个彻底改动。当前版本主要是反映设计理念
    gowk
    gowk
    Oct 12, 2020 via Android
    10
    Go 的话试试 ent ?
    err1y
    err1y
    Oct 12, 2020 via iPhone
    11
    apijson
    zachlhb
    zachlhb
    Oct 12, 2020 via Android
    12
    @DoctorCat 我知道,Python 代码已经够简单了,一个接口写不了几行代码,还要生成器么?
    anaf
    anaf
    Oct 12, 2020
    13
    django-admin flask-admin 这类不是嘛?
    janxin
    janxin
    Oct 12, 2020
    15
    上面 python 的挺多的,提一个 Go 的吧,指定数据库,直接生成对应的 Restful 程序

    https://github.com/smallnest/gen
    vicalloy
    vicalloy
    Oct 12, 2020
    17
    代码生成器无非是从 model 类读取模型信息,然后根据模板把代码生成出来。
    文件名称、文件类容都可以用模板生成。
    我的一个 Django 项目有代码生成器(使用 jinja2 处理模板),可以参考一下。
    https://github.com/vicalloy/django-lb-workflow/blob/master/lbworkflow/flowgen/__init__.py
    Hanggi
    Hanggi
    Oct 12, 2020
    18
    正好问下,Golang 有没有好用的自定义模板代码生成工具?
    securityCoding
    securityCoding
    Oct 12, 2020
    19
    OpenAPI?
    zunceng
    zunceng
    Oct 12, 2020
    20
    go-swagger ?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1878 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 45ms · UTC 16:36 · PVG 00:36 · LAX 08:36 · JFK 11:36
    ♥ Do have faith in what you're doing.