Skip to content
This repository has been archived by the owner on Nov 14, 2022. It is now read-only.

Commit

Permalink
improve command gen dao
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Jun 3, 2021
1 parent 732c319 commit 4a7d304
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions commands/gen/gen_dao_template_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ type {TplTableNameCamelLowerCase}Dao struct {
var (
// {TplTableNameCamelCase} is globally public accessible object for table {TplTableName} operations.
{TplTableNameCamelCase} {TplTableNameCamelLowerCase}Dao
)
func init() {
{TplTableNameCamelCase} = {TplTableNameCamelLowerCase}Dao{
internal.{TplTableNameCamelCase},
}
)
}
// Fill with you ideas below.
Expand Down Expand Up @@ -58,6 +62,10 @@ type {TplTableNameCamelLowerCase}Columns struct {
var (
// {TplTableNameCamelCase} is globally public accessible object for table {TplTableName} operations.
{TplTableNameCamelCase} {TplTableNameCamelCase}Dao
)
func init() {
{TplTableNameCamelCase} = {TplTableNameCamelCase}Dao{
M: g.DB("{TplGroupName}").Model("{TplTableName}").Safe(),
DB: g.DB("{TplGroupName}"),
Expand All @@ -66,5 +74,5 @@ var (
{TplColumnNames}
},
}
)
}
`
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

const (
VERSION = "v1.16.1"
VERSION = "v1.16.2"
)

func init() {
Expand Down

0 comments on commit 4a7d304

Please sign in to comment.