package config

import (
	"github.com/zeromicro/go-zero/core/stores/cache"
	"github.com/zeromicro/go-zero/rest"
)

type Config struct {
	rest.RestConf
	DataSource    string
	CacheRedis    cache.CacheConf
	JwtAuth       JwtAuth // JWT 鉴权相关配置
	VerifyCode    VerifyCode
	Encrypt       Encrypt
	Tianyuanapi   TianyuanapiConfig
	SystemConfig  SystemConfig
	WechatH5      WechatH5Config
	Authorization AuthorizationConfig // 授权书配置
	WechatMini    WechatMiniConfig
	Query         QueryConfig
	AdminConfig   AdminConfig
	TaxConfig     TaxConfig
	// PC 报告前端访问基础地址，例如 https://your-domain/in-webview
	ReportPcBaseUrl string
	// 报告 PDF 本地缓存目录
	ReportPdfDir string
}

// JwtAuth 用于 JWT 鉴权配置
type JwtAuth struct {
	AccessSecret string // JWT 密钥，用于签发 Token
	AccessExpire int64  // Token 过期时间，单位为秒
	RefreshAfter int64
}
type VerifyCode struct {
	AccessKeyID       string
	AccessKeySecret   string
	EndpointURL       string
	SignName          string
	TemplateCode      string
	ValidTime         int
	ComplaintTemplate string // 投诉通知短信模板
}
type Encrypt struct {
	SecretKey string
}
type SystemConfig struct {
	ThreeVerify bool
}
type WechatH5Config struct {
	Enabled   bool // 是否启用微信公众号登录
	AppID     string
	AppSecret string
}
type WechatMiniConfig struct {
	AppID     string
	AppSecret string
}
type QueryConfig struct {
	ShareLinkExpire int64
}
type AdminConfig struct {
	AccessSecret string
	AccessExpire int64
	RefreshAfter int64
}

type TaxConfig struct {
	TaxRate            float64
	TaxExemptionAmount float64
}
type TianyuanapiConfig struct {
	AccessID string
	Key      string
	BaseURL  string
	Timeout  int64
}

type AuthorizationConfig struct {
	FileBaseURL string // 授权书文件访问基础URL
}
