package controller import ( "enterprise/server/api" "enterprise/server/service" "enterprise/server/session" "github.com/gin-gonic/gin" "net/http" ) type CorpUser struct { } func NewCorpUser() *CorpUser { return &CorpUser{} } func (s *CorpUser) Login(ctx *gin.Context) { var req api.CorpLoginReq session.CheckParamError(ctx.ShouldBindJSON(&req)) sess := ctx.Keys[session.ContextSession].(*session.AdminSession) data := service.NewCorpUser().Login(sess, &req) ctx.JSON(http.StatusOK, session.NewRsp(data)) }