44323
2024-01-30 987fd6c12a7dcfb2b6ae9ee585fc182d2d865040
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//package com.dsh.guns.modular.code.controller;
//
//import com.dsh.guns.config.properties.DefaultTemplateFactory;
//import com.dsh.guns.core.base.controller.BaseController;
//import com.dsh.guns.modular.code.service.TableService;
//import com.stylefeng.guns.core.config.properties.DruidProperties;
//import com.stylefeng.guns.generator.action.config.WebGeneratorConfig;
//import com.stylefeng.guns.generator.action.model.GenQo;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//
///**
// * 代码生成控制器
// *
// * @author fengshuonan
// * @Date 2017年11月30日16:39:19
// */
//@Controller
//@RequestMapping("/code")
//public class CodeController extends BaseController {
//
//    private static String PREFIX = "/code";
//
//    @Autowired
//    private TableService tableService;
//
//    @Autowired
//    private DruidProperties druidProperties;
//
//    /**
//     * 跳转到代码生成主页
//     */
//    @RequestMapping("")
//    public String blackboard(Model model) {
//        model.addAttribute("tables", tableService.getAllTables());
//        model.addAttribute("params", DefaultTemplateFactory.getDefaultParams());
//        model.addAttribute("templates", DefaultTemplateFactory.getDefaultTemplates());
//        return PREFIX + "/code.html";
//    }
//
//    /**
//     * 生成代码
//     */
//    @ApiOperation("生成代码")
//    @RequestMapping(value = "/generate", method = RequestMethod.POST)
//    @ResponseBody
//    public Object generate(GenQo genQo) {
//        genQo.setUrl(druidProperties.getUrl());
//        genQo.setUserName(druidProperties.getUsername());
//        genQo.setPassword(druidProperties.getPassword());
//        WebGeneratorConfig webGeneratorConfig = new WebGeneratorConfig(genQo);
//        webGeneratorConfig.doMpGeneration();
//        webGeneratorConfig.doGunsGeneration();
//        return SUCCESS_TIP;
//    }
//}