public with sharing class DealerVisitDetailsController {
    @AuraEnabled
    public static InitData init(String recordId){
        InitData res  = new initData();
        ID myUserID = UserInfo.getUserId();
        try {
            User userinfo = [SELECT id,ProfileId FROM User WHERE Id = :myUserID LIMIT 1];
            Account report = [SELECT Id,RecordTypeId,Department_Class_Label__c,name,Hospital_Department_Class__c FROM Account WHERE Id = :recordId];
            res.profileId = userinfo.ProfileId;
            res.recordTypeId = report.recordTypeId;
            res.departmentClassLabel = report.Department_Class_Label__c;
            res.name = report.name;
            res.hospitalDepartmentClass = report.Hospital_Department_Class__c;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
        return res;
    }
    public class InitData{
        @AuraEnabled
        public string profileId;
        @AuraEnabled
        public string recordTypeId;
        @AuraEnabled
        public string departmentClassLabel;
        @AuraEnabled
        public string name;
        @AuraEnabled
        public string hospitalDepartmentClass;
    }
}