first commit
This commit is contained in:
31
pkg/req/open.go
Normal file
31
pkg/req/open.go
Normal file
@ -0,0 +1,31 @@
|
||||
package req
|
||||
|
||||
type AudioToTextReq struct {
|
||||
Url string `json:"audio_url" form:"audio_url" uri:"audio_url"`
|
||||
Text string `json:"text" form:"text" uri:"text"`
|
||||
}
|
||||
|
||||
func (d AudioToTextReq) GetText() string {
|
||||
if len(d.Text) == 0 {
|
||||
return `本人尊重宣誓:本人自愿加入东东电竞,并严格遵守东东电竞所有规定,接受个人信息公开到互联网进行监督和宣传,爱国爱党不触碰法律法规,不做无道德无底线的事,不做违法乱纪的事。做一名优秀的陪玩,时刻约束自己,努力为陪玩行业正名,拥有远大志向,从我做起改善不良风气,不断努力,不断进步,和东东电竞一起努力,共同构建陪玩行业新标杆。若出现违反相关规定内容,本人自愿接受所有处罚。`
|
||||
}
|
||||
return d.Text
|
||||
}
|
||||
|
||||
type TextSimilarityReq struct {
|
||||
Text1 string `json:"text1" form:"text1" uri:"text1"`
|
||||
Text2 string `json:"text2" form:"text2" uri:"text2"`
|
||||
}
|
||||
|
||||
type VideoExtractFramesReq struct {
|
||||
Url string `json:"video_url" form:"video_url" uri:"video_url"`
|
||||
NumFrames int `json:"num_frames" form:"num_frames" uri:"num_frames"`
|
||||
Force bool `json:"force" form:"force" uri:"force"`
|
||||
}
|
||||
|
||||
func (d VideoExtractFramesReq) GetNumFrames() int {
|
||||
if d.NumFrames <= 0 || d.NumFrames > 20 {
|
||||
return 5
|
||||
}
|
||||
return d.NumFrames
|
||||
}
|
||||
Reference in New Issue
Block a user