From a262a865a0c0561c00fb7fd4379160e618670bbd Mon Sep 17 00:00:00 2001 From: mlogclub Date: Fri, 24 Apr 2026 21:43:39 +0800 Subject: [PATCH] refactor: move WxWorkKFChannelConfig to dto package and update references --- internal/pkg/dto/dto.go | 4 ++++ internal/services/channel_service.go | 10 +++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/pkg/dto/dto.go b/internal/pkg/dto/dto.go index 39d8ac9..453ca4c 100644 --- a/internal/pkg/dto/dto.go +++ b/internal/pkg/dto/dto.go @@ -11,3 +11,7 @@ type AuthPrincipal struct { Roles []string Permissions []string } + +type WxWorkKFChannelConfig struct { + OpenKfID string `json:"openKfId"` +} diff --git a/internal/services/channel_service.go b/internal/services/channel_service.go index a88e824..dd1a89c 100644 --- a/internal/services/channel_service.go +++ b/internal/services/channel_service.go @@ -26,10 +26,6 @@ func newChannelService() *channelService { type channelService struct { } -type WxWorkKFChannelConfig struct { - OpenKfID string `json:"openKfId"` -} - func (s *channelService) Get(id int64) *models.Channel { return repositories.ChannelRepository.Get(sqls.DB(), id) } @@ -150,12 +146,12 @@ func (s *channelService) DeleteChannel(id int64, operator *dto.AuthPrincipal) er }) } -func (s *channelService) ParseWxWorkKFChannelConfig(raw string) (*WxWorkKFChannelConfig, error) { +func (s *channelService) ParseWxWorkKFChannelConfig(raw string) (*dto.WxWorkKFChannelConfig, error) { raw = strings.TrimSpace(raw) if raw == "" { - return &WxWorkKFChannelConfig{}, nil + return &dto.WxWorkKFChannelConfig{}, nil } - cfg := &WxWorkKFChannelConfig{} + cfg := &dto.WxWorkKFChannelConfig{} if err := json.Unmarshal([]byte(raw), cfg); err != nil { return nil, err }