LogUsualController.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the dreamlu.net developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: Chill 庄骞 (smallchill@163.com)
  16. */
  17. package org.springblade.modules.system.controller;
  18. import com.baomidou.mybatisplus.core.metadata.IPage;
  19. import lombok.AllArgsConstructor;
  20. import org.springblade.core.launch.constant.AppConstant;
  21. import org.springblade.core.log.model.LogUsual;
  22. import org.springblade.core.mp.support.Condition;
  23. import org.springblade.core.mp.support.Query;
  24. import org.springblade.core.tool.api.R;
  25. import org.springblade.modules.system.service.ILogUsualService;
  26. import org.springframework.web.bind.annotation.GetMapping;
  27. import org.springframework.web.bind.annotation.RequestMapping;
  28. import org.springframework.web.bind.annotation.RequestParam;
  29. import org.springframework.web.bind.annotation.RestController;
  30. import springfox.documentation.annotations.ApiIgnore;
  31. import java.util.Map;
  32. /**
  33. * 控制器
  34. *
  35. * @author Chill
  36. */
  37. @ApiIgnore
  38. @RestController
  39. @AllArgsConstructor
  40. @RequestMapping(AppConstant.APPLICATION_LOG_NAME + "/usual")
  41. public class LogUsualController {
  42. private ILogUsualService logService;
  43. /**
  44. * 查询单条
  45. */
  46. @GetMapping("/detail")
  47. public R<LogUsual> detail(LogUsual log) {
  48. return R.data(logService.getOne(Condition.getQueryWrapper(log)));
  49. }
  50. /**
  51. * 查询多条(分页)
  52. */
  53. @GetMapping("/list")
  54. public R<IPage<LogUsual>> list(@ApiIgnore @RequestParam Map<String, Object> log, Query query) {
  55. IPage<LogUsual> pages = logService.page(Condition.getPage(query), Condition.getQueryWrapper(log, LogUsual.class));
  56. return R.data(pages);
  57. }
  58. }