Documentation ¶
Index ¶
- Constants
- type Desc
- type DescList
- type GetPrivacySettingResponse
- type OwnerSetting
- type Privacy
- func (s *Privacy) GetPrivacySetting(ctx context.Context, privacyVer int) (GetPrivacySettingResponse, error)
- func (s *Privacy) SetPrivacySetting(ctx context.Context, privacyVer int, ownerSetting OwnerSetting, ...) error
- func (s *Privacy) UploadPrivacyExtFile(ctx context.Context, fileData []byte) (UploadPrivacyExtFileResponse, error)
- type SetPrivacySettingRequest
- type SettingItem
- type SettingResponseItem
- type UploadPrivacyExtFileResponse
Constants ¶
View Source
const ( // PrivacyV1 用户隐私保护指引的版本,1表示现网版本。 PrivacyV1 = 1 // PrivacyV2 2表示开发版。默认是2开发版。 PrivacyV2 = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Desc ¶
type Desc struct { PrivacyDesc string `json:"privacy_desc"` PrivacyKey string `json:"privacy_key"` }
Desc 权限列表明细(保持与官方一致)
type DescList ¶
type DescList struct {
PrivacyDescList []Desc `json:"privacy_desc_list"`
}
DescList 权限列表(保持与官方一致)
type GetPrivacySettingResponse ¶
type GetPrivacySettingResponse struct { util.CommonError CodeExist int `json:"code_exist"` PrivacyList []string `json:"privacy_list"` SettingList []SettingResponseItem `json:"setting_list"` UpdateTime int64 `json:"update_time"` OwnerSetting OwnerSetting `json:"owner_setting"` PrivacyDesc DescList `json:"privacy_desc"` }
GetPrivacySettingResponse 获取权限配置的响应结果
type OwnerSetting ¶
type OwnerSetting struct { ContactEmail string `json:"contact_email"` ContactPhone string `json:"contact_phone"` ContactQQ string `json:"contact_qq"` ContactWeixin string `json:"contact_weixin"` ExtFileMediaID string `json:"ext_file_media_id"` NoticeMethod string `json:"notice_method"` StoreExpireTimestamp string `json:"store_expire_timestamp"` }
OwnerSetting 收集方(开发者)信息配置
type Privacy ¶
Privacy 小程序授权隐私设置
func NewPrivacy ¶
NewPrivacy 实例化小程序隐私接口 文档地址 https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/privacy_config/set_privacy_setting.html
func (*Privacy) GetPrivacySetting ¶
func (s *Privacy) GetPrivacySetting(ctx context.Context, privacyVer int) (GetPrivacySettingResponse, error)
GetPrivacySetting 获取小程序权限配置
func (*Privacy) SetPrivacySetting ¶
func (s *Privacy) SetPrivacySetting(ctx context.Context, privacyVer int, ownerSetting OwnerSetting, settingList []SettingItem) error
SetPrivacySetting 更新小程序权限配置
func (*Privacy) UploadPrivacyExtFile ¶
func (s *Privacy) UploadPrivacyExtFile(ctx context.Context, fileData []byte) (UploadPrivacyExtFileResponse, error)
UploadPrivacyExtFile 上传权限定义模板
type SetPrivacySettingRequest ¶
type SetPrivacySettingRequest struct { PrivacyVer int `json:"privacy_ver"` OwnerSetting OwnerSetting `json:"owner_setting"` SettingList []SettingItem `json:"setting_list"` }
SetPrivacySettingRequest 设置权限的请求参数
type SettingItem ¶
type SettingItem struct { PrivacyKey string `json:"privacy_key"` PrivacyText string `json:"privacy_text"` }
SettingItem 收集权限的配置
type SettingResponseItem ¶
type SettingResponseItem struct { PrivacyKey string `json:"privacy_key"` PrivacyText string `json:"privacy_text"` PrivacyLabel string `json:"privacy_label"` }
SettingResponseItem 获取权限设置的响应明细
type UploadPrivacyExtFileResponse ¶
type UploadPrivacyExtFileResponse struct { util.CommonError ExtFileMediaID string `json:"ext_file_media_id"` }
UploadPrivacyExtFileResponse 上传权限定义模板响应参数
Click to show internal directories.
Click to hide internal directories.