Skip to content

[Bug] enum.use.custom 没有生效 #1089

Open
@ChenYilei2016

Description

easy api config:

enum.use.custom[groovy:it.isExtend("com.zbycorp.fenghuo.domain.common.constants.BaseEnum")]=code

基类

public interface BaseEnum {
    default String enumClass() {
        return this.getClass().getName();
    }

    /**
     * 枚举一般作为value的字段
     */
    Object getCode();
}

实现类

@Getter
public enum StrategyTypeEnum implements BaseEnum {

    CAMPAIGN_BUDGET("广告活动分时预算"),
    TARGET_BID("分时竞价")

    ;

    private String desc;


    StrategyTypeEnum(String desc) {
        this.desc = desc;
    }


    @Override
    public String getCode() {
        return this.name();
    }
}

使用地方

    /**
     * @see StrategyTypeEnum
     */
    @ApiModelProperty("策略类型")
    private String strategyType;

结果
没有输出任何值, 去掉配置之后 就可以输出了, 不知道为啥, 也没报错

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions