oktadev / ionic-jhipster-starter

Starter Template for Ionic Apps with JHipster
https://developer.okta.com/blog/2019/06/24/ionic-4-angular-spring-boot-jhipster
Apache License 2.0
27 stars 18 forks source link

entity to User JDL #29

Closed MInesGomes closed 5 years ago

MInesGomes commented 5 years ago

I have this Jdl

entity NmsAlert {
  alertBegin ZonedDateTime,
  alertSent ZonedDateTime,
  alertAnswered ZonedDateTime,
  text String
}

relationship ManyToOne {
    NmsAlert{userAttended} to User, 
}

And It generates import { User } from '../../../services/user/user.model'; That doesn't exist

============ I replaced with import { JhiUser } from '../../../../model/jhi-user';

and created this class in src/model

export class JhiUser {
    constructor(
        public id?: number,
        public login?: string,
        public activated?: boolean,
        public authorities?: any[],
        public email?: string,
        public firstName?: string,
        public langKey?: string,
        public lastName?: string,
        public imageUrl?: string,
        public createdBy?: string,
        public createdDate?: Date,
        public lastModifiedBy?: string,
        public lastModifiedDate?: Date,
        public password?: string
    ) 
    {
        this.id = id ? id : null;
        this.login = login ? login : null;
        this.firstName = firstName ? firstName : null;
        this.lastName = lastName ? lastName : null;
        this.email = email ? email : null;
        this.activated = activated ? activated : false;
        this.langKey = langKey ? langKey : 'en';
        this.authorities = authorities ? authorities : null;
        this.createdBy = createdBy ? createdBy : null;
        this.createdDate = createdDate ? createdDate : null;
        this.lastModifiedBy = lastModifiedBy ? lastModifiedBy : null;
        this.lastModifiedDate = lastModifiedDate ? lastModifiedDate : null;
        this.password = password ? password : null;
    }
}

=====

And is working :-)

mraible commented 5 years ago

I imported this JDL with the new import-jdl subgenerator and ran ionic build --prod and everything compiles. Because of this, I'm closing this issue as fixed.