article.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. package controllers
  2. import (
  3. "encoding/json"
  4. "hongze/hongze_cygx/models"
  5. "hongze/hongze_cygx/services"
  6. "hongze/hongze_cygx/utils"
  7. "html"
  8. "regexp"
  9. "strconv"
  10. "strings"
  11. "time"
  12. )
  13. type ArticleController struct {
  14. BaseAuthController
  15. }
  16. type ArticleCommonController struct {
  17. BaseCommonController
  18. }
  19. // @Title 获取报告详情
  20. // @Description 获取报告详情接口
  21. // @Param ArticleId query int true "报告ID"
  22. // @Success 200 {object} models.ArticleDetailResp
  23. // @router /detail [get]
  24. func (this *ArticleController) Detail() {
  25. br := new(models.BaseResponse).Init()
  26. defer func() {
  27. this.Data["json"] = br
  28. this.ServeJSON()
  29. }()
  30. user := this.User
  31. if user == nil {
  32. br.Msg = "请登录"
  33. br.ErrMsg = "请登录,用户信息为空"
  34. br.Ret = 408
  35. return
  36. }
  37. uid := user.UserId
  38. articleId, err := this.GetInt("ArticleId")
  39. if articleId <= 0 {
  40. br.Msg = "文章不存在"
  41. br.ErrMsg = "文章不存在,文章ID错误"
  42. return
  43. }
  44. detail := new(models.ArticleDetail)
  45. hasPermission := 0
  46. hasFree := 0
  47. //判断是否已经申请过
  48. applyCount, err := models.GetApplyRecordCount(uid)
  49. if err != nil && err.Error() != utils.ErrNoRow() {
  50. br.Msg = "获取信息失败"
  51. br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
  52. return
  53. }
  54. //`description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,4:潜在客户,未提交过申请,5:潜在客户,已提交过申请"`
  55. if user.CompanyId > 1 {
  56. companyPermission, err := models.GetCompanyPermission(user.CompanyId)
  57. if err != nil {
  58. br.Msg = "获取信息失败"
  59. br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  60. return
  61. }
  62. detail, err = models.GetArticleDetailById(articleId)
  63. if err != nil {
  64. br.Msg = "获取信息失败"
  65. br.ErrMsg = "获取信息失败,Err:" + err.Error()
  66. return
  67. }
  68. detail.Body = html.UnescapeString(detail.Body)
  69. //detail.Abstract = html.UnescapeString(detail.Abstract)
  70. detail.Abstract, _ = services.GetReportContentTextSub(detail.Abstract)
  71. if companyPermission == "" {
  72. if applyCount > 0 {
  73. hasPermission = 5
  74. } else {
  75. hasPermission = 2
  76. }
  77. hasFree = 2
  78. goto Loop
  79. } else {
  80. hasFree = 1
  81. // 原有的权限校验 更改于 2021-05-18
  82. //articlePermission, err := models.GetArticlePermission(detail.SubCategoryName)
  83. //fmt.Println(articlePermission)
  84. //fmt.Println(detail.SubCategoryName)
  85. //if err != nil {
  86. // br.Msg = "获取信息失败"
  87. // br.ErrMsg = "获取报告权限失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  88. // return
  89. //}
  90. //if articlePermission == nil {
  91. // br.Msg = "获取信息失败"
  92. // br.ErrMsg = "报告权限不存在,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  93. // return
  94. //}
  95. //for _, p := range articlePermission {
  96. // if strings.Contains(companyPermission, p.PermissionName) {
  97. // hasPermission = 1
  98. // historyRecord := new(models.CygxArticleHistoryRecord)
  99. // historyRecord.UserId = uid
  100. // historyRecord.ArticleId = articleId
  101. // historyRecord.CreateTime = time.Now()
  102. // historyRecord.Mobile = user.Mobile
  103. // historyRecord.Email = user.Email
  104. // historyRecord.CompanyId = user.CompanyId
  105. // historyRecord.CompanyName = user.CompanyName
  106. // go models.AddCygxArticleHistoryRecord(historyRecord)
  107. // break
  108. // } else { //无该行业权限
  109. // hasPermission = 3
  110. // }
  111. //}
  112. var articlePermissionPermissionName string
  113. if detail.CategoryId > 0 {
  114. articlePermission, err := models.GetArticlePermission(detail.CategoryId)
  115. if err != nil {
  116. br.Msg = "获取信息失败"
  117. br.ErrMsg = "获取报告权限失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  118. return
  119. }
  120. if articlePermission == nil {
  121. br.Msg = "获取信息失败"
  122. br.ErrMsg = "报告权限不存在,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  123. return
  124. }
  125. articlePermissionPermissionName = articlePermission.PermissionName
  126. } else {
  127. articlePermissionPermissionName = detail.CategoryName
  128. }
  129. if strings.Contains(companyPermission, articlePermissionPermissionName) {
  130. hasPermission = 1
  131. detailNew, err := models.GetNewArticleHistoryRecord(uid, articleId)
  132. if err != nil {
  133. br.Msg = "获取信息失败"
  134. br.ErrMsg = "获取信息失败,Err:" + err.Error()
  135. return
  136. }
  137. recordCount, _ := models.GetNoAddStoptimeArticleCount(detailNew.Id)
  138. if recordCount < 1 {
  139. historyRecord := new(models.CygxArticleHistoryRecord)
  140. historyRecord.UserId = uid
  141. historyRecord.ArticleId = articleId
  142. historyRecord.CreateTime = time.Now()
  143. historyRecord.Mobile = user.Mobile
  144. historyRecord.Email = user.Email
  145. historyRecord.CompanyId = user.CompanyId
  146. historyRecord.CompanyName = user.CompanyName
  147. go models.AddCygxArticleHistoryRecord(historyRecord)
  148. }
  149. } else { //无该行业权限
  150. hasPermission = 3
  151. }
  152. if hasPermission == 1 {
  153. key := "CYGX_ARTICLE_" + strconv.Itoa(articleId) + "_" + strconv.Itoa(uid)
  154. if !utils.Rc.IsExist(key) {
  155. //新增浏览记录
  156. record := new(models.CygxArticleViewRecord)
  157. record.UserId = uid
  158. record.ArticleId = articleId
  159. record.CreateTime = time.Now()
  160. record.Mobile = user.Mobile
  161. record.Email = user.Email
  162. record.CompanyId = user.CompanyId
  163. record.CompanyName = user.CompanyName
  164. go models.AddCygxArticleViewRecord(record)
  165. utils.Rc.Put(key, 1, 5*time.Second)
  166. models.ModifyReportLastViewTime(uid)
  167. }
  168. }
  169. }
  170. collectCount, err := models.GetArticleCollectCount(uid, articleId)
  171. if err != nil && err.Error() != utils.ErrNoRow() {
  172. br.Msg = "获取信息失败"
  173. br.ErrMsg = "判断是否已收藏失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  174. return
  175. }
  176. if collectCount > 0 {
  177. detail.IsCollect = true
  178. }
  179. interviewApplyItem, err := models.GetArticleInterviewApply(uid, articleId)
  180. if err != nil && err.Error() != utils.ErrNoRow() {
  181. br.Msg = "获取信息失败"
  182. br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  183. return
  184. }
  185. if interviewApplyItem != nil && interviewApplyItem.InterviewApplyId > 0 {
  186. detail.IsInterviewApply = true
  187. detail.InterviewApplyStatus = interviewApplyItem.Status
  188. }
  189. //获取销售手机号
  190. sellerItem, err := models.GetSellerByCompanyId(user.CompanyId)
  191. if err != nil {
  192. br.Msg = "获取信息失败"
  193. br.ErrMsg = "获取销售数据失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  194. return
  195. }
  196. if sellerItem != nil {
  197. detail.SellerMobile = sellerItem.Mobile
  198. detail.SellerName = sellerItem.RealName
  199. }
  200. sellerList, err := models.GetSellerList(articleId)
  201. if err != nil {
  202. br.Msg = "获取信息失败"
  203. br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  204. return
  205. }
  206. if detail.ArticleId > 1000000 {
  207. var hrefRegexp = regexp.MustCompile("[0-9]\\d*")
  208. match := hrefRegexp.FindAllString(detail.SellerAndMobile, -1)
  209. if match != nil {
  210. for _, v := range match {
  211. sellerAndMobile := &models.SellerRep{
  212. SellerMobile: v,
  213. SellerName: strings.Replace(detail.SellerAndMobile, v, "", -1),
  214. }
  215. sellerList = append(sellerList, sellerAndMobile)
  216. }
  217. }
  218. }
  219. detail.SellerList = sellerList
  220. } else { //潜在客户
  221. if applyCount > 0 {
  222. hasPermission = 5
  223. } else {
  224. hasPermission = 4
  225. }
  226. }
  227. Loop:
  228. if hasPermission != 1 {
  229. detail.Body = ""
  230. detail.BodyText = ""
  231. }
  232. resp := new(models.ArticleDetailResp)
  233. resp.HasPermission = hasPermission
  234. resp.HasFree = hasFree
  235. resp.Detail = detail
  236. br.Ret = 200
  237. br.Success = true
  238. br.Msg = "获取成功"
  239. br.Data = resp
  240. }
  241. // @Title 收藏
  242. // @Description 收藏
  243. // @Param request body models.ArticleCollectReq true "type json string"
  244. // @Success 200 {object} models.FontsCollectResp
  245. // @router /collect [post]
  246. func (this *ArticleController) ArticleCollect() {
  247. br := new(models.BaseResponse).Init()
  248. defer func() {
  249. this.Data["json"] = br
  250. this.ServeJSON()
  251. }()
  252. user := this.User
  253. if user == nil {
  254. br.Msg = "请重新登录"
  255. br.Ret = 408
  256. return
  257. }
  258. uid := user.UserId
  259. var req models.ArticleCollectReq
  260. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  261. if err != nil {
  262. br.Msg = "参数解析异常!"
  263. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  264. return
  265. }
  266. count, err := models.GetArticleCollectCount(uid, req.ArticleId)
  267. if err != nil {
  268. br.Msg = "获取数据失败!"
  269. br.ErrMsg = "获取数据失败,Err:" + err.Error()
  270. return
  271. }
  272. resp := new(models.ArticleCollectResp)
  273. if count <= 0 {
  274. item := new(models.CygxArticleCollect)
  275. item.ArticleId = req.ArticleId
  276. item.UserId = uid
  277. item.CreateTime = time.Now()
  278. _, err = models.AddCygxArticleCollect(item)
  279. if err != nil {
  280. br.Msg = "收藏失败"
  281. br.ErrMsg = "收藏失败,Err:" + err.Error()
  282. return
  283. }
  284. br.Msg = "收藏成功"
  285. resp.Status = 1
  286. } else {
  287. err = models.RemoveArticleCollect(uid, req.ArticleId)
  288. if err != nil {
  289. br.Msg = "取消收藏失败"
  290. br.ErrMsg = "取消收藏失败,Err:" + err.Error()
  291. return
  292. }
  293. br.Msg = "已取消收藏"
  294. resp.Status = 2
  295. }
  296. collectTotal, err := models.GetArticleCollectUsersCount(req.ArticleId)
  297. if err != nil {
  298. br.Msg = "获取数据失败"
  299. br.ErrMsg = "获取数据失败,Err:" + err.Error()
  300. return
  301. }
  302. resp.CollectCount = collectTotal
  303. br.Ret = 200
  304. br.Success = true
  305. br.Data = resp
  306. }
  307. // @Title 访谈申请
  308. // @Description 访谈申请
  309. // @Param request body models.ArticleInterviewApplyReq true "type json string"
  310. // @Success 200 {object} models.FontsCollectResp
  311. // @router /interview/apply [post]
  312. func (this *ArticleController) InterviewApply() {
  313. br := new(models.BaseResponse).Init()
  314. defer func() {
  315. this.Data["json"] = br
  316. this.ServeJSON()
  317. }()
  318. user := this.User
  319. if user == nil {
  320. br.Msg = "请重新登录"
  321. br.Ret = 408
  322. return
  323. }
  324. uid := user.UserId
  325. var req models.ArticleInterviewApplyReq
  326. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  327. if err != nil {
  328. br.Msg = "参数解析异常!"
  329. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  330. return
  331. }
  332. article, err := models.GetArticleDetailById(req.ArticleId)
  333. if err != nil {
  334. br.Msg = "获取纪要失败!"
  335. br.ErrMsg = "获取纪要失败,Err:" + err.Error()
  336. return
  337. }
  338. count, err := models.GetArticleInterviewApplyCount(uid, req.ArticleId)
  339. if err != nil {
  340. br.Msg = "获取数据失败!"
  341. br.ErrMsg = "获取数据失败,Err:" + err.Error()
  342. return
  343. }
  344. resp := new(models.ArticleInterviewApplyResp)
  345. if count <= 0 {
  346. item := new(models.CygxInterviewApply)
  347. item.ArticleId = req.ArticleId
  348. item.UserId = uid
  349. item.CompanyId = user.CompanyId
  350. item.Status = "待邀请"
  351. item.Sort = 1
  352. item.ArticleTitle = article.Title
  353. item.CreateTime = time.Now()
  354. item.ModifyTime = time.Now()
  355. item.ArticleIdMd5 = article.ArticleIdMd5
  356. _, err = models.AddCygxInterviewApply(item)
  357. if err != nil {
  358. br.Msg = "申请失败"
  359. br.ErrMsg = "申请失败,Err:" + err.Error()
  360. return
  361. }
  362. br.Msg = "申请成功"
  363. resp.Status = 1
  364. //发送模板消息
  365. if user.CompanyId > 1 {
  366. mobile := user.Mobile
  367. if mobile == "" {
  368. mobile = user.Email
  369. }
  370. sellerItem, _ := models.GetSellerByCompanyId(user.CompanyId)
  371. if sellerItem != nil && sellerItem.AdminId > 0 && user.Mobile != "" {
  372. openIpItem, _ := models.GetUserRecordByUserId(sellerItem.UserId, 1)
  373. if openIpItem != nil && openIpItem.OpenId != "" {
  374. go services.SendInterviewApplyTemplateMsg(user.RealName, sellerItem.CompanyName, mobile, article.Title, openIpItem.OpenId)
  375. }
  376. }
  377. }
  378. } else {
  379. err = models.RemoveArticleInterviewApply(uid, req.ArticleId)
  380. if err != nil {
  381. br.Msg = "取消申请失败"
  382. br.ErrMsg = "取消申请失败,Err:" + err.Error()
  383. return
  384. }
  385. br.Msg = "已取消申请"
  386. resp.Status = 2
  387. if user.CompanyId > 1 {
  388. mobile := user.Mobile
  389. if mobile == "" {
  390. mobile = user.Email
  391. }
  392. sellerItem, _ := models.GetSellerByCompanyId(user.CompanyId)
  393. if sellerItem != nil && sellerItem.AdminId > 0 && user.Mobile != "" {
  394. openIpItem, _ := models.GetUserRecordByUserId(sellerItem.UserId, 1)
  395. if openIpItem != nil && openIpItem.OpenId != "" {
  396. go services.SendInterviewApplyCancelTemplateMsg(user.RealName, sellerItem.CompanyName, mobile, article.Title, openIpItem.OpenId)
  397. }
  398. }
  399. }
  400. }
  401. br.Ret = 200
  402. br.Success = true
  403. br.Data = resp
  404. }
  405. // @Title 获取报告详情
  406. // @Description 获取报告详情接口
  407. // @Param ArticleIdMd5 query int true "报告ID"
  408. // @Success 200 {object} models.ArticleDetailResp
  409. // @router /look/detail [get]
  410. func (this *ArticleCommonController) Detail() {
  411. br := new(models.BaseResponse).Init()
  412. defer func() {
  413. this.Data["json"] = br
  414. this.ServeJSON()
  415. }()
  416. articleIdMd5 := this.GetString("ArticleIdMd5")
  417. if articleIdMd5 == "" {
  418. br.Msg = "参数错误"
  419. br.ErrMsg = "参数错误"
  420. return
  421. }
  422. resp := new(models.ArticleDetailResp)
  423. detail, err := models.GetArticleDetailByIdMd5(articleIdMd5)
  424. if err != nil && err.Error() != utils.ErrNoRow() {
  425. br.Msg = "获取信息失败"
  426. br.ErrMsg = "获取信息失败,Err:" + err.Error()
  427. return
  428. }
  429. if detail == nil {
  430. resp.HasPermission = 2
  431. } else {
  432. resp.HasPermission = 1
  433. }
  434. if detail != nil {
  435. detail.Body = html.UnescapeString(detail.Body)
  436. detail.Abstract = html.UnescapeString(detail.Abstract)
  437. }
  438. sellerList, err := models.GetSellerList(detail.ArticleId)
  439. if err != nil {
  440. br.Msg = "获取信息失败"
  441. br.ErrMsg = "获取销售数据失败,Err:" + err.Error() + ";articleId" + strconv.Itoa(detail.ArticleId)
  442. return
  443. }
  444. if detail.ArticleId > 1000000 {
  445. var hrefRegexp = regexp.MustCompile("[0-9]\\d*")
  446. match := hrefRegexp.FindAllString(detail.SellerAndMobile, -1)
  447. if match != nil {
  448. for _, v := range match {
  449. sellerAndMobile := &models.SellerRep{
  450. SellerMobile: v,
  451. SellerName: strings.Replace(detail.SellerAndMobile, v, "", -1),
  452. }
  453. sellerList = append(sellerList, sellerAndMobile)
  454. }
  455. }
  456. }
  457. detail.SellerList = sellerList
  458. resp.Detail = detail
  459. br.Ret = 200
  460. br.Success = true
  461. br.Msg = "获取成功"
  462. br.Data = resp
  463. }
  464. // @Title 上传文章阅读时间
  465. // @Description 上传文章阅读时间接口
  466. // @Param request body models.AddStopTimeRep true "type json string"
  467. // @Success 200 {object} models.ArticleDetailResp
  468. // @router /addStopTime [post]
  469. func (this *ArticleController) AddStopTime() {
  470. br := new(models.BaseResponse).Init()
  471. defer func() {
  472. this.Data["json"] = br
  473. this.ServeJSON()
  474. }()
  475. user := this.User
  476. if user == nil {
  477. br.Msg = "请登录"
  478. br.ErrMsg = "请登录,用户信息为空"
  479. br.Ret = 408
  480. return
  481. }
  482. var req models.AddStopTimeRep
  483. err := json.Unmarshal(this.Ctx.Input.RequestBody, &req)
  484. if err != nil {
  485. br.Msg = "参数解析异常!"
  486. br.ErrMsg = "参数解析失败,Err:" + err.Error()
  487. return
  488. }
  489. uid := user.UserId
  490. articleId := req.ArticleId
  491. stopTime := req.StopTime
  492. if articleId <= 0 {
  493. br.Msg = "参数错误"
  494. br.ErrMsg = "参数错误"
  495. return
  496. }
  497. if stopTime == 0 {
  498. stopTime = 1
  499. //br.Msg = "时间格式错误"
  500. //br.ErrMsg = "时间错误"
  501. //return
  502. }
  503. detail := new(models.ArticleDetail)
  504. hasPermission := 0
  505. hasFree := 0
  506. //判断是否已经申请过
  507. applyCount, err := models.GetApplyRecordCount(uid)
  508. if err != nil && err.Error() != utils.ErrNoRow() {
  509. br.Msg = "获取信息失败"
  510. br.ErrMsg = "判断是否已申请过试用失败,Err:" + err.Error()
  511. return
  512. }
  513. //`description:"1:有该行业权限,正常展示,2:无该行业权限,不存在权益客户下,3:无该品类权限,4:潜在客户,未提交过申请,5:潜在客户,已提交过申请"`
  514. if user.CompanyId > 1 {
  515. companyPermission, err := models.GetCompanyPermission(user.CompanyId)
  516. if err != nil {
  517. br.Msg = "获取信息失败"
  518. br.ErrMsg = "判断是否已申请访谈失败,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  519. return
  520. }
  521. detail, err = models.GetArticleDetailById(articleId)
  522. if err != nil {
  523. br.Msg = "获取信息失败"
  524. br.ErrMsg = "获取信息失败,Err:" + err.Error()
  525. return
  526. }
  527. if companyPermission == "" {
  528. if applyCount > 0 {
  529. hasPermission = 5
  530. } else {
  531. hasPermission = 2
  532. }
  533. hasFree = 2
  534. goto Loop
  535. } else {
  536. hasFree = 1
  537. var articlePermissionPermissionName string
  538. if detail.CategoryId > 0 {
  539. articlePermission, err := models.GetArticlePermission(detail.CategoryId)
  540. if err != nil {
  541. br.Msg = "获取信息失败"
  542. br.ErrMsg = "获取报告权限失败,Err:" + err.Error() + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  543. return
  544. }
  545. if articlePermission == nil {
  546. br.Msg = "获取信息失败"
  547. br.ErrMsg = "报告权限不存在,Err:" + strconv.Itoa(uid) + ";articleId" + strconv.Itoa(articleId)
  548. return
  549. }
  550. articlePermissionPermissionName = articlePermission.PermissionName
  551. } else {
  552. articlePermissionPermissionName = detail.CategoryName
  553. }
  554. if strings.Contains(companyPermission, articlePermissionPermissionName) {
  555. detailNew, err := models.GetNewArticleHistoryRecord(uid, articleId)
  556. if err != nil {
  557. br.Msg = "获取信息失败"
  558. br.ErrMsg = "获取信息失败,Err:" + err.Error()
  559. return
  560. }
  561. hasPermission = 1
  562. historyRecord := new(models.AddStopTimeNewRep)
  563. historyRecord.StopTime = detailNew.StopTime + stopTime
  564. historyRecord.Id = detailNew.Id
  565. go models.AddArticleStopTime(historyRecord)
  566. } else { //无该行业权限
  567. hasPermission = 3
  568. }
  569. }
  570. } else { //潜在客户
  571. if applyCount > 0 {
  572. hasPermission = 5
  573. } else {
  574. hasPermission = 4
  575. }
  576. }
  577. Loop:
  578. resp := new(models.ArticleDetailAddStopTimeRep)
  579. resp.HasPermission = hasPermission
  580. resp.HasFree = hasFree
  581. br.Ret = 200
  582. br.Success = true
  583. br.Msg = "操作成功"
  584. br.Data = resp
  585. }