package com.example.DemoElasticsearch.Mapper; import com.example.DemoElasticsearch.entity.Employee; import com.example.DemoElasticsearch.request.AddEmployeeRequest; import com.example.DemoElasticsearch.response.EmployeeResponse; import org.mapstruct.Mapper; import org.mapstruct.Mapping; @Mapper(componentModel = "spring") public abstract class EmployeeMapper { @Mapping(target = "id",expression = "java(com.example.DemoElasticsearch.until.Until.generateId())") @Mapping(target = "created_time",expression = "java(com.example.DemoElasticsearch.until.Until.createDateRealTime())") public abstract Employee convertAttribute(AddEmployeeRequest addEmployeeRequest); public abstract EmployeeResponse convertAttribute(Employee employee); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter