|
|
@ -1,11 +1,14 @@
|
|
|
|
package cokr.xit.tool.crudgen.web;
|
|
|
|
package cokr.xit.tool.crudgen.web;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
|
|
|
|
import cokr.xit.foundation.web.AbstractController;
|
|
|
|
import cokr.xit.foundation.web.AbstractController;
|
|
|
@ -22,11 +25,6 @@ public class CrudgenController extends AbstractController {
|
|
|
|
return new ModelAndView("index");
|
|
|
|
return new ModelAndView("index");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/preview.do")
|
|
|
|
|
|
|
|
public ModelAndView preview() {
|
|
|
|
|
|
|
|
return new ModelAndView("preview");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/entityInfo.do")
|
|
|
|
@GetMapping("/entityInfo.do")
|
|
|
|
public ModelAndView entityInfo(String tableName) {
|
|
|
|
public ModelAndView entityInfo(String tableName) {
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
@ -35,8 +33,15 @@ public class CrudgenController extends AbstractController {
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/generate.do")
|
|
|
|
@PostMapping("/generate.do")
|
|
|
|
public ModelAndView generate(@RequestBody EntityInfo entityInfo) {
|
|
|
|
public ModelAndView generate(@RequestBody EntityInfo entityInfo) {
|
|
|
|
|
|
|
|
Map<String, Object> result = service.generateCodes(entityInfo);
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
return new ModelAndView("jsonView")
|
|
|
|
.addAllObjects(service.generateCodes(entityInfo));
|
|
|
|
.addAllObjects(result);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/preview.do")
|
|
|
|
|
|
|
|
public ModelAndView preview(@RequestParam Map<String, String> sourceCodes) {
|
|
|
|
|
|
|
|
return new ModelAndView("preview")
|
|
|
|
|
|
|
|
.addAllObjects(sourceCodes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/create.do")
|
|
|
|
@PostMapping("/create.do")
|
|
|
|