DeepLX/types.go
2024-09-15 02:04:53 -04:00

92 lines
2.2 KiB
Go

/*
* @Author: Vincent Yang
* @Date: 2024-03-20 15:43:57
* @LastEditors: Vincent Yang
* @LastEditTime: 2024-09-15 01:54:05
* @FilePath: /DeepLX/types.go
* @Telegram: https://t.me/missuo
* @GitHub: https://github.com/missuo
*
* Copyright © 2024 by Vincent, All Rights Reserved.
*/
package main
type Config struct {
IP string
Port int
Token string
AuthKey string
DlSession string
Proxy string
}
type Lang struct {
SourceLangUserSelected string `json:"source_lang_user_selected"`
TargetLang string `json:"target_lang"`
}
type CommonJobParams struct {
WasSpoken bool `json:"wasSpoken"`
TranscribeAS string `json:"transcribe_as"`
RegionalVariant string `json:"regionalVariant,omitempty"`
}
type Params struct {
Texts []Text `json:"texts"`
Splitting string `json:"splitting"`
Lang Lang `json:"lang"`
Timestamp int64 `json:"timestamp"`
CommonJobParams CommonJobParams `json:"commonJobParams"`
TagHandling string `json:"tag_handling"`
}
type Text struct {
Text string `json:"text"`
RequestAlternatives int `json:"requestAlternatives"`
}
type PostData struct {
Jsonrpc string `json:"jsonrpc"`
Method string `json:"method"`
ID int64 `json:"id"`
Params Params `json:"params"`
}
type PayloadFree struct {
TransText string `json:"text"`
SourceLang string `json:"source_lang"`
TargetLang string `json:"target_lang"`
TagHandling string `json:"tag_handling"`
}
type PayloadAPI struct {
Text []string `json:"text"`
TargetLang string `json:"target_lang"`
SourceLang string `json:"source_lang"`
TagHandling string `json:"tag_handling"`
}
type Translation struct {
Text string `json:"text"`
}
type TranslationResponse struct {
Translations []Translation `json:"translations"`
}
type DeepLUsageResponse struct {
CharacterCount int `json:"character_count"`
CharacterLimit int `json:"character_limit"`
}
type DeepLXTranslationResult struct {
Code int
ID int64
Message string
Data string
Alternatives []string
SourceLang string
TargetLang string
Method string
}