You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
package com.youlai.boot.mini.converter;
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.youlai.boot.mini.model.entity.MiniPointRule;
|
|
|
|
|
import com.youlai.boot.mini.model.form.AddPointRuleForm;
|
|
|
|
|
import com.youlai.boot.mini.model.vo.RuleListVO;
|
|
|
|
|
import org.mapstruct.Mapper;
|
|
|
|
|
import org.mapstruct.Mapping;
|
|
|
|
|
import org.mapstruct.Named;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 积分规则对象转换器
|
|
|
|
|
*/
|
|
|
|
|
@Mapper(componentModel = "spring")
|
|
|
|
|
public interface MiniPointRuleConverter {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页对象转换
|
|
|
|
|
*/
|
|
|
|
|
Page<RuleListVO> toRulePageVo(Page<MiniPointRule> pageList);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 单个对象转换
|
|
|
|
|
*/
|
|
|
|
|
@Mapping(source = "status", target = "status", qualifiedByName = "booleanToInt")
|
|
|
|
|
RuleListVO toRuleVo(MiniPointRule entity);
|
|
|
|
|
|
|
|
|
|
@Named("booleanToInt")
|
|
|
|
|
default Integer booleanToInt(Boolean status) {
|
|
|
|
|
return status == null ? null : (status ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增表单转实体
|
|
|
|
|
*/
|
|
|
|
|
MiniPointRule toEntity(AddPointRuleForm form);
|
|
|
|
|
|
|
|
|
|
}
|