// api_id (uid) find user
// check status and allow ip
api_id (uid) find user
check status and allow ip
// api_id ( uid ) find user // check status and allow ip
func ApiLoadUser(apiId string, ip string) (User, error) {
	var user User
	if err := DB.Where("api_id = ?", apiId).First(&user).Error; err != nil {
		return user, errors.New("not found user")
	}
	if !user.IsActive() {
		return User{}, errors.New("account is forbidden")
	}
	if !user.IsAllowIP(ip) {
		return User{}, errors.New("ip deny")
	}
	return user, nil
}
func ApiLoadUser ( apiId string , ip string ) ( User , error ) { var user User if err := DB . Where ( " " , apiId ) . First ( & user ) . Error ; err != nil { return user , errors . New ( " " ) } if ! user . IsActive ( ) { return User { } , errors . New ( " " ) } if ! user . IsAllowIP ( ip ) { return User { } , errors . New ( " " ) } return user , nil }
api_id (uid) find user
check status and allow ip
api_id ( uid ) find user check status and allow ip