Forráskód Böngészése

新增语音播报核心观点

317699326@qq.com 1 hónapja
szülő
commit
b8310cb1c3

+ 2 - 2
controller/voice_broadcast/voice_broadcast.go

@@ -109,7 +109,7 @@ func AddBroadcast(c *gin.Context) {
 	userInfo := user.GetInfoByClaims(c)
 	// 新增
 	resp, e := services.CreateVoiceBroadcast(req.SectionId, req.VarietyId, req.AuthorId, req.BroadcastName, req.SectionName, req.VarietyName,
-		req.Author, req.VoiceSeconds, req.VoiceSize, req.VoiceUrl, req.Imgs, userInfo)
+		req.Author, req.VoiceSeconds, req.VoiceSize, req.VoiceUrl, req.Imgs, req.CentralArguments, userInfo)
 	if e != nil {
 		response.FailMsg("新增失败", e.Error(), c)
 		return
@@ -175,7 +175,7 @@ func EditBroadcast(c *gin.Context) {
 	userInfo := user.GetInfoByClaims(c)
 	// 编辑
 	resp, e := services.EditVoiceBroadcast(req.BroadcastId, req.SectionId, req.VarietyId, req.AuthorId, req.BroadcastName, req.SectionName, req.VarietyName,
-		req.Author, req.VoiceSeconds, req.VoiceSize, req.VoiceUrl, req.Imgs, userInfo)
+		req.Author, req.VoiceSeconds, req.VoiceSize, req.VoiceUrl, req.Imgs, req.CentralArguments, userInfo)
 	if e != nil {
 		response.FailMsg("新增失败", e.Error(), c)
 		return

+ 13 - 12
models/request/voice_broadcast.go

@@ -23,18 +23,19 @@ type BroadcastMsgSendReq struct {
 }
 
 type SaveBroadcastReq struct {
-	BroadcastId   int    `json:"broadcast_id" form:"broadcast_id" description:"语音播报ID"`
-	BroadcastName string `json:"broadcast_name" description:"语音标题"`
-	SectionId     int    `json:"section_id" form:"section_id" description:"板块ID"`
-	SectionName   string `json:"section_name" form:"section_name" description:"板块名称"`
-	VarietyId     int    `json:"variety_id" form:"variety_id" description:"品种ID"`
-	VarietyName   string `json:"variety_name" form:"variety_name" description:"品种名称"`
-	AuthorId      int    `json:"author_id" form:"author_id" description:"作者ID"`
-	Author        string `json:"author" form:"author" description:"作者名称"`
-	Imgs          string `json:"imgs" form:"imgs" description:"图片,英文逗号拼接"`
-	VoiceSeconds  string `json:"voice_seconds" form:"voice_seconds" description:"音频时长"`
-	VoiceSize     string `json:"voice_size" form:"voice_size" description:"音频大小"`
-	VoiceUrl      string `json:"voice_url" form:"voice_url" description:"音频文件地址"`
+	BroadcastId      int    `json:"broadcast_id" form:"broadcast_id" description:"语音播报ID"`
+	BroadcastName    string `json:"broadcast_name" description:"语音标题"`
+	SectionId        int    `json:"section_id" form:"section_id" description:"板块ID"`
+	SectionName      string `json:"section_name" form:"section_name" description:"板块名称"`
+	VarietyId        int    `json:"variety_id" form:"variety_id" description:"品种ID"`
+	VarietyName      string `json:"variety_name" form:"variety_name" description:"品种名称"`
+	AuthorId         int    `json:"author_id" form:"author_id" description:"作者ID"`
+	Author           string `json:"author" form:"author" description:"作者名称"`
+	Imgs             string `json:"imgs" form:"imgs" description:"图片,英文逗号拼接"`
+	VoiceSeconds     string `json:"voice_seconds" form:"voice_seconds" description:"音频时长"`
+	VoiceSize        string `json:"voice_size" form:"voice_size" description:"音频大小"`
+	VoiceUrl         string `json:"voice_url" form:"voice_url" description:"音频文件地址"`
+	CentralArguments string `json:"central_arguments" form:"central_arguments" description:"核心观点"`
 }
 
 type PublishBroadcastReq struct {

+ 1 - 0
models/response/voice_broadcast.go

@@ -27,6 +27,7 @@ type Broadcast struct {
 	PublishTime      string   `description:"发布时间"`
 	PrePublishTime   string   `description:"定时发布时间"`
 	Imgs             []string `description:"图片"`
+	CentralArguments string   `description:"核心观点"`
 }
 
 type VarietyList struct {

+ 1 - 0
models/tables/voice_broadcast/voice_broadcast.go

@@ -20,6 +20,7 @@ type VoiceBroadcast struct {
 	PrePublishTime   string `description:"预发布时间"`
 	MsgState         int    `description:"消息推送状态:0-待推送 1-已推送"`
 	MsgTime          string `description:"消息推送时间"`
+	CentralArguments string `description:"核心观点"`
 }
 
 // TableName get sql table name.获取数据库表名

+ 5 - 3
services/voice_broadcast.go

@@ -222,7 +222,7 @@ func SendBroadcastMsg(broadcastId, userId int) (errMsg string, err error) {
 }
 
 // CreateVoiceBroadcast 新增语音播报
-func CreateVoiceBroadcast(sectionId, varietyId, authorId int, broadcastName, sectionName, varietyName, author, voiceSeconds, voiceSize, voiceUrl, imgs string, userInfo user.UserInfo) (resp response.Broadcast, err error) {
+func CreateVoiceBroadcast(sectionId, varietyId, authorId int, broadcastName, sectionName, varietyName, author, voiceSeconds, voiceSize, voiceUrl, imgs, centralArguments string, userInfo user.UserInfo) (resp response.Broadcast, err error) {
 	nowTime := time.Now().Local()
 	if userInfo.UserID > 0 {
 		authorId = int(userInfo.UserID)
@@ -240,6 +240,7 @@ func CreateVoiceBroadcast(sectionId, varietyId, authorId int, broadcastName, sec
 		VoiceUrl:         voiceUrl,
 		VoicePlaySeconds: voiceSeconds,
 		VoiceSize:        voiceSize,
+		CentralArguments: centralArguments,
 		CreateTime:       nowTime.Format(utils.FormatDateTime),
 		ModifyTime:       nowTime.Format(utils.FormatDateTime),
 	}
@@ -273,7 +274,7 @@ func CreateVoiceBroadcast(sectionId, varietyId, authorId int, broadcastName, sec
 }
 
 // EditVoiceBroadcast 编辑语音播报
-func EditVoiceBroadcast(broadcastId, sectionId, varietyId, authorId int, broadcastName, sectionName, varietyName, author, voiceSeconds, voiceSize, voiceUrl, imgs string, userInfo user.UserInfo) (resp response.Broadcast, err error) {
+func EditVoiceBroadcast(broadcastId, sectionId, varietyId, authorId int, broadcastName, sectionName, varietyName, author, voiceSeconds, voiceSize, voiceUrl, imgs, centralArguments string, userInfo user.UserInfo) (resp response.Broadcast, err error) {
 	if broadcastId <= 0 {
 		return
 	}
@@ -284,7 +285,7 @@ func EditVoiceBroadcast(broadcastId, sectionId, varietyId, authorId int, broadca
 	}
 	nowTime := time.Now().Local()
 	updateCols := []string{"BroadcastName", "SectionId", "SectionName", "VarietyId", "VarietyName", "AuthorId", "Author", "VoiceUrl",
-		"VoicePlaySeconds", "VoiceSize", "ModifyTime"}
+		"VoicePlaySeconds", "VoiceSize", "ModifyTime", "CentralArguments"}
 	item.BroadcastName = broadcastName
 	item.SectionId = sectionId
 	item.SectionName = sectionName
@@ -296,6 +297,7 @@ func EditVoiceBroadcast(broadcastId, sectionId, varietyId, authorId int, broadca
 	item.VoicePlaySeconds = voiceSeconds
 	item.VoiceSize = voiceSize
 	item.ModifyTime = nowTime.Format(utils.FormatDateTime)
+	item.CentralArguments = centralArguments
 	// 图片
 	imgList := make([]*voice_broadcast_img.YbVoiceBroadcastImg, 0)
 	if imgs != "" {