package nacos

type AliConfig struct {
	SecretId    string      `yaml:"secretId"`
	SecretKey   string      `yaml:"secretKey"`
	AliDytNsApi AliDytNsApi `yaml:"aliDytNsApi"`
}

type AliDytNsApi struct {
	PhoneNumberStatusForRealAuthCode string `yaml:"phoneNumberStatusForRealAuthCode"`
	DescribePhoneNumberAuthCode      string `yaml:"describePhoneNumberAuthCode"`
}

// DataCenterKafka 数据部的kafka配置 topic可以都在这里
type DataCenterKafka struct {
	Servers         string `yaml:"servers"`
	EnterpriseTopic string `yaml:"enterpriseTopic"`
}

type Config struct {
	Env                 string   `yaml:"env"`
	Diydb               Database `yaml:"diydb"`
	CUserServerDb       Database `yaml:"cuser-serverdb"`
	DiyGalaxydb         Database `yaml:"diy-galaxydb"`
	GalaxyCRMdb         Database `yaml:"galaxy-crmdb"`
	MarketingServerDb   Database `yaml:"marketing_server"`
	AuthDB              Database `yaml:"auth_server"`
	ServerSiteMicrosDb  Database `yaml:"serverSiteMicrosDb"`
	FlowMicrosDb        Database `yaml:"flowMicrosDb"`
	InfoFlowServerDb    Database `yaml:"infoflow-serverDb"`
	UserMicrosDb        Database `yaml:"userMicrosDb"`
	RpcDb               Database `yaml:"rpcDb"`
	PresaleMicrosDb     Database `yaml:"presaleMicrosDb"`
	SmartWritingDb      Database `yaml:"smartWritingDb"`
	GoodsServerDb       Database `yaml:"goodsServerDb"`
	ArticleServerDB     Database `yaml:"articleServerDB"`
	KidsbayServerDB     Database `yaml:"KidsbayServerDB"`
	GalaxySopDB         Database `yaml:"galaxySopDB"`
	AfterServerDB       Database `yaml:"afterServerDB"`
	SuperAppDB          Database `yaml:"superAppDB"`
	MemberMicrosDB      Database `yaml:"memberMicrosDB"`
	CronDB              Database `yaml:"cronDB"`
	GalaxyDB            Database `yaml:"galaxyDB"`
	ActivityServerDB    Database `yaml:"activityServerDB"`
	GrayscaleDB         Database `yaml:"grayscaleDB"`
	Redis               Redis
	AliConversion       AliConversion `yaml:"aliConversion"`
	Oss                 Oss           `yaml:"oss"`
	QiYueSuo            QiYueSuo      `yaml:"qiYueSuo"`
	PublicOss           Oss           `yaml:"publicOss"`
	PublicResuorces     Oss           `yaml:"publicResuorces"`
	OldOss              Oss           `yaml:"oldOss"`
	HkOss               Oss           `yaml:"hkOss"`
	UserServer          Server        `yaml:"userServer"`
	CUserServer         Server        `yaml:"cUserServer"`
	IdServer            Server        `yaml:"idServer"`
	ThirdServer         Server        `yaml:"thirdServer"`
	TradeServer         Server        `yaml:"tradeServer"`
	MarketingServer     Server        `yaml:"marketingServer"`
	GoodsServer         Server        `yaml:"goodsServer"`
	LogServer           Server        `yaml:"logServer"`
	InfoFlowServer      Server        `yaml:"infoFlowServer"`
	OrderServer         Server        `yaml:"orderServer"`
	ProductServer       Server        `yaml:"productServer"`
	ComServer           Server        `yaml:"commonServer"`
	AuthServer          Server        `yaml:"authServer"`
	KidsbayServer       Server        `yaml:"kidsbayServer"`
	DwpServer           Server        `yaml:"dwpServer"`
	DiyArticleServer    Server        `yaml:"diyArticleServer"`
	ArticleServer       Server        `yaml:"articleServer"`
	NginxServer         Server        `yaml:"nginxServer"`
	AfterServer         Server        `yaml:"afterServer"`
	SuperAppServer      Server        `yaml:"superAppServer"`
	ActivityServer      Server        `yaml:"activityServer"`
	GrayscaleServer     Server        `yaml:"grayscaleServer"`
	ConvertServer       Server        `yaml:"convertServer"`
	Php                 Php           `yaml:"php"`
	Go                  Go            `yaml:"go"`
	Java                Java          `yaml:"java"`
	Elasticsearch       Elasticsearch `yaml:"elasticsearch"`
	SkyWalking          SkyWalking    `yaml:"skywalking"`
	Jaeger              Jaeger        `yaml:"jaeger"`
	TencentSMS          []TencentSMS  `yaml:"tencentSMS"`
	AliSMS              []AliSMS      `yaml:"aliSMS"`
	AliConfig           AliConfig     `yaml:"aliConfig"`
	Path                Path
	Jwt                 Jwt
	OcrServer           OcrServer `yaml:"ocrServer"`
	Rpc                 rpc
	Mail                Mail                `yaml:"mail"`
	JPush               JPush               `yaml:"jpush"`
	PushPool            PushPool            `yaml:"pushPool"`
	BasicInfo           BasicInfo           `yaml:"basicInfo"`
	WechatInfo          WechatInfo          `yaml:"wechatInfo"`
	KidsBayWechatAppKey KidsBayWechatAppKey `yaml:"kidsBayWechatAppKey"`
	MarketingQrcodeInfo MarketingQrcodeInfo `yaml:"marketingQrcodeInfo"`
	H5Url               H5Url               `yaml:"h5Url"`
	AppVersion          []AppVersion        `yaml:"appVersion"`
	RpcMiniConfig       RpcMiniConfig       `yaml:"rpcMiniConfig" comment:"智慧银河小程序的相关配置"`
	KidsbayNotice       KidsbayNotice       `yaml:"kidsbayNotice"`
	Aigc                Aigc                `yaml:"aigc"`
	PhoneCode           []string            `yaml:"phone_code"`    // iOS审核需要的白名单过滤
	CodeAuthInfo        CodeAuthInfo        `yaml:"codeAuthInfo"`  // 一键登录认证信息配置
	AliyunAuth          AliyunAuth          `yaml:"aliyunAuth"`    // 一键登录auth信息
	StsAuth             StsAuth             `yaml:"stsAuth"`       // oss 默认sts临时授权
	HkStsAuth           StsAuth             `yaml:"hKStsAuth"`     // oss hk sts临时授权
	PublicStsAuth       StsAuth             `yaml:"publicStsAuth"` // oss public sts临时授权
	BaiduOcr            BaiduOcr            `yaml:"baiduOcr"`
	AliOcr              AliOcr              `yaml:"aliOcr"`
	TencentOcr          TencentOcr          `yaml:"tencentOcr"`
	MarketingActivity   MarketingActivity   `yaml:"marketingActivity"`
	DwpAuth             DwpAuth             `yaml:"dwpAuth"`
	DataCenter          DataCenter          `yaml:"dataCenter"`
	Wework              Wework              `yaml:"wework"`
	Serversite          Serversite          `yaml:"serversite"`
	TestWhileList       TestWhileList       `yaml:"testWhileList"`
	MockUpServiceUrl    string              `yaml:"mockUpServiceUrl"`
	GrayscaleApps       []GrayscaleApp      `yaml:"grayscaleApps"`
	DataCenterKafka     DataCenterKafka     `yaml:"dataCenterKafka"`
}

type Serversite struct {
	CustomerAuthSalt string `yaml:"customer_auth_salt"`
}

type StsAuth struct {
	Arn             string   `yaml:"arn"`
	Endpoint        string   `yaml:"endpoint"`
	Bucket          []string `yaml:"bucket"`
	AccessKeyId     string   `yaml:"accessKeyId"`
	AccessKeySecret string   `yaml:"accessKeySecret"`
}

type DwpAuth struct {
	SecretKey     string   `yaml:"secretKey"`
	TokenDuration int      `yaml:"tokenDuration"`
	Start         bool     `yaml:"start"`
	WhiteRoutes   []string `yaml:"whiteRoutes"`
}

type CodeAuthInfo struct {
	Android string `yaml:"android"`
	IOS     string `yaml:"ios"`
}

type AliyunAuth struct {
	AccessKeyID     string `yaml:"AccessKeyID"`
	AccessKeySecret string `yaml:"accessKeySecret"`
}

type H5Url struct {
	ArticleH5Url string `yaml:"app_article_h5_url"`
}

type AppVersion struct {
	AppPlatform   string `yaml:"AppPlatform"`   // ios,android
	MinVersion    string `yaml:"MinVersion"`    // 最小版本
	MaxVersion    string `yaml:"MaxVersion"`    // 最大版本
	MinVersionNum int32  `yaml:"MinVersionNum"` // 最小版本数字
	MaxVersionNum int32  `yaml:"MaxVersionNum"` // 最大版本数字
}

// BasicInfo 一些基础信息
type BasicInfo struct {
	DomainName string `yaml:"domain_name"`
}

type Elasticsearch struct {
	Address  []string `yaml:"address"`  // es 地址
	Username string   `yaml:"username"` // es 账号
	Password string   `yaml:"password"` // es 密码
}

type JPush struct {
	Address        string `yaml:"address"`        // JPush 地址
	AppKey         string `yaml:"appKey"`         // JPush 账号
	MasterSecret   string `yaml:"masterSecret"`   // JPush 密码
	ApnsProduction bool   `yaml:"apnsProduction"` // false 测试环境 true正式环境
}

type PushPool struct {
	Cap int `yaml:"cap"` // 推送池容量
}

type SkyWalking struct {
	Address string `yaml:"addr"`
}

type Jaeger struct {
	Endpoint string `yaml:"endpoint"`
}

type TencentSMS struct {
	SignName  string `yaml:"signName"` // 签名
	Index     int32  `yaml:"index"`    // 索引值等于smsSubject
	SecretId  string `yaml:"secretId"`
	SecretKey string `yaml:"secretKey"`
	AppId     string `yaml:"appId"`
}

type Email struct {
	From string `yaml:"from"`
	Pass string `yaml:"pass"`
}

type AliSMS struct {
	SignName  string `yaml:"signName"` // 签名
	Index     int32  `yaml:"index"`    // 索引值等于smsSubject
	SecretId  string `yaml:"secretId"`
	SecretKey string `yaml:"secretKey"`
}

type Oss struct {
	EndPoint        string `yaml:"endPoint"`
	AccessId        string `yaml:"accessId"`
	AccessKeySecret string `yaml:"accessKeySecret"`
	Bucket          string `yaml:"bucket"`
}

type AliConversion struct {
	EndPoint        string `yaml:"endPoint"`
	AccessId        string `yaml:"accessId"`
	AccessKeySecret string `yaml:"accessKeySecret"`
	BucketPrivate   string `yaml:"bucketPrivate"`
	BucketPub       string `yaml:"bucketPub"`
}

// AliOcr 阿里ocr 识别
type AliOcr struct {
	UserPrincipalName string `yaml:"userPrincipalName"`
	AccessKeyId       string `yaml:"accessKeyId"`
	AccessKeySecret   string `yaml:"accessKeySecret"`
	Endpoint          string `yaml:"endpoint"`
}

// TencentOcr 腾讯ocr识别
type TencentOcr struct {
	AccessKeyId     string `yaml:"accessKeyId"`
	AccessKeySecret string `yaml:"accessKeySecret"`
	Endpoint        string `yaml:"endpoint"`
	Region          string `yaml:"region"`
}

// BaiduOcr 百度ocr 识别
type BaiduOcr struct {
	AppId           string `yaml:"appId"`
	AccessKeyId     string `yaml:"accessKeyId"`
	AccessKeySecret string `yaml:"accessKeySecret"`
}

type QiYueSuo struct {
	CategoryName  string `yaml:"categoryName"`
	Subject       string `yaml:"subject"`
	UserName      string `yaml:"userName"`
	Contact       string `yaml:"contact"`
	AccessToken   string `yaml:"accessToken"`
	AccessSecret  string `yaml:"accessSecret"`
	MicroKey      string `yaml:"microKey"`
	GatewayDomain string `yaml:"gatewayDomain"`
	ServerUrl     string `yaml:"serverUrl"`
}

// 各种路径
type Path struct {
	Logpath string `yaml:"log_path"`
}

// 服务端口
type Server struct {
	HttpPort uint64 `yaml:"httpPort"`
	GrpcPort uint64 `yaml:"grpcPort"`
	Name     string `yaml:"name"`
}

type Jwt struct {
	SecretKey     string `yaml:"secretKey"`
	TokenDuration int    `yaml:"tokenDuration"`
	IsInterceptor string `yaml:"isInterceptor"`
}
type rpc struct {
	RpcKey string `yaml:"rpcKey"`
}
type Redis struct {
	Host string `yaml:"host"`
	Port string `yaml:"port"`
	Db   int    `yaml:"db"`
	Pass string `yaml:"pass"`
}
type Nats struct {
	Host string `yaml:"host"`
	Port string `yaml:"port"`
}

type Py struct {
	GalaxyPy string `yaml:"galaxyPy"`
}

type Php struct {
	GalaxyDwp     string `yaml:"galaxyDwp"`
	GalaxyMes     string `yaml:"galaxyMes"`
	Diy           string `yaml:"diy"`
	GalaxyNetwork string `yaml:"galaxyNetWork"`
	UserMicros    string `yaml:"userMicros"`
	FlowMicrosUrl string `yaml:"flowMicrosUrl"`
	Rpc           string `yaml:"rpc"`
	Crm           string `yaml:"crm"`
}

type Go struct {
	ComServer string `yaml:"comServer"`
}

type Java struct {
	NoticeServer string `yaml:"noticeServer"`
}

type Database struct {
	DbName   string `yaml:"dbName"`
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Username string `yaml:"username"`
	Pass     string `yaml:"pass"`
}

type Canal struct {
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Pass     string `yaml:"pass"`
	Dest     string `yaml:"dest"`
}

type OcrServer struct {
	Address string `yaml:"address"`
}

type Mail struct {
	Host        string `yaml:"host"`
	Port        int    `yaml:"port"`
	Username    string `yaml:"username"`
	Password    string `yaml:"password"`
	FromAddress string `yaml:"from_address"`
	FromName    string `yaml:"from_name"`
}

type WechatInfo struct {
	AppId     string `yaml:"app_id"`
	AppSecret string `yaml:"app_secret"`
}

// 小程序appId
type KidsBayWechatAppKey struct {
	AppId     string `yaml:"appId"`
	AppSecret string `yaml:"appSecret"`
}

// KidsbayNotice kidsbay企微消息通知
type KidsbayNotice struct {
	NoticeRoleID    int `yaml:"noticeRoleID"`
	LeaveMaterialID int `yaml:"leaveMaterialID"`
	StartMaterialID int `yaml:"startMaterialID"`
	EndMaterialID   int `yaml:"endMaterialID"`
	AgentID         int `yaml:"agentID"`
}

type MarketingQrcodeInfo struct {
	DisplayHtmlLink  string `yaml:"display_html_link"`
	DisplayPicWidth  int32  `yaml:"display_pic_width"`
	DisplayPicHeight int32  `yaml:"display_pic_height"`
}

// RpcMiniConfig 小程序mini的配置-智慧银河小程序
type RpcMiniConfig struct {
	RpcKey         string `yaml:"rpcKey" comment:"rpc_base生成token的rpcKey"`
	RpcTokenExpire uint64 `yaml:"rpcTokenExpire" comment:"rpc_base生成token的过期时间秒"`
}

type Aigc struct {
	AigcHost string           `yaml:"aigcHost"`
	GptModel []string         `yaml:"gptModel"`
	Jira     []map[string]any `yaml:"jira"`
	Wework   map[string]any   `yaml:"wework"`
	Jwt      struct {
		SecretKey     string `yaml:"secretKey"`
		TokenDuration int    `yaml:"tokenDuration"`
		Start         bool   `yaml:"start"`
	} `yaml:"jwt"`
}

type MarketingActivity struct {
	SendPointActivityID int32 `yaml:"sendPointActivityId"`
	SendPointSceneID    int32 `yaml:"sendPointSceneId"`
	AddPoint            int32 `yaml:"addPoint"`
	PointTypeID         int32 `yaml:"pointTypeId"`
}
type DwpServer struct {
	Server
	Jwt
}

type DataCenter struct {
	URL   string               `yaml:"url"`
	Label DataCenterCredential `yaml:"label"`
}

// DataCenterCredential 数据公用结构
type DataCenterCredential struct {
	SecretKey     string `yaml:"secretKey"`
	ChannelCode   string `yaml:"channelCode"`
	InterfaceCode string `yaml:"interfaceCode"`
}

type Wework struct {
	CorpID     string `yaml:"corpId"`
	CorpSecret string `yaml:"corpSecret"`
}

// TestWhileList 用于测试线上功能的白名单，不同业务可以分不同的key
type TestWhileList struct {
	DailyMarkTagWhilePhones string `yaml:"dailyMarkTagWhilePhones"`
}

// GrayscaleApp 接入灰度发布服务的应用
type GrayscaleApp struct {
	Key  string `yaml:"key"`  // 应用唯一标识
	Name string `yaml:"name"` // 应用名称
}

const DefaultConfig = `diydb:
  dbName:new_diy
  username: root
  pass: LnfbR2rADTAw3tmP
  host: 120.79.37.227
  port: 3306
diy-galaxydb:
  dbName: crm
  username: admin
  pass: 0HkUEneEon#gQJAa
  host: wan-test1-mysql-m1.galaxy-immi.com
  port: 3306
galaxy-crmdb:
  dbName:
  username: admin
  pass: 0HkUEneEon#gQJAa
  host: wan-test1-mysql-m1.galaxy-immi.com
  port: 3306
redis:
  host: 120.79.37.227
  port: 6379
  db: 10
  pass: admin0440
qiYueSuo:
  categoryName: "小程序文书签字"
  subject : "银河香港身份规划远程签单合同"
  userName : "银河成员"
  contact : "15527487898"
  accessToken :"3gmH6cLG6V"
  accessSecret :"DGN7SArIFL47xGkk3c8u7cd7LZSOYh"
oss:
  endPoint: https://oss-cn-shenzhen.aliyuncs.com
  accessId: LTAI5t6JCESFScYpWLRyQaZK
  accessKeySecret: ukpfg0QWvuOKuAb9P8HXXKe5AcfcKo
  bucket: galaxy-immi-mp
publicOss:
  endPoint: https://oss-cn-shenzhen.aliyuncs.com
  accessId: LTAI5t6JCESFScYpWLRyQaZK
  accessKeySecret: ukpfg0QWvuOKuAb9P8HXXKe5AcfcKo
  bucket: galaxy-immi-mp
oldOss:
  endPoint: https://oss-cn-shenzhen.aliyuncs.com
  accessId: LTAI5tJPQC4La6LWbcNoz61u
  accessKeySecret: Gx1rW6MNo0iq0cSjazkIYgNIxLyFSK
py:
  galaxyPy: "http://127.0.0.1:5001/pyapi/multi_similar"
php:
  galaxyDwp: "https://dwp-inner.galaxy-immi.com/api/"
  galaxyMes: "http://172.18.18.0:9307/"
  galaxyMesTest: "http://192.168.11.175:9307"
  diy: https://test-api-diymanager.galaxy-immi.com/
go:
  comServer: https://test-comserver.galaxy-immi.com/
path:
  log_path: "./log"
jwt:
  secretKey: "3&YhNBHuisy)92m3nueh7fbxg35HH5g"
  tokenDuration: 2592000
orderServer:
  httpPort: 18080
  grpcPort: 19095
  name: "order-server.GRPC"
userServer:
  httpPort: 18081
  grpcPort: 19096
  name: "user-server.GRPC"
productServer:
  httpPort: 18082
  grpcPort: 19097
  name: "product-server.GRPC"
authServer:
  httpPort: 18083
  grpcPort: 19098
  name: "auth-server.GRPC"
dwpServer:
  httpPort: 18084
  grpcPort: 19099
  name: "dwp-server.GRPC"
articleServer:
  httpPort: 18085
  grpcPort: 19100
  name: "article-server.GRPC"
commonServer:
  httpPort: 18086
  grpcPort: 19101
  name: "common-server.GRPC"
`
