enable to set the translate model

This commit is contained in:
RockYang
2024-11-08 18:06:39 +08:00
parent 6e03f4b363
commit 95a071014c
25 changed files with 328 additions and 207 deletions

View File

@@ -113,10 +113,13 @@ func (h *FunctionHandler) WeiBo(c *gin.Context) {
SetHeader("AppId", h.config.AppId).
SetHeader("Authorization", fmt.Sprintf("Bearer %s", h.config.Token)).
SetSuccessResult(&res).Get(url)
if err != nil || r.IsErrorState() {
resp.ERROR(c, fmt.Sprintf("%v%v", err, r.Err))
if err != nil {
resp.ERROR(c, fmt.Sprintf("%v", err))
return
}
if r.IsErrorState() {
resp.ERROR(c, fmt.Sprintf("error http code status: %v", r.Status))
}
if res.Code != types.Success {
resp.ERROR(c, res.Message)