34 lines
798 B
Go
34 lines
798 B
Go
package server
|
|
|
|
import (
|
|
"admin/internal/context"
|
|
"admin/internal/model/dto"
|
|
)
|
|
|
|
func (ctl *controller) Login(ctx *context.WebContext, params *dto.LoginReq, rsp *dto.LoginRsp) error {
|
|
loginInfo, err := ctl.svc.Login(params.User, params.Password)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*rsp = *loginInfo
|
|
return nil
|
|
}
|
|
|
|
func (ctl *controller) GetUserInfo(ctx *context.WebContext, params *dto.NilReq, rsp *dto.GetUserInfoRsp) error {
|
|
svcRsp, err := ctl.svc.GetUserInfo(ctx.Header.UserId)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*rsp = *svcRsp
|
|
return nil
|
|
}
|
|
|
|
func (ctl *controller) GetUserExecHistory(ctx *context.WebContext, params *dto.ListUserOpHistoryReq, rsp *dto.ListUserOpHistoryRsp) error {
|
|
rsp1, err := ctl.svc.ListUserExecHistory(params)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
*rsp = *rsp1
|
|
return nil
|
|
}
|