xin
2025-09-27 b500e0ad05da794f2b3764b81fb1181e1debf597
oying-generator/src/main/java/com/oying/rest/GeneratorController.java
@@ -2,7 +2,6 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.oying.domain.ColumnInfo;
import com.oying.domain.dto.TableInfo;
import com.oying.service.GenConfigService;
import com.oying.service.GeneratorService;
import com.oying.utils.R;
@@ -10,7 +9,6 @@
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import com.oying.exception.BadRequestException;
import com.oying.utils.PageResult;
import com.oying.utils.PageUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
@@ -34,8 +32,8 @@
    private final GeneratorService generatorService;
    private final GenConfigService genConfigService;
    @Value("${generator.enabled}")
    private Boolean generatorEnabled;
    @Value("${oying.enabled}")
    private Boolean oyingEnabled;
    @ApiOperation("查询数据库数据")
    @GetMapping(value = "/tables")
@@ -69,7 +67,7 @@
    @ApiOperation("生成代码")
    @PostMapping(value = "/{tableName}/{type}")
    public ResponseEntity<Object> generatorCode(@PathVariable String tableName, @PathVariable Integer type, HttpServletRequest request, HttpServletResponse response) {
        if (!generatorEnabled && type == 0) {
        if (!oyingEnabled && type == 0) {
            throw new BadRequestException("此环境不允许生成代码,请选择预览或者下载查看!");
        }
        switch (type) {