ConfigController.java 988 B

12345678910111213141516171819202122232425262728
  1. package cn.seecoder.paas.web.controller.api;
  2. import cn.seecoder.paas.service.ConfigService;
  3. import cn.seecoder.paas.service.model.vo.ConfigVO;
  4. import cn.seecoder.paas.util.ServiceException;
  5. import cn.seecoder.paas.web.model.Response;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.PutMapping;
  8. import org.springframework.web.bind.annotation.RequestBody;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;
  11. @RestController
  12. @RequestMapping("/api/config")
  13. public class ConfigController {
  14. private final ConfigService configService;
  15. @Autowired
  16. public ConfigController(ConfigService configService) {
  17. this.configService = configService;
  18. }
  19. @PutMapping("")
  20. public Response update(@RequestBody ConfigVO configVO) throws ServiceException {
  21. return Response.buildSuccess(configService.createOrUpdate(configVO));
  22. }
  23. }