SysCommonController.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package com.backendsys.modules.system.controller;
  2. import com.backendsys.modules.common.utils.Result;
  3. import com.backendsys.modules.system.entity.SysCommon;
  4. import com.backendsys.modules.system.entity.SysLogEntity;
  5. import com.backendsys.modules.system.service.SysCommonService;
  6. import io.swagger.v3.oas.annotations.Operation;
  7. import io.swagger.v3.oas.annotations.tags.Tag;
  8. import org.apache.ibatis.annotations.Update;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.security.access.prepost.PreAuthorize;
  11. import org.springframework.validation.annotation.Validated;
  12. import org.springframework.web.bind.annotation.GetMapping;
  13. import org.springframework.web.bind.annotation.PutMapping;
  14. import org.springframework.web.bind.annotation.RequestBody;
  15. import org.springframework.web.bind.annotation.RestController;
  16. @Validated
  17. @RestController
  18. @Tag(name = "系统配置")
  19. public class SysCommonController {
  20. @Autowired
  21. private SysCommonService sysCommonService;
  22. @Operation(summary = "获取系统配置列表")
  23. @PreAuthorize("@sr.hasPermission('6.1')")
  24. @GetMapping("/api/system/common/getCommonList")
  25. public Result getCommonList(String tag) {
  26. return Result.success().put("data", sysCommonService.selectCommonList(tag));
  27. }
  28. @Operation(summary = "获取系统配置详情")
  29. @PreAuthorize("@sr.hasPermission('6.1.1')")
  30. @GetMapping("/api/system/common/getCommonDetail")
  31. public Result getCommonDetail(@Validated(SysCommon.Detail.class) SysCommon sysCommon) {
  32. return Result.success().put("data", sysCommonService.selectCommonDetail(sysCommon));
  33. }
  34. @Operation(summary = "编辑系统配置")
  35. @PreAuthorize("@sr.hasPermission('6.1.3')")
  36. @PutMapping("/api/system/common/updateCommon")
  37. public Result updateCommon(@Validated(SysCommon.Update.class) @RequestBody SysCommon sysCommon) {
  38. return Result.success().put("data", sysCommonService.updateCommon(sysCommon));
  39. }
  40. // // 测试后删除
  41. // @GetMapping("/api/system/common/getCommonValue")
  42. // public Object getCommonValue(Long id) {
  43. // return sysCommonService.getCommonValue(id);
  44. // }
  45. }