mirror of
https://github.com/keven1024/015.git
synced 2026-05-26 07:08:02 +00:00
feat(backend): add text translation functionality with new task payload structure
This commit is contained in:
@@ -23,3 +23,10 @@ type ConvertImageTaskPayload struct {
|
||||
BaseFileTaskPayload
|
||||
TargetExt string `json:"target_ext"`
|
||||
}
|
||||
|
||||
type TranslateTextTaskPayload struct {
|
||||
Text string `json:"text"`
|
||||
Source string `json:"source"`
|
||||
Target string `json:"target"`
|
||||
Provider string `json:"provider"`
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ func main() {
|
||||
mux.HandleFunc("file:remove", tasks.RemoveFile)
|
||||
mux.HandleFunc("image:compress", tasks.CompressImage)
|
||||
mux.HandleFunc("image:convert", tasks.ConvertImage)
|
||||
mux.HandleFunc("text:translate", tasks.TranslateText)
|
||||
|
||||
if err := srv.Run(mux); err != nil {
|
||||
log.Fatalf("could not run server: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user