Giter Site home page Giter Site logo

qorproj's Introduction

1. QOR

1.1. TODO

  • bindatafs
  • 微信授权
  • 七牛存储
  • 添加 spa 机制
  • 产品列表链接丢失
  • go mod 相关 / debug 时 go mod 走 vendor 但是, go run main 走 $GOpath / 原来如此

1.2. 说明

  • 不错的学习资料

1.3. 启动

// 1. 配置 gopath
...

// 2. 初始化 go mod.
$ go mod init qorproj/

// 3. 下载依赖到 gopath.
$ go mod tidy -v

// 4. vendor 化, 方便修改错误.
$ go mod vendor

// 5. 生成 mock 数据
$ go run config/db/seeds/main.go config/db/seeds/seeds.go

// 6. vendor main.go.
$ go run -mod

1.4. 结构

  • app/ - 模块.
  • config/ - 配置
  • vendor/ - 第三方 vendor 方便调试与修改
  • main.go - 入口
  • ... 剩下模块内部原理

1.5. 概念

模块化的方式.
业务都内聚到了 app/ 下的各个模块里.

  1. Application 主程序

    1. cmdLine 启动参数输入捕获
    2. application.New
    3. application.Use(mod.New(conf))
    4. application.NewServeMux()
  2. Admin 管理

  3. 模块机制

    • DraftDB 临时 DB 比如 生成 mock 数据时.

    • resource 概念

    • menu

    • meta

    • scope

    • context

    • router

    • handler

    • action

    • controller

    • template

    • funcMap

    • assetsFS

    • Bindatafs - compile templates into binary,

    • il8n 国际化

      1. yml
      2. built-in 更内聚与模块
      3. inline 最细,最上下文
  4. docker 部署

1.6. Q 包

  • Q/qor

    • Q/qor/gulp.js 提供 admin 前端构建能力
  • Q/admin

  • Q/auth

  • Q/page_builder

  • Q/widget

1.7. 错误修复

登录 - 错误

tx.Model(context.Auth.AuthIdentityModel).Where(authInfo).Scan(&authInfo).RecordNotFound()

... 替换成

authwhere := auth_identity.AuthIdentity{Basic: authInfo}
tx.Model(context.Auth.AuthIdentityModel).Where(authwhere).Scan(&authInfo).RecordNotFound()

需要在下面代码替换.

Q/auth/providers/user_storer.go 错误 Q/auth/providers/password 错误 .../password.go 错误 .../handlers.go 错误

主导航 -> Men/Women/Kids 下列表链接错误

model/products

func DefaultPath(){
  defaultpath := "/"
  // 这里的 缺少 ColorVariations 这个值链接就会生成失败
  if len(product.ColorVariations) > 0 {
    defaultpath = "xx"
  }
  return defaultpath
}

额外资料

QOR 官网
QOR 相关 blog
go modules 初探
go modules 使用与细节 vscode go test 配置 go build/install/get

包解决知道

当有第三方包需要修改时,作者不接受 pr 。 如果作者修复了问题可以简单删除 replace 就可以了。 当修改包路径时

replace 解决 依赖包修改问题

当有第三方包需要修改时,作者不接受 pr 。 如果作者修复了问题可以简单删除 replace 就可以了。 当修改包路径时

qorproj's People

Contributors

robert7git avatar

Stargazers

 avatar

Watchers

 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.