惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
V
Visual Studio Blog
P
Privacy International News Feed
月光博客
月光博客
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
T
Threatpost
宝玉的分享
宝玉的分享
The Last Watchdog
The Last Watchdog
小众软件
小众软件
L
LINUX DO - 最新话题
C
Cisco Blogs
T
Troy Hunt's Blog
Schneier on Security
Schneier on Security
酷 壳 – CoolShell
酷 壳 – CoolShell
www.infosecurity-magazine.com
www.infosecurity-magazine.com
雷峰网
雷峰网
G
GRAHAM CLULEY
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
罗磊的独立博客
V
V2EX
博客园 - Franky
P
Proofpoint News Feed
SecWiki News
SecWiki News
腾讯CDC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Google DeepMind News
Google DeepMind News
Attack and Defense Labs
Attack and Defense Labs
人人都是产品经理
人人都是产品经理
The Cloudflare Blog
PCI Perspectives
PCI Perspectives
V2EX - 技术
V2EX - 技术
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
aimingoo的专栏
aimingoo的专栏
Cisco Talos Blog
Cisco Talos Blog
N
News and Events Feed by Topic
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题

博客园 - 猫猫客服

cursor编辑器 ai客服 laravel12 微服务 Claude Code 接口类,需要指定入参类型,出参类型 海量数据查询,es替代方案 数据库设计 php消费者 转载,电商系统多规格 php响应 docker,2024年8月9日 使用wsl,windows自带的linux虚拟机 go 微服务 vue3 前端工具 java基础 架构 es学习 简单分表 go 指针
Goframe 学习笔记
猫猫客服 · 2026-04-26 · via 博客园 - 猫猫客服

GoframePro

https://goflys.cn/articledetail?id=378

api层->controller控制层->service服务层->logic实现层->dao数据层

一个service服务层,可以调用多个logic实现层

一个logic实现层对应1个dao层

Goframe

https://goframe.org/quick/install

type HelloReq struct {
g.Meta `path:"/" method:"get"`
Name string `v:"required" dc:"姓名"`
Age int `v:"required" dc:"年龄"`
}

结构体,添加

g.Meta `path:"/" method:"get"`

请求时,自动绑定到这个结构体

 接口层api层,返回的是“接口对象”,类似php的协议,也就是说接口层是定义规范的,具体实现不参与

image

Entity 是和数据表一一对应的数据模型,是纯粹的数据载体,只定义表的字段和类型,不包含任何业务逻辑或数据库操作。

简单对应:

  • model/entity ≈ PHP 里的 Model(表结构映射、字段标签、表名绑定)GoFrame
  • model/do ≈ 数据传输 / 转换层(业务 ↔ 数据模型)GoFrame
  • dao ≈ 简化的 DAL,封装 CRUD,内部依赖 entity/doGoFrame