|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- package hdl
-
- import (
- "applet/app/mw"
- "applet/app/svc"
- "github.com/gin-gonic/gin"
- )
-
- // CollegeCate
- // @Summary 蛋蛋学院-分类
- // @Tags 蛋蛋学院
- // @Description 蛋蛋学院-分类
- // @Accept json
- // @Produce json
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @Success 200 {object} md.AdvertisingResp "具体数据"
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/v1/college/cate [get]
- func CollegeCate(c *gin.Context) {
- svc.CollegeCate(c)
- }
-
- // CollegeList
- // @Summary 蛋蛋学院-文章列表
- // @Tags 蛋蛋学院
- // @Description 蛋蛋学院-文章列表
- // @Accept json
- // @Produce json
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @Param req body md.CollegeListReq true "参数"
- // @Success 200 {object} md.CollegeListResp "具体数据"
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/v1/college/list [post]
- func CollegeList(c *gin.Context) {
- svc.CollegeList(c)
- }
-
- // CollegeDetail
- // @Summary 蛋蛋学院-文章详情
- // @Tags 蛋蛋学院
- // @Description 蛋蛋学院-文章详情
- // @Accept json
- // @Produce json
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @Param req body md.CollegeDetailReq true "参数"
- // @Success 200 {object} md.CollegeDetailResp "具体数据"
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/v1/college/detail [post]
- func CollegeDetail(c *gin.Context) {
- uid := 0
- if c.GetHeader("Authorization") != "" {
- mw.Auth(c)
- user := svc.GetUser(c)
- uid = int(user.Id)
- }
- svc.CollegeDetail(c, uid)
- }
-
- // CollegeLikeAdd
- // @Summary 蛋蛋学院-文章-点赞
- // @Tags 蛋蛋学院
- // @Description 蛋蛋学院-文章-点赞
- // @Accept json
- // @Produce json
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @Param req body md.CollegeDetailReq true "参数"
- // @Success 200 {string} "具体数据"
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/v1/college/like/add [post]
- func CollegeLikeAdd(c *gin.Context) {
- svc.CollegeLikeAdd(c)
- }
-
- // CollegeLikeCancel
- // @Summary 蛋蛋学院-文章-取消点赞
- // @Tags 蛋蛋学院
- // @Description 蛋蛋学院-文章-取消点赞
- // @Accept json
- // @Produce json
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @Param req body md.CollegeDetailReq true "参数"
- // @Success 200 {string} "具体数据"
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/v1/college/like/cancel [post]
- func CollegeLikeCancel(c *gin.Context) {
- svc.CollegeLikeCancel(c)
- }
-
- // CollegeShareAdd
- // @Summary 蛋蛋学院-文章-分享后调用统计数量
- // @Tags 蛋蛋学院
- // @Description 蛋蛋学院-文章-分享后调用统计数量
- // @Accept json
- // @Produce json
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @Param req body md.CollegeDetailReq true "参数"
- // @Success 200 {string} "具体数据"
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/v1/college/share/add [post]
- func CollegeShareAdd(c *gin.Context) {
- svc.CollegeShareAdd(c)
- }
|