响应数据支持根据不同的content_type使用不同的发送方式

This commit is contained in:
2025-04-28 21:48:52 +08:00
parent 24f33309b9
commit 8a21c7eb52
4 changed files with 62 additions and 13 deletions

View File

@ -146,3 +146,10 @@ func (logic *LogicAfterResponse) AddFailureHook(f func()) {
defer logic.Lock.Unlock()
logic.FailureHookFuncList = append(logic.FailureHookFuncList, f)
}
// ResponseOption 响应的可用选项
type ResponseOption struct {
ContentType string `json:"content_type"` // 响应的contentType
Extension map[string]any `json:"extension"` // 扩展数据
XmlName string `json:"xml_name"` // 以xml文件格式响应数据时, Xml文件名(根节点)
}