feat: add WeChat MP channel support and enhance widget configuration
- Updated output path for generated enums to reflect new structure. - Enhanced ChannelController to handle WeChat MP OAuth authorization and callback. - Introduced WechatMPChannelConfig DTO for WeChat MP specific configurations. - Modified WidgetConfigResponse to include channel type and external source. - Added enums for WeChat MP channel type and external source. - Implemented OAuth flow for WeChat MP, including state signing and verification. - Updated frontend forms to accommodate WeChat MP configurations. - Enhanced API interactions to support WeChat MP external ID and source. - Updated generated enums to include WeChat MP external source.
This commit is contained in:
@@ -23,3 +23,15 @@ type WebChannelConfig struct {
|
||||
Position string `json:"position"`
|
||||
Width string `json:"width"`
|
||||
}
|
||||
|
||||
type WechatMPChannelConfig struct {
|
||||
Title string `json:"title"`
|
||||
Subtitle string `json:"subtitle"`
|
||||
ThemeColor string `json:"themeColor"`
|
||||
Position string `json:"position"`
|
||||
Width string `json:"width"`
|
||||
AppID string `json:"appId"`
|
||||
AppSecret string `json:"appSecret"`
|
||||
OAuthScope string `json:"oauthScope"`
|
||||
OAuthEnabled bool `json:"oauthEnabled"`
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package response
|
||||
|
||||
type WidgetConfigResponse struct {
|
||||
ChannelID string `json:"channelId"`
|
||||
Title string `json:"title"`
|
||||
Subtitle string `json:"subtitle"`
|
||||
ThemeColor string `json:"themeColor"`
|
||||
Position string `json:"position"`
|
||||
Width string `json:"width"`
|
||||
ChannelID string `json:"channelId"`
|
||||
ChannelType string `json:"channelType"`
|
||||
ExternalSource string `json:"externalSource"`
|
||||
Title string `json:"title"`
|
||||
Subtitle string `json:"subtitle"`
|
||||
ThemeColor string `json:"themeColor"`
|
||||
Position string `json:"position"`
|
||||
Width string `json:"width"`
|
||||
}
|
||||
|
||||
@@ -7,11 +7,13 @@ type ExternalSource string
|
||||
|
||||
const (
|
||||
ExternalSourceWebChat ExternalSource = "web_chat"
|
||||
ExternalSourceWechatMP ExternalSource = "wechat_mp"
|
||||
ExternalSourceWxWorkKF ExternalSource = "wxwork_kf"
|
||||
)
|
||||
|
||||
var externalSourceLabelMap = map[ExternalSource]string{
|
||||
ExternalSourceWebChat: "网页客服",
|
||||
ExternalSourceWechatMP: "微信公众号",
|
||||
ExternalSourceWxWorkKF: "企业微信客服",
|
||||
}
|
||||
|
||||
@@ -25,7 +27,7 @@ func GetExternalSourceLabel(v ExternalSource) string {
|
||||
// IsAllowedOpenImExternalSource 开放 IM 入口允许的外部来源(闭集校验)。
|
||||
func IsAllowedOpenImExternalSource(s ExternalSource) bool {
|
||||
switch s {
|
||||
case ExternalSourceWebChat:
|
||||
case ExternalSourceWebChat, ExternalSourceWechatMP:
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
|
||||
@@ -18,6 +18,7 @@ const (
|
||||
|
||||
const (
|
||||
ChannelTypeWeb = "web"
|
||||
ChannelTypeWechatMP = "wechat_mp"
|
||||
ChannelTypeWxWorkKF = "wxwork_kf"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user