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

Commit

Permalink
improve template for command gen dao
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Jun 3, 2021
1 parent 4a7d304 commit 4c84e08
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions commands/gen/gen_dao_template_dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
// and custom defined data operations functions management. You can define
// methods on it to extend its functionality as you wish.
type {TplTableNameCamelLowerCase}Dao struct {
internal.{TplTableNameCamelCase}Dao
*internal.{TplTableNameCamelCase}Dao
}
var (
Expand All @@ -25,7 +25,7 @@ var (
func init() {
{TplTableNameCamelCase} = {TplTableNameCamelLowerCase}Dao{
internal.{TplTableNameCamelCase},
internal.New{TplTableNameCamelCase}Dao(),
}
}
Expand Down Expand Up @@ -60,13 +60,8 @@ type {TplTableNameCamelLowerCase}Columns struct {
{TplColumnDefine}
}
var (
// {TplTableNameCamelCase} is globally public accessible object for table {TplTableName} operations.
{TplTableNameCamelCase} {TplTableNameCamelCase}Dao
)
func init() {
{TplTableNameCamelCase} = {TplTableNameCamelCase}Dao{
func New{TplTableNameCamelCase}Dao() *{TplTableNameCamelCase}Dao {
return &{TplTableNameCamelCase}Dao{
M: g.DB("{TplGroupName}").Model("{TplTableName}").Safe(),
DB: g.DB("{TplGroupName}"),
Table: "{TplTableName}",
Expand Down

0 comments on commit 4c84e08

Please sign in to comment.