|
|
@ -3,6 +3,7 @@ package org.mobidgim.mobidigimproject.controller; |
|
|
import lombok.AllArgsConstructor; |
|
|
import lombok.AllArgsConstructor; |
|
|
import org.mobidgim.mobidigimproject.common.api.Api; |
|
|
import org.mobidgim.mobidigimproject.common.api.Api; |
|
|
import org.mobidgim.mobidigimproject.model.device.DeviceDTO; |
|
|
import org.mobidgim.mobidigimproject.model.device.DeviceDTO; |
|
|
|
|
|
import org.mobidgim.mobidigimproject.model.register.RegisterDTO; |
|
|
import org.mobidgim.mobidigimproject.service.SettingService; |
|
|
import org.mobidgim.mobidigimproject.service.SettingService; |
|
|
import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.http.ResponseEntity; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
@ -32,9 +33,15 @@ public class Controller { |
|
|
return ResponseEntity.ok().body(Api.OK(entity)); |
|
|
return ResponseEntity.ok().body(Api.OK(entity)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// @PostMapping("/register")
|
|
|
@PostMapping("/register") |
|
|
// public Api<RegisterDTO> settingRegister(@RequestBody RegisterDTO request)throws IOException{
|
|
|
public Api<RegisterDTO> settingRegister(@RequestBody RegisterDTO request)throws IOException{ |
|
|
// settingService.saveFileWithRegister(request);
|
|
|
settingService.saveFileWithRegister(request); |
|
|
// return Api.OK(request);
|
|
|
return Api.OK(request); |
|
|
// }
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/get-register") |
|
|
|
|
|
public Api<RegisterDTO> getRegister(@RequestParam("id") String id) throws IOException { |
|
|
|
|
|
var entity = settingService.readFileWithRegister(); |
|
|
|
|
|
return Api.OK(entity); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|