kobe6258 4 сар өмнө
parent
commit
ab8ba877bd

+ 1 - 0
controllers/media/media_controller.go

@@ -133,6 +133,7 @@ func (m *MediaController) List(mediaType string, permissionIds string) {
 
 type RecordCountReq struct {
 	MediaId   int    `json:"mediaId"`
+	MediaName string `json:"mediaName"`
 	TraceId   string `json:"traceId"`
 	MediaType string `json:"mediaType"`
 }

+ 10 - 9
domian/user/user_source_click_flow_service.go

@@ -9,15 +9,16 @@ import (
 )
 
 type RecordCountDTO struct {
-	UserId     int
-	TraceId    string
-	Mobile     string
-	SourceId   int
-	SourceType userDao.SourceType
-	IpAddress  string
-	Location   string
-	Referer    string
-	Additional string
+	UserId      int
+	TraceId     string
+	Mobile      string
+	SourceId    int
+	SourceTitle string
+	SourceType  userDao.SourceType
+	IpAddress   string
+	Location    string
+	Referer     string
+	Additional  string
 }
 
 const (

+ 2 - 1
models/user/user_source_click_flow.go

@@ -16,7 +16,8 @@ type UserSourceClickFlow struct {
 	TraceId             string     `gorm:"column:trace_id"`
 	UserID              int        `gorm:"column:user_id"` // 用户ID\
 	Mobile              string     `gorm:"column:mobile"`
-	SourceId            int        `gorm:"column:source_id"` // 研报ID
+	SourceId            int        `gorm:"column:source_id"`    // 研报ID
+	SourceTitle         string     `gorm:"column:source_title"` // 研报ID
 	SourceType          SourceType `gorm:"column:source_type;type:enum('REPORT','VIDEO','AUDIO')"`
 	ClickTime           time.Time  `gorm:"column:click_time"` // 点击时间
 	ReadDurationSeconds int64      `gorm:"column:read_duration_seconds"`

+ 4 - 2
service/media/media_service.go

@@ -35,6 +35,7 @@ type RecordCount struct {
 	UserId     int
 	Mobile     string
 	MediaId    int
+	MediaName  string
 	TraceId    string
 	MediaType  string
 	IpAddress  string
@@ -53,13 +54,14 @@ func convertToMediaCountDTO(record RecordCount) (dto userService.RecordCountDTO)
 }
 
 func CountMedia(count RecordCount) (traceId string, err error) {
-	meida, err := mediaService.GetMediaById(count.MediaType, count.MediaId)
+	media, err := mediaService.GetMediaById(count.MediaType, count.MediaId)
 	if err != nil {
 		err = exception.New(exception.MediaFoundFailed)
 		return
 	}
 	dto := convertToMediaCountDTO(count)
-	return userService.CountMedia(dto, meida.MediaType)
+	dto.SourceTitle = media.MediaName
+	return userService.CountMedia(dto, media.MediaType)
 }
 
 func RangeSearchByAnalyst(mediaType string, analystId int, userId int) (total int64, latestId int64, ids []int, mappingRiskLevel string) {

+ 6 - 0
service/report/report_service.go

@@ -415,7 +415,13 @@ func GetReportPageByAnalyst(pageInfo page.PageInfo, analyst string, reportIds []
 	return
 }
 func CountReport(count RecordCount) (traceId string, err error) {
+	report, err := reportService.GetReportById(count.ReportId)
+	if err != nil {
+		err = exception.New(exception.GetReportFailed)
+		return
+	}
 	dto := convertToRecordCountDTO(count)
+	dto.SourceTitle = report.Title
 	return userService.CountReport(dto)
 }
 func GetRandedReportByWeeklyHot(limit int, isLogin bool, userId int, pdRiskLevel string) (reports []HotRankedReport, err error) {