修改ppt主题列表结构体json解析
This commit is contained in:
parent
da64bd7c56
commit
cf4cbbeec6
|
|
@ -450,7 +450,7 @@ func GetSparkPPTThemeList(c *gin.Context) {
|
|||
}
|
||||
modelParam.Url = model.Url
|
||||
modelParam.System = funcs[0].Info //系统功能
|
||||
var themeList proto.PPTThemeResponse
|
||||
var themeList proto.SparkPPTThemeListResponse
|
||||
//获取主题列表
|
||||
if worker.IsContainKey("spark_ppt_theme_list") {
|
||||
themeListStr := worker.GetRedis("spark_ppt_theme_list")
|
||||
|
|
|
|||
|
|
@ -185,3 +185,39 @@ type GetSparkCreatePPTStatusReq struct {
|
|||
Function string `json:"function" form:"function"` // 功能
|
||||
SessionID int `json:"sessionId" form:"sessionId"` // 会话id
|
||||
}
|
||||
|
||||
type SparkPPTThemeListData struct {
|
||||
Total int `json:"total"`
|
||||
Records []SparkPPTThemeListRecord `json:"records"`
|
||||
PageNum int `json:"pageNum"`
|
||||
}
|
||||
|
||||
type SparkPPTThemeListRecord struct {
|
||||
TemplateIndexId string `json:"templateIndexId"`
|
||||
PageCount int `json:"pageCount"`
|
||||
Type string `json:"type"`
|
||||
Color string `json:"color"`
|
||||
Industry string `json:"industry"`
|
||||
Style string `json:"style"`
|
||||
DetailImageStr string `json:"detailImage"`
|
||||
PayType string `json:"payType"`
|
||||
DetailImage SparkPPTThemeListDetailImage
|
||||
}
|
||||
|
||||
type SparkPPTThemeListDetailImage struct {
|
||||
TitleCoverImageLarge string `json:"titleCoverImageLarge"`
|
||||
TitleCoverImage string `json:"titleCoverImage"`
|
||||
CatalogueCoverImage string `json:"catalogueCoverImage"`
|
||||
ChapterCoverImage string `json:"chapterCoverImage"`
|
||||
ContentCoverImage string `json:"contentCoverImage"`
|
||||
EndCoverImage string `json:"endCoverImage"`
|
||||
}
|
||||
|
||||
type SparkPPTThemeListResponse struct {
|
||||
Flag bool `json:"flag"`
|
||||
Code int `json:"code"`
|
||||
Desc string `json:"desc"`
|
||||
Count any `json:"count"`
|
||||
Data SparkPPTThemeListData `json:"data"`
|
||||
Sid any `json:"sid"`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
func SparkPPTThemeList(model *proto.ModelParam, req proto.GetSparkPPTThemeReq) (proto.PPTThemeResponse, error) {
|
||||
func SparkPPTThemeList(model *proto.ModelParam, req proto.GetSparkPPTThemeReq) (proto.SparkPPTThemeListResponse, error) {
|
||||
url := "https://zwapi.xfyun.cn/api/ppt/v2/template/list"
|
||||
headers, err := getSparkRequestHeaders(model.APPID, model.APISecret)
|
||||
if err != nil {
|
||||
log.Println("Spark PPT Theme Error getting headers:", err)
|
||||
return proto.PPTThemeResponse{}, err
|
||||
return proto.SparkPPTThemeListResponse{}, err
|
||||
}
|
||||
//log.Println("Spark PPT Theme headers:", headers)
|
||||
|
||||
|
|
@ -37,12 +37,12 @@ func SparkPPTThemeList(model *proto.ModelParam, req proto.GetSparkPPTThemeReq) (
|
|||
reqStr, err := json.Marshal(req_)
|
||||
if err != nil {
|
||||
log.Println("Spark PPT Theme Error encoding request:", err)
|
||||
return proto.PPTThemeResponse{}, err
|
||||
return proto.SparkPPTThemeListResponse{}, err
|
||||
}
|
||||
log.Println("Spark PPT Theme req:", string(reqStr))
|
||||
|
||||
err, resp := worker.DoPostRequestJSON(url, reqStr, headers)
|
||||
var response proto.PPTThemeResponse
|
||||
var response proto.SparkPPTThemeListResponse
|
||||
if err != nil {
|
||||
log.Println("Spark PPT Theme Error:", err)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue