From 6175eba13d39e965f9335ff7343eedbaffaa182f Mon Sep 17 00:00:00 2001 From: han0 Date: Tue, 2 Jan 2024 16:53:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(price-publish):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/controller/PricePublishController.java | 16 ++++++++++++++++ .../xinke/main/controller/PublicController.java | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/src/main/java/mjkf/xinke/main/controller/PricePublishController.java b/src/main/java/mjkf/xinke/main/controller/PricePublishController.java index 18f9001..93bede2 100644 --- a/src/main/java/mjkf/xinke/main/controller/PricePublishController.java +++ b/src/main/java/mjkf/xinke/main/controller/PricePublishController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.websocket.server.PathParam; +import java.time.LocalDateTime; import java.util.List; /** @@ -89,4 +90,19 @@ public class PricePublishController { return FuHttpResponse.Builder().dataResponse().build(); } + + @ApiOperation("发布信息") + @GetMapping("/info") + public HttpResponse info ( + @ApiParam("年份") @RequestParam("year") Integer year, + @ApiParam("月份") @RequestParam(value = "month") Integer month + ) throws Exception { + var data = new PricePublish(); + data.setCreateTime(LocalDateTime.of(year, month, 1, 0, 0)); + + var result = new PublicController.PublicUpdateInfo(data); + + return FuHttpResponse.Builder().dataResponse(result).build(); + } + } diff --git a/src/main/java/mjkf/xinke/main/controller/PublicController.java b/src/main/java/mjkf/xinke/main/controller/PublicController.java index c31fea4..200e1e8 100644 --- a/src/main/java/mjkf/xinke/main/controller/PublicController.java +++ b/src/main/java/mjkf/xinke/main/controller/PublicController.java @@ -108,6 +108,12 @@ public class PublicController { @ApiModelProperty("期数") private Integer period; + @ApiModelProperty("年份") + private Integer year; + + @ApiModelProperty("月份") + private Integer month; + public PublicUpdateInfo () {} public PublicUpdateInfo (PricePublish lastData) { @@ -124,6 +130,8 @@ public class PublicController { } } this.period = initialPeriod + months; + this.year = date.getYear(); + this.month = date.getMonth().getValue(); } }