package com.zxyj.controller.config; import com.zxyj.common.Result; import com.zxyj.dto.SysConfigDTO; import com.zxyj.service.SysConfigService; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; import java.util.List; import java.util.Map; @RestController @RequestMapping("/api/admin/config") public class SysConfigController { @Resource private SysConfigService configService; @PostMapping("/list") public Result> list() { return configService.listAll(); } @PostMapping("/update") public Result update(@RequestBody Map params) { String key = (String) params.get("configKey"); String value = (String) params.get("configValue"); return configService.update(key, value); } @PostMapping("/all") public Result> getAllAsMap() { return configService.getAllAsMap(); } }