|
@@ -8,37 +8,39 @@ import (
|
|
|
"hongze/hongze_yb/models/tables/rddp/banner"
|
|
|
"hongze/hongze_yb/models/tables/rddp/classify"
|
|
|
"hongze/hongze_yb/models/tables/rddp/report"
|
|
|
+ "hongze/hongze_yb/models/tables/yb_pc_suncode"
|
|
|
+ "hongze/hongze_yb/services"
|
|
|
"hongze/hongze_yb/services/pc"
|
|
|
userService "hongze/hongze_yb/services/user"
|
|
|
+ "hongze/hongze_yb/utils"
|
|
|
"strconv"
|
|
|
)
|
|
|
|
|
|
// LatestNews 研报首页最新资讯
|
|
|
-func LatestNews(c *gin.Context) {
|
|
|
- banner,err := banner.GetHomeBannerList()
|
|
|
+func LatestNews(c *gin.Context) {
|
|
|
+ banner, err := banner.GetHomeBannerList()
|
|
|
if err != nil {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", banner, c )
|
|
|
+ response.OkData("查询成功", banner, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// Banner 首页banner图
|
|
|
-func Banner(c *gin.Context) {
|
|
|
- banner,err := banner.GetHomeBannerList()
|
|
|
+func Banner(c *gin.Context) {
|
|
|
+ banner, err := banner.GetHomeBannerList()
|
|
|
if err != nil {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", banner, c )
|
|
|
+ response.OkData("查询成功", banner, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// LatestRelease 上新公告
|
|
|
-func LatestRelease(c *gin.Context) {
|
|
|
- classifyIdString := c.DefaultQuery("ClassifyId","")
|
|
|
+func LatestRelease(c *gin.Context) {
|
|
|
+ classifyIdString := c.DefaultQuery("ClassifyId", "")
|
|
|
if classifyIdString == "" {
|
|
|
response.Fail("请输入classifyId", c)
|
|
|
return
|
|
@@ -55,12 +57,12 @@ func LatestRelease(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- response.OkData("查询成功", classifyInfo, c )
|
|
|
+ response.OkData("查询成功", classifyInfo, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// ClassifyDetail 专栏详情
|
|
|
-func ClassifyDetail(c *gin.Context) {
|
|
|
+func ClassifyDetail(c *gin.Context) {
|
|
|
reqClassifyIdSecond := c.DefaultQuery("classify_id_second", "")
|
|
|
if reqClassifyIdSecond == "" {
|
|
|
response.Fail("请输入二级分类标识", c)
|
|
@@ -79,12 +81,12 @@ func ClassifyDetail(c *gin.Context) {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", detail, c )
|
|
|
+ response.OkData("查询成功", detail, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// ClassifyDetailBanner 专栏详情banner图
|
|
|
-func ClassifyDetailBanner(c *gin.Context) {
|
|
|
+func ClassifyDetailBanner(c *gin.Context) {
|
|
|
reqReportId := c.DefaultQuery("reportId", "")
|
|
|
if reqReportId == "" {
|
|
|
response.Fail("请输入二级分类标识", c)
|
|
@@ -115,12 +117,12 @@ func ClassifyDetailBanner(c *gin.Context) {
|
|
|
response.Fail("分类查询出错", c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", classifyInfo, c )
|
|
|
+ response.OkData("查询成功", classifyInfo, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// Recommend 专栏详情页更多推荐
|
|
|
-func Recommend(c *gin.Context) {
|
|
|
+func Recommend(c *gin.Context) {
|
|
|
reqReportId := c.DefaultQuery("reportId", "")
|
|
|
if reqReportId == "" {
|
|
|
response.Fail("请输入二级分类标识", c)
|
|
@@ -158,12 +160,12 @@ func Recommend(c *gin.Context) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- response.OkData("查询成功", recommendList, c )
|
|
|
+ response.OkData("查询成功", recommendList, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// ClassifyFirstList Ficc 菜单
|
|
|
-func ClassifyFirstList(c *gin.Context) {
|
|
|
+func ClassifyFirstList(c *gin.Context) {
|
|
|
userinfo := userService.GetInfoByClaims(c)
|
|
|
|
|
|
classList, err := pc.GetClassifyFirstList(userinfo)
|
|
@@ -171,17 +173,50 @@ func ClassifyFirstList(c *gin.Context) {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", classList, c )
|
|
|
+ response.OkData("查询成功", classList, c)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
// CustomerComment 客户评价
|
|
|
-func CustomerComment(c *gin.Context) {
|
|
|
- lists,err := customer_comment.GetCustomerComment()
|
|
|
+func CustomerComment(c *gin.Context) {
|
|
|
+ lists, err := customer_comment.GetCustomerComment()
|
|
|
if err != nil {
|
|
|
response.Fail(err.Error(), c)
|
|
|
return
|
|
|
}
|
|
|
- response.OkData("查询成功", lists, c )
|
|
|
+ response.OkData("查询成功", lists, c)
|
|
|
return
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+// GetSunCode 获取太阳码
|
|
|
+// @Tags 公共模块
|
|
|
+// @Summary 获取分享海报
|
|
|
+// @Description 获取分享海报
|
|
|
+// @Param CodeScene query string true "scene值"
|
|
|
+// @Param CodePage query string true "codePage"
|
|
|
+// @Success 200 {object} string "获取成功"
|
|
|
+// @failure 400 {string} string "获取失败"
|
|
|
+// @Router /pc/getSunCode [post]
|
|
|
+func GetSunCode(c *gin.Context) {
|
|
|
+ codeScene := c.Query("CodeScene")
|
|
|
+ codePage := c.Query("CodePage")
|
|
|
+
|
|
|
+ var sunCodeUrl string
|
|
|
+ //先查,查不到再去生成上传
|
|
|
+ item,err := yb_pc_suncode.GetYbPcSunCode(codeScene, codePage)
|
|
|
+ sunCodeUrl = item.SuncodeURL
|
|
|
+ if err != nil && err != utils.ErrNoRow{
|
|
|
+ response.Fail(err.Error(), c)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if sunCodeUrl == ""{
|
|
|
+ sunCodeUrl, err = services.PcCreateAndUploadSunCode(codePage, codeScene)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ response.OkData("查询成功", sunCodeUrl, c)
|
|
|
+ return
|
|
|
+}
|