Coder Social home page Coder Social logo

go-web's Introduction

go-web-edu

使用 gin + gorm 完成第二期课后练习,gorm 完成数据库的增删改查,viper读取配置文件

项目结构

├── common
│   └── function.go
├── config
│   └── app.yml
├── controller
│   ├── article.go
│   └── category.go
├── go.mod
├── go.sum
├── main.go
├── model
│   ├── article.go
│   ├── category.go
│   └── time.go
├── response
│   └── response.go
├── router.go
├── routers
│   ├── Article.go
│   └── category.go
├── service
│   ├── article.go
│   ├── category.go
│   └── database.go
└── vendor

  • controller: 控制器
  • model: 模型文件
  • configs: 配置文件
  • routers: 路由文件
  • response: 针对返回函数封装
  • service: 服务逻辑处理层
  • common: 通用的文件
  • vendor: 三方包

工行创新项目目录文件约定

├── common
│   └── function.go 通用的方法文件
├── config
│   └── app.yml    配置文件
├── controller
│   ├── article.go  文章控制器
│   └── category.go 分类控制器
├── go.mod
├── go.sum
├── main.go  入口文件
├── model
│   ├── article.go  文章模型
│   ├── category.go 分类模型
│   └── time.go     时间封装,处理时间格式
├── response
│   └── response.go  返回函数封装
├── router.go
├── routers
│   ├── Article.go  文章路由
│   └── category.go 分类路由
├── service
│   ├── article.go  文章操作数据库
│   ├── category.go 分类操作数据库
│   └── database.go 初始化数据库

go-web's People

Watchers

 avatar  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.