@@ -0,0 +1,891 @@
+package com.rizki.mufrizal.belajar.oauth2.controller;%0A%0Aimport com.rizki.mufrizal.belajar.oauth2.domain.Barang;%0Aimport com.rizki.mufrizal.belajar.oauth2.service.BarangService;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.http.HttpStatus;%0Aimport org.springframework.http.MediaType;%0Aimport org.springframework.security.access.annotation.Secured;%0Aimport org.springframework.web.bind.annotation.*;%0A%0Aimport java.util.List;%0A%0A@RestController%0A@RequestMapping(value = %22/api%22)%0Apublic class BarangController %7B%0A%0A    @Autowired%0A    private BarangService barangService;%0A%0A    @Secured(%7B%22ADMIN%22,%22USER%22%7D)%0A    @ResponseBody%0A    @ResponseStatus(HttpStatus.OK)%0A    @RequestMapping(value = %22/barang%22, method = RequestMethod.GET, produces = %7BMediaType.APPLICATION_JSON_VALUE%7D)%0A    public List%3CBarang%3E getBarang()%7B%0A        return barangService.getBarangList();%0A    %7D%0A%0A%7D%0A

Add Controller Barang