Browse Source
12.30日,将导入符合条件的jwcode到redis改为导入到数据库表后,将coupon_qualified_users表纳入管理,使得导入数据库表没有问题,有关coupon_qualified_users表的也都没有问题
master
12.30日,将导入符合条件的jwcode到redis改为导入到数据库表后,将coupon_qualified_users表纳入管理,使得导入数据库表没有问题,有关coupon_qualified_users表的也都没有问题
master
9 changed files with 164 additions and 35 deletions
-
4api/v1/couponusers/couponUsers.go
-
2hack/config.yaml
-
3internal/controller/couponusers/couponUsers.go
-
27internal/dao/coupon_qualified_users.go
-
75internal/dao/internal/coupon_qualified_users.go
-
59internal/logic/couponusers/couponUsers.go
-
16internal/model/do/coupon_qualified_users.go
-
11internal/model/entity/coupon_qualified_users.go
-
2internal/service/couponusers.go
@ -0,0 +1,27 @@ |
|||
// =================================================================================
|
|||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
|||
// =================================================================================
|
|||
|
|||
package dao |
|||
|
|||
import ( |
|||
"CouponBackendGo/internal/dao/internal" |
|||
) |
|||
|
|||
// internalCouponQualifiedUsersDao is internal type for wrapping internal DAO implements.
|
|||
type internalCouponQualifiedUsersDao = *internal.CouponQualifiedUsersDao |
|||
|
|||
// couponQualifiedUsersDao is the data access object for table coupon_qualified_users.
|
|||
// You can define custom methods on it to extend its functionality as you wish.
|
|||
type couponQualifiedUsersDao struct { |
|||
internalCouponQualifiedUsersDao |
|||
} |
|||
|
|||
var ( |
|||
// CouponQualifiedUsers is globally public accessible object for table coupon_qualified_users operations.
|
|||
CouponQualifiedUsers = couponQualifiedUsersDao{ |
|||
internal.NewCouponQualifiedUsersDao(), |
|||
} |
|||
) |
|||
|
|||
// Fill with you ideas below.
|
@ -0,0 +1,75 @@ |
|||
// ==========================================================================
|
|||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|||
// ==========================================================================
|
|||
|
|||
package internal |
|||
|
|||
import ( |
|||
"context" |
|||
|
|||
"github.com/gogf/gf/v2/database/gdb" |
|||
"github.com/gogf/gf/v2/frame/g" |
|||
) |
|||
|
|||
// CouponQualifiedUsersDao is the data access object for table coupon_qualified_users.
|
|||
type CouponQualifiedUsersDao struct { |
|||
table string // table is the underlying table name of the DAO.
|
|||
group string // group is the database configuration group name of current DAO.
|
|||
columns CouponQualifiedUsersColumns // columns contains all the column names of Table for convenient usage.
|
|||
} |
|||
|
|||
// CouponQualifiedUsersColumns defines and stores column names for table coupon_qualified_users.
|
|||
type CouponQualifiedUsersColumns struct { |
|||
Id string //
|
|||
Jwcode string //
|
|||
} |
|||
|
|||
// couponQualifiedUsersColumns holds the columns for table coupon_qualified_users.
|
|||
var couponQualifiedUsersColumns = CouponQualifiedUsersColumns{ |
|||
Id: "id", |
|||
Jwcode: "jwcode", |
|||
} |
|||
|
|||
// NewCouponQualifiedUsersDao creates and returns a new DAO object for table data access.
|
|||
func NewCouponQualifiedUsersDao() *CouponQualifiedUsersDao { |
|||
return &CouponQualifiedUsersDao{ |
|||
group: "default", |
|||
table: "coupon_qualified_users", |
|||
columns: couponQualifiedUsersColumns, |
|||
} |
|||
} |
|||
|
|||
// DB retrieves and returns the underlying raw database management object of current DAO.
|
|||
func (dao *CouponQualifiedUsersDao) DB() gdb.DB { |
|||
return g.DB(dao.group) |
|||
} |
|||
|
|||
// Table returns the table name of current dao.
|
|||
func (dao *CouponQualifiedUsersDao) Table() string { |
|||
return dao.table |
|||
} |
|||
|
|||
// Columns returns all column names of current dao.
|
|||
func (dao *CouponQualifiedUsersDao) Columns() CouponQualifiedUsersColumns { |
|||
return dao.columns |
|||
} |
|||
|
|||
// Group returns the configuration group name of database of current dao.
|
|||
func (dao *CouponQualifiedUsersDao) Group() string { |
|||
return dao.group |
|||
} |
|||
|
|||
// Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
|
|||
func (dao *CouponQualifiedUsersDao) Ctx(ctx context.Context) *gdb.Model { |
|||
return dao.DB().Model(dao.table).Safe().Ctx(ctx) |
|||
} |
|||
|
|||
// Transaction wraps the transaction logic using function f.
|
|||
// It rollbacks the transaction and returns the error from function f if it returns non-nil error.
|
|||
// It commits the transaction and returns nil if function f returns nil.
|
|||
//
|
|||
// Note that, you should not Commit or Rollback the transaction in function f
|
|||
// as it is automatically handled by this function.
|
|||
func (dao *CouponQualifiedUsersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) { |
|||
return dao.Ctx(ctx).Transaction(ctx, f) |
|||
} |
@ -0,0 +1,16 @@ |
|||
// =================================================================================
|
|||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|||
// =================================================================================
|
|||
|
|||
package do |
|||
|
|||
import ( |
|||
"github.com/gogf/gf/v2/frame/g" |
|||
) |
|||
|
|||
// CouponQualifiedUsers is the golang structure of table coupon_qualified_users for DAO operations like Where/Data.
|
|||
type CouponQualifiedUsers struct { |
|||
g.Meta `orm:"table:coupon_qualified_users, do:true"` |
|||
Id interface{} //
|
|||
Jwcode interface{} //
|
|||
} |
@ -0,0 +1,11 @@ |
|||
// =================================================================================
|
|||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
|||
// =================================================================================
|
|||
|
|||
package entity |
|||
|
|||
// CouponQualifiedUsers is the golang structure for table coupon_qualified_users.
|
|||
type CouponQualifiedUsers struct { |
|||
Id uint `json:"id" orm:"id" description:""` //
|
|||
Jwcode int `json:"jwcode" orm:"jwcode" description:""` //
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue