File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -21,23 +21,27 @@ func (e *Entry) AddLabel(labels ...*Label) EntryDecorator {
2121}
2222
2323// EnableAuth 启动身份验证
24- func (e * Entry ) EnableAuth () {
24+ func (e * Entry ) EnableAuth () EntryDecorator {
2525 e .AuthEnable = true
26+ return e
2627}
2728
2829// DisableAuth 不启用身份验证
29- func (e * Entry ) DisableAuth () {
30+ func (e * Entry ) DisableAuth () EntryDecorator {
3031 e .AuthEnable = false
32+ return e
3133}
3234
3335// EnablePermission 启用授权验证
34- func (e * Entry ) EnablePermission () {
36+ func (e * Entry ) EnablePermission () EntryDecorator {
3537 e .PermissionEnable = true
38+ return e
3639}
3740
3841// DisablePermission 禁用授权验证
39- func (e * Entry ) DisablePermission () {
42+ func (e * Entry ) DisablePermission () EntryDecorator {
4043 e .PermissionEnable = false
44+ return e
4145}
4246
4347// NewEntrySet 实例
Original file line number Diff line number Diff line change @@ -70,8 +70,8 @@ type SubRouter interface {
7070type EntryDecorator interface {
7171 // SetLabel 设置子路由标签, 作用于Entry上
7272 AddLabel (... * Label ) EntryDecorator
73- EnableAuth ()
74- DisableAuth ()
75- EnablePermission ()
76- DisablePermission ()
73+ EnableAuth () EntryDecorator
74+ DisableAuth () EntryDecorator
75+ EnablePermission () EntryDecorator
76+ DisablePermission () EntryDecorator
7777}
You can’t perform that action at this time.
0 commit comments