Commit b7a29a4b authored by Edric Li's avatar Edric Li
Browse files

fix: update mock interfaces and fix gofmt issues for CI

- Update mockGatewayCacheForPlatform and mockGatewayCacheForGemini
  to match new GatewayCache interface with groupID parameter
- Fix gofmt formatting in group_handler.go and admin_service.go
parent a4210588
...@@ -166,14 +166,14 @@ type mockGatewayCacheForPlatform struct { ...@@ -166,14 +166,14 @@ type mockGatewayCacheForPlatform struct {
sessionBindings map[string]int64 sessionBindings map[string]int64
} }
func (m *mockGatewayCacheForPlatform) GetSessionAccountID(ctx context.Context, sessionHash string) (int64, error) { func (m *mockGatewayCacheForPlatform) GetSessionAccountID(ctx context.Context, groupID int64, sessionHash string) (int64, error) {
if id, ok := m.sessionBindings[sessionHash]; ok { if id, ok := m.sessionBindings[sessionHash]; ok {
return id, nil return id, nil
} }
return 0, errors.New("not found") return 0, errors.New("not found")
} }
func (m *mockGatewayCacheForPlatform) SetSessionAccountID(ctx context.Context, sessionHash string, accountID int64, ttl time.Duration) error { func (m *mockGatewayCacheForPlatform) SetSessionAccountID(ctx context.Context, groupID int64, sessionHash string, accountID int64, ttl time.Duration) error {
if m.sessionBindings == nil { if m.sessionBindings == nil {
m.sessionBindings = make(map[string]int64) m.sessionBindings = make(map[string]int64)
} }
...@@ -181,7 +181,7 @@ func (m *mockGatewayCacheForPlatform) SetSessionAccountID(ctx context.Context, s ...@@ -181,7 +181,7 @@ func (m *mockGatewayCacheForPlatform) SetSessionAccountID(ctx context.Context, s
return nil return nil
} }
func (m *mockGatewayCacheForPlatform) RefreshSessionTTL(ctx context.Context, sessionHash string, ttl time.Duration) error { func (m *mockGatewayCacheForPlatform) RefreshSessionTTL(ctx context.Context, groupID int64, sessionHash string, ttl time.Duration) error {
return nil return nil
} }
......
...@@ -190,14 +190,14 @@ type mockGatewayCacheForGemini struct { ...@@ -190,14 +190,14 @@ type mockGatewayCacheForGemini struct {
sessionBindings map[string]int64 sessionBindings map[string]int64
} }
func (m *mockGatewayCacheForGemini) GetSessionAccountID(ctx context.Context, sessionHash string) (int64, error) { func (m *mockGatewayCacheForGemini) GetSessionAccountID(ctx context.Context, groupID int64, sessionHash string) (int64, error) {
if id, ok := m.sessionBindings[sessionHash]; ok { if id, ok := m.sessionBindings[sessionHash]; ok {
return id, nil return id, nil
} }
return 0, errors.New("not found") return 0, errors.New("not found")
} }
func (m *mockGatewayCacheForGemini) SetSessionAccountID(ctx context.Context, sessionHash string, accountID int64, ttl time.Duration) error { func (m *mockGatewayCacheForGemini) SetSessionAccountID(ctx context.Context, groupID int64, sessionHash string, accountID int64, ttl time.Duration) error {
if m.sessionBindings == nil { if m.sessionBindings == nil {
m.sessionBindings = make(map[string]int64) m.sessionBindings = make(map[string]int64)
} }
...@@ -205,7 +205,7 @@ func (m *mockGatewayCacheForGemini) SetSessionAccountID(ctx context.Context, ses ...@@ -205,7 +205,7 @@ func (m *mockGatewayCacheForGemini) SetSessionAccountID(ctx context.Context, ses
return nil return nil
} }
func (m *mockGatewayCacheForGemini) RefreshSessionTTL(ctx context.Context, sessionHash string, ttl time.Duration) error { func (m *mockGatewayCacheForGemini) RefreshSessionTTL(ctx context.Context, groupID int64, sessionHash string, ttl time.Duration) error {
return nil return nil
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment