Documentation ¶
Index ¶
- Variables
- type AopUtil
- func (this AopUtil) CallAfterFunc(funcName string, ctx *gin.Context, params ...interface{}) *MsgEmity
- func (this AopUtil) CallAroundFunc(funcName string, ctx *gin.Context, params ...interface{}) *MsgEmity
- func (this AopUtil) CallBeforeFunc(funcName string, ctx *gin.Context, params ...interface{}) *MsgEmity
- func (this AopUtil) RegisterAfterAop(funcName string, ...)
- func (this AopUtil) RegisterAroundAop(funcName string, ...)
- func (this AopUtil) RegisterBeforeAop(funcName string, ...)
- type AppUtil
- func (this AppUtil) HasSection(sectionName string) bool
- func (this AppUtil) IsCloudApp() bool
- func (this AppUtil) IsCloudSystem() bool
- func (this AppUtil) IsNotCloudApp() bool
- func (this AppUtil) IsNotCloudSystem() bool
- func (this AppUtil) ReadConfigKey(section string, key string, def interface{}) interface{}
- func (this AppUtil) ToEntity(entity interface{}, names ...string) *model.MsgEmity
- type BrickApp
- type Cloud
- type CommonController
- type CommonDao
- func (dao CommonDao) Add(entity interface{}) *MsgEmity
- func (dao CommonDao) AddCommon(entity interface{}) *MsgEmity
- func (dao CommonDao) AddNode(entity interface{}) *MsgEmity
- func (dao CommonDao) Adds(entitys []interface{}) *MsgEmity
- func (dao CommonDao) ChangeSetp(entity interface{}, id interface{}, iSetp int, iVersion int, sMemo string, ...) *MsgEmity
- func (dao CommonDao) ChangeState(entity interface{}, id interface{}, iState int, iVersion int, sMemo string, ...) *MsgEmity
- func (dao CommonDao) CommonCheckRepeatByAdd(dbEntity interface{}, currentUser string) *MsgEmity
- func (dao CommonDao) CommonCheckRepeatByAddAndTree(dbEntity interface{}, currentUser string) *MsgEmity
- func (dao CommonDao) CommonCheckRepeatByEdit(entity interface{}, id interface{}, currentUser string) *MsgEmity
- func (dao CommonDao) CommonCheckRepeatByEditAndTree(entity interface{}, id interface{}, sName interface{}, currentUser string) *MsgEmity
- func (dao CommonDao) Del(entity interface{}, id interface{}, iVersion int, currentUser string, ...) *MsgEmity
- func (dao CommonDao) DelByMap(entity interface{}, where map[string]interface{}, currentUser string, ...) *MsgEmity
- func (dao CommonDao) DelSign(entity interface{}, id interface{}, iVersion int, currentUser string, ...) *MsgEmity
- func (dao CommonDao) DelSignByMap(entity interface{}, where map[string]interface{}, currentUser string, ...) *MsgEmity
- func (dao CommonDao) DoSql(sql string) *MsgEmity
- func (dao CommonDao) Edit(entity interface{}, id interface{}, iVersion int, data map[string]interface{}, ...) *MsgEmity
- func (dao CommonDao) EntityById(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *MsgEmity
- func (dao CommonDao) EntityBySql(entityList interface{}, sql string, where map[string]interface{}) *MsgEmity
- func (dao CommonDao) ExecSql(sql string) *MsgEmity
- func (dao CommonDao) FindAll(entity interface{}, where map[string]interface{}, currentUser string, ...) *MsgEmity
- func (dao CommonDao) FindByDate(entity interface{}, sDateSt string, sDateEd string, currentUser string, ...) *MsgEmity
- func (dao CommonDao) FindByFields(entity interface{}, where map[string]interface{}, fieldMap map[string]string, ...) *MsgEmity
- func (dao CommonDao) FindById(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *MsgEmity
- func (dao CommonDao) FindByKey(entity interface{}, where map[string]interface{}, currentUser string, ...) *MsgEmity
- func (dao CommonDao) FindByPage(entity interface{}, findByPageParam FindByPageParam, currentUser string, ...) *MsgEmity
- func (dao CommonDao) FindByRow(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *MsgEmity
- func (dao CommonDao) FindByTree(entity interface{}, sGroupColumn, sGroupName string, currentUser string) *MsgEmity
- func (dao CommonDao) FindCountByKey(entity interface{}, where map[string]interface{}, currentUser string, ...) *MsgEmity
- func (dao CommonDao) FindOneByKey(entity interface{}, where map[string]interface{}, currentUser string, ...) *MsgEmity
- func (dao CommonDao) FindValueByKey(entity interface{}, where map[string]interface{}, fieldName string, ...) *MsgEmity
- func (dao CommonDao) GetPath(sId, dbName, tableName string) string
- func (dao CommonDao) GetRow(sql string) *MsgEmity
- func (dao CommonDao) GetRows(sql string) *MsgEmity
- func (dao CommonDao) GetValue(sql string) *MsgEmity
- func (dao CommonDao) GetValueByField(entity interface{}, id interface{}, fieldName string, currentUser string) *MsgEmity
- func (dao CommonDao) GetValueByFieldName(entity interface{}, id interface{}, fieldNames []string, currentUser string) *MsgEmity
- func (dao CommonDao) GetiState(entity interface{}, id interface{}) *MsgEmity
- func (dao CommonDao) GetiVersion(entity interface{}, id interface{}) *MsgEmity
- func (dao CommonDao) GroupByField(entity interface{}, sCreator string, fields map[string]string, ...) *MsgEmity
- func (dao CommonDao) GroupByFieldAndCount(entity interface{}, sCreator string, fields map[string]string, ...) *MsgEmity
- func (dao CommonDao) GroupByFieldBase(entity interface{}, sCreator string, fields map[string]string, ...) *MsgEmity
- func (dao CommonDao) HasById(entity interface{}, id interface{}) *MsgEmity
- func (dao CommonDao) HasByKey(entity interface{}, keyName string, keyValue interface{}) *MsgEmity
- func (dao CommonDao) MaxByField(entity interface{}, sCreator string, field string, ...) *MsgEmity
- func (dao CommonDao) MinByField(entity interface{}, sCreator string, field string, ...) *MsgEmity
- func (dao CommonDao) NewChildId(tableInfo *TableInfo, sPid string) *MsgEmity
- func (dao CommonDao) TransactionSql(sqls map[string]map[string]interface{}) *MsgEmity
- func (dao CommonDao) ValidEntityRepeatByAdd(dbEntity interface{}, currentUser string) *MsgEmity
- func (dao CommonDao) ValidEntityRepeatByEdit(entity interface{}, id interface{}, data map[string]interface{}, ...) *MsgEmity
- type CommonService
- func (service CommonService) Add(ctx *gin.Context, entity interface{}, data map[string]interface{}) *MsgEmity
- func (service CommonService) AddCommon(ctx *gin.Context, entity interface{}, data map[string]interface{}) *MsgEmity
- func (service CommonService) AddList(ctx *gin.Context, entitys []interface{}) *MsgEmity
- func (service CommonService) AddNode(ctx *gin.Context, entity interface{}, data map[string]interface{}) *MsgEmity
- func (service CommonService) AddToGroup(ctx *gin.Context, entity interface{}, sGroupName, sGroupValue string) *MsgEmity
- func (service CommonService) Adds(ctx *gin.Context, entitys []interface{}, list []map[string]interface{}) *MsgEmity
- func (service CommonService) ChangeSetp(ctx *gin.Context, entity interface{}, id interface{}, iSetp int, iVersion int, ...) *MsgEmity
- func (service CommonService) ChangeState(ctx *gin.Context, entity interface{}, id interface{}, iState int, iVersion int, ...) *MsgEmity
- func (service CommonService) ClearCache(ctx *gin.Context, cacheName string, sUser string) *MsgEmity
- func (service CommonService) CommonCheckRepeatByAdd(ctx *gin.Context, dbEntity interface{}) *MsgEmity
- func (service CommonService) CommonCheckRepeatByAddAndTree(ctx *gin.Context, dbEntity interface{}) *MsgEmity
- func (service CommonService) CommonCheckRepeatByEdit(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
- func (service CommonService) CommonCheckRepeatByEditAndTree(ctx *gin.Context, entity interface{}, id interface{}, sName interface{}) *MsgEmity
- func (this CommonService) CreateTree(source interface{}, rootName, idFieldName, pIdFieldName, childFieldName string) *MsgEmity
- func (service CommonService) Del(ctx *gin.Context, entity interface{}, id interface{}, iVersion int) *MsgEmity
- func (service CommonService) DelByMap(ctx *gin.Context, entity interface{}, where map[string]interface{}) *MsgEmity
- func (service CommonService) DoSql(sql string) *MsgEmity
- func (service CommonService) Edit(ctx *gin.Context, entity interface{}, id interface{}, iVersion int, ...) *MsgEmity
- func (service CommonService) ExecSql(sql string) *MsgEmity
- func (service CommonService) FindAll(ctx *gin.Context, entity interface{}, where map[string]interface{}) *MsgEmity
- func (service CommonService) FindByDate(ctx *gin.Context, entity interface{}, sDateSt string, sDateEd string) *MsgEmity
- func (service CommonService) FindByFields(ctx *gin.Context, entity interface{}, where map[string]interface{}, ...) *MsgEmity
- func (service CommonService) FindByGroup(ctx *gin.Context, entity interface{}, sGroupColumn, sGroupName string) *MsgEmity
- func (service CommonService) FindById(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
- func (service CommonService) FindByKey(ctx *gin.Context, entity interface{}, where map[string]interface{}) *MsgEmity
- func (service CommonService) FindByPage(ctx *gin.Context, entity interface{}, findByPageParam FindByPageParam) *MsgEmity
- func (service CommonService) FindByRow(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
- func (service CommonService) FindByTree(ctx *gin.Context, entity interface{}, sGroupColumn, sGroupName string) *MsgEmity
- func (service CommonService) FindCountByKey(ctx *gin.Context, entity interface{}, where map[string]interface{}) *MsgEmity
- func (service CommonService) FindOneByKey(ctx *gin.Context, entity interface{}, where map[string]interface{}, ...) *MsgEmity
- func (service CommonService) FindValueByKey(ctx *gin.Context, entity interface{}, where map[string]interface{}, ...) *MsgEmity
- func (service CommonService) GetRow(sql string) *MsgEmity
- func (service CommonService) GetRows(sql string) *MsgEmity
- func (service CommonService) GetValue(sql string) *MsgEmity
- func (service CommonService) GetValueByField(ctx *gin.Context, entity interface{}, id interface{}, fieldName string) *MsgEmity
- func (service CommonService) GetValueByFieldName(ctx *gin.Context, entity interface{}, id interface{}, fieldNames []string) *MsgEmity
- func (service CommonService) GetiState(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
- func (service CommonService) GetiVersion(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
- func (service CommonService) GroupByField(ctx *gin.Context, entity interface{}, sCreator string, ...) *MsgEmity
- func (service CommonService) GroupByFieldAndCount(ctx *gin.Context, entity interface{}, sCreator string, ...) *MsgEmity
- func (service CommonService) HasById(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
- func (service CommonService) HasByKey(ctx *gin.Context, entity interface{}, keyName string, keyValue interface{}) *MsgEmity
- func (service CommonService) HoldByEntity(entity interface{}, data map[string]interface{}, fieldPrefix ...string) map[string]interface{}
- func (service CommonService) MaxByField(ctx *gin.Context, entity interface{}, sCreator string, field string, ...) *MsgEmity
- func (service CommonService) MinByField(ctx *gin.Context, entity interface{}, sCreator string, field string, ...) *MsgEmity
- func (service CommonService) SupplyDbEntityAttrByAdd(ctx *gin.Context, dbEntity interface{}, selfId string, idValuePrefix string) *MsgEmity
- func (service CommonService) ValidEntityRepeatByAdd(ctx *gin.Context, dbEntity interface{}) *MsgEmity
- func (service CommonService) ValidEntityRepeatByEdit(ctx *gin.Context, entity interface{}, id interface{}, ...) *MsgEmity
- type ControllerUtil
- func (controlUtil ControllerUtil) Add(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) AddToGroup(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) Adds(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) ClearCache(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) Del(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) Edit(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) FindAll(ctx *gin.Context, control interface{}, attachWhere ...Set) *MsgEmity
- func (controlUtil ControllerUtil) FindByDate(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) FindByGroup(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) FindById(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) FindByKey(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) FindByPage(ctx *gin.Context, control interface{}, injectionCondition ...Set) *MsgEmity
- func (controlUtil ControllerUtil) FindByRow(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) FindByTree(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) FindCountByKey(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) FindOneByKey(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) FindValueByKey(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) GetParams(ctx *gin.Context, entity interface{}) *MsgEmity
- func (controlUtil ControllerUtil) GetValueByField(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) GetValueByFieldName(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) Group(ctx *gin.Context, control interface{}, fields map[string]string) *MsgEmity
- func (controlUtil ControllerUtil) GroupAndCount(ctx *gin.Context, control interface{}, fields map[string]string) *MsgEmity
- func (controlUtil ControllerUtil) GroupByField(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) HasById(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) HasByKey(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) MaxByField(ctx *gin.Context, control interface{}) *MsgEmity
- func (controlUtil ControllerUtil) MinByField(ctx *gin.Context, control interface{}) *MsgEmity
- type ModuleUtil
- func (mu ModuleUtil) CreateNewInstance(t reflect.Type, isReturnVal bool) interface{}
- func (mu ModuleUtil) CurrentLoginUserId(ctx *gin.Context) string
- func (mu ModuleUtil) EnableFind(moduleName string) bool
- func (mu ModuleUtil) EnableTag(moduleName string, i int) bool
- func (mu ModuleUtil) GetFindByPageSelectSql(currentUser string, entity interface{}, findByPageParam FindByPageParam, ...) (string, string, map[string]interface{})
- func (mu ModuleUtil) GetFindByPageSelectSqlByField(dataInfo DataInfo, sTableName, sFieldName string, oTherJoin map[string]string) (string, string)
- func (mu ModuleUtil) GetLikeTimeLimit(object interface{}) int
- func (mu ModuleUtil) GetModuleEnable(moduleName string) int
- func (mu ModuleUtil) GetModuleEntity(control interface{}) interface{}
- func (mu ModuleUtil) GetModuleService(control interface{}) interface{}
- func (mu ModuleUtil) GetNewId(iLength int, sTableName string) string
- func (mu ModuleUtil) GetService(name string) interface{}
- func (mu ModuleUtil) GetSimplName(object interface{}) string
- func (mu ModuleUtil) NowModuleEntity(control interface{}) interface{}
- func (mu ModuleUtil) NowModuleEntityAndInit(control interface{}) interface{}
- type WebConfigInfo
Constants ¶
This section is empty.
Variables ¶
var (
AppCfg *ini.File //配置文件变量
)
Functions ¶
This section is empty.
Types ¶
type AopUtil ¶
type AopUtil struct{}
func (AopUtil) CallAfterFunc ¶
func (this AopUtil) CallAfterFunc(funcName string, ctx *gin.Context, params ...interface{}) *MsgEmity
*
- 调用Aop-函数执行后调用函数
- @param funcName 被监听函数 xxservice.xx
- @param doFunc 被调用函数
- @return
func (AopUtil) CallAroundFunc ¶
func (this AopUtil) CallAroundFunc(funcName string, ctx *gin.Context, params ...interface{}) *MsgEmity
*
- 调用Aop-函数执行中调用函数
- @param funcName 被监听函数 xxservice.xx
- @param doFunc 被调用函数
- @return
func (AopUtil) CallBeforeFunc ¶
func (this AopUtil) CallBeforeFunc(funcName string, ctx *gin.Context, params ...interface{}) *MsgEmity
*
- 调用Aop-函数执行前调用函数
- @param funcName 被监听函数 xxservice.xx
- @param doFunc 被调用函数
- @return
func (AopUtil) RegisterAfterAop ¶
func (this AopUtil) RegisterAfterAop(funcName string, doFunc func(ctx *gin.Context, params ...interface{}) *MsgEmity)
*
- 注册Aop-函数执行后调用函数
- @param funcName 被监听函数
- @param doFunc 被调用函数
- @return
type BrickApp ¶
type BrickApp struct{}
type Cloud ¶
type Cloud struct{}
func (Cloud) CloudMonitor ¶
#region @Api {title=取服务器外网IP} @return {type=json explainType=MsgEmity<string> explain=返回IP} @RequestMapping {name=ServerIp type=GET value=/ipcity/ip/server} #endregion
type CommonController ¶
type CommonController struct{}
type CommonDao ¶
type CommonDao struct{}
func (CommonDao) Add ¶
func (dao CommonDao) Add(entity interface{}) *MsgEmity
*
- 新增
- @param entity 待保存实体
func (CommonDao) AddCommon ¶
func (dao CommonDao) AddCommon(entity interface{}) *MsgEmity
*
- 通用新增数据方法
- @param entity 待保存实体
func (CommonDao) AddNode ¶
func (dao CommonDao) AddNode(entity interface{}) *MsgEmity
*
- 新增树节点
- @param entity 检查用数据结构
func (CommonDao) ChangeSetp ¶
func (dao CommonDao) ChangeSetp(entity interface{}, id interface{}, iSetp int, iVersion int, sMemo string, unidirectional bool) *MsgEmity
*
- 修改步骤值(如果设置为单向则新值必须大于旧值)
- @param id 编号
- @param iSetp 步骤值
- @param iVersion 记录版本号
- @param sMemo 备注
- @param unidirectional 是否单向 设置为单向则新值必须大于旧值才能执行
- @param entity 实体类
- @return MsgEmity 返回执行情况
func (CommonDao) ChangeState ¶
func (dao CommonDao) ChangeState(entity interface{}, id interface{}, iState int, iVersion int, sMemo string, unidirectional bool) *MsgEmity
*
- 修改状态
- @param entity 实体类
- @param id 编号
- @param iState 状态值
- @param iVersion 记录版本号
- @param sMemo 备注
- @param unidirectional 是否单向 设置为单向则新值必须大于旧值才能执行
- @return MsgEmity 返回执行情况
func (CommonDao) CommonCheckRepeatByAddAndTree ¶
func (dao CommonDao) CommonCheckRepeatByAddAndTree(dbEntity interface{}, currentUser string) *MsgEmity
*
- 通用树型结构表添加数据时重复检查方法
- dbEntity
func (CommonDao) CommonCheckRepeatByEdit ¶
func (dao CommonDao) CommonCheckRepeatByEdit(entity interface{}, id interface{}, currentUser string) *MsgEmity
*
- 通用更新数据时重复检查方法
- entity
func (CommonDao) CommonCheckRepeatByEditAndTree ¶
func (dao CommonDao) CommonCheckRepeatByEditAndTree(entity interface{}, id interface{}, sName interface{}, currentUser string) *MsgEmity
*
- 通用树型结构表添加数据时重复检查方法
- entity
func (CommonDao) Del ¶
func (dao CommonDao) Del(entity interface{}, id interface{}, iVersion int, currentUser string, onlyCreator bool) *MsgEmity
删除
func (CommonDao) DelByMap ¶
func (dao CommonDao) DelByMap(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *MsgEmity
删除
func (CommonDao) DelSign ¶
func (dao CommonDao) DelSign(entity interface{}, id interface{}, iVersion int, currentUser string, onlyCreator bool) *MsgEmity
逻辑删除(非物理删除)
func (CommonDao) DelSignByMap ¶
func (dao CommonDao) DelSignByMap(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *MsgEmity
逻辑删除(非物理删除)
func (CommonDao) DoSql ¶
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @return MsgEmity
func (CommonDao) Edit ¶
func (dao CommonDao) Edit(entity interface{}, id interface{}, iVersion int, data map[string]interface{}, currentUser string, onlyCreator bool) *MsgEmity
*
- 修改
- @param entity 对象类型
- @param id 记录编号值
- @param iVersion 记录版本号
- @param data 待更新的字段和值
- @param currentUser 当前用户
- @return MsgEmity
func (CommonDao) EntityById ¶
func (dao CommonDao) EntityById(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *MsgEmity
*
- 根据主键查询数据(返回结构体数据)
- entity 检查用数据结构
- id 主键
func (CommonDao) EntityBySql ¶
func (CommonDao) ExecSql ¶
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @return MsgEmity
func (CommonDao) FindAll ¶
func (dao CommonDao) FindAll(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *MsgEmity
查询所有数据
func (CommonDao) FindByDate ¶
func (dao CommonDao) FindByDate(entity interface{}, sDateSt string, sDateEd string, currentUser string, onlyCreator bool) *MsgEmity
查询指定时间内数据
func (CommonDao) FindByFields ¶
func (dao CommonDao) FindByFields(entity interface{}, where map[string]interface{}, fieldMap map[string]string, currentUser string, onlyCreator bool) *MsgEmity
*
- 根据关键值取对象集合中的符合条件的第一条记录的指定字段
- @Param entity 实体类
- @Param where 存放查询条件
- @param fieldMap 指定要查询的字段集合(原字段, 别名)
- @param currentUser 当前用户
- @param onlyCreator 仅查询创建者
- @return MsgEmity
func (CommonDao) FindById ¶
func (dao CommonDao) FindById(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *MsgEmity
*
- 根据主键查询数据
- entity 检查用数据结构
- id 主键
func (CommonDao) FindByKey ¶
func (dao CommonDao) FindByKey(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *MsgEmity
*
- 根据关键值取对象集合
- @Param entity 实体类
- @Param where 存放查询条件
- @return MsgEmity
func (CommonDao) FindByPage ¶
func (dao CommonDao) FindByPage(entity interface{}, findByPageParam FindByPageParam, currentUser string, onlyCreator bool) *MsgEmity
查询分页数据
func (CommonDao) FindByRow ¶
func (dao CommonDao) FindByRow(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *MsgEmity
查询指定行数据
func (CommonDao) FindByTree ¶
func (dao CommonDao) FindByTree(entity interface{}, sGroupColumn, sGroupName string, currentUser string) *MsgEmity
*
- 读取树形结构数据
- @param entity
- @param sGroupColumn
- @param sGroupName
- @return
func (CommonDao) FindCountByKey ¶
func (dao CommonDao) FindCountByKey(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *MsgEmity
*
- 根据关键值查数量
- @Param entity 实体类
- @Param where 存放查询条件
- @return MsgEmity
func (CommonDao) FindOneByKey ¶
func (dao CommonDao) FindOneByKey(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool, fields ...string) *MsgEmity
*
- 根据关键值取对象集合中的第一个
- @Param entity 实体类
- @Param where 存放查询条件
- @param fields 指定要查询的字段集合
- @return MsgEmity
func (CommonDao) FindValueByKey ¶
func (dao CommonDao) FindValueByKey(entity interface{}, where map[string]interface{}, fieldName string, currentUser string, onlyCreator bool) *MsgEmity
*
- 根据关键值取对象集合中的符合条件的第一条记录的指定字段
- @Param entity 实体类
- @Param where 存放查询条件
- @param fieldName 指定要查询的字段
- @param currentUser 当前用户
- @param onlyCreator 仅查询创建者
- @return MsgEmity
func (CommonDao) GetRow ¶
*
- 执行SQL脚本获取一行数据(多列)
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录
- @param sql 待执行的SQL脚本
- @return MsgEmity
func (CommonDao) GetRows ¶
*
- 执行SQL脚本获取多行数据(多列)
- 注意:库名必须用${}进行包装,此脚本可返回多条记录
- @param sql SQL脚本
- @return MsgEmity
func (CommonDao) GetValue ¶
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @return MsgEmity
func (CommonDao) GetValueByField ¶
func (dao CommonDao) GetValueByField(entity interface{}, id interface{}, fieldName string, currentUser string) *MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- @param entity 实体类
- @param id
- @param fieldName 待取数据的字段名称集合
- @return MsgEmity 返回内容data中存放的是Map
func (CommonDao) GetValueByFieldName ¶
func (dao CommonDao) GetValueByFieldName(entity interface{}, id interface{}, fieldNames []string, currentUser string) *MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- @param entity 实体类
- @param id
- @param fieldNames 待取数据的字段名称集合
- @return MsgEmity 返回内容data中存放的是Map
func (CommonDao) GetiState ¶
func (dao CommonDao) GetiState(entity interface{}, id interface{}) *MsgEmity
*
- 取记录对应的状态值
- @param entity 实体类
- @param idName 编号
- @return
func (CommonDao) GetiVersion ¶
func (dao CommonDao) GetiVersion(entity interface{}, id interface{}) *MsgEmity
*
- 取记录对应的版本号
- @param entity 实体类
- @param idName 编号
- @return
func (CommonDao) GroupByField ¶
func (dao CommonDao) GroupByField(entity interface{}, sCreator string, fields map[string]string, currentUser string, onlyCreator bool) *MsgEmity
*
- 根据字段名取分组数据
- @param entity 实体类
- @param sCreator 指定用户
- @param fields 字段名与别名对象
- @param currentUser 当前用户
- @param onlyCreator 用户查询限制(仅创建者可见)
- @return
func (CommonDao) GroupByFieldAndCount ¶
func (dao CommonDao) GroupByFieldAndCount(entity interface{}, sCreator string, fields map[string]string, currentUser string, onlyCreator bool) *MsgEmity
*
- 根据字段名取分组数据,并返回数量
- @param entity 实体类
- @param sCreator 指定用户
- @param fields 字段名与别名对象
- @param currentUser 当前用户
- @param onlyCreator 用户查询限制(仅创建者可见)
- @return
func (CommonDao) GroupByFieldBase ¶
func (dao CommonDao) GroupByFieldBase(entity interface{}, sCreator string, fields map[string]string, currentUser string, onlyCreator, isGroupCount bool) *MsgEmity
*
- 根据字段名取分组数据
- @param entity 实体类
- @param sCreator 指定用户
- @param fields 字段名与别名对象
- @param currentUser 当前用户
- @param onlyCreator 用户查询限制(仅创建者可见)
- @param isGroupCount 添加分组后是否添加'数量列'
- @return
func (CommonDao) HasById ¶
func (dao CommonDao) HasById(entity interface{}, id interface{}) *MsgEmity
*
- 检查关键值记录是否存在(返回1:存在;0:不存在)
- @param entity 实体类
- @Param id
- @return MsgEmity
func (CommonDao) HasByKey ¶
*
- 检查关键值记录是否存在(返回1:存在;0:不存在)
- @param entity 实体类
- @Param keyName 字段名
- @Param keyValue 字段值
- @return MsgEmity
func (CommonDao) MaxByField ¶
func (dao CommonDao) MaxByField(entity interface{}, sCreator string, field string, where map[string]interface{}, currentUser string, onlyCreator bool) *MsgEmity
*
- 取表中指定字段的最大值
- @param entity 实体类
- @param sCreator 指定用户
- @param field 字段名
- @param condition 查询条件字符串
- @return
func (CommonDao) MinByField ¶
func (dao CommonDao) MinByField(entity interface{}, sCreator string, field string, where map[string]interface{}, currentUser string, onlyCreator bool) *MsgEmity
*
- 取表中指定字段的最小值
- @param entity 实体类
- @param sCreator 指定用户
- @param field 字段名
- @param whereStr 查询条件字符串
- @return
func (CommonDao) TransactionSql ¶
*
- 以事务方式执行多个sql
- 注意:Mapper必须存在才能执行
- @param sqls [sql, params]
- @return MsgEmity 一个执行失败则回滚
func (CommonDao) ValidEntityRepeatByEdit ¶
func (dao CommonDao) ValidEntityRepeatByEdit(entity interface{}, id interface{}, data map[string]interface{}, currentUser string) *MsgEmity
*
- 验证更新数据是否存在重复 *
type CommonService ¶
type CommonService struct{}
func (CommonService) Add ¶
func (service CommonService) Add(ctx *gin.Context, entity interface{}, data map[string]interface{}) *MsgEmity
*
- 新增
- entity 检查用数据结构
- data 数据
func (CommonService) AddCommon ¶
func (service CommonService) AddCommon(ctx *gin.Context, entity interface{}, data map[string]interface{}) *MsgEmity
*
- 新增普通数据
- entity 检查用数据结构
- data 数据
func (CommonService) AddList ¶
func (service CommonService) AddList(ctx *gin.Context, entitys []interface{}) *MsgEmity
批量新增
func (CommonService) AddNode ¶
func (service CommonService) AddNode(ctx *gin.Context, entity interface{}, data map[string]interface{}) *MsgEmity
*
- 新增树节点
- entity 检查用数据结构
- data 数据
func (CommonService) AddToGroup ¶
func (service CommonService) AddToGroup(ctx *gin.Context, entity interface{}, sGroupName, sGroupValue string) *MsgEmity
*
- 添加数据到指定组下
- 警告:对象必须符合树形结构要求,如:sId、sPid
- @param r Http请求对象
- @param sGroupName 分组字段名称(树节点)
- @param sGroupValue 分组字段值(树节点)
- @param entity 实体对象
- @return
func (CommonService) Adds ¶
func (service CommonService) Adds(ctx *gin.Context, entitys []interface{}, list []map[string]interface{}) *MsgEmity
批量新增
func (CommonService) ChangeSetp ¶
func (service CommonService) ChangeSetp(ctx *gin.Context, entity interface{}, id interface{}, iSetp int, iVersion int, sMemo string, unidirectional bool) *MsgEmity
*
- 修改步骤值(如果设置为单向则新值必须大于旧值)
- @param id 编号
- @param iSetp 步骤值
- @param iVersion 记录版本号
- @param sMemo 备注
- @param unidirectional 是否单向 设置为单向则新值必须大于旧值才能执行
- @param entity 实体类
- @return MsgEmity 返回执行情况
func (CommonService) ChangeState ¶
func (service CommonService) ChangeState(ctx *gin.Context, entity interface{}, id interface{}, iState int, iVersion int, sMemo string, unidirectional bool) *MsgEmity
*
- 修改状态
- @param entity 实体类
- @param id 编号
- @param iState 状态值
- @param iVersion 记录版本号
- @param sMemo 备注
- @param unidirectional 是否单向 设置为单向则新值必须大于旧值才能执行
- @return MsgEmity 返回执行情况
func (CommonService) ClearCache ¶
func (service CommonService) ClearCache(ctx *gin.Context, cacheName string, sUser string) *MsgEmity
*
- 清理指定用户的缓存
- @param cacheName 缓存名
- @Param sUser 用户名
- @return MsgEmity
func (CommonService) CommonCheckRepeatByAdd ¶
func (service CommonService) CommonCheckRepeatByAdd(ctx *gin.Context, dbEntity interface{}) *MsgEmity
*
- 通用添加数据时重复检查方法
- dbEntity
func (CommonService) CommonCheckRepeatByAddAndTree ¶
func (service CommonService) CommonCheckRepeatByAddAndTree(ctx *gin.Context, dbEntity interface{}) *MsgEmity
*
- 通用树型结构表添加数据时重复检查方法
- dbEntity
func (CommonService) CommonCheckRepeatByEdit ¶
func (service CommonService) CommonCheckRepeatByEdit(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
*
- 通用更新数据时重复检查方法
- entity
func (CommonService) CommonCheckRepeatByEditAndTree ¶
func (service CommonService) CommonCheckRepeatByEditAndTree(ctx *gin.Context, entity interface{}, id interface{}, sName interface{}) *MsgEmity
*
- 通用树型结构表添加数据时重复检查方法
- entity
func (CommonService) CreateTree ¶
func (this CommonService) CreateTree(source interface{}, rootName, idFieldName, pIdFieldName, childFieldName string) *MsgEmity
*
- List转树形结构
- @param source Map或切片结构
- @param rootName
- @param idFieldName
- @param pIdFieldName
- @param childFieldName
- @return
func (CommonService) Del ¶
func (service CommonService) Del(ctx *gin.Context, entity interface{}, id interface{}, iVersion int) *MsgEmity
*
- 删除
- @param entity 对象类型
- @param id 记录编号值
- @param iVersion 记录版本号
- @return MsgEmity
func (CommonService) DelByMap ¶
func (service CommonService) DelByMap(ctx *gin.Context, entity interface{}, where map[string]interface{}) *MsgEmity
*
- 删除
- @param entity 对象类型
- @param where 执行条件
- @return MsgEmity
func (CommonService) DoSql ¶
func (service CommonService) DoSql(sql string) *MsgEmity
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @return MsgEmity
func (CommonService) Edit ¶
func (service CommonService) Edit(ctx *gin.Context, entity interface{}, id interface{}, iVersion int, data map[string]interface{}) *MsgEmity
*
- 修改
- @param entity 对象类型
- @param id 记录编号值
- @param iVersion 记录版本号
- @param data 待更新的字段和值
- @return MsgEmity
func (CommonService) ExecSql ¶
func (service CommonService) ExecSql(sql string) *MsgEmity
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @return MsgEmity
func (CommonService) FindAll ¶
func (service CommonService) FindAll(ctx *gin.Context, entity interface{}, where map[string]interface{}) *MsgEmity
查询所有数据
func (CommonService) FindByDate ¶
func (service CommonService) FindByDate(ctx *gin.Context, entity interface{}, sDateSt string, sDateEd string) *MsgEmity
查询指定时间内数据
func (CommonService) FindByFields ¶
func (service CommonService) FindByFields(ctx *gin.Context, entity interface{}, where map[string]interface{}, fieldMap map[string]string) *MsgEmity
*
- 根据指定字段进行分组查询
- @Param entity 实体类
- @Param where 存放查询条件
- @param fieldMap 指定要查询的字段集合(原字段, 别名)
- @return MsgEmity
func (CommonService) FindByGroup ¶
func (service CommonService) FindByGroup(ctx *gin.Context, entity interface{}, sGroupColumn, sGroupName string) *MsgEmity
*
- 查询组结构数据
- @param r Http请求对象
- @param entity 实体类
- @param sGroupColumn 分组名(树节点)所在字段名
- @param sGroupName 分组名(树节点)
- @return
func (CommonService) FindById ¶
func (service CommonService) FindById(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
*
- 根据主键查询数据
- id 主键
- entity 检查用数据结构
func (CommonService) FindByKey ¶
func (service CommonService) FindByKey(ctx *gin.Context, entity interface{}, where map[string]interface{}) *MsgEmity
*
- 根据关键值取对象集合
- @Param entity 实体类
- @Param where 存放查询条件
- @return MsgEmity
func (CommonService) FindByPage ¶
func (service CommonService) FindByPage(ctx *gin.Context, entity interface{}, findByPageParam FindByPageParam) *MsgEmity
查询分页数据
func (CommonService) FindByRow ¶
func (service CommonService) FindByRow(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
查询指定行数据
func (CommonService) FindByTree ¶
func (service CommonService) FindByTree(ctx *gin.Context, entity interface{}, sGroupColumn, sGroupName string) *MsgEmity
*
- 读取树形结构数据
- @param entity
- @param sGroupColumn
- @param sGroupName
- @return
func (CommonService) FindCountByKey ¶
func (service CommonService) FindCountByKey(ctx *gin.Context, entity interface{}, where map[string]interface{}) *MsgEmity
*
- 根据关键值查数量
- @Param entity 实体类
- @Param where 存放查询条件
- @return MsgEmity
func (CommonService) FindOneByKey ¶
func (service CommonService) FindOneByKey(ctx *gin.Context, entity interface{}, where map[string]interface{}, fields ...string) *MsgEmity
*
- 根据关键值取对象集合中的第一个
- @Param entity 实体类
- @Param where 存放查询条件
- @param fields 指定要查询的字段集合
- @return MsgEmity
func (CommonService) FindValueByKey ¶
func (service CommonService) FindValueByKey(ctx *gin.Context, entity interface{}, where map[string]interface{}, fieldName string) *MsgEmity
*
- 根据关键值取对象集合中的符合条件的第一条记录的指定字段
- @Param entity 实体类
- @Param where 存放查询条件
- @param fieldName 指定要查询的字段
- @return MsgEmity
func (CommonService) GetRow ¶
func (service CommonService) GetRow(sql string) *MsgEmity
*
- 执行SQL脚本获取一行数据(多列)
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录
- @param sql 待执行的SQL脚本
- @return MsgEmity
func (CommonService) GetRows ¶
func (service CommonService) GetRows(sql string) *MsgEmity
*
- 执行SQL脚本获取多行数据(多列)
- 注意:库名必须用${}进行包装,此脚本可返回多条记录
- @param sql SQL脚本
- @return MsgEmity
func (CommonService) GetValue ¶
func (service CommonService) GetValue(sql string) *MsgEmity
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @return MsgEmity
func (CommonService) GetValueByField ¶
func (service CommonService) GetValueByField(ctx *gin.Context, entity interface{}, id interface{}, fieldName string) *MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- @param entity 实体类
- @param id
- @param fieldName 待取数据的字段名称集合
- @return MsgEmity 返回内容data中存放的是Map
func (CommonService) GetValueByFieldName ¶
func (service CommonService) GetValueByFieldName(ctx *gin.Context, entity interface{}, id interface{}, fieldNames []string) *MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- @param entity 实体类
- @param id
- @param fieldNames 待取数据的字段名称集合
- @return MsgEmity 返回内容data中存放的是Map
func (CommonService) GetiState ¶
func (service CommonService) GetiState(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
*
- 取记录对应的状态值
- @param entity 实体类
- @param idName 编号
- @return
func (CommonService) GetiVersion ¶
func (service CommonService) GetiVersion(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
*
- 取记录对应的版本号
- @param entity 实体类
- @param idName 编号
- @return
func (CommonService) GroupByField ¶
func (service CommonService) GroupByField(ctx *gin.Context, entity interface{}, sCreator string, fields map[string]string) *MsgEmity
*
- 根据字段名取分组数据
- @param entity 实体类
- @param sCreator 指定用户
- @param fields 字段名与别名对象
- @return
func (CommonService) GroupByFieldAndCount ¶
func (service CommonService) GroupByFieldAndCount(ctx *gin.Context, entity interface{}, sCreator string, fields map[string]string) *MsgEmity
*
- 根据字段名取分组数据及分组后数量
- @param entity 实体类
- @param sCreator 指定用户
- @param fields 字段名与别名对象
- @return
func (CommonService) HasById ¶
func (service CommonService) HasById(ctx *gin.Context, entity interface{}, id interface{}) *MsgEmity
*
- 检查关键值记录是否存在(返回1:存在;0:不存在)
- @param entity 实体类
- @Param id
- @return MsgEmity
func (CommonService) HasByKey ¶
func (service CommonService) HasByKey(ctx *gin.Context, entity interface{}, keyName string, keyValue interface{}) *MsgEmity
*
- 检查关键值记录是否存在(返回1:存在;0:不存在)
- @param entity 实体类
- @Param keyName 字段名
- @Param keyValue 字段值
- @return MsgEmity
func (CommonService) HoldByEntity ¶
func (service CommonService) HoldByEntity(entity interface{}, data map[string]interface{}, fieldPrefix ...string) map[string]interface{}
*
- 按实体保留map中的数据
- object 待检查对象
- data 数据
- fieldPrefix 字段前缀(可不传)
func (CommonService) MaxByField ¶
func (service CommonService) MaxByField(ctx *gin.Context, entity interface{}, sCreator string, field string, where map[string]interface{}) *MsgEmity
*
- 取表中指定字段的最大值
- @param entity 实体类
- @param sCreator 指定用户
- @param field 字段名
- @param where 查询条件字符串
- @return MsgEmity
func (CommonService) MinByField ¶
func (service CommonService) MinByField(ctx *gin.Context, entity interface{}, sCreator string, field string, where map[string]interface{}) *MsgEmity
*
- 取表中指定字段的最小值
- @param entity 实体类
- @param sCreator 指定用户
- @param field 字段名
- @param where 查询条件
- @return MsgEmity
func (CommonService) SupplyDbEntityAttrByAdd ¶
func (service CommonService) SupplyDbEntityAttrByAdd(ctx *gin.Context, dbEntity interface{}, selfId string, idValuePrefix string) *MsgEmity
*
- 补充数据库实体类的数据--新增
- @param dbEntity
- @param selfId 自提供的编号,防止从序列中获取
- @param idValuePrefix Id前缀
- @return
func (CommonService) ValidEntityRepeatByAdd ¶
func (service CommonService) ValidEntityRepeatByAdd(ctx *gin.Context, dbEntity interface{}) *MsgEmity
*
- 验证新增数据是否存在重复 *
func (CommonService) ValidEntityRepeatByEdit ¶
func (service CommonService) ValidEntityRepeatByEdit(ctx *gin.Context, entity interface{}, id interface{}, data map[string]interface{}) *MsgEmity
*
- 验证更新数据是否存在重复 *
type ControllerUtil ¶
type ControllerUtil struct{}
func (ControllerUtil) Add ¶
func (controlUtil ControllerUtil) Add(ctx *gin.Context, control interface{}) *MsgEmity
*
- 新增
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) AddToGroup ¶
func (controlUtil ControllerUtil) AddToGroup(ctx *gin.Context, control interface{}) *MsgEmity
*
- 添加数据到指定组下
- 警告:对象必须符合树形结构要求,如:sId、sPid
- ctx GinHttp上下文对象
- control 控制层
- @param sGroupName 分组字段名称(树节点)
- @param sGroupValue 分组字段值(树节点)
- @param entity 实体对象
- @return
func (ControllerUtil) Adds ¶
func (controlUtil ControllerUtil) Adds(ctx *gin.Context, control interface{}) *MsgEmity
*
- 批量新增
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) ClearCache ¶
func (controlUtil ControllerUtil) ClearCache(ctx *gin.Context, control interface{}) *MsgEmity
*
- 清理指定用户的缓存
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) Del ¶
func (controlUtil ControllerUtil) Del(ctx *gin.Context, control interface{}) *MsgEmity
*
- 删除
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) Edit ¶
func (controlUtil ControllerUtil) Edit(ctx *gin.Context, control interface{}) *MsgEmity
*
- 修改
- @param entity 对象类型
- @param id 记录编号值
- @param iVersion 记录版本号
- @param data 待更新的字段和值
- @return MsgEmity
func (ControllerUtil) FindAll ¶
func (controlUtil ControllerUtil) FindAll(ctx *gin.Context, control interface{}, attachWhere ...Set) *MsgEmity
*
- 查询所有数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByDate ¶
func (controlUtil ControllerUtil) FindByDate(ctx *gin.Context, control interface{}) *MsgEmity
*
- 查询时间范围内数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByGroup ¶
func (controlUtil ControllerUtil) FindByGroup(ctx *gin.Context, control interface{}) *MsgEmity
*
- 查询组结构数据
- ctx GinHttp上下文对象
- control 控制层
- @return
func (ControllerUtil) FindById ¶
func (controlUtil ControllerUtil) FindById(ctx *gin.Context, control interface{}) *MsgEmity
*
- 根据主键查询数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByKey ¶
func (controlUtil ControllerUtil) FindByKey(ctx *gin.Context, control interface{}) *MsgEmity
*
- 根据关键值取对象集合
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByPage ¶
func (controlUtil ControllerUtil) FindByPage(ctx *gin.Context, control interface{}, injectionCondition ...Set) *MsgEmity
*
- 查询分页数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByRow ¶
func (controlUtil ControllerUtil) FindByRow(ctx *gin.Context, control interface{}) *MsgEmity
*
- 查找指定行数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByTree ¶
func (controlUtil ControllerUtil) FindByTree(ctx *gin.Context, control interface{}) *MsgEmity
*
- 读取树形结构数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindCountByKey ¶
func (controlUtil ControllerUtil) FindCountByKey(ctx *gin.Context, control interface{}) *MsgEmity
*
- 根据关键值查数量
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindOneByKey ¶
func (controlUtil ControllerUtil) FindOneByKey(ctx *gin.Context, control interface{}) *MsgEmity
*
- 根据关键值取对象集合中的第一个
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindValueByKey ¶
func (controlUtil ControllerUtil) FindValueByKey(ctx *gin.Context, control interface{}) *MsgEmity
*
- 根据关键值取对象集合中的符合条件的第一条记录的指定字段
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) GetParams ¶
func (controlUtil ControllerUtil) GetParams(ctx *gin.Context, entity interface{}) *MsgEmity
*
- 取所有参数,并转换成对应实体属性类型(map[string]interface{})
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) GetValueByField ¶
func (controlUtil ControllerUtil) GetValueByField(ctx *gin.Context, control interface{}) *MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) GetValueByFieldName ¶
func (controlUtil ControllerUtil) GetValueByFieldName(ctx *gin.Context, control interface{}) *MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) Group ¶
func (controlUtil ControllerUtil) Group(ctx *gin.Context, control interface{}, fields map[string]string) *MsgEmity
*
- 根据字段名取分组数据
- ctx GinHttp上下文对象
- control 控制层
- fields 分组字段[字段名,字段别名]
func (ControllerUtil) GroupAndCount ¶
func (controlUtil ControllerUtil) GroupAndCount(ctx *gin.Context, control interface{}, fields map[string]string) *MsgEmity
*
- 根据字段名取分组数据且取数量
- ctx GinHttp上下文对象
- control 控制层
- fields 分组字段[字段名,字段别名]
func (ControllerUtil) GroupByField ¶
func (controlUtil ControllerUtil) GroupByField(ctx *gin.Context, control interface{}) *MsgEmity
*
- 根据字段名取分组数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) HasById ¶
func (controlUtil ControllerUtil) HasById(ctx *gin.Context, control interface{}) *MsgEmity
*
- 取表中指定字段的最小值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) HasByKey ¶
func (controlUtil ControllerUtil) HasByKey(ctx *gin.Context, control interface{}) *MsgEmity
*
- 取表中指定字段的最小值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) MaxByField ¶
func (controlUtil ControllerUtil) MaxByField(ctx *gin.Context, control interface{}) *MsgEmity
*
- 取表中指定字段的最大值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) MinByField ¶
func (controlUtil ControllerUtil) MinByField(ctx *gin.Context, control interface{}) *MsgEmity
*
- 取表中指定字段的最小值
- ctx GinHttp上下文对象
- control 控制层
type ModuleUtil ¶
type ModuleUtil struct{}
func (ModuleUtil) CreateNewInstance ¶
func (mu ModuleUtil) CreateNewInstance(t reflect.Type, isReturnVal bool) interface{}
根据传入的参数类型创建新的实体变量(指针或值) isReturnVal 是否以值返回,调用方为匿名类调用时必须返回值,true:返回'值';false:返回'指针' 注意:入参数 t不是匿名函数时不能使用 isReturnVal=true
func (ModuleUtil) CurrentLoginUserId ¶
func (mu ModuleUtil) CurrentLoginUserId(ctx *gin.Context) string
取当前用户
func (ModuleUtil) EnableFind ¶
func (mu ModuleUtil) EnableFind(moduleName string) bool
*
- 取查询控制开关(取控制开关简化方式)
- @param moduleName 模块名称
- @return
func (ModuleUtil) EnableTag ¶
func (mu ModuleUtil) EnableTag(moduleName string, i int) bool
*
- 取控制开关
- 控制开关,7个数的控制分别是:删除、修改、查询、导出、统计、步骤值可逆、物理删除
- 其中前5个为'是否仅创建者可操作'后续为其它控制开关
- @param moduleName 模块名称
- @param i 位数,从右到左数,下标从1开始
- @return
func (ModuleUtil) GetFindByPageSelectSql ¶
func (mu ModuleUtil) GetFindByPageSelectSql(currentUser string, entity interface{}, findByPageParam FindByPageParam, onlyCreator bool) (string, string, map[string]interface{})
分页数据查询部分语句,在分页查询数据及 数据搜索时使用 返回 findByPageCountSql, findByPageSql, params
func (ModuleUtil) GetFindByPageSelectSqlByField ¶
func (mu ModuleUtil) GetFindByPageSelectSqlByField(dataInfo DataInfo, sTableName, sFieldName string, oTherJoin map[string]string) (string, string)
取分页查询的字段信息
func (ModuleUtil) GetLikeTimeLimit ¶
func (mu ModuleUtil) GetLikeTimeLimit(object interface{}) int
*
- 取对应模块业务模糊查询控制时间限制
- moduleName 控制层
func (ModuleUtil) GetModuleEnable ¶
func (mu ModuleUtil) GetModuleEnable(moduleName string) int
*
- 取对应模块业务控制参数
- control 控制层
func (ModuleUtil) GetModuleEntity ¶
func (mu ModuleUtil) GetModuleEntity(control interface{}) interface{}
*
- 取模块数据实体,并创建新实例
- control 控制层
func (ModuleUtil) GetModuleService ¶
func (mu ModuleUtil) GetModuleService(control interface{}) interface{}
*
- 取对应模块业务实体
- control 控制层
func (ModuleUtil) GetNewId ¶
func (mu ModuleUtil) GetNewId(iLength int, sTableName string) string
取新ID
func (ModuleUtil) GetService ¶
func (mu ModuleUtil) GetService(name string) interface{}
*
- 取对应模块业务实体
- control 控制层
func (ModuleUtil) GetSimplName ¶
func (mu ModuleUtil) GetSimplName(object interface{}) string
*
- 取对应模块业务实体
- object 对象
func (ModuleUtil) NowModuleEntity ¶
func (mu ModuleUtil) NowModuleEntity(control interface{}) interface{}
*
- 按模块数据实体创建新实例(仅为地址,未进行实例化)
- control 控制层
func (ModuleUtil) NowModuleEntityAndInit ¶
func (mu ModuleUtil) NowModuleEntityAndInit(control interface{}) interface{}
*
- 按模块数据实体创建新实例,并实例化
- control 控制层