Skip to content

Commit

Permalink
fix: 修复代码生成相关错误
Browse files Browse the repository at this point in the history
1.通用枚举查询无法扫描到 QueryTypeEnum
2.前端路径校验错误
3.部分命名格式修复
  • Loading branch information
Charles7c committed Dec 12, 2023
1 parent 3ece42b commit 3fdc50d
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package top.charles7c.continew.admin.tool.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import top.charles7c.continew.starter.data.mybatis.plus.enums.IBaseEnum;

/**
* 查询类型枚举
*
* @author Charles7c
* @since 2023/8/6 10:49
*/
@Getter
@RequiredArgsConstructor
public enum QueryTypeEnum implements IBaseEnum<Integer> {

/**
* 等值查询,例如:WHERE `age` = 18
*/
EQUAL(1, "="),
/**
* 非等值查询,例如:WHERE `age` != 18
*/
NOT_EQUAL(2, "!="),
/**
* 大于查询,例如:WHERE `age` > 18
*/
GREATER_THAN(3, ">"),
/**
* 小于查询,例如:WHERE `age` < 18
*/
LESS_THAN(4, "<"),
/**
* 大于等于查询,例如:WHERE `age` >= 18
*/
GREATER_THAN_OR_EQUAL(5, ">="),
/**
* 小于等于查询,例如:WHERE `age` <= 18
*/
LESS_THAN_OR_EQUAL(6, "<="),
/**
* 范围查询,例如:WHERE `age` BETWEEN 10 AND 18
*/
BETWEEN(7, "BETWEEN"),
/**
* 左模糊查询,例如:WHERE `nickname` LIKE '%s'
*/
LEFT_LIKE(8, "LIKE '%s'"),
/**
* 中模糊查询,例如:WHERE `nickname` LIKE '%s%'
*/
INNER_LIKE(9, "LIKE '%s%'"),
/**
* 右模糊查询,例如:WHERE `nickname` LIKE 's%'
*/
RIGHT_LIKE(10, "LIKE 's%'"),
/**
* 包含查询,例如:WHERE `age` IN (10, 20, 30)
*/
IN(11, "IN"),
/**
* 不包含查询,例如:WHERE `age` NOT IN (20, 30)
*/
NOT_IN(12, "NOT IN"),
/**
* 空查询,例如:WHERE `email` IS NULL
*/
IS_NULL(13, "IS NULL"),
/**
* 非空查询,例如:WHERE `email` IS NOT NULL
*/
IS_NOT_NULL(14, "IS NOT NULL"),;

private final Integer value;
private final String description;
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
import cn.hutool.setting.dialect.PropsUtil;

import top.charles7c.continew.admin.tool.enums.FormTypeEnum;
import top.charles7c.continew.admin.tool.enums.QueryTypeEnum;
import top.charles7c.continew.starter.core.constant.StringConstants;
import top.charles7c.continew.starter.data.mybatis.plus.enums.QueryTypeEnum;

/**
* 字段配置实体
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ public class GenConfigDO implements Serializable {
*/
@Schema(description = "前端路径", example = "D:/continew-admin/continew-admin-ui/src/views/system/user")
@Length(max = 255, message = "前端路径不能超过 {max} 个字符")
@Pattern(regexp = "^$|^(?=.*src\\/views)(?!.*\\/views\\/?$).*", message = "前端路径配置错误")
private String frontendPath;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@

import top.charles7c.continew.admin.tool.config.properties.GeneratorProperties;
import top.charles7c.continew.admin.tool.config.properties.GeneratorProperties.TemplateConfig;
import top.charles7c.continew.admin.tool.enums.QueryTypeEnum;
import top.charles7c.continew.admin.tool.mapper.FieldConfigMapper;
import top.charles7c.continew.admin.tool.mapper.GenConfigMapper;
import top.charles7c.continew.admin.tool.model.entity.FieldConfigDO;
Expand All @@ -58,7 +59,6 @@
import top.charles7c.continew.starter.core.util.db.MetaUtils;
import top.charles7c.continew.starter.core.util.db.Table;
import top.charles7c.continew.starter.core.util.validate.CheckUtils;
import top.charles7c.continew.starter.data.mybatis.plus.enums.QueryTypeEnum;
import top.charles7c.continew.starter.extension.crud.model.query.PageQuery;
import top.charles7c.continew.starter.extension.crud.model.resp.PageDataResp;

Expand Down
6 changes: 3 additions & 3 deletions continew-admin-ui/src/views/tool/generator/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@
<a-select
v-if="record.showInQuery"
v-model="record.queryType"
:options="query_type_Enum"
:options="query_type_enum"
placeholder="请选择查询方式"
/>
<span v-else>无需设置</span>
Expand Down Expand Up @@ -281,9 +281,9 @@
} from '@/api/tool/generator';
const { proxy } = getCurrentInstance() as any;
const { form_type_enum, query_type_Enum } = proxy.useDict(
const { form_type_enum, query_type_enum } = proxy.useDict(
'form_type_enum',
'query_type_Enum',
'query_type_enum',
);
const tableList = ref<TableRecord[]>([]);
Expand Down

0 comments on commit 3fdc50d

Please sign in to comment.