article.go 18 KB

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