package hycom; import hycom.model.Form; import hycom.model.FormsResoult; import hycom.model.UsersResoult; import hycom.service.DatabaseService; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.ByteArrayResource; import org.springframework.core.io.Resource; import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; @RestController public class FormsController { @Autowired DatabaseService databaseService; public final String USER = "username=c2VydmljZVVzZXI="; public final String PASSWORD = "password=UTJyVDg5JHE="; @RequestMapping(value = "/rest/form/{id}", method = RequestMethod.GET, headers = {USER, PASSWORD}) public @ResponseBody Form getForm(@PathVariable("id") int formId) { return databaseService.getForm(formId); } @RequestMapping(value = "/rest/forms", method = RequestMethod.GET, headers = {USER, PASSWORD}) public @ResponseBody List