yanxuan_special.go 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257
  1. package controllers
  2. import (
  3. "encoding/json"
  4. "github.com/rdlucklib/rdluck_tools/paging"
  5. "hongze/hongze_web_mfyx/models"
  6. "hongze/hongze_web_mfyx/services"
  7. "hongze/hongze_web_mfyx/utils"
  8. "path"
  9. "strconv"
  10. "strings"
  11. "time"
  12. )
  13. type YanxuanSpecialController struct {
  14. BaseAuthController
  15. }
  16. type YanxuanSpecialNoLoginController struct {
  17. BaseAuthMobileController
  18. }
  19. // @Title 专栏列表
  20. // @Description 专栏列表
  21. // @Param SpecialColumnId query int true "作者专栏ID"
  22. // @Param PageSize query int true "每页数据条数"
  23. // @Param CurrentIndex query int true "当前页页码,从1开始"
  24. // @Success 200 {object} models.AddEnglishReportResp
  25. // @router /list [get]
  26. func (this *YanxuanSpecialNoLoginController) List() {
  27. br := new(models.BaseResponse).Init()
  28. defer func() {
  29. this.Data["json"] = br
  30. this.ServeJSON()
  31. }()
  32. sysUser := this.User
  33. if sysUser == nil {
  34. br.Msg = "请登录"
  35. br.ErrMsg = "请登录,SysUser Is Empty"
  36. br.Ret = 408
  37. return
  38. }
  39. specialColumnId, _ := this.GetInt("SpecialColumnId", 0)
  40. pageSize, _ := this.GetInt("PageSize")
  41. currentIndex, _ := this.GetInt("CurrentIndex")
  42. var startSize int
  43. if pageSize <= 0 {
  44. pageSize = utils.PageSize20
  45. }
  46. if currentIndex <= 0 {
  47. currentIndex = 1
  48. }
  49. startSize = utils.StartIndex(currentIndex, pageSize)
  50. resp := new(models.SpecialListResp)
  51. var condition string
  52. var pars []interface{}
  53. if specialColumnId > 0 {
  54. authorItem, err := models.GetYanxuanSpecialAuthorById(specialColumnId)
  55. if err != nil {
  56. br.Msg = "查询栏目详情失败!"
  57. br.ErrMsg = "查询栏目详情失败,Err:" + err.Error()
  58. return
  59. }
  60. condition += ` AND a.user_id = ? `
  61. pars = append(pars, authorItem.UserId)
  62. }
  63. condition += ` AND a.status = 3 `
  64. total, err := models.GetCygxYanxuanSpecialCount(condition, pars)
  65. if err != nil {
  66. br.Msg = "获取失败"
  67. br.ErrMsg = "获取失败, Err:" + err.Error()
  68. return
  69. }
  70. list, err := models.GetYanxuanSpecialList(sysUser.UserId, condition, pars, startSize, pageSize)
  71. if err != nil {
  72. br.Msg = "获取失败"
  73. br.ErrMsg = "获取失败, Err:" + err.Error()
  74. return
  75. }
  76. var yanxuanSpecialIds []int
  77. for _, v := range list {
  78. yanxuanSpecialIds = append(yanxuanSpecialIds, v.Id)
  79. }
  80. yanxuanSpecialPv := services.GetYanxuanSpecialRecordByYanxuanSpecialId(yanxuanSpecialIds)
  81. for _, v := range list {
  82. hasImg, err := utils.ArticleHasImgUrl(v.Content)
  83. if err != nil {
  84. return
  85. }
  86. if hasImg {
  87. v.ContentHasImg = 1
  88. }
  89. v.ImgUrl = strings.TrimRight(v.ImgUrl, ",")
  90. //去除图片标签
  91. v.Content = utils.ArticleRemoveImgUrl(v.Content)
  92. //v.Content, err = utils.ExtractText(v.Content)
  93. if v.DocUrl != "" {
  94. var docs []models.Doc
  95. err := json.Unmarshal([]byte(v.DocUrl), &docs)
  96. if err != nil {
  97. br.Msg = "参数解析异常!"
  98. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  99. return
  100. }
  101. v.Docs = docs
  102. }
  103. if v.MyCollectNum > 0 {
  104. v.IsCollect = 1
  105. }
  106. if v.ImgUrl != "" {
  107. imgList := strings.Split(v.ImgUrl, ",")
  108. for _, s := range imgList {
  109. v.ImgUrlList = append(v.ImgUrlList, s)
  110. }
  111. } else {
  112. v.ImgUrlList = []string{}
  113. }
  114. if v.CompanyTags != "" {
  115. tagList := strings.Split(v.CompanyTags, ",")
  116. for _, s := range tagList {
  117. v.TagList = append(v.TagList, s)
  118. }
  119. }
  120. if v.IndustryTags != "" {
  121. tagList := strings.Split(v.IndustryTags, ",")
  122. for _, s := range tagList {
  123. v.TagList = append(v.TagList, s)
  124. }
  125. }
  126. if len(v.TagList) == 0 {
  127. v.TagList = []string{}
  128. }
  129. v.Pv = yanxuanSpecialPv[v.Id]
  130. }
  131. specialAuthorCheck := services.GetYanxuanSpecialAuthorInfo(sysUser) //用户是否没开通研选专栏以及,专栏信息是否完善
  132. resp.IsAuthor = specialAuthorCheck.IsAuthor
  133. resp.IsImproveInformation = specialAuthorCheck.IsImproveInformation
  134. resp.List = list
  135. page := paging.GetPaging(currentIndex, pageSize, total)
  136. resp.Paging = page
  137. br.Data = resp
  138. br.Ret = 200
  139. br.Success = true
  140. br.Msg = "获取成功"
  141. }
  142. // @Title 专栏详情
  143. // @Description 专栏详情
  144. // @Param request body help_doc.AddHelpDocReq true "type json string"
  145. // @Param InviteShareCode query string false "销售账号邀请码"
  146. // @Success 200 {object} models.AddEnglishReportResp
  147. // @router /detail [get]
  148. func (this *YanxuanSpecialNoLoginController) Detail() {
  149. br := new(models.BaseResponse).Init()
  150. defer func() {
  151. this.Data["json"] = br
  152. this.ServeJSON()
  153. }()
  154. sysUser := this.User
  155. if sysUser == nil {
  156. br.Msg = "请登录"
  157. br.ErrMsg = "请登录,SysUser Is Empty"
  158. br.Ret = 408
  159. return
  160. }
  161. specialId, _ := this.GetInt("Id", 0)
  162. inviteShareCode := this.GetString("InviteShareCode")
  163. if specialId <= 0 {
  164. br.Msg = "参数错误"
  165. br.ErrMsg = "参数错误"
  166. return
  167. }
  168. item, tmpErr := models.GetYanxuanSpecialById(specialId, sysUser.UserId)
  169. if tmpErr != nil {
  170. br.Msg = "获取失败"
  171. br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
  172. return
  173. }
  174. //记录分享来源
  175. if inviteShareCode != "" {
  176. go services.AddCygxUserAdminShareHistory(sysUser, utils.CYGX_OBJ_YANXUANSPECIAL, item.Title, inviteShareCode, specialId)
  177. }
  178. if item.MyCollectNum > 0 {
  179. item.IsCollect = 1
  180. }
  181. var resp models.CygxYanxuanSpecialResp
  182. resp.HasPermission = 1
  183. resp.CygxYanxuanSpecialItem = *item
  184. if item.DocUrl != "" {
  185. var docs []models.Doc
  186. err := json.Unmarshal([]byte(item.DocUrl), &docs)
  187. if err != nil {
  188. br.Msg = "参数解析异常!"
  189. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  190. return
  191. }
  192. resp.Docs = docs
  193. }
  194. if item.ImgUrl != "" {
  195. imgList := strings.Split(item.ImgUrl, ",")
  196. for _, s := range imgList {
  197. resp.ImgUrlList = append(resp.ImgUrlList, s)
  198. }
  199. } else {
  200. resp.ImgUrlList = []string{}
  201. }
  202. if item.CompanyTags != "" {
  203. cTagList := strings.Split(item.CompanyTags, ",")
  204. for _, s := range cTagList {
  205. resp.CompanyTags = append(resp.CompanyTags, s)
  206. }
  207. } else {
  208. resp.CompanyTags = []string{}
  209. }
  210. if item.IndustryTags != "" {
  211. iTagList := strings.Split(item.IndustryTags, ",")
  212. for _, s := range iTagList {
  213. resp.IndustryTags = append(resp.IndustryTags, s)
  214. }
  215. } else {
  216. resp.IndustryTags = []string{}
  217. }
  218. var configCode string
  219. //如果是研选的就推送给汪洋跟王芳,否则就推送给王芳
  220. configCode = utils.TPL_MSG_WANG_FANG_WANG_YANG
  221. cnf, err := models.GetConfigByCode(configCode)
  222. if err != nil {
  223. br.Msg = "获取失败"
  224. br.ErrMsg = "获取失败, Err:" + err.Error()
  225. return
  226. }
  227. if item.UserId != sysUser.UserId && item.Status != 3 && !strings.Contains(cnf.ConfigValue, sysUser.Mobile) {
  228. resp.CygxYanxuanSpecialItem = *new(models.CygxYanxuanSpecialItem) // 如果内容不可见,就把内容置空
  229. resp.CygxYanxuanSpecialItem.Status = item.Status
  230. //resp.HasPermission = 2
  231. }
  232. //如果是用户本人写的专栏,那么就不做校验
  233. //if item.UserId == sysUser.UserId || sysUser.UserId == 0 {
  234. // resp.HasPermission = 1
  235. //} else {
  236. // hasPermission, err := services.GetUserRaiPermissionYanXuanInfo(sysUser)
  237. // if err != nil {
  238. // br.Msg = "获取失败"
  239. // br.ErrMsg = "获取失败, Err:" + err.Error()
  240. // return
  241. // }
  242. // resp.HasPermission = hasPermission
  243. //}
  244. //判断是否属于审核人员
  245. mobileSlice := strings.Split(cnf.ConfigValue, ",")
  246. for _, v := range mobileSlice {
  247. if v == sysUser.Mobile {
  248. resp.IsApprovalAdmin = true
  249. }
  250. }
  251. fllowNum, err := models.GetCygxYanxuanSpecialFollowCountByUserId(sysUser.UserId, item.UserId)
  252. if err != nil {
  253. br.Msg = "获取失败"
  254. br.ErrMsg = "获取是否关注作者失败, Err:" + err.Error()
  255. return
  256. }
  257. if fllowNum == 1 {
  258. resp.IsFollowAuthor = true
  259. }
  260. //
  261. //if resp.HasPermission != 1 || sysUser.UserId == 0 {
  262. // resp.Content = utils.InterceptHtmlLength(resp.Content, 240)
  263. //}
  264. //resp.ShareImg = utils.YANXUAN_SPECIAL_SHARE_IMG
  265. resp.ShareImg = resp.HeadImg
  266. br.Data = resp
  267. br.Ret = 200
  268. br.Success = true
  269. br.Msg = "获取成功"
  270. }
  271. // @Title 新增保存专栏作者详情
  272. // @Description 新增保存专栏作者详情
  273. // @Param request body help_doc.AddHelpDocReq true "type json string"
  274. // @Success 200 {object} models.AddEnglishReportResp
  275. // @router /author/save [post]
  276. func (this *YanxuanSpecialController) AuthorSave() {
  277. br := new(models.BaseResponse).Init()
  278. defer func() {
  279. this.Data["json"] = br
  280. this.ServeJSON()
  281. }()
  282. sysUser := this.User
  283. if sysUser == nil {
  284. br.Msg = "请登录"
  285. br.ErrMsg = "请登录,SysUser Is Empty"
  286. br.Ret = 408
  287. return
  288. }
  289. var req models.SaveCygxYanxuanSpecialAuthorReq
  290. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  291. if err != nil {
  292. br.Msg = "参数解析异常!"
  293. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  294. return
  295. }
  296. if req.SpecialColumnId <= 0 {
  297. br.Msg = "栏目id有误"
  298. return
  299. }
  300. if req.SpecialName == "" {
  301. br.Msg = "请输入专栏名称"
  302. return
  303. }
  304. if req.NickName == "" {
  305. br.Msg = "请输入昵称"
  306. return
  307. }
  308. item := models.CygxYanxuanSpecialAuthor{
  309. Id: req.SpecialColumnId,
  310. UserId: sysUser.UserId,
  311. SpecialName: req.SpecialName,
  312. Introduction: req.Introduction,
  313. Label: req.Label,
  314. NickName: req.NickName,
  315. CreateTime: time.Now(),
  316. ModifyTime: time.Now(),
  317. BgImg: "",
  318. Status: 1,
  319. }
  320. //if req.Id == 0{
  321. // _, err = models.AddCygxYanxuanSpecialAuthor(&item)
  322. // if err != nil {
  323. // br.Msg = "新增失败"
  324. // br.ErrMsg = "新增失败,Err:" + err.Error()
  325. // return
  326. // }
  327. //} else {
  328. // err = models.UpdateYanxuanSpecialAuthor(&item)
  329. // if err != nil {
  330. // br.Msg = "保存失败"
  331. // br.ErrMsg = "保存失败,Err:" + err.Error()
  332. // return
  333. // }
  334. //}
  335. err = models.UpdateYanxuanSpecialAuthor(&item)
  336. if err != nil {
  337. br.Msg = "保存失败"
  338. br.ErrMsg = "保存失败,Err:" + err.Error()
  339. return
  340. }
  341. br.Ret = 200
  342. br.Success = true
  343. br.Msg = "保存成功"
  344. }
  345. // @Title 新增保存专栏
  346. // @Description 新增保存专栏
  347. // @Param request body help_doc.AddHelpDocReq true "type json string"
  348. // @Success 200 {object} models.AddEnglishReportResp
  349. // @router /save [post]
  350. func (this *YanxuanSpecialController) Save() {
  351. br := new(models.BaseResponse).Init()
  352. defer func() {
  353. this.Data["json"] = br
  354. this.ServeJSON()
  355. }()
  356. sysUser := this.User
  357. if sysUser == nil {
  358. br.Msg = "请登录"
  359. br.ErrMsg = "请登录,SysUser Is Empty"
  360. br.Ret = 408
  361. return
  362. }
  363. var req models.CygxYanxuanSpecialReq
  364. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  365. if err != nil {
  366. br.Msg = "参数解析异常!"
  367. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  368. return
  369. }
  370. if req.Content == "" && req.DoType == 2 {
  371. br.Msg = "请输入内容"
  372. return
  373. }
  374. if len(req.CompanyTags) == 0 && len(req.IndustryTags) == 0 && req.DoType == 2 {
  375. br.Msg = "请至少输入一个标签"
  376. return
  377. }
  378. if len(req.Docs) > 0 {
  379. for i, doc := range req.Docs {
  380. extMap := services.GetCloudDiskResourceFileTypeExtMap()
  381. ext := path.Ext(doc.DocName)
  382. req.Docs[i].DocIcon = extMap[ext]
  383. }
  384. }
  385. docUrl, err := json.Marshal(req.Docs)
  386. if err != nil {
  387. return
  388. }
  389. imgUrls := strings.Join(req.ImgUrl, ",")
  390. cTags := strings.Join(req.CompanyTags, ",")
  391. iTags := strings.Join(req.IndustryTags, ",")
  392. isApprovalPersonnel := req.IsApprovalPersonnel
  393. item := models.CygxYanxuanSpecial{
  394. Id: req.Id,
  395. UserId: sysUser.UserId,
  396. CreateTime: time.Now(),
  397. ModifyTime: time.Now(),
  398. PublishTime: time.Now(),
  399. Content: req.Content,
  400. CompanyTags: cTags,
  401. IndustryTags: iTags,
  402. ImgUrl: imgUrls,
  403. DocUrl: string(docUrl),
  404. Title: req.Title,
  405. Type: req.Type,
  406. }
  407. if req.DoType == 1 {
  408. item.Status = 1
  409. br.Msg = "保存成功"
  410. } else {
  411. item.Status = 2
  412. br.Msg = "已提交审核"
  413. }
  414. var authorUserId int
  415. // 如果是审批人员操作的那么就是修改内容,加审批通过
  416. if isApprovalPersonnel {
  417. item.Status = 3
  418. //校验是否属于审核人员
  419. if !services.CheckYxSpecialIsApprovalPersonnel(sysUser.Mobile) {
  420. br.Msg = "操作失败"
  421. br.ErrMsg = "操作失败,该账号不属于审核人员:" + sysUser.Mobile
  422. return
  423. }
  424. specialItem, err := models.GetYanxuanSpecialItemById(req.Id)
  425. if err != nil {
  426. br.Msg = "保存失败"
  427. br.ErrMsg = "保存失败,Err:" + err.Error()
  428. return
  429. }
  430. item.UserId = specialItem.UserId // 专栏userid还是原有userId
  431. authorUserId = specialItem.UserId
  432. item.AdminName = sysUser.RealName //审核人员姓名
  433. br.Msg = "审批成功"
  434. }
  435. specialId := 0
  436. if req.Id == 0 {
  437. id, err := models.AddCygxYanxuanSpecial(&item)
  438. if err != nil {
  439. br.Msg = "新增失败"
  440. br.ErrMsg = "新增失败,Err:" + err.Error()
  441. return
  442. }
  443. specialId = int(id)
  444. } else {
  445. detail, tmpErr := models.GetYanxuanSpecialById(req.Id, sysUser.UserId)
  446. if tmpErr != nil {
  447. br.Msg = "获取失败"
  448. br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
  449. return
  450. }
  451. if detail.Status == 2 && !isApprovalPersonnel {
  452. br.Msg = "请勿重复提交"
  453. br.ErrMsg = "保存失败,专栏内容正在审核"
  454. return
  455. }
  456. err = models.UpdateYanxuanSpecial(&item)
  457. if err != nil {
  458. br.Msg = "保存失败"
  459. br.ErrMsg = "保存失败,Err:" + err.Error()
  460. return
  461. }
  462. specialId = req.Id
  463. }
  464. if isApprovalPersonnel {
  465. go services.UpdateYanxuanSpecialResourceData(specialId) // 写入首页最新 cygx_resource_data 表
  466. go services.EsAddYanxuanSpecial(specialId) // 写入es 综合搜索
  467. go services.SendWxMsgSpecialFollow(req.Id) //研选专栏有新内容审核通过时,给关注此专栏的客户发送模板消息
  468. go services.SendWxMsgSpecialAuthor(req.Id, 2) //研选专栏审核完成时,给提交人发送模板消息
  469. go services.UdpateYanxuanSpecialauthorArticleNum(authorUserId) // 更新作者发布文章的数量
  470. } else {
  471. if req.DoType == 2 {
  472. go services.SendReviewTemplateMsgAdmin(specialId)
  473. go services.UpdateYanxuanSpecialResourceData(specialId) // 写入首页最新 cygx_resource_data 表
  474. go services.EsAddYanxuanSpecial(specialId) // 写入es 综合搜索
  475. }
  476. }
  477. br.Ret = 200
  478. br.Success = true
  479. br.Data = specialId
  480. }
  481. // @Title 专栏作者详情
  482. // @Description 专栏作者详情
  483. // @Param request body help_doc.AddHelpDocReq true "type json string"
  484. // @Success 200 {object} models.AddEnglishReportResp
  485. // @router /author/detail [get]
  486. func (this *YanxuanSpecialNoLoginController) AuthorDetail() {
  487. br := new(models.BaseResponse).Init()
  488. defer func() {
  489. this.Data["json"] = br
  490. this.ServeJSON()
  491. }()
  492. sysUser := this.User
  493. if sysUser == nil {
  494. br.Msg = "请登录"
  495. br.ErrMsg = "请登录,SysUser Is Empty"
  496. br.Ret = 408
  497. return
  498. }
  499. specialColumnId, _ := this.GetInt("SpecialColumnId", 0)
  500. item, tmpErr := models.GetYanxuanSpecialAuthorBySpecialColumnId(specialColumnId, sysUser.UserId)
  501. if tmpErr != nil && tmpErr.Error() != utils.ErrNoRow() {
  502. br.Msg = "获取失败"
  503. br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
  504. return
  505. }
  506. br.Data = item
  507. br.Ret = 200
  508. br.Success = true
  509. br.Msg = "获取成功"
  510. }
  511. // @Title 审批研选专栏
  512. // @Description 审批研选专栏
  513. // @Param request body help_doc.AddHelpDocReq true "type json string"
  514. // @Success 200 {object} models.AddEnglishReportResp
  515. // @router /enable [post]
  516. func (this *YanxuanSpecialController) Enable() {
  517. br := new(models.BaseResponse).Init()
  518. defer func() {
  519. this.Data["json"] = br
  520. this.ServeJSON()
  521. }()
  522. user := this.User
  523. if user == nil {
  524. br.Msg = "请登录"
  525. br.ErrMsg = "请登录,SysUser Is Empty"
  526. br.Ret = 408
  527. return
  528. }
  529. var req models.EnableCygxYanxuanSpecialReq
  530. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  531. if err != nil {
  532. br.Msg = "参数解析异常!"
  533. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  534. return
  535. }
  536. if req.Id <= 0 {
  537. br.Msg = "文章id错误"
  538. return
  539. }
  540. if req.Status <= 0 {
  541. br.Msg = "参数错误"
  542. return
  543. }
  544. status := 0
  545. if req.Status == 1 {
  546. status = 3
  547. } else {
  548. status = 4
  549. }
  550. detail, err := models.GetYanxuanSpecialItemById(req.Id)
  551. if err != nil {
  552. br.Msg = "审批失败"
  553. br.ErrMsg = "审批失败, Err:" + err.Error()
  554. return
  555. }
  556. if tmpErr := models.EnableYanxuanSpecial(req.Id, status, req.Reason, user.RealName); tmpErr != nil {
  557. br.Msg = "审批失败"
  558. br.ErrMsg = "审批失败, Err:" + tmpErr.Error()
  559. return
  560. }
  561. if req.Status == 1 {
  562. go services.SendWxMsgSpecialFollow(req.Id)
  563. }
  564. go services.SendWxMsgSpecialAuthor(req.Id, req.Status)
  565. go services.UpdateYanxuanSpecialResourceData(req.Id) // 写入首页最新 cygx_resource_data 表
  566. go services.EsAddYanxuanSpecial(req.Id) // 写入es 综合搜索
  567. go services.AddAddCygxYanxuanSpecialApprovalLog(user, req.Id, req.Status, req.Reason) // 写入es 综合搜索
  568. go services.UdpateYanxuanSpecialauthorArticleNum(detail.UserId) // 更新作者发布文章的数量
  569. br.Msg = "审批成功"
  570. br.Ret = 200
  571. br.Success = true
  572. }
  573. // @Title 研选专栏收藏
  574. // @Description 研选专栏收藏
  575. // @Param request body help_doc.AddHelpDocReq true "type json string"
  576. // @Success 200 {object} models.AddEnglishReportResp
  577. // @router /collect [post]
  578. func (this *YanxuanSpecialController) Collect() {
  579. br := new(models.BaseResponse).Init()
  580. defer func() {
  581. this.Data["json"] = br
  582. this.ServeJSON()
  583. }()
  584. user := this.User
  585. if user == nil {
  586. br.Msg = "请登录"
  587. br.ErrMsg = "请登录,SysUser Is Empty"
  588. br.Ret = 408
  589. return
  590. }
  591. var req models.CollectCygxYanxuanSpecialReq
  592. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  593. if err != nil {
  594. br.Msg = "参数解析异常!"
  595. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  596. return
  597. }
  598. if req.Id <= 0 {
  599. br.Msg = "文章id错误"
  600. return
  601. }
  602. if req.Status <= 0 {
  603. br.Msg = "参数错误"
  604. return
  605. }
  606. var sellerName string
  607. if req.Status == 1 {
  608. sellerItem, _ := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
  609. //if err != nil {
  610. // br.Msg = "收藏失败!"
  611. // br.ErrMsg = "获取对应销售失败,Err:" + err.Error()
  612. // return
  613. //}
  614. //无权限客户也能收藏
  615. if sellerItem != nil {
  616. sellerName = sellerItem.RealName
  617. }
  618. item := models.CygxYanxuanSpecialCollect{
  619. UserId: user.UserId,
  620. Mobile: user.Mobile,
  621. Email: user.Email,
  622. CompanyId: user.CompanyId,
  623. CompanyName: user.CompanyName,
  624. RealName: user.RealName,
  625. SellerName: sellerName,
  626. CreateTime: time.Now(),
  627. ModifyTime: time.Now(),
  628. RegisterPlatform: utils.REGISTER_PLATFORM,
  629. YanxuanSpecialId: req.Id,
  630. }
  631. _, err = models.AddCygxYanxuanSpecialCollect(&item)
  632. if err != nil {
  633. br.Msg = "新增失败"
  634. br.ErrMsg = "新增失败,Err:" + err.Error()
  635. return
  636. }
  637. br.Msg = "收藏成功"
  638. } else {
  639. err = models.DelCygxYanxuanSpecialCollect(user.UserId, req.Id)
  640. if err != nil {
  641. br.Msg = "取消收藏失败"
  642. br.ErrMsg = "取消收藏失败,Err:" + err.Error()
  643. return
  644. }
  645. br.Msg = "取消收藏成功"
  646. }
  647. go services.UdpateYanxuanSpecialCollect(req.Id)
  648. br.Ret = 200
  649. br.Success = true
  650. }
  651. // @Title 专栏内容中心
  652. // @Description 专栏内容中心
  653. // @Param request body help_doc.AddHelpDocReq true "type json string"
  654. // @Success 200 {object} models.AddEnglishReportResp
  655. // @router /center [get]
  656. func (this *YanxuanSpecialController) Center() {
  657. br := new(models.BaseResponse).Init()
  658. defer func() {
  659. this.Data["json"] = br
  660. this.ServeJSON()
  661. }()
  662. sysUser := this.User
  663. if sysUser == nil {
  664. br.Msg = "请登录"
  665. br.ErrMsg = "请登录,SysUser Is Empty"
  666. br.Ret = 408
  667. return
  668. }
  669. // 1:未发布,2:审核中 3:已发布 4:驳回
  670. status, _ := this.GetInt("Status", 0)
  671. if status <= 0 {
  672. br.Msg = "参数错误"
  673. br.ErrMsg = "参数错误"
  674. return
  675. }
  676. var condition string
  677. var pars []interface{}
  678. condition += ` AND a.user_id = ? `
  679. pars = append(pars, sysUser.UserId)
  680. condition += ` AND a.status = ? `
  681. pars = append(pars, status)
  682. list, tmpErr := models.GetYanxuanSpecialList(sysUser.UserId, condition, pars, 0, 0)
  683. if tmpErr != nil {
  684. br.Msg = "获取失败"
  685. br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
  686. return
  687. }
  688. br.Data = list
  689. br.Ret = 200
  690. br.Success = true
  691. br.Msg = "获取成功"
  692. }
  693. // @Title 专栏点击记录
  694. // @Description 专栏点击记录
  695. // @Param request body models.AddCygxReportSelectionSubjectHistoryReq true "type json string"
  696. // @router /record [post]
  697. func (this *YanxuanSpecialController) Record() {
  698. br := new(models.BaseResponse).Init()
  699. defer func() {
  700. this.Data["json"] = br
  701. this.ServeJSON()
  702. }()
  703. user := this.User
  704. if user == nil {
  705. br.Msg = "请重新登录"
  706. br.Ret = 408
  707. return
  708. }
  709. var req models.AddCygxYanxuanSpecialRecordReq
  710. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  711. if err != nil {
  712. br.Msg = "参数解析异常!"
  713. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  714. return
  715. }
  716. if req.SpecialId <= 0 {
  717. br.Msg = "文章不存在"
  718. br.ErrMsg = "文章不存在,文章ID错误"
  719. return
  720. }
  721. specialId := req.SpecialId
  722. stopTime := req.StopTime
  723. if req.SpecialId <= 0 {
  724. br.Msg = "文章不存在"
  725. br.ErrMsg = "文章不存在,文章ID错误"
  726. return
  727. }
  728. err = services.AddSpecialRecord(this.User, specialId, stopTime)
  729. if err != nil {
  730. br.Msg = "记录失败"
  731. br.ErrMsg = "记录失败,Err:" + err.Error()
  732. return
  733. }
  734. br.Ret = 200
  735. br.Success = true
  736. br.Msg = "记录成功"
  737. }
  738. // @Title 研选专栏关注
  739. // @Description 研选专栏关注
  740. // @Param request body help_doc.AddHelpDocReq true "type json string"
  741. // @Success 200 {object} models.AddEnglishReportResp
  742. // @router /follow [post]
  743. func (this *YanxuanSpecialController) Follow() {
  744. br := new(models.BaseResponse).Init()
  745. defer func() {
  746. this.Data["json"] = br
  747. this.ServeJSON()
  748. }()
  749. user := this.User
  750. if user == nil {
  751. br.Msg = "请登录"
  752. br.ErrMsg = "请登录,SysUser Is Empty"
  753. br.Ret = 408
  754. return
  755. }
  756. var req models.FollowCygxYanxuanSpecialReq
  757. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  758. if err != nil {
  759. br.Msg = "参数解析异常!"
  760. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  761. return
  762. }
  763. if req.FollowSpecialColumnId <= 0 {
  764. br.Msg = "被关注的专栏栏目id错误"
  765. return
  766. }
  767. if req.Status <= 0 {
  768. br.Msg = "参数错误"
  769. return
  770. }
  771. var sellerName string
  772. sellerItemQy, err := models.GetSellerByCompanyIdCheckFicc(user.CompanyId, 2)
  773. if err != nil && err.Error() != utils.ErrNoRow() {
  774. br.Msg = "查询栏目详情失败!"
  775. br.ErrMsg = "获取销售信息失败,Err:" + err.Error()
  776. return
  777. }
  778. if sellerItemQy != nil {
  779. sellerName = sellerItemQy.RealName
  780. }
  781. authorItem, err := models.GetYanxuanSpecialAuthorById(req.FollowSpecialColumnId)
  782. if err != nil {
  783. br.Msg = "查询栏目详情失败!"
  784. br.ErrMsg = "查询栏目详情失败,Err:" + err.Error()
  785. return
  786. }
  787. if req.Status == 1 {
  788. item := models.CygxYanxuanSpecialFollow{
  789. UserId: user.UserId,
  790. FollowUserId: authorItem.UserId,
  791. Mobile: user.Mobile,
  792. Email: user.Email,
  793. CompanyId: user.CompanyId,
  794. CompanyName: user.CompanyName,
  795. RealName: user.RealName,
  796. SellerName: sellerName,
  797. CreateTime: time.Now(),
  798. ModifyTime: time.Now(),
  799. RegisterPlatform: utils.REGISTER_PLATFORM,
  800. YanxuanSpecialId: req.SpecialId,
  801. }
  802. err = models.AddCygxYanxuanSpecialFollow(&item)
  803. if err != nil {
  804. br.Msg = "新增失败"
  805. br.ErrMsg = "新增失败,Err:" + err.Error()
  806. return
  807. }
  808. br.Msg = "关注成功"
  809. } else {
  810. err = models.DelCygxYanxuanSpecialFollow(user.UserId, authorItem.UserId)
  811. if err != nil {
  812. br.Msg = "删除失败"
  813. br.ErrMsg = "删除失败,Err:" + err.Error()
  814. return
  815. }
  816. br.Msg = "取消关注成功"
  817. }
  818. go services.UdpateYanxuanSpecialFansNum(authorItem.UserId)
  819. br.Ret = 200
  820. br.Success = true
  821. }
  822. // @Title 行业标签搜索
  823. // @Description 行业标签搜索
  824. // @Param request body help_doc.AddHelpDocReq true "type json string"
  825. // @Success 200 {object} models.AddEnglishReportResp
  826. // @router /industrySearch [get]
  827. func (this *YanxuanSpecialController) IndustrySearch() {
  828. br := new(models.BaseResponse).Init()
  829. defer func() {
  830. this.Data["json"] = br
  831. this.ServeJSON()
  832. }()
  833. sysUser := this.User
  834. if sysUser == nil {
  835. br.Msg = "请登录"
  836. br.ErrMsg = "请登录,SysUser Is Empty"
  837. br.Ret = 408
  838. return
  839. }
  840. keyword := this.GetString("Keyword")
  841. list, tmpErr := models.GetYanxuanSpecialIndustry(keyword)
  842. if tmpErr != nil {
  843. br.Msg = "获取失败"
  844. br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
  845. return
  846. }
  847. br.Data = list
  848. br.Ret = 200
  849. br.Success = true
  850. br.Msg = "获取成功"
  851. }
  852. // @Title 公司标签搜索
  853. // @Description 公司标签搜索
  854. // @Param request body help_doc.AddHelpDocReq true "type json string"
  855. // @Success 200 {object} models.AddEnglishReportResp
  856. // @router /companySearch [get]
  857. func (this *YanxuanSpecialController) CompanySearch() {
  858. br := new(models.BaseResponse).Init()
  859. defer func() {
  860. this.Data["json"] = br
  861. this.ServeJSON()
  862. }()
  863. sysUser := this.User
  864. if sysUser == nil {
  865. br.Msg = "请登录"
  866. br.ErrMsg = "请登录,SysUser Is Empty"
  867. br.Ret = 408
  868. return
  869. }
  870. keyword := this.GetString("Keyword")
  871. if keyword == "" {
  872. br.Ret = 200
  873. return
  874. }
  875. list, tmpErr := models.GetYanxuanSpecialCompany(keyword)
  876. if tmpErr != nil {
  877. br.Msg = "获取失败"
  878. br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
  879. return
  880. }
  881. br.Data = list
  882. br.Ret = 200
  883. br.Success = true
  884. br.Msg = "获取成功"
  885. }
  886. // @Title 专栏取消发布
  887. // @Description 专栏取消发布
  888. // @Param request body help_doc.AddHelpDocReq true "type json string"
  889. // @Success 200 {object} models.AddEnglishReportResp
  890. // @router /cancel [post]
  891. func (this *YanxuanSpecialController) Cancel() {
  892. br := new(models.BaseResponse).Init()
  893. defer func() {
  894. this.Data["json"] = br
  895. this.ServeJSON()
  896. }()
  897. sysUser := this.User
  898. if sysUser == nil {
  899. br.Msg = "请登录"
  900. br.ErrMsg = "请登录,SysUser Is Empty"
  901. br.Ret = 408
  902. return
  903. }
  904. var req models.CancelPublishCygxYanxuanSpecialReq
  905. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  906. if err != nil {
  907. br.Msg = "参数解析异常!"
  908. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  909. return
  910. }
  911. if req.Id <= 0 {
  912. br.Msg = "文章id错误"
  913. return
  914. }
  915. specialItem, err := models.GetYanxuanSpecialItemById(req.Id)
  916. if err != nil {
  917. br.Msg = "专栏取消发布失败"
  918. br.ErrMsg = "专栏取消发布失败,Err:" + err.Error()
  919. return
  920. }
  921. if tmpErr := models.CancelPublishYanxuanSpecial(req.Id); tmpErr != nil {
  922. br.Msg = "取消发布失败"
  923. br.ErrMsg = "取消发布失败, Err:" + tmpErr.Error()
  924. return
  925. }
  926. go services.UpdateYanxuanSpecialResourceData(req.Id) // 写入首页最新 cygx_resource_data 表
  927. go services.EsAddYanxuanSpecial(req.Id) // 写入es 综合搜索
  928. go services.UdpateYanxuanSpecialauthorArticleNum(specialItem.UserId) // 更新作者发布文章的数量
  929. br.Msg = "取消发布成功"
  930. br.Ret = 200
  931. br.Success = true
  932. }
  933. // @Title 作者列表
  934. // @Description 作者列表
  935. // @Param PageSize query int true "每页数据条数"
  936. // @Param CurrentIndex query int true "当前页页码,从1开始"
  937. // @Success 200 {object} models.AddEnglishReportResp
  938. // @router /author/list [get]
  939. func (this *YanxuanSpecialNoLoginController) AuthorList() {
  940. br := new(models.BaseResponse).Init()
  941. defer func() {
  942. this.Data["json"] = br
  943. this.ServeJSON()
  944. }()
  945. sysUser := this.User
  946. if sysUser == nil {
  947. br.Msg = "请登录"
  948. br.ErrMsg = "请登录,SysUser Is Empty"
  949. br.Ret = 408
  950. return
  951. }
  952. pageSize, _ := this.GetInt("PageSize")
  953. currentIndex, _ := this.GetInt("CurrentIndex")
  954. var startSize int
  955. if pageSize <= 0 {
  956. pageSize = utils.PageSize20
  957. }
  958. if currentIndex <= 0 {
  959. currentIndex = 1
  960. }
  961. startSize = utils.StartIndex(currentIndex, pageSize)
  962. resp := new(models.SpecialAuthorListResp)
  963. specialAuthorCheck := services.GetYanxuanSpecialAuthorInfo(sysUser) //用户是否没开通研选专栏以及,专栏信息是否完善
  964. resp.IsAuthor = specialAuthorCheck.IsAuthor
  965. resp.IsImproveInformation = specialAuthorCheck.IsImproveInformation
  966. resp.SpecialColumnId = specialAuthorCheck.SpecialColumnId
  967. resp.HeadImg = specialAuthorCheck.HeadImg
  968. var condition string
  969. var conditionUserSort string
  970. var pars []interface{}
  971. condition += ` AND a.nick_name <> '' `
  972. conditionUserSort += ` ( IF ( a.user_id = ` + strconv.Itoa(sysUser.UserId) + `, 1 = 1, user_id = 1 ) ) AS user_sort , ` // 用户本人如果开通了专栏,就放在最前面
  973. total, err := models.GetCygxYanxuanSpecialAuthorCount(condition, pars)
  974. if err != nil {
  975. br.Msg = "获取失败"
  976. br.ErrMsg = "获取失败,Err:" + err.Error()
  977. return
  978. }
  979. condition += ` ORDER BY user_sort DESC, latest_publish_time DESC`
  980. list, tmpErr := models.GetYanxuanSpecialAuthorList(conditionUserSort, condition, pars, startSize, pageSize)
  981. if tmpErr != nil {
  982. br.Msg = "获取失败"
  983. br.ErrMsg = "获取失败, Err:" + tmpErr.Error()
  984. return
  985. }
  986. //var userIds []int
  987. for _, v := range list {
  988. v.LatestPublishDate = v.LatestPublishTime.Format(utils.FormatDate) + "更新"
  989. //userIds = append(userIds, v.UserId)
  990. }
  991. page := paging.GetPaging(currentIndex, pageSize, total)
  992. resp.List = list
  993. resp.Paging = page
  994. br.Data = resp
  995. br.Ret = 200
  996. br.Success = true
  997. br.Msg = "获取成功"
  998. }
  999. // @Title 更新作者头像
  1000. // @Description 更新作者头像
  1001. // @Param request body help_doc.AddHelpDocReq true "type json string"
  1002. // @Success 200 {object} models.AddEnglishReportResp
  1003. // @router /author/head_img [post]
  1004. func (this *YanxuanSpecialController) AuthorHeadImg() {
  1005. br := new(models.BaseResponse).Init()
  1006. defer func() {
  1007. this.Data["json"] = br
  1008. this.ServeJSON()
  1009. }()
  1010. sysUser := this.User
  1011. if sysUser == nil {
  1012. br.Msg = "请登录"
  1013. br.ErrMsg = "请登录,SysUser Is Empty"
  1014. br.Ret = 408
  1015. return
  1016. }
  1017. var req models.SaveCygxYanxuanSpecialAuthoHeadImgrReq
  1018. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  1019. if err != nil {
  1020. br.Msg = "参数解析异常!"
  1021. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  1022. return
  1023. }
  1024. if req.SpecialColumnId <= 0 {
  1025. br.Msg = "专栏栏目id错误"
  1026. return
  1027. }
  1028. if req.HeadImg == "" {
  1029. br.Msg = "头像图片错误"
  1030. return
  1031. }
  1032. item := models.CygxYanxuanSpecialAuthor{
  1033. Id: req.SpecialColumnId,
  1034. HeadImg: req.HeadImg,
  1035. }
  1036. err = models.UpdateYanxuanSpecialAuthorHeadImg(&item)
  1037. if err != nil {
  1038. br.Msg = "保存失败"
  1039. br.ErrMsg = "保存失败,Err:" + err.Error()
  1040. return
  1041. }
  1042. br.Ret = 200
  1043. br.Success = true
  1044. br.Msg = "保存成功"
  1045. }
  1046. // @Title 删除专栏
  1047. // @Description 删除专栏
  1048. // @Param request body help_doc.AddHelpDocReq true "type json string"
  1049. // @Success 200 {object} models.AddEnglishReportResp
  1050. // @router /del [post]
  1051. func (this *YanxuanSpecialController) Delete() {
  1052. br := new(models.BaseResponse).Init()
  1053. defer func() {
  1054. this.Data["json"] = br
  1055. this.ServeJSON()
  1056. }()
  1057. sysUser := this.User
  1058. if sysUser == nil {
  1059. br.Msg = "请登录"
  1060. br.ErrMsg = "请登录,SysUser Is Empty"
  1061. br.Ret = 408
  1062. return
  1063. }
  1064. var req models.DelCygxYanxuanSpecialReq
  1065. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  1066. if err != nil {
  1067. br.Msg = "参数解析异常!"
  1068. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  1069. return
  1070. }
  1071. if req.Id <= 0 {
  1072. br.Msg = "文章id错误"
  1073. return
  1074. }
  1075. if tmpErr := models.DelYanxuanSpecial(req.Id); tmpErr != nil {
  1076. br.Msg = "删除失败"
  1077. br.ErrMsg = "删除失败, Err:" + tmpErr.Error()
  1078. return
  1079. }
  1080. br.Msg = "删除成功"
  1081. br.Ret = 200
  1082. br.Success = true
  1083. }
  1084. // @Title 专栏文章敏感词检测
  1085. // @Description 专栏文章敏感词检测
  1086. // @Param request body help_doc.AddHelpDocReq true "type json string"
  1087. // @Success 200 {object} models.AddEnglishReportResp
  1088. // @router /check [post]
  1089. func (this *YanxuanSpecialController) Check() {
  1090. br := new(models.BaseResponse).Init()
  1091. defer func() {
  1092. this.Data["json"] = br
  1093. this.ServeJSON()
  1094. }()
  1095. sysUser := this.User
  1096. if sysUser == nil {
  1097. br.Msg = "请登录"
  1098. br.ErrMsg = "请登录,SysUser Is Empty"
  1099. br.Ret = 408
  1100. return
  1101. }
  1102. var req models.CygxYanxuanSpecialCheckReq
  1103. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  1104. if err != nil {
  1105. br.Msg = "参数解析异常!"
  1106. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  1107. return
  1108. }
  1109. if req.Content == "" {
  1110. br.Ret = 200
  1111. br.Success = true
  1112. br.Msg = "校验成功"
  1113. }
  1114. itemToken, err := services.WxGetToken()
  1115. if err != nil {
  1116. br.Msg = "GetWxAccessToken Err:" + err.Error()
  1117. return
  1118. }
  1119. if itemToken.AccessToken == "" {
  1120. br.Msg = "accessToken is empty"
  1121. return
  1122. }
  1123. suggest := models.WxCheckContent(itemToken.AccessToken, sysUser.OpenId, req.Content)
  1124. if suggest == "risky" {
  1125. br.Msg = "文章内容含有违法违规内容"
  1126. br.ErrMsg = "文章内容含有违法违规内容"
  1127. return
  1128. }
  1129. if len(req.ImgUrl) > 0 {
  1130. //for _, imgUrl := range req.ImgUrl {
  1131. // imgBody, err := http.Get(imgUrl)
  1132. // if err != nil {
  1133. // br.Msg = "图片链接有误"
  1134. // br.ErrMsg = "图片链接有误"
  1135. // return
  1136. // }
  1137. // rnStr := utils.GetRandStringNoSpecialChar(5)
  1138. // savePath := time.Now().Format(utils.FormatDateTimeUnSpace) + rnStr + ".jpg"
  1139. // err = file.SaveFile(imgBody, savePath)
  1140. // if err != nil {
  1141. // br.Msg = "保存图片错误"
  1142. // br.ErrMsg = "保存图片错误"
  1143. // return
  1144. // }
  1145. // res, err := weapp.IMGSecCheck(itemToken.AccessToken, savePath)
  1146. // if err != nil {
  1147. // // 处理一般错误信息
  1148. // br.Msg = "图片内容含有违法违规内容"
  1149. // br.ErrMsg = "图片内容含有违法违规内容"
  1150. // return
  1151. // }
  1152. // if err := res.GetResponseError(); err != nil {
  1153. // // 处理微信返回错误信息
  1154. // br.Msg = "GetResponseError Err:" + err.Error()
  1155. // return
  1156. // }
  1157. // err = os.RemoveAll(savePath)
  1158. // if err != nil {
  1159. // br.Msg = "RemoveAll Err:" + err.Error()
  1160. // return
  1161. // }
  1162. //}
  1163. }
  1164. br.Ret = 200
  1165. br.Success = true
  1166. br.Msg = "校验成功"
  1167. }