yang_shj
1 year ago
15 changed files with 177 additions and 29 deletions
@ -0,0 +1,16 @@
|
||||
package com.hnac.hzims.alarm.vo; |
||||
|
||||
import com.hnac.hzims.alarm.entity.AlarmConfigEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
@Data |
||||
public class AlarmConfigVo extends AlarmConfigEntity { |
||||
|
||||
@ApiModelProperty(value = "用户名称") |
||||
private String userName; |
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.hnac.hzims.alarm.config.weapper; |
||||
|
||||
import com.hnac.hzims.alarm.entity.AlarmConfigEntity; |
||||
import com.hnac.hzims.alarm.vo.AlarmConfigVo; |
||||
import org.springblade.core.mp.support.BaseEntityWrapper; |
||||
import org.springblade.core.tool.utils.BeanUtil; |
||||
import org.springblade.system.user.cache.UserCache; |
||||
import org.springblade.system.user.entity.User; |
||||
|
||||
import java.util.Optional; |
||||
|
||||
|
||||
/** |
||||
* @author ysj |
||||
*/ |
||||
public class AlarmConfigWrapper extends BaseEntityWrapper<AlarmConfigEntity,AlarmConfigVo> { |
||||
|
||||
public static AlarmConfigWrapper build() { |
||||
return new AlarmConfigWrapper(); |
||||
} |
||||
|
||||
@Override |
||||
public AlarmConfigVo entityVO(AlarmConfigEntity entity) { |
||||
AlarmConfigVo config = BeanUtil.copy(entity, AlarmConfigVo.class); |
||||
User user = UserCache.getUser(entity.getCreateUser()); |
||||
config.setUserName(Optional.ofNullable(user).map(User::getName).orElse(null)); |
||||
return config; |
||||
} |
||||
} |
Loading…
Reference in new issue