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

推荐订阅源

Martin Fowler
Martin Fowler
Y
Y Combinator Blog
M
MIT News - Artificial intelligence
The Cloudflare Blog
WordPress大学
WordPress大学
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 司徒正美
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
J
Java Code Geeks
云风的 BLOG
云风的 BLOG
C
Check Point Blog
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
V
V2EX
F
Fortinet All Blogs
B
Blog
大猫的无限游戏
大猫的无限游戏
N
Netflix TechBlog - Medium
B
Blog RSS Feed
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - 猫猫客服

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