修复 ErrorCodeApi 接收 LocalDateTime 参数不正确的问题

This commit is contained in:
YunaiV 2023-07-25 21:42:04 +08:00
parent c22cf007d1
commit 3126672fcb

View File

@ -4,11 +4,12 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO; import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeAutoGenerateReqDTO;
import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO; import cn.iocoder.yudao.module.system.api.errorcode.dto.ErrorCodeRespDTO;
import cn.iocoder.yudao.module.system.enums.ApiConstants; import cn.iocoder.yudao.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters; import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -16,9 +17,10 @@ import org.springframework.web.bind.annotation.RequestParam;
import javax.validation.Valid; import javax.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date;
import java.util.List; import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory = @FeignClient(name = ApiConstants.NAME) // TODO 芋艿fallbackFactory =
@Tag(name = "RPC 服务 - 错误码") @Tag(name = "RPC 服务 - 错误码")
public interface ErrorCodeApi { public interface ErrorCodeApi {
@ -35,7 +37,9 @@ public interface ErrorCodeApi {
@Parameter(name = "applicationName", description = "应用名", example = "system-server", required = true), @Parameter(name = "applicationName", description = "应用名", example = "system-server", required = true),
@Parameter(name = "minUpdateTime", description = "最小更新时间") @Parameter(name = "minUpdateTime", description = "最小更新时间")
}) })
CommonResult<List<ErrorCodeRespDTO>> getErrorCodeList(@RequestParam(value = "applicationName") String applicationName, CommonResult<List<ErrorCodeRespDTO>> getErrorCodeList(
@RequestParam(value = "minUpdateTime", required = false) LocalDateTime minUpdateTime); @RequestParam(value = "applicationName") String applicationName,
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@RequestParam(value = "minUpdateTime", required = false) LocalDateTime minUpdateTime);
} }