privacy

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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

type Privacy struct {
	*context2.Context
}

Privacy 小程序授权隐私设置

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 上传权限定义模板响应参数

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL