duhuizhe
2024-04-19 64c4fd3c7067c7626dc960a70b4bc2c3662bc653
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.yqzx.generator.action;
 
import com.yqzx.generator.action.config.WebGeneratorConfig;
import com.yqzx.generator.action.model.GenQo;
import com.yqzx.common.domain.result.CommonResult;
import com.yqzx.common.util.CommonUtil;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 功能描述:代码生成器入口
 *
 * @author dhz
 * @date 2024-04-16 14:54
 * @Version 1.0
 **/
@RequestMapping("/v1/base/web")
@RestController
public class WebGenerator {
 
    @RequestMapping("/generator")
    @ResponseBody
    public CommonResult generator() {
        GenQo genQo = CommonUtil.getObjFromReq(GenQo.class);
//        genQo.setQueryTableInfo(new ArrayList<TableInfo>() {{
//            TableInfo tableInfo = new TableInfo();
//            tableInfo.setName("name");
//            tableInfo.setType("String");
//            tableInfo.setComment("姓名");
//            tableInfo.setPropertyName("name");
//            tableInfo.setJdbcType("VARCHAR");
//            add(tableInfo);
//        }});
        WebGeneratorConfig webGeneratorConfig = new WebGeneratorConfig(genQo);
        webGeneratorConfig.doGeneration();
        return new CommonResult(CommonResult.CODE_OK);
    }
}