Re-migrate code

This commit is contained in:
2026-03-02 10:05:12 +08:00
parent d1e6f15745
commit 51025195a5
7 changed files with 177 additions and 0 deletions

View File

@@ -163,3 +163,16 @@ func (c *AuthController) UpdateProfile(ctx *gin.Context) {
"user": profile,
})
}
// Logout 登出
// @Summary 用户登出
// @Description 用户登出JWT 无状态,前端清理令牌即可)
// @Tags 认证
// @Produce json
// @Security BearerAuth
// @Success 200 {object} models.BaseResponse
// @Failure 401 {object} models.ErrorResponse
// @Router /auth/logout [post]
func (c *AuthController) Logout(ctx *gin.Context) {
SuccessResponse(ctx, "登出成功")
}

View File

@@ -198,3 +198,25 @@ func (c *CompaniesController) Delete(ctx *gin.Context) {
"message": "企业删除成功",
})
}
// StatsOverview 获取企业统计概览
// @Summary 获取企业统计概览
// @Description 获取企业、企业赋码、员工赋码的统计数据
// @Tags 企业管理
// @Produce json
// @Security BearerAuth
// @Success 200 {object} models.DataResponse
// @Failure 401 {object} models.ErrorResponse
// @Failure 500 {object} models.ErrorResponse
// @Router /companies/stats/overview [get]
func (c *CompaniesController) StatsOverview(ctx *gin.Context) {
stats, err := c.companiesService.GetStatsOverview()
if err != nil {
ErrorResponse(ctx, http.StatusInternalServerError, err.Error())
return
}
SuccessResponse(ctx, "获取企业统计概览成功", gin.H{
"overview": stats,
})
}