蛋蛋星球-客户端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

hdl_college.go 3.6 KiB

pirms 4 nedēļām
pirms 3 nedēļām
pirms 4 nedēļām
pirms 3 nedēļām
pirms 4 nedēļām
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. package hdl
  2. import (
  3. "applet/app/mw"
  4. "applet/app/svc"
  5. "github.com/gin-gonic/gin"
  6. )
  7. // CollegeCate
  8. // @Summary 蛋蛋学院-分类
  9. // @Tags 蛋蛋学院
  10. // @Description 蛋蛋学院-分类
  11. // @Accept json
  12. // @Produce json
  13. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  14. // @Success 200 {object} md.AdvertisingResp "具体数据"
  15. // @Failure 400 {object} md.Response "具体错误"
  16. // @Router /api/v1/college/cate [get]
  17. func CollegeCate(c *gin.Context) {
  18. svc.CollegeCate(c)
  19. }
  20. // CollegeList
  21. // @Summary 蛋蛋学院-文章列表
  22. // @Tags 蛋蛋学院
  23. // @Description 蛋蛋学院-文章列表
  24. // @Accept json
  25. // @Produce json
  26. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  27. // @Param req body md.CollegeListReq true "参数"
  28. // @Success 200 {object} md.CollegeListResp "具体数据"
  29. // @Failure 400 {object} md.Response "具体错误"
  30. // @Router /api/v1/college/list [post]
  31. func CollegeList(c *gin.Context) {
  32. svc.CollegeList(c)
  33. }
  34. // CollegeDetail
  35. // @Summary 蛋蛋学院-文章详情
  36. // @Tags 蛋蛋学院
  37. // @Description 蛋蛋学院-文章详情
  38. // @Accept json
  39. // @Produce json
  40. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  41. // @Param req body md.CollegeDetailReq true "参数"
  42. // @Success 200 {object} md.CollegeDetailResp "具体数据"
  43. // @Failure 400 {object} md.Response "具体错误"
  44. // @Router /api/v1/college/detail [post]
  45. func CollegeDetail(c *gin.Context) {
  46. uid := 0
  47. if c.GetHeader("Authorization") != "" {
  48. mw.Auth(c)
  49. user := svc.GetUser(c)
  50. uid = int(user.Id)
  51. }
  52. svc.CollegeDetail(c, uid)
  53. }
  54. // CollegeLikeAdd
  55. // @Summary 蛋蛋学院-文章-点赞
  56. // @Tags 蛋蛋学院
  57. // @Description 蛋蛋学院-文章-点赞
  58. // @Accept json
  59. // @Produce json
  60. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  61. // @Param req body md.CollegeDetailReq true "参数"
  62. // @Success 200 {string} "具体数据"
  63. // @Failure 400 {object} md.Response "具体错误"
  64. // @Router /api/v1/college/like/add [post]
  65. func CollegeLikeAdd(c *gin.Context) {
  66. svc.CollegeLikeAdd(c)
  67. }
  68. // CollegeLikeCancel
  69. // @Summary 蛋蛋学院-文章-取消点赞
  70. // @Tags 蛋蛋学院
  71. // @Description 蛋蛋学院-文章-取消点赞
  72. // @Accept json
  73. // @Produce json
  74. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  75. // @Param req body md.CollegeDetailReq true "参数"
  76. // @Success 200 {string} "具体数据"
  77. // @Failure 400 {object} md.Response "具体错误"
  78. // @Router /api/v1/college/like/cancel [post]
  79. func CollegeLikeCancel(c *gin.Context) {
  80. svc.CollegeLikeCancel(c)
  81. }
  82. // CollegeShareAdd
  83. // @Summary 蛋蛋学院-文章-分享后调用统计数量
  84. // @Tags 蛋蛋学院
  85. // @Description 蛋蛋学院-文章-分享后调用统计数量
  86. // @Accept json
  87. // @Produce json
  88. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  89. // @Param req body md.CollegeDetailReq true "参数"
  90. // @Success 200 {string} "具体数据"
  91. // @Failure 400 {object} md.Response "具体错误"
  92. // @Router /api/v1/college/share/add [post]
  93. func CollegeShareAdd(c *gin.Context) {
  94. svc.CollegeShareAdd(c)
  95. }