mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-10 11:13:44 +08:00
v2.0
This commit is contained in:
40
server/internal/dao/sys_cron_group.go
Normal file
40
server/internal/dao/sys_cron_group.go
Normal file
@@ -0,0 +1,40 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/dao/internal"
|
||||
)
|
||||
|
||||
// internalSysCronGroupDao is internal type for wrapping internal DAO implements.
|
||||
type internalSysCronGroupDao = *internal.SysCronGroupDao
|
||||
|
||||
// sysCronGroupDao is the data access object for table hg_sys_cron_group.
|
||||
// You can define custom methods on it to extend its functionality as you wish.
|
||||
type sysCronGroupDao struct {
|
||||
internalSysCronGroupDao
|
||||
}
|
||||
|
||||
var (
|
||||
// SysCronGroup is globally public accessible object for table hg_sys_cron_group operations.
|
||||
SysCronGroup = sysCronGroupDao{
|
||||
internal.NewSysCronGroupDao(),
|
||||
}
|
||||
)
|
||||
|
||||
// GetName 获取分组名称
|
||||
func (dao *sysCronGroupDao) GetName(ctx context.Context, id int64) (name string, err error) {
|
||||
m := dao.Ctx(ctx).Fields("name").Where("id", id)
|
||||
list, err := m.Value()
|
||||
if err != nil {
|
||||
err = gerror.Wrap(err, consts.ErrorORM)
|
||||
return name, err
|
||||
}
|
||||
|
||||
return list.String(), nil
|
||||
}
|
||||
Reference in New Issue
Block a user