Giter Club home page Giter Club logo

iris-gorm-demo's Introduction

iris-gorm-demo

与lib-ui对应的服务端代码,使用iris+gorm+mysql搭建的一个restful项目模板

12.26更新

  1. 优化代码结构
  2. jwt实现
  3. json传参
  4. md5处理
conf  配置文件
controllers  控制器 入参处理 api的入口
datasource 数据库配置 
models  结构体
db  sql数据文件 postman接口文件
repo 数据库的操作
middleware 中间件 jwt实现
route  注册路由
service 业务逻辑代码
utils  工具类
config.json 配置文件的映射
main.go 主程序入口

启动项目

1.安装依赖 go get
2.go run main.go
  1. 使用go get直接下载依赖,或在github手动下载包放到gopath/src/github.com/
  2. 导包时使用相对路径需要将项目放在你配置的GOPATH目录下
  3. 这里我没有使用go module来管理依赖,是因为下载包很容易被墙。你可以使用go mod init用go mod来管理

前端

https://github.com/pppercyWang/lib-ui

iris-gorm-demo's People

Contributors

pppercywang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

iris-gorm-demo's Issues

cannot use func literal

middleware/jwt.go:26:3: cannot use func literal (type func("github.com/kataras/iris/context".Context, string)) as type "github.com/iris-contrib/middleware/jwt".errorHandler in field value
倒腾一下午,最后还是不行

运行时报错

go: finding github.com/iris-contrib/middleware/cors latest
go: finding github.com/modern-go/concurrent latest
build _/Users/knight/repository/iris-gorm-demo/conf: cannot find module for path _/Users/knight/repository/iris-gorm-demo/conf

demo的一个小疑问

func NewBookService() BookService{
return &bookService{}
}
大佬你好,看到你使用了以上的内容,我有点不太明白这样的原理是什么。。。为什么不会报空指针?

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.