public IHttpActionResult Get([FromUri] CodeRuleFilter request) { var response = new BaseResponse <string>(); response.Data = service.GenerateCodeRule(request); return(Ok(response)); }
public string GenerateCodeRule(CodeRuleFilter codeRule) { if (!Enum.IsDefined(typeof(EnumCodeKey), codeRule.CodeKey)) { return("CodeKey不存在EnumCodeKey枚举中,请先添加相应的枚举值。"); } if (!Enum.IsDefined(typeof(EnumCodeRule), codeRule.GenerateRule)) { return("GenerateRule不存在EnumCodeRule枚举中,请先添加相应的枚举值。"); } return(base.GenerateCode( (EnumCodeKey)Enum.Parse(typeof(EnumCodeKey), codeRule.CodeKey), (EnumCodeRule)Enum.Parse(typeof(EnumCodeRule), codeRule.GenerateRule), codeRule.Prefix, codeRule.SerialNumberLength, codeRule.OrganizationID)); }