Browse Source

ppt 新增 中间页封底页

gmy 5 months ago
parent
commit
dbcd81c377

+ 18 - 0
controllers/data_manage/excel/excel_info.go

@@ -107,6 +107,24 @@ func (c *ExcelInfoController) Add() {
 		}
 	}
 
+	// 来源字数校验
+	type SourcesFrom struct {
+		Text string `json:"text"`
+	}
+
+	if req.SourcesFrom != "" && len(req.SourcesFrom) > 0 {
+		var sourcesFrom SourcesFrom
+		err = json.Unmarshal([]byte(req.SourcesFrom), &sourcesFrom)
+		if err != nil {
+			return
+		}
+		if len(sourcesFrom.Text) > 50 {
+			br.Msg = "字数已达上限!"
+			br.ErrMsg = "来源文本字数已达上限,请修改!"
+			return
+		}
+	}
+
 	if req.ParentId > 0 {
 		parentExcelInfo, e := excel3.GetExcelInfoById(req.ParentId)
 		if e != nil {

+ 36 - 0
controllers/image_conf_controller.go

@@ -0,0 +1,36 @@
+package controllers
+
+import "eta_gn/eta_api/models"
+
+type ImageConfController struct {
+	BaseAuthController
+}
+
+// AddImageMaterial
+// @Title 新增图片素材
+// @Description 新增图片素材
+// @Success 200 操作成功
+// @router /add/image/material [post]
+func (this *ImageConfController) AddImageMaterial() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		if br.ErrMsg == "" {
+			br.IsSendEmail = false
+		}
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+	sysUser := this.SysUser
+	if sysUser == nil {
+		br.Msg = "请登录"
+		br.ErrMsg = "请登录,SysUser Is Empty"
+		br.Ret = 408
+		return
+	}
+	var req map[string]interface{}
+	if e := json.Unmarshal(this.Ctx.Input.RequestBody, &req); e != nil {
+		br.Msg = "参数解析异常!"
+		br.ErrMsg = "参数解析失败,Err:" + e.Error()
+		return
+	}
+}

+ 15 - 0
models/image_conf.go

@@ -0,0 +1,15 @@
+package models
+
+import "time"
+
+type ImageConf struct {
+	ImageConfId int       `gorm:"primaryKey;column:image_conf_id;type:int(10) unsigned;not null"`
+	CreateTime  time.Time `gorm:"column:create_time" description:"消息时间"`
+	ModifyTime  time.Time `gorm:"column:modify_time" description:"更新时间"`
+	ImageName   string    `gorm:"column:image_name;type:varchar(64);not null;default:''" description:"图片名称"`
+	Url         string    `gorm:"column:url;type:varchar(512);not null;default:''" description:"图片地址"`
+	ConfType    int       `gorm:"column:conf_type;type:tinyint(4) unsigned;not null;default:1" description:"配置类型 1-ppt素材"`
+	ImageType   int       `gorm:"column:image_type;type:tinyint(4) unsigned;not null;default:1" description:"图片类型 1-封面图 2-背景图 3-封底图"`
+}
+
+//