refactor: extract path logic to path.go and run go fmt on codebase
This commit is contained in:
@@ -96,17 +96,17 @@ func (b *Bark) Request(title, content string) ([]byte, error) {
|
||||
encryptData[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
jsonData, err := json.Marshal(encryptData)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
ciphertext, err := b.encryptPayload(string(jsonData))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("encryption failed: %v", err)
|
||||
}
|
||||
|
||||
|
||||
postData = map[string]interface{}{
|
||||
"ciphertext": ciphertext,
|
||||
"iv": b.IV,
|
||||
|
||||
@@ -27,7 +27,7 @@ func (v *VoceChat) Request(title, content string) ([]byte, error) {
|
||||
}
|
||||
|
||||
url := fmt.Sprintf("%s/api/bot/%s/%s", server, endpoint, v.TargetID)
|
||||
|
||||
|
||||
// Use text/plain for now as requested
|
||||
body := content
|
||||
if title != "" {
|
||||
|
||||
@@ -15,15 +15,15 @@ func (c *BarkChannel) Send(config ChannelConfig, msg *Message) (*Result, error)
|
||||
}
|
||||
|
||||
cli := message.Bark{
|
||||
PushKey: pushKey,
|
||||
Archive: config.GetString("archive"),
|
||||
Group: config.GetString("group"),
|
||||
Sound: config.GetString("sound"),
|
||||
Icon: config.GetString("icon"),
|
||||
Level: config.GetString("level"),
|
||||
URL: config.GetString("url"),
|
||||
Key: config.GetString("key"),
|
||||
IV: config.GetString("iv"),
|
||||
PushKey: pushKey,
|
||||
Archive: config.GetString("archive"),
|
||||
Group: config.GetString("group"),
|
||||
Sound: config.GetString("sound"),
|
||||
Icon: config.GetString("icon"),
|
||||
Level: config.GetString("level"),
|
||||
URL: config.GetString("url"),
|
||||
Key: config.GetString("key"),
|
||||
IV: config.GetString("iv"),
|
||||
Server: config.GetString("server"),
|
||||
Badge: config.GetString("badge"),
|
||||
Copy: config.GetString("copy"),
|
||||
|
||||
@@ -22,7 +22,7 @@ func NewBaseChannel(channelType string, supportedFormats []string) *BaseChannel
|
||||
return &BaseChannel{channelType: channelType, supportedFormats: supportedFormats}
|
||||
}
|
||||
|
||||
func (c *BaseChannel) GetType() string { return c.channelType }
|
||||
func (c *BaseChannel) GetType() string { return c.channelType }
|
||||
func (c *BaseChannel) GetSupportedFormats() []string { return c.supportedFormats }
|
||||
|
||||
// FormatContent 根据渠道支持的格式选择最佳内容
|
||||
|
||||
@@ -54,7 +54,7 @@ func (c *WxPusherChannel) Send(config ChannelConfig, msg *Message) (*Result, err
|
||||
}
|
||||
|
||||
_, formattedContent := c.FormatContent(msg)
|
||||
|
||||
|
||||
// 如果有标题,将标题和内容合并
|
||||
content := formattedContent
|
||||
if msg.Title != "" {
|
||||
|
||||
Reference in New Issue
Block a user