Skip to content

Commit 1a72e38

Browse files
committed
添加说明
1 parent e198235 commit 1a72e38

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
+ http框架: 用于构建领域服务的路由框架, 基于httprouter进行封装
55
+ 异常处理: 定义API Exception
66
+ 日志处理: 封装zap, 用于日志处理
7-
+ 负责注册: 服务注册组件
7+
+ 服务注册: 服务注册组件
88
+ 缓存处理: 用于构建多级对象缓存
99
+ 加密解密: 封装cbc和ecies
1010
+ 自定义类型: ftime方便控制时间序列化的类型, set集合

http/router/router.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99

1010
// Entry 路由条目
1111
type Entry struct {
12-
Name string `json:"name,omitempty"`
12+
Domain string `json:"domain,omitempty"`
1313
Resource string `json:"resource,omitempty"`
14-
Method string `json:"method,omitempty"`
1514
Path string `json:"path,omitempty"`
15+
Method string `json:"method,omitempty"`
16+
Name string `json:"name,omitempty"`
1617
Protected bool `json:"protected"`
17-
Desc string `json:"desc,omitempty"`
1818
Labels map[string]string `json:"labels,omitempty"`
1919
}
2020

@@ -43,8 +43,8 @@ type Router interface {
4343
// SetLabel 设置路由标签, 作用于Entry上
4444
SetLabel(...*Label)
4545

46-
// 生成子路由实例
47-
SubRouter(namespace string) SubRouter
46+
// 子路由
47+
SubRouter(domainName string) SubRouter
4848
}
4949

5050
// SubRouter 子路由或者分组路由
@@ -59,4 +59,6 @@ type SubRouter interface {
5959
With(m ...Middleware) SubRouter
6060
// SetLabel 设置子路由标签, 作用于Entry上
6161
SetLabel(...*Label)
62+
// // ResourceRouter 资源路由器
63+
// ResourceRouter(resourceName string) SubRouter
6264
}

0 commit comments

Comments
 (0)