github.com/SupenBysz/gf-admin-community@v0.7.4/sys_service/sys_industry.go (about)

     1  // ================================================================================
     2  // Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
     3  // You can delete these comments if you wish manually maintain this interface file.
     4  // ================================================================================
     5  
     6  package sys_service
     7  
     8  import (
     9  	"context"
    10  
    11  	"github.com/SupenBysz/gf-admin-community/sys_model"
    12  	"github.com/SupenBysz/gf-admin-community/sys_model/sys_entity"
    13  )
    14  
    15  type (
    16  	ISysIndustry interface {
    17  		// GetIndustryById 根据ID获取行业类别信息
    18  		GetIndustryById(ctx context.Context, id int64) (*sys_entity.SysIndustry, error)
    19  		// CreateIndustry 创建行业类别
    20  		CreateIndustry(ctx context.Context, info *sys_model.SysIndustry) (*sys_entity.SysIndustry, error)
    21  		// UpdateIndustry 更新行业类别
    22  		UpdateIndustry(ctx context.Context, info *sys_model.UpdateSysIndustry) (*sys_entity.SysIndustry, error)
    23  		// SaveIndustry 新增或保存行业类别信息,并自动更新对应的权限信息
    24  		SaveIndustry(ctx context.Context, info *sys_model.SysIndustry) (*sys_entity.SysIndustry, error)
    25  		// DeleteIndustry 删除行业类别,删除的时候要关联删除sys_permission,有子行业类别时禁止删除。
    26  		DeleteIndustry(ctx context.Context, id int64) (bool, error)
    27  		// MakeIndustryTree 构建行业类别树
    28  		MakeIndustryTree(ctx context.Context, parentId int64, isMakeNodeFun func(ctx context.Context, cruuentIndustry *sys_entity.SysIndustry) bool) ([]*sys_model.SysIndustryTreeRes, error)
    29  		// GetIndustryTree 根据ID获取下级行业类别信息,返回行业类别树,并缓存
    30  		GetIndustryTree(ctx context.Context, parentId int64) (sys_model.SysIndustryTreeListRes, error)
    31  		// GetIndustryList 根据ID获取下级行业类别列表,IsRecursive代表是否需要返回下级
    32  		GetIndustryList(ctx context.Context, parentId int64, IsRecursive bool, limitChildrenIds ...int64) ([]*sys_entity.SysIndustry, error)
    33  	}
    34  )
    35  
    36  var (
    37  	localSysIndustry ISysIndustry
    38  )
    39  
    40  func SysIndustry() ISysIndustry {
    41  	if localSysIndustry == nil {
    42  		panic("implement not found for interface ISysIndustry, forgot register?")
    43  	}
    44  	return localSysIndustry
    45  }
    46  
    47  func RegisterSysIndustry(i ISysIndustry) {
    48  	localSysIndustry = i
    49  }