public without sharing class lexUpdateDateController {
    public lexUpdateDateController() {

    }
    @AuraEnabled
    public static UserResult userCheck(){
        UserResult result = new UserResult();
        ID myUserID = UserInfo.getUserId();
        try { 
            User tempUser =
                [select Id,isFormal_Stuff__c,FirstName,LastName,Alias from user where id = : myUserID ];
            result.Id = tempUser.Id;
            // result.isFormalStuff = tempUser.isFormal_Stuff__c;
            // result.firstName = tempUser.FirstName;
            // result.lastName = tempUser.LastName;
            if (UserInfo.getProfileId() == System.Label.ProfileId_SystemAdmin) {
                result.adminId = true;
            }
            result.Alias = tempUser.Alias;
        } catch (exception e) {
            
            result.result = e.getMessage();
        }
        return result;
    }
    @AuraEnabled
    public static initdata init(String recordId){
        InitData res = new initData();
        try {
            Maintenance_Contract__c nObj = [SELECT Id,Name,Status2__c FROM Maintenance_Contract__c WHERE Id =: recordId];
            res.Id = nObj.Id;
            res.name = nObj.Name;
            res.status2 = nObj.Status2__c;
            return res;
        } catch (Exception e) {
            throw new AuraHandledException(e.getMessage());
        }
    }
    public class initData{
        @AuraEnabled
        public String Id;

        @AuraEnabled
        public String status2;
        @AuraEnabled
        public String name;
    }
    public class UserResult{
        @AuraEnabled
        public string result;
        public UserResult( ) {
            result = 'Success';
        }
        @AuraEnabled
        public String Id;
        @AuraEnabled
        public String Alias;
        @AuraEnabled
        public Boolean adminId;
    }
}