2024-04-23 12:50:11 +08:00
|
|
|
/*
|
|
|
|
* @Author: Vincent Yang
|
|
|
|
* @Date: 2024-03-20 15:43:57
|
|
|
|
* @LastEditors: Vincent Yang
|
2024-09-15 14:04:53 +08:00
|
|
|
* @LastEditTime: 2024-09-15 01:54:05
|
2024-04-23 12:50:11 +08:00
|
|
|
* @FilePath: /DeepLX/types.go
|
|
|
|
* @Telegram: https://t.me/missuo
|
|
|
|
* @GitHub: https://github.com/missuo
|
|
|
|
*
|
|
|
|
* Copyright © 2024 by Vincent, All Rights Reserved.
|
|
|
|
*/
|
2024-03-21 04:41:44 +08:00
|
|
|
package main
|
|
|
|
|
|
|
|
type Config struct {
|
2024-08-15 19:19:12 +08:00
|
|
|
IP string
|
2024-04-23 12:50:11 +08:00
|
|
|
Port int
|
|
|
|
Token string
|
|
|
|
AuthKey string
|
|
|
|
DlSession string
|
2024-06-18 03:09:20 +08:00
|
|
|
Proxy string
|
2024-03-21 04:41:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type Lang struct {
|
|
|
|
SourceLangUserSelected string `json:"source_lang_user_selected"`
|
|
|
|
TargetLang string `json:"target_lang"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type CommonJobParams struct {
|
2024-06-16 22:19:18 +08:00
|
|
|
WasSpoken bool `json:"wasSpoken"`
|
|
|
|
TranscribeAS string `json:"transcribe_as"`
|
|
|
|
RegionalVariant string `json:"regionalVariant,omitempty"`
|
2024-03-21 04:41:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type Params struct {
|
|
|
|
Texts []Text `json:"texts"`
|
|
|
|
Splitting string `json:"splitting"`
|
|
|
|
Lang Lang `json:"lang"`
|
|
|
|
Timestamp int64 `json:"timestamp"`
|
|
|
|
CommonJobParams CommonJobParams `json:"commonJobParams"`
|
2024-09-15 14:04:53 +08:00
|
|
|
TagHandling string `json:"tag_handling"`
|
2024-03-21 04:41:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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 {
|
2024-09-15 14:04:53 +08:00
|
|
|
TransText string `json:"text"`
|
|
|
|
SourceLang string `json:"source_lang"`
|
|
|
|
TargetLang string `json:"target_lang"`
|
|
|
|
TagHandling string `json:"tag_handling"`
|
2024-03-21 04:41:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
type PayloadAPI struct {
|
2024-09-15 14:04:53 +08:00
|
|
|
Text []string `json:"text"`
|
|
|
|
TargetLang string `json:"target_lang"`
|
|
|
|
SourceLang string `json:"source_lang"`
|
|
|
|
TagHandling string `json:"tag_handling"`
|
2024-03-21 04:41:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|