feat(price-publish): 新增发布信息接口

This commit is contained in:
han0
2024-01-02 16:53:37 +08:00
parent a6e4d78c21
commit 6175eba13d
2 changed files with 24 additions and 0 deletions

View File

@@ -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();
}
}

View File

@@ -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();
}
}