@@ -0,0 +1,1504 @@
+package com.rizki.mufrizal.belajar.oauth2.controller;%0A%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0Aimport org.springframework.web.bind.annotation.RequestMethod;%0Aimport org.springframework.web.bind.annotation.RestController;%0A%0Aimport javax.servlet.http.HttpSession;%0Aimport java.security.Principal;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport java.util.UUID;%0A%0A@RestController%0A@RequestMapping(value = %22/api%22)%0Apublic class HelloController %7B%0A%0A    private static final String STATE = %22state%22;%0A%0A    @RequestMapping(value = %22/hello%22, method = RequestMethod.GET)%0A    public Map%3CString, Object%3E hello()%7B%0A        Map%3CString, Object%3E message = new HashMap%3CString, Object%3E();%0A        message.put(%22Success%22, Boolean.TRUE);%0A        message.put(%22Info%22, %22Hello Word%22);%0A%0A        return message;%0A    %7D%0A%0A    @RequestMapping(value = %22/admin%22, method = RequestMethod.GET)%0A    public Map%3CString, Object%3E admin(Principal principal)%7B%0A        Map%3CString, Object%3E message = new HashMap%3CString, Object%3E();%0A        message.put(%22Success%22, Boolean.TRUE);%0A        message.put(%22User%22, principal.getName());%0A%0A        return message;%0A    %7D%0A%0A    @RequestMapping(%22/state/new%22)%0A    public Map%3CString, Object%3E newState(HttpSession session)%7B%0A        Map%3CString, Object%3E hasil = new HashMap%3CString, Object%3E();%0A        hasil.put(%22sukses%22, Boolean.TRUE);%0A%0A        String state = UUID.randomUUID().toString();%0A        hasil.put(STATE, state);%0A        session.setAttribute(STATE, state);%0A%0A        return hasil;%0A    %7D%0A%0A%7D%0A

Add Hello Controller