使用什么来代替“引用”;System.out.println“;在java Spring引导中
以上是我的主要代码。我想打印天数差(创建日期和更新日期之间的天数)。我在哪里写这个逻辑?我记得在java中我们使用使用什么来代替“引用”;System.out.println“;在java Spring引导中,java,spring-boot,mysql-workbench,hibernate-mapping,hibernate-criteria,Java,Spring Boot,Mysql Workbench,Hibernate Mapping,Hibernate Criteria,以上是我的主要代码。我想打印天数差(创建日期和更新日期之间的天数)。我在哪里写这个逻辑?我记得在java中我们使用System.out.println来显示输出,但在这里我不知道如何在Postman上显示代码 以下是我的DTO: @RequestMapping(method=RequestMethod.POST, value= {"/LMSServer/getNoOfDaysOfApplicationBycellNo"} ) @PreAuthorize("hasAuthority('CUSTOM
System.out.println
来显示输出,但在这里我不知道如何在Postman上显示代码
以下是我的DTO:
@RequestMapping(method=RequestMethod.POST, value= {"/LMSServer/getNoOfDaysOfApplicationBycellNo"} )
@PreAuthorize("hasAuthority('CUSTOMER_MANAGEMENT_R') OR hasAuthority('CUSTOMER_MANAGEMENT_RW')")
public BasicResponce getNoOfDaysOfApplicationBycellNo(@RequestParam(value = "cellNo") long cellNo)
{
if(LOG.isInfoEnabled()){
LOG.info("WebClientRestContoller.getNoOfDaysOfApplicationBycellNo--Start");
LOG.info("Cell NO: "+cellNo);
}
BasicResponce authResp = null;
try {
Customer fromDB= (Customer) objLMSDAO.getDetailsByCellno(cellNo);
DaysOfApplicationResponseDTO toSend= new DaysOfApplicationResponseDTO();
toSend.setCreatedAt(fromDB.getCreatedAt()+"");
toSend.setUpdatedAt(fromDB.getUpdatedAt()+"");
toSend.setRequested_Action(true);
authResp=toSend;
} catch (Exception e) {
e.printStackTrace();
}
if(LOG.isInfoEnabled()){
LOG.info("Returned Response is:");
LOG.info("Response Requested_Action: {} ",new Object[]{authResp.getRequested_Action()});
LOG.info("WebClientRestContoller.getNoOfDaysOfApplicationBycellNo--End");
}
return authResp;
}
应用程序响应的公共类日期扩展基本响应{
私有字符串createdAt;
私有字符串更新数据;
私人串日;
公共字符串getDays(){
返程天数;
}
公共无效设置天数(字符串天数){
这个.天=天;
}
私有列表贷款应用程序DummyResponseList;
公共字符串getCreatedAt(){
返回createdAt;
}
公共void setCreatedAt(字符串createdAt){
this.createdAt=createdAt;
}
公共字符串getUpdatedAt(){
返回更新数据;
}
公共void setUpdatedAt(字符串updatedAt){
this.updatedAt=updatedAt;
}
公共列表getLoanApplicationDummyResponseList(){
返回贷款申请DummyResponseList;
}
公共无效设置应用程序Dummy响应列表(
列表loanApplicationDummyResponseList){
LoanApplicationDummyResponseList=LoanApplicationDummyResponseList;
}
公共日申请响应到(){
超级();
}
ApplicationResponsedTo(字符串createdAt、字符串UpdatedAt、字符串days、,
列表loanApplicationDummyResponseList){
超级();
this.createdAt=createdAt;
this.updatedAt=updatedAt;
这个.天=天;
this.LoanApplicationDummyResponseList=LoanApplicationDummyResponseList;
}
}
您可以将服务类(@service annotation)引入到项目中,用于域逻辑。您必须将项目分解并组织成合适的项目结构(为了清晰起见,您的控制器、实体和服务位于不同的包中)。更多信息,请阅读这些内容
下面是一个有用的堆栈溢出问题,
您希望输出到哪里?进入日志文件以控制发生的情况,或在客户端页面上?请修改标题,因为标题与实际问题无关!。
public class DaysOfApplicationResponseDTO extends BasicResponce{
private String createdAt;
private String updatedAt;
private String days;
public String getDays() {
return days;
}
public void setDays(String days) {
this.days = days;
}
private List<CustomerLoanSummaryResponseDTO> LoanApplicationDummyResponseList;
public String getCreatedAt() {
return createdAt;
}
public void setCreatedAt(String createdAt) {
this.createdAt = createdAt;
}
public String getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(String updatedAt) {
this.updatedAt = updatedAt;
}
public List<CustomerLoanSummaryResponseDTO> getLoanApplicationDummyResponseList() {
return LoanApplicationDummyResponseList;
}
public void setLoanApplicationDummyResponseList(
List<CustomerLoanSummaryResponseDTO> loanApplicationDummyResponseList) {
LoanApplicationDummyResponseList = loanApplicationDummyResponseList;
}
public DaysOfApplicationResponseDTO() {
super();
}
public DaysOfApplicationResponseDTO(String createdAt, String UpdatedAt, String days,
List<CustomerLoanSummaryResponseDTO> loanApplicationDummyResponseList) {
super();
this.createdAt = createdAt;
this.updatedAt = updatedAt;
this.days = days;
this.LoanApplicationDummyResponseList = loanApplicationDummyResponseList;
}
}