Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码生成器生成controller时遇到数字型主键的问题 #100

Closed
cranehe opened this issue Dec 29, 2017 · 1 comment
Closed

代码生成器生成controller时遇到数字型主键的问题 #100

cranehe opened this issue Dec 29, 2017 · 1 comment

Comments

@cranehe
Copy link

cranehe commented Dec 29, 2017

代码生成器生成controller时遇到数字型主键,使用的代码模板没有考虑这种情况

文件位置:wk-code/wk-code-generator/src/main/resources/templet/controller.vm

@At("/detail/?")
    @Ok("beetl:/${table.ViewBasePath}/detail.html")
    @RequiresPermissions("${table.Permissions}")
	public void detail(${table.pkType} id, HttpServletRequest req) {
		if (!Strings.isBlank(id)) {
            req.setAttribute("obj", ${table.ServiceInstanceName}.fetch(id));
		}else{
            req.setAttribute("obj", null);
        }
    }
@Wizzercn
Copy link
Owner

Wizzercn commented Dec 29, 2017

好吧好吧,改了……

@Wizzercn Wizzercn added 需求 and removed 搁置 labels Dec 30, 2017
@Wizzercn Wizzercn reopened this Dec 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants