package service import ( "gouser/domain/model" "gouser/domain/repository" ) type IUserDataService interface { Login(int32, string, int32, string) (*model.User, error) } type UserDataService struct { userRepository repository.IUserRepository } func NewUserDataService(userRepository repository.IUserRepository) IUserDataService { return &UserDataService{userRepository: userRepository} } //重写接口方法 func (u *UserDataService) Login(clientId int32, phone string, systemId int32, verificationCode string) (user *model.User, err error) { return u.userRepository.Login(clientId, phone, systemId, verificationCode) } /* clientId, _ := strconv.Atoi(c.Request.FormValue("clientId")) phone := c.Request.FormValue("phone") systemId, _ := strconv.Atoi(c.Request.FormValue("systemId")) verificationCode := c.Request.FormValue("verificationCode") */