Ignore:
Timestamp:
04/19/23 21:19:08 (15 months ago)
Author:
Gjoko Kostadinov <gjoko.kostadinov@…>
Branches:
master
Children:
950fa0d
Parents:
9050790
Message:

Add admin functionality and business admin functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/edu/gjoko/schedlr/controllers/rest/BusinessController.java

    r9050790 r8bcd64c  
    44import edu.gjoko.schedlr.services.BusinessService;
    55import lombok.AllArgsConstructor;
     6import org.springframework.security.core.Authentication;
     7import org.springframework.security.core.context.SecurityContextHolder;
    68import org.springframework.web.bind.annotation.*;
    79
     10import javax.servlet.http.HttpServletRequest;
    811import java.util.List;
    912
     
    2932        businessService.updateBusinesses(businessList);
    3033    }
     34
     35    @GetMapping(path = "/me")
     36    public Business getPersonalInfo(HttpServletRequest request) {
     37        Long businessOwnerId = (long) request.getSession(true).getAttribute("stakeholderId");
     38        return businessService.findByOwner(businessOwnerId);
     39    }
    3140}
Note: See TracChangeset for help on using the changeset viewer.