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

代码生成 报 404 #4

Closed
cppfuns opened this issue Jul 24, 2020 · 2 comments
Closed

代码生成 报 404 #4

cppfuns opened this issue Jul 24, 2020 · 2 comments

Comments

@cppfuns
Copy link

cppfuns commented Jul 24, 2020

http://demo.g-fast.cn/tool/gen/batchGenCode?tables=user 404

看前端有

/** 生成代码操作 */
    handleGenTable(row) {
      const tableNames = row.tableName || this.tableNames;
      if (tableNames == "") {
        this.msgError("请选择要生成的数据");
        return;
      }
      downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi");
    },

后端代码并没有看到对应的接口

//代码生成
		group.Group("/tools", func(group *ghttp.RouterGroup) {
			group.ALL("/gen", new(admin.Gen))
		})

感谢开源

@tiger1103
Copy link
Owner

功能细节还在完善中

@gutrse3321
Copy link

预览生成的model.go

AddReq结构体,Id自增长主键,AddSave函数会去使用req不存在的Id

// AddSave 添加
func AddSave(req *AddReq) error {
	.   .   .
	entity.Id = req.Id
	.   .   .
}

SelectPageReq结构体PageNum字段类型是int,分页查询函数

func SelectListByPage(req *SelectPageReq) (total int, page int64, list []*Entity, err error) {
	.  .  .
	//req.PageNum需要转换类型为int64
	page = req.PageNum
	.  .  .
}

@cppfuns cppfuns closed this as completed Sep 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants