12345678910111213141516171819202122232425262728 |
- package admin_common
- import (
- "fmt"
- "github.com/gin-gonic/gin"
- "net/http"
- "sghgogs.com/sghblog/authorization-client/response"
- "sghgogs.com/sghblog/authorization-client/utils"
- pb "sghgogs.com/sghblog/authorization-service/proto"
- )
- // Logout
- // @summary 退出登录
- // @Description
- // @Tags Common
- // @Accept json
- // @Produce json
- // @Param Authorization header string true "Bearer 用户令牌"
- // @Success 200 {object} response.ApiResponse "成功"
- // @Failure 400 {object} response.ApiResponse "请求错误"
- // @Failure 500 {object} response.ApiResponse "内部错误"
- // @Router /v1/api/admin/profile [post]
- func (svc *ApiAdminCommon) Logout(c *gin.Context) {
- ctx, _ := utils.CreateContextWithToken(c, "authorizationservice", "CommonService.AdminLogout")
- logout, err := svc.Service.AdminLogout(ctx, &pb.AdminLogoutRequest{})
- fmt.Println(logout, err)
- c.JSON(http.StatusOK, response.SuccessResponse(nil))
- }
|