Browse Source

英文报告详情

ziwen 2 years ago
parent
commit
486fd7c3e6
4 changed files with 474 additions and 0 deletions
  1. 47 0
      controllers/english_report.go
  2. 43 0
      models/english_report.go
  3. 379 0
      routers/commentsRouter.go
  4. 5 0
      routers/router.go

+ 47 - 0
controllers/english_report.go

@@ -0,0 +1,47 @@
+package controllers
+
+import (
+	"hongze/hongze_api/models"
+	"html"
+)
+
+//报告分享
+type EnglishReportShareController struct {
+	BaseCommonController
+}
+
+// @Title 日评详情
+// @Description 日评详情接口
+// @Param   ReportCode   query   string  true       "报告唯一编码"
+// @Success 200 {object} models.ReportShareDetailResp
+// @router /share/detail [get]
+func (this *ReportShareController) EnglishReportDetail() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+
+	reportCode := this.GetString("ReportCode")
+	if reportCode == "" {
+		br.Msg = "参数错误"
+		br.ErrMsg = "参数错误,reportCode 为空"
+		return
+	}
+	report, err := models.GetEnglishReportByCode(reportCode)
+	if err != nil {
+		br.Msg = "该报告已删除"
+		br.ErrMsg = "获取报告详情失败,Err:" + err.Error()
+		return
+	}
+
+	report.ContentSub = html.UnescapeString(report.ContentSub)
+	report.Content = html.UnescapeString(report.Content)
+
+	resp := new(models.EnglishReportShareDetailResp)
+	resp.Report = report
+	br.Ret = 200
+	br.Success = true
+	br.Msg = "获取成功"
+	br.Data = resp
+}

+ 43 - 0
models/english_report.go

@@ -0,0 +1,43 @@
+package models
+
+import "github.com/beego/beego/v2/client/orm"
+
+type EnglishReportDetail struct {
+	Id                 int    `orm:"column(id)" description:"报告Id"`
+	AddType            int    `description:"新增方式:1:新增报告,2:继承报告"`
+	ClassifyIdFirst    int    `description:"一级分类id"`
+	ClassifyNameFirst  string `description:"一级分类名称"`
+	ClassifyIdSecond   int    `description:"二级分类id"`
+	ClassifyNameSecond string `description:"二级分类名称"`
+	Title              string `description:"标题"`
+	Abstract           string `description:"摘要"`
+	Author             string `description:"作者"`
+	Frequency          string `description:"频度"`
+	CreateTime         string `description:"创建时间"`
+	ModifyTime         string `description:"修改时间"`
+	State              int    `description:"1:未发布,2:已发布"`
+	PublishTime        string `description:"发布时间"`
+	Stage              int    `description:"期数"`
+	MsgIsSend          int    `description:"消息是否已发送,0:否,1:是"`
+	Content            string `description:"内容"`
+	VideoUrl           string `description:"音频文件URL"`
+	VideoName          string `description:"音频文件名称"`
+	VideoPlaySeconds   string `description:"音频播放时长"`
+	ContentSub         string `description:"内容前两个章节"`
+	ThsMsgIsSend       int    `description:"客户群消息是否已发送,0:否,1:是"`
+	HasChapter         int    `description:"是否有章节 0-否 1-是"`
+	ChapterType        string `description:"章节类型 day-晨报 week-周报"`
+}
+
+
+func GetEnglishReportByCode(reportCode string) (item *EnglishReportDetail, err error) {
+	o := orm.NewOrmUsingDB("rddp")
+	sql := `SELECT * FROM english_report WHERE report_code=?`
+	err = o.Raw(sql, reportCode).QueryRow(&item)
+	return
+}
+
+
+type EnglishReportShareDetailResp struct {
+	Report *EnglishReportDetail `description:"报告"`
+}

+ 379 - 0
routers/commentsRouter.go

@@ -0,0 +1,379 @@
+package routers
+
+import (
+	beego "github.com/beego/beego/v2/server/web"
+	"github.com/beego/beego/v2/server/web/context/param"
+)
+
+func init() {
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:BillController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:BillController"],
+        beego.ControllerComments{
+            Method: "Detail",
+            Router: `/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ClassifyCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ClassifyCommonController"],
+        beego.ControllerComments{
+            Method: "List",
+            Router: `/pc/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ClassifyCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ClassifyCommonController"],
+        beego.ControllerComments{
+            Method: "SecondList",
+            Router: `/pc/second/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ClassifyController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ClassifyController"],
+        beego.ControllerComments{
+            Method: "Detail",
+            Router: `/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeCommonController"],
+        beego.ControllerComments{
+            Method: "PcListBanner",
+            Router: `/pc/banner`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeCommonController"],
+        beego.ControllerComments{
+            Method: "PcColumnList",
+            Router: `/pc/column/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeCommonController"],
+        beego.ControllerComments{
+            Method: "ListHome",
+            Router: `/pc/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeController"],
+        beego.ControllerComments{
+            Method: "ListBanner",
+            Router: `/banner`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:HomeController"],
+        beego.ControllerComments{
+            Method: "ListHome",
+            Router: `/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportCommonController"],
+        beego.ControllerComments{
+            Method: "ResearchReportList",
+            Router: `/pc/research/report/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportCommonController"],
+        beego.ControllerComments{
+            Method: "PcSearchReportList",
+            Router: `/pc/search/report/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"],
+        beego.ControllerComments{
+            Method: "AddAudioRecord",
+            Router: `/addAudioRecord`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"],
+        beego.ControllerComments{
+            Method: "AddUpdateLabelReport",
+            Router: `/addUpdateLabel`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"],
+        beego.ControllerComments{
+            Method: "AddViewRecordReport",
+            Router: `/addViewRecord`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"],
+        beego.ControllerComments{
+            Method: "AuthorDetail",
+            Router: `/author/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"],
+        beego.ControllerComments{
+            Method: "Detail",
+            Router: `/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportController"],
+        beego.ControllerComments{
+            Method: "ListReport",
+            Router: `/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportShareController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportShareController"],
+        beego.ControllerComments{
+            Method: "EnglishReportDetail",
+            Router: `/share/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportShareController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:ReportShareController"],
+        beego.ControllerComments{
+            Method: "Detail",
+            Router: `/share/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:RunLogController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:RunLogController"],
+        beego.ControllerComments{
+            Method: "Edit",
+            Router: `/save`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserController"],
+        beego.ControllerComments{
+            Method: "Apply",
+            Router: `/apply`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserController"],
+        beego.ControllerComments{
+            Method: "Detail",
+            Router: `/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserController"],
+        beego.ControllerComments{
+            Method: "SmallLimit",
+            Router: `/smallLimit`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"],
+        beego.ControllerComments{
+            Method: "CheckEmailCode",
+            Router: `/checkEmailCode`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"],
+        beego.ControllerComments{
+            Method: "CheckSmsCode",
+            Router: `/checkSmsCode`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"],
+        beego.ControllerComments{
+            Method: "GetEmailCode",
+            Router: `/getEmailCode`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"],
+        beego.ControllerComments{
+            Method: "GetSmsCode",
+            Router: `/getSmsCode`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"],
+        beego.ControllerComments{
+            Method: "Login",
+            Router: `/login`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserNotAuthController"],
+        beego.ControllerComments{
+            Method: "Test",
+            Router: `/test`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"],
+        beego.ControllerComments{
+            Method: "PcBind",
+            Router: `/pc/bind`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"],
+        beego.ControllerComments{
+            Method: "CheckLogin",
+            Router: `/pc/check/login`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"],
+        beego.ControllerComments{
+            Method: "GetGraphicVerifyCode",
+            Router: `/pc/getGraphicVerifyCode`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"],
+        beego.ControllerComments{
+            Method: "PcGetSmsCode",
+            Router: `/pc/getSmsCode`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:UserPcNotAuthController"],
+        beego.ControllerComments{
+            Method: "PcLogin",
+            Router: `/pc/login`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:VideoController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:VideoController"],
+        beego.ControllerComments{
+            Method: "List",
+            Router: `/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:VideoController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:VideoController"],
+        beego.ControllerComments{
+            Method: "TagsList",
+            Router: `/tags/list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:WechatCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:WechatCommonController"],
+        beego.ControllerComments{
+            Method: "WechatLogin",
+            Router: `/login`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:WechatCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:WechatCommonController"],
+        beego.ControllerComments{
+            Method: "Notify",
+            Router: `/notify`,
+            AllowHTTPMethods: []string{"get","post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:WechatCommonController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:WechatCommonController"],
+        beego.ControllerComments{
+            Method: "PcWechatLogin",
+            Router: `/pc/login`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:WechatController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:WechatController"],
+        beego.ControllerComments{
+            Method: "GetWxSign",
+            Router: `/getWxSign`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["hongze/hongze_api/controllers:YbApplyController"] = append(beego.GlobalControllerRouter["hongze/hongze_api/controllers:YbApplyController"],
+        beego.ControllerComments{
+            Method: "YbApply",
+            Router: `/ybApply`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+}

+ 5 - 0
routers/router.go

@@ -90,6 +90,11 @@ func init() {
 				&controllers.RunLogController{},
 			),
 		),
+		web.NSNamespace("/english_report",
+			web.NSInclude(
+				&controllers.EnglishReportShareController{},
+			),
+		),
 	)
 	web.AddNamespace(ns)
 }