12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package ppt2img
- import (
- "encoding/json"
- "errors"
- "eta/eta_mobile/utils"
- "fmt"
- "github.com/rdlucklib/rdluck_tools/http"
- <<<<<<< HEAD
- "eta/eta_mobile/utils"
- =======
- >>>>>>> eta/1.4
- )
- type Ppt2ImgResponse struct {
- Ret int
- Msg string
- ErrMsg string
- ErrCode string
- Data []string
- Success bool `description:"true 执行成功,false 执行失败"`
- IsSendEmail bool `description:"true 发送邮件,false 不发送邮件"`
- }
- // Ppt2Img ppt转图片
- // @params pptUrl ppt的在线url
- func Ppt2Img(pptUrl string) (resourceUrlList []string, err error) {
- params := make(map[string]interface{})
- params["PptUrl"] = pptUrl
- param, err := json.Marshal(params)
- if err != nil {
- utils.FileLog.Info("Ppt2Img json.Marshal Err:" + err.Error())
- return
- }
- body, err := http.Post(utils.Ppt2ImageUrl, string(param))
- var result Ppt2ImgResponse
- err = json.Unmarshal(body, &result)
- if err != nil {
- fmt.Println("err:" + err.Error())
- return
- }
- if result.Ret != 200 {
- err = errors.New("获取token失败,Err:" + result.Msg)
- return
- }
- resourceUrlList = result.Data
- return
- }
|