Feat: hash id decode and verification

This commit is contained in:
HFO4
2020-01-26 14:57:07 +08:00
parent 880d224169
commit 94b13393a9
7 changed files with 111 additions and 5 deletions

View File

@@ -15,3 +15,14 @@ func CreateShare(c *gin.Context) {
c.JSON(200, ErrorResponse(err))
}
}
// GetShare 查看分享
func GetShare(c *gin.Context) {
var service share.ShareGetService
if err := c.ShouldBindQuery(&service); err == nil {
res := service.Get(c)
c.JSON(200, res)
} else {
c.JSON(200, ErrorResponse(err))
}
}

View File

@@ -167,6 +167,13 @@ func InitMasterRouter() *gin.Engine {
)
}
// 分享相关
share := v3.Group("share")
{
// 获取分享
share.GET(":id", controllers.GetShare)
}
// 需要登录保护的
auth := v3.Group("")
auth.Use(middleware.AuthRequired())