找回密码
 立即注册
查看: 56|回复: 0

springboot3实体日期格式正确封装

[复制链接]

153

主题

5

精华

157

金币

技术维护QQ:515138

积分
339
发表于 2025-12-30 11:34:21 | 显示全部楼层 |阅读模式
springboot3实体日期格式正确封装
  1. package com.sky.controller.admin;
  2. import com.sky.result.Result;
  3. import com.sky.service.ReportService;
  4. import com.sky.vo.TurnoverReportVO;
  5. import io.swagger.annotations.Api;
  6. import io.swagger.annotations.ApiOperation;
  7. import lombok.extern.slf4j.Slf4j;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.format.annotation.DateTimeFormat;
  10. import org.springframework.web.bind.annotation.GetMapping;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.RestController;
  13. import java.time.LocalDate;
  14. /**
  15. * 报表
  16. */
  17. @RestController
  18. @RequestMapping("/admin/report")
  19. @Slf4j
  20. @Api(tags = "统计报表相关接口")
  21. public class ReportController {
  22.     @Autowired
  23.     private ReportService reportService;
  24.     /**
  25.      * 营业额数据统计
  26.      *
  27.      * @param begin
  28.      * @param end
  29.      * @return
  30.      */
  31.     @GetMapping("/turnoverStatistics")
  32.     @ApiOperation("营业额数据统计")
  33.     public Result<TurnoverReportVO> turnoverStatistics(
  34.             @DateTimeFormat(pattern = "yyyy-MM-dd")
  35.                     LocalDate begin,
  36.             @DateTimeFormat(pattern = "yyyy-MM-dd")
  37.                     LocalDate end) {
  38.         return Result.success(reportService.getTurnover(begin, end));
  39.     }
  40. }
复制代码




上一篇:Apache ECharts数据可视化图表库
下一篇:SpringCloud微服务开发与实战之MybatisPlus入门案例
网站建设,公众号小程序开发,系统定制,软件App开发,技术维护【联系我们】手机/微信:17817817816 QQ:515138

QQ|Archiver|自丢网 ( 粤ICP备2024252464号-1 )

GMT+8, 2026-1-13 12:49

专注于网站建设,公众号小程序制作,商城小程序,系统定制,软件App开发

【联系我们】手机/微信:17817817816 QQ:515138

快速回复 返回顶部 返回列表