Skip to content

Commit f4888c4

Browse files
lint
1 parent 480de46 commit f4888c4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

services/webhook/feishu.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type (
2626
FeishuPayload struct {
2727
Timestamp int64 `json:"timestamp,omitempty"` // Unix timestamp for signature verification
2828
Sign string `json:"sign,omitempty"` // Signature for verification
29-
MsgType string `json:"msg_type"` // text / post / image / share_chat / interactive / file /audio / media
29+
MsgType string `json:"msg_type"` // text / post / image / share_chat / interactive / file /audio / media
3030
Content struct {
3131
Text string `json:"text"`
3232
} `json:"content"`
@@ -204,44 +204,44 @@ func GenSign(secret string, timestamp int64) (string, error) {
204204

205205
func newFeishuRequest(_ context.Context, w *webhook_model.Webhook, t *webhook_model.HookTask) (*http.Request, []byte, error) {
206206
var pc payloadConvertor[FeishuPayload] = feishuConvertor{}
207-
207+
208208
// Get the payload first
209209
payload, err := newPayload(pc, []byte(t.PayloadContent), t.EventType)
210210
if err != nil {
211211
return nil, nil, err
212212
}
213-
213+
214214
// Add timestamp and signature if secret is provided
215215
if w.Secret != "" {
216216
timestamp := time.Now().Unix()
217217
payload.Timestamp = timestamp
218-
218+
219219
// Generate signature
220220
sign, err := GenSign(w.Secret, timestamp)
221221
if err != nil {
222222
return nil, nil, err
223223
}
224224
payload.Sign = sign
225225
}
226-
226+
227227
// Marshal the payload
228228
body, err := json.MarshalIndent(payload, "", " ")
229229
if err != nil {
230230
return nil, nil, err
231231
}
232-
232+
233233
// Create the request
234234
method := w.HTTPMethod
235235
if method == "" {
236236
method = http.MethodPost
237237
}
238-
238+
239239
req, err := http.NewRequest(method, w.URL, bytes.NewReader(body))
240240
if err != nil {
241241
return nil, nil, err
242242
}
243243
req.Header.Set("Content-Type", "application/json")
244-
244+
245245
// Add default headers
246246
return req, body, addDefaultHeaders(req, []byte(w.Secret), w, t, body)
247247
}

0 commit comments

Comments
 (0)