Documentation ¶
Index ¶
- Variables
- type AopUtil
- func (au AopUtil) CallAfterFunc(funcName string, ctx ginutil.Context, params ...interface{}) *emity.MsgEmity
- func (au AopUtil) CallAroundFunc(funcName string, ctx ginutil.Context, params ...interface{}) *emity.MsgEmity
- func (au AopUtil) CallBeforeFunc(funcName string, ctx ginutil.Context, params ...interface{}) *emity.MsgEmity
- func (au AopUtil) RegisterAfterAop(funcName string, ...)
- func (au AopUtil) RegisterAroundAop(funcName string, ...)
- func (au AopUtil) RegisterBeforeAop(funcName string, ...)
- type AppUtil
- func (au AppUtil) HasSection(sectionName string) bool
- func (au AppUtil) IsCloudApp() bool
- func (au AppUtil) IsCloudSystem() bool
- func (au AppUtil) IsNotCloudApp() bool
- func (au AppUtil) IsNotCloudSystem() bool
- func (au AppUtil) ReadConfigKey(section string, key string, def interface{}) interface{}
- func (au AppUtil) ToEntity(entity interface{}, names ...string) *emity.MsgEmity
- type BrickApp
- type Cloud
- type CommonController
- type CommonDao
- func (dao CommonDao) Add(entity interface{}) *emity.MsgEmity
- func (dao CommonDao) AddCommon(entity interface{}) *emity.MsgEmity
- func (dao CommonDao) AddNode(entity interface{}) *emity.MsgEmity
- func (dao CommonDao) Adds(entitys []interface{}) *emity.MsgEmity
- func (dao CommonDao) ChangeSetp(entity interface{}, id interface{}, iSetp int, iVersion int, sMemo string, ...) *emity.MsgEmity
- func (dao CommonDao) ChangeState(entity interface{}, id interface{}, iState int, iVersion int, sMemo string, ...) *emity.MsgEmity
- func (dao CommonDao) CommonCheckRepeatByAdd(dbEntity interface{}, currentUser string) *emity.MsgEmity
- func (dao CommonDao) CommonCheckRepeatByAddAndTree(dbEntity interface{}, currentUser string) *emity.MsgEmity
- func (dao CommonDao) CommonCheckRepeatByEdit(entity interface{}, id interface{}, currentUser string) *emity.MsgEmity
- func (dao CommonDao) CommonCheckRepeatByEditAndTree(entity interface{}, id interface{}, sName interface{}, currentUser string) *emity.MsgEmity
- func (dao CommonDao) Del(entity interface{}, id interface{}, iVersion int, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) DelByMap(entity interface{}, where map[string]interface{}, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) DelSign(entity interface{}, id interface{}, iVersion int, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) DelSignByMap(entity interface{}, where map[string]interface{}, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) DoSql(sql string, where ...interface{}) *emity.MsgEmity
- func (dao CommonDao) Edit(entity interface{}, id interface{}, iVersion int, data map[string]interface{}, ...) *emity.MsgEmity
- func (dao CommonDao) EntityById(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
- func (dao CommonDao) EntityBySql(entityList interface{}, sql string, where map[string]interface{}) *emity.MsgEmity
- func (dao CommonDao) ExecSql(sql string, where ...interface{}) *emity.MsgEmity
- func (dao CommonDao) FindAll(entity interface{}, where map[string]interface{}, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) FindByDate(entity interface{}, sDateSt string, sDateEd string, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) FindByFields(entity interface{}, where map[string]interface{}, fieldMap map[string]string, ...) *emity.MsgEmity
- func (dao CommonDao) FindById(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
- func (dao CommonDao) FindByKey(entity interface{}, where map[string]interface{}, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) FindByPage(entity interface{}, findByPageParam dbinfo.FindByPageParam, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) FindByRow(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
- func (dao CommonDao) FindByTree(entity interface{}, sGroupColumn, sGroupName string, currentUser string) *emity.MsgEmity
- func (dao CommonDao) FindCountByKey(entity interface{}, where map[string]interface{}, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) FindOneByKey(entity interface{}, where map[string]interface{}, currentUser string, ...) *emity.MsgEmity
- func (dao CommonDao) FindValueByKey(entity interface{}, where map[string]interface{}, fieldName string, ...) *emity.MsgEmity
- func (dao CommonDao) GetPath(sId, dbName, tableName string) string
- func (dao CommonDao) GetRow(sql string, where ...interface{}) *emity.MsgEmity
- func (dao CommonDao) GetRows(sql string, where ...interface{}) *emity.MsgEmity
- func (dao CommonDao) GetValue(sql string, where ...interface{}) *emity.MsgEmity
- func (dao CommonDao) GetValueByField(entity interface{}, id interface{}, fieldName string, currentUser string) *emity.MsgEmity
- func (dao CommonDao) GetValueByFieldName(entity interface{}, id interface{}, fieldNames []string, currentUser string) *emity.MsgEmity
- func (dao CommonDao) GetiState(entity interface{}, id interface{}) *emity.MsgEmity
- func (dao CommonDao) GetiVersion(entity interface{}, id interface{}) *emity.MsgEmity
- func (dao CommonDao) GroupByField(entity interface{}, sCreator string, fields map[string]string, ...) *emity.MsgEmity
- func (dao CommonDao) GroupByFieldAndCount(entity interface{}, sCreator string, fields map[string]string, ...) *emity.MsgEmity
- func (dao CommonDao) GroupByFieldBase(entity interface{}, sCreator string, fields map[string]string, ...) *emity.MsgEmity
- func (dao CommonDao) HasById(entity interface{}, id interface{}) *emity.MsgEmity
- func (dao CommonDao) HasByKey(entity interface{}, keyName string, keyValue interface{}) *emity.MsgEmity
- func (dao CommonDao) MaxByField(entity interface{}, sCreator string, field string, ...) *emity.MsgEmity
- func (dao CommonDao) MinByField(entity interface{}, sCreator string, field string, ...) *emity.MsgEmity
- func (dao CommonDao) NewChildId(tableInfo *dbinfo.TableInfo, sPid string) *emity.MsgEmity
- func (dao CommonDao) ReversalByKey(entity interface{}, where map[string]interface{}, ...) *emity.MsgEmity
- func (dao CommonDao) TransactionSql(sqls map[string]map[string]interface{}) *emity.MsgEmity
- func (dao CommonDao) ValidEntityRepeatByAdd(dbEntity interface{}, currentUser string) *emity.MsgEmity
- func (dao CommonDao) ValidEntityRepeatByEdit(entity interface{}, id interface{}, data map[string]interface{}, ...) *emity.MsgEmity
- type CommonService
- func (service CommonService) Add(ctx ginutil.Context, entity interface{}, data map[string]interface{}) *emity.MsgEmity
- func (service CommonService) AddCommon(ctx ginutil.Context, entity interface{}, aData map[string]interface{}) *emity.MsgEmity
- func (service CommonService) AddList(ctx ginutil.Context, entitys []interface{}) *emity.MsgEmity
- func (service CommonService) AddNode(ctx ginutil.Context, entity interface{}, aData map[string]interface{}) *emity.MsgEmity
- func (service CommonService) AddToGroup(ctx ginutil.Context, entity interface{}, sGroupName, sGroupValue string) *emity.MsgEmity
- func (service CommonService) Adds(ctx ginutil.Context, entitys []interface{}, list []map[string]interface{}) *emity.MsgEmity
- func (service CommonService) ChangeSetp(ctx ginutil.Context, entity interface{}, id interface{}, iSetp int, ...) *emity.MsgEmity
- func (service CommonService) ChangeState(ctx ginutil.Context, entity interface{}, id interface{}, iState int, ...) *emity.MsgEmity
- func (service CommonService) ClearCache(ctx ginutil.Context, cacheName string, sUser string) *emity.MsgEmity
- func (service CommonService) CommonCheckRepeatByAdd(ctx ginutil.Context, dbEntity interface{}) *emity.MsgEmity
- func (service CommonService) CommonCheckRepeatByAddAndTree(ctx ginutil.Context, dbEntity interface{}) *emity.MsgEmity
- func (service CommonService) CommonCheckRepeatByEdit(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
- func (service CommonService) CommonCheckRepeatByEditAndTree(ctx ginutil.Context, entity interface{}, id interface{}, sName interface{}) *emity.MsgEmity
- func (this CommonService) CreateTree(source interface{}, rootName, idFieldName, pIdFieldName, childFieldName string) *emity.MsgEmity
- func (service CommonService) Del(ctx ginutil.Context, entity interface{}, id interface{}, iVersion int) *emity.MsgEmity
- func (service CommonService) DelByMap(ctx ginutil.Context, entity interface{}, where map[string]interface{}) *emity.MsgEmity
- func (service CommonService) DoSql(sql string) *emity.MsgEmity
- func (service CommonService) Edit(ctx ginutil.Context, entity interface{}, id interface{}, iVersion int, ...) *emity.MsgEmity
- func (service CommonService) ExecSql(sql string) *emity.MsgEmity
- func (service CommonService) FindAll(ctx ginutil.Context, entity interface{}, where map[string]interface{}) *emity.MsgEmity
- func (service CommonService) FindByDate(ctx ginutil.Context, entity interface{}, sDateSt string, sDateEd string) *emity.MsgEmity
- func (service CommonService) FindByFields(ctx ginutil.Context, entity interface{}, where map[string]interface{}, ...) *emity.MsgEmity
- func (service CommonService) FindByGroup(ctx ginutil.Context, entity interface{}, sGroupColumn, sGroupName string) *emity.MsgEmity
- func (service CommonService) FindById(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
- func (service CommonService) FindByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}) *emity.MsgEmity
- func (service CommonService) FindByPage(ctx ginutil.Context, entity interface{}, ...) *emity.MsgEmity
- func (service CommonService) FindByRow(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
- func (service CommonService) FindByTree(ctx ginutil.Context, entity interface{}, sGroupColumn, sGroupName string) *emity.MsgEmity
- func (service CommonService) FindCountByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}) *emity.MsgEmity
- func (service CommonService) FindField(ctx ginutil.Context, entity interface{}, where map[string]interface{}, ...) *emity.MsgEmity
- func (service CommonService) FindOneByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}, ...) *emity.MsgEmity
- func (service CommonService) FindValueByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}, ...) *emity.MsgEmity
- func (service CommonService) GetRow(sql string) *emity.MsgEmity
- func (service CommonService) GetRows(sql string) *emity.MsgEmity
- func (service CommonService) GetValue(sql string) *emity.MsgEmity
- func (service CommonService) GetValueByField(ctx ginutil.Context, entity interface{}, id interface{}, fieldName string) *emity.MsgEmity
- func (service CommonService) GetValueByFieldName(ctx ginutil.Context, entity interface{}, id interface{}, fieldNames []string) *emity.MsgEmity
- func (service CommonService) GetiState(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
- func (service CommonService) GetiVersion(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
- func (service CommonService) GroupByField(ctx ginutil.Context, entity interface{}, sCreator string, ...) *emity.MsgEmity
- func (service CommonService) GroupByFieldAndCount(ctx ginutil.Context, entity interface{}, sCreator string, ...) *emity.MsgEmity
- func (service CommonService) HasById(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
- func (service CommonService) HasByKey(ctx ginutil.Context, entity interface{}, keyName string, keyValue interface{}) *emity.MsgEmity
- func (service CommonService) HoldByEntity(entity interface{}, data map[string]interface{}, fieldPrefix ...string) map[string]interface{}
- func (service CommonService) LookImg(ctx ginutil.Context, modelName, filename string)
- func (service CommonService) MaxByField(ctx ginutil.Context, entity interface{}, sCreator string, field string, ...) *emity.MsgEmity
- func (service CommonService) MinByField(ctx ginutil.Context, entity interface{}, sCreator string, field string, ...) *emity.MsgEmity
- func (service CommonService) ReversalByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}, ...) *emity.MsgEmity
- func (service CommonService) SupplyDbEntityAttrByAdd(ctx ginutil.Context, dbEntity interface{}, selfId string, idValuePrefix string) *emity.MsgEmity
- func (service CommonService) UpFile(ctx ginutil.Context, modelName string) *emity.MsgEmity
- func (service CommonService) ValidEntityRepeatByAdd(ctx ginutil.Context, dbEntity interface{}) *emity.MsgEmity
- func (service CommonService) ValidEntityRepeatByEdit(ctx ginutil.Context, entity interface{}, id interface{}, ...) *emity.MsgEmity
- type Controller
- type ControllerBaseFunc
- func (control ControllerBaseFunc) CheckRepeatAlone() map[string]int
- func (control ControllerBaseFunc) CheckRepeatCombination() []string
- func (control ControllerBaseFunc) Enable() string
- func (control *ControllerBaseFunc) GetModuleEntity() (dbinfo.Entity, error)
- func (control *ControllerBaseFunc) GetModuleService() (interface{}, error)
- func (control ControllerBaseFunc) IdValuePrefix() string
- func (control ControllerBaseFunc) RegisterUrl()
- type ControllerUtil
- func (controlUtil ControllerUtil) Add(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) AddRequestAttrib(ctx ginutil.Context, attribs ...[]string)
- func (controlUtil ControllerUtil) AddToGroup(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) Adds(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) ClearCache(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) Del(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) Edit(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindAll(ctx ginutil.Context, control interface{}, attachWhere ...set.Set) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindByDate(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindByGroup(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindById(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindByPage(ctx ginutil.Context, control interface{}, injectionCondition ...set.Set) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindByRow(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindByTree(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindCountByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindOneByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) FindValueByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) GetParams(ctx ginutil.Context, entity interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) GetValueByField(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) GetValueByFieldName(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) Group(ctx ginutil.Context, control interface{}, fields map[string]string) *emity.MsgEmity
- func (controlUtil ControllerUtil) GroupAndCount(ctx ginutil.Context, control interface{}, fields map[string]string) *emity.MsgEmity
- func (controlUtil ControllerUtil) GroupByField(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) HasById(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) HasByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) LookImg(ctx ginutil.Context, modelName, filename string)
- func (controlUtil ControllerUtil) MaxByField(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) MinByField(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) ReversalByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
- func (controlUtil ControllerUtil) UpFile(ctx ginutil.Context, modelName string) *emity.MsgEmity
- type Dao
- type ModuleUtil
- func (mu ModuleUtil) CreateNewInstance(t reflect.Type, isReturnVal bool) interface{}
- func (mu ModuleUtil) CurrentLoginUserId(ctx ginutil.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 dbinfo.FindByPageParam, ...) (string, string, map[string]interface{})
- func (mu ModuleUtil) GetFindByPageSelectSqlByField(dataInfo dbinfo.DataInfo, sTableName, sFieldName 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{}
- func (mu ModuleUtil) SetTableKeyServiceName(name string)
- type Service
- 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 (au AopUtil) CallAfterFunc(funcName string, ctx ginutil.Context, params ...interface{}) *emity.MsgEmity
*
- 调用Aop-函数执行后调用函数
- @param funcName 被监听函数 xxservice.xx
- @param doFunc 被调用函数
- @return
func (AopUtil) CallAroundFunc ¶
func (au AopUtil) CallAroundFunc(funcName string, ctx ginutil.Context, params ...interface{}) *emity.MsgEmity
*
- 调用Aop-函数执行中调用函数
- @param funcName 被监听函数 xxservice.xx
- @param doFunc 被调用函数
- @return
func (AopUtil) CallBeforeFunc ¶
func (au AopUtil) CallBeforeFunc(funcName string, ctx ginutil.Context, params ...interface{}) *emity.MsgEmity
*
- 调用Aop-函数执行前调用函数
- @param funcName 被监听函数 xxservice.xx
- @param doFunc 被调用函数
- @return
func (AopUtil) RegisterAfterAop ¶
func (au AopUtil) RegisterAfterAop(funcName string, doFunc func(ctx ginutil.Context, params ...interface{}) *emity.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) ChangeSetp ¶
func (dao CommonDao) ChangeSetp(entity interface{}, id interface{}, iSetp int, iVersion int, sMemo string, unidirectional bool) *emity.MsgEmity
*
- 修改步骤值(如果设置为单向则新值必须大于旧值)
- @param id 编号
- @param iSetp 步骤值
- @param iVersion 记录版本号
- @param sMemo 备注
- @param unidirectional 是否单向 设置为单向则新值必须大于旧值才能执行
- @param entity 实体类
- @return emity.MsgEmity 返回执行情况
func (CommonDao) ChangeState ¶
func (dao CommonDao) ChangeState(entity interface{}, id interface{}, iState int, iVersion int, sMemo string, unidirectional bool) *emity.MsgEmity
*
- 修改状态
- @param entity 实体类
- @param id 编号
- @param iState 状态值
- @param iVersion 记录版本号
- @param sMemo 备注
- @param unidirectional 是否单向 设置为单向则新值必须大于旧值才能执行
- @return emity.MsgEmity 返回执行情况
func (CommonDao) CommonCheckRepeatByAdd ¶
func (dao CommonDao) CommonCheckRepeatByAdd(dbEntity interface{}, currentUser string) *emity.MsgEmity
*
- 通用添加数据时重复检查方法
- @param dbEntity 数据实体
- @param currentUser 当前用户
- @return emity.MsgEmity
func (CommonDao) CommonCheckRepeatByAddAndTree ¶
func (dao CommonDao) CommonCheckRepeatByAddAndTree(dbEntity interface{}, currentUser string) *emity.MsgEmity
*
- 通用树型结构表添加数据时重复检查方法
- @param dbEntity 数据实体
- @param currentUser 当前用户
- @return emity.MsgEmity
func (CommonDao) CommonCheckRepeatByEdit ¶
func (dao CommonDao) CommonCheckRepeatByEdit(entity interface{}, id interface{}, currentUser string) *emity.MsgEmity
*
- 通用更新数据时重复检查方法
- @param entity 数据实体
- @param id 数据主键
- @param currentUser 当前用户
- @return emity.MsgEmity
func (CommonDao) CommonCheckRepeatByEditAndTree ¶
func (dao CommonDao) CommonCheckRepeatByEditAndTree(entity interface{}, id interface{}, sName interface{}, currentUser string) *emity.MsgEmity
*
- 通用树型结构表添加数据时重复检查方法
- @param dbEntity 数据实体
- @param id 主键
- @param sName 展现名
- @param currentUser 当前用户
- @return emity.MsgEmity
func (CommonDao) Del ¶
func (dao CommonDao) Del(entity interface{}, id interface{}, iVersion int, currentUser string, onlyCreator bool) *emity.MsgEmity
删除
func (CommonDao) DelByMap ¶
func (dao CommonDao) DelByMap(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
删除
func (CommonDao) DelSign ¶
func (dao CommonDao) DelSign(entity interface{}, id interface{}, iVersion int, currentUser string, onlyCreator bool) *emity.MsgEmity
逻辑删除(非物理删除)
func (CommonDao) DelSignByMap ¶
func (dao CommonDao) DelSignByMap(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
逻辑删除(非物理删除)
func (CommonDao) DoSql ¶
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @param where 存放查询条件
- @return emity.MsgEmity
func (CommonDao) Edit ¶
func (dao CommonDao) Edit(entity interface{}, id interface{}, iVersion int, data map[string]interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 修改
- @param entity 对象类型
- @param id 记录编号值
- @param iVersion 记录版本号
- @param data 待更新的字段和值
- @param currentUser 当前用户
- @param onlyCreator 仅创建用户
- @return emity.MsgEmity
func (CommonDao) EntityById ¶
func (dao CommonDao) EntityById(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 根据主键查询数据(返回结构体数据)
- @param entity 检查用数据结构
- @param id 主键
- @param currentUser 当前用户
- @param onlyCreator 仅创建用户
- @return emity.MsgEmity
func (CommonDao) EntityBySql ¶
func (CommonDao) ExecSql ¶
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @param where 存放查询条件
- @return emity.MsgEmity
func (CommonDao) FindAll ¶
func (dao CommonDao) FindAll(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 查询所有数据
- @param entity 检查用数据结构
- @param where 查询条件
- @param currentUser 当前用户
- @param onlyCreator 仅创建用户
- @return emity.MsgEmity
func (CommonDao) FindByDate ¶
func (dao CommonDao) FindByDate(entity interface{}, sDateSt string, sDateEd string, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 查询指定时间内数据
- @param entity 检查用数据结构
- @param sDateSt 开始时间
- @param sDateEd 结束时间
- @param currentUser 当前用户
- @param onlyCreator 仅创建用户
- @return emity.MsgEmity
func (CommonDao) FindByFields ¶
func (dao CommonDao) FindByFields(entity interface{}, where map[string]interface{}, fieldMap map[string]string, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 根据关键值取对象集合中的符合条件的第一条记录的指定字段
- @Param entity 实体类
- @Param where 存放查询条件
- @param fieldMap 指定要查询的字段集合(原字段, 别名)
- @param currentUser 当前用户
- @param onlyCreator 仅查询创建者
- @return emity.MsgEmity
func (CommonDao) FindById ¶
func (dao CommonDao) FindById(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 根据主键查询数据
- @param entity 检查用数据结构
- @param id 主键
- @param currentUser 当前用户
- @param onlyCreator 仅创建用户
- @return emity.MsgEmity
func (CommonDao) FindByKey ¶
func (dao CommonDao) FindByKey(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 根据关键值取对象集合
- @Param entity 实体类
- @Param where 存放查询条件
- @Param currentUser 当前用户
- @Param onlyCreator 是否只取当前用户创建的数据
- @return emity.MsgEmity
func (CommonDao) FindByPage ¶
func (dao CommonDao) FindByPage(entity interface{}, findByPageParam dbinfo.FindByPageParam, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 查询分页数据
- @param entity 检查用数据结构
- @param findByPageParam 分页参数
- @param currentUser 当前用户
- @param onlyCreator 仅创建用户
- @return emity.MsgEmity
func (CommonDao) FindByRow ¶
func (dao CommonDao) FindByRow(entity interface{}, id interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 查询指定行数据
- @param entity 检查用数据结构
- @param id 记录编号
- @param currentUser 当前用户
- @param onlyCreator 仅创建用户
- @return emity.MsgEmity
func (CommonDao) FindByTree ¶
func (dao CommonDao) FindByTree(entity interface{}, sGroupColumn, sGroupName string, currentUser string) *emity.MsgEmity
*
- 读取树形结构数据
- @param entity 数据实体
- @param sGroupColumn 分组字段
- @param sGroupName 分组名称
- @param currentUser 当前用户
- @return emity.MsgEmity
func (CommonDao) FindCountByKey ¶
func (dao CommonDao) FindCountByKey(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 根据关键值查数量
- @Param entity 实体类
- @Param where 存放查询条件
- @param currentUser 当前用户
- @param onlyCreator 仅查询创建者
- @return emity.MsgEmity
func (CommonDao) FindOneByKey ¶
func (dao CommonDao) FindOneByKey(entity interface{}, where map[string]interface{}, currentUser string, onlyCreator bool, fields ...string) *emity.MsgEmity
*
- 根据关键值取对象集合中的第一个
- @Param entity 实体类
- @Param where 存放查询条件
- @Param currentUser 当前用户
- @param onlyCreator 是否只取当前用户创建的数据
- @param fields 指定要查询的字段集合
- @return emity.MsgEmity
func (CommonDao) FindValueByKey ¶
func (dao CommonDao) FindValueByKey(entity interface{}, where map[string]interface{}, fieldName string, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 根据关键值取对象集合中的符合条件的第一条记录的指定字段
- @Param entity 实体类
- @Param where 存放查询条件
- @param fieldName 指定要查询的字段
- @param currentUser 当前用户
- @param onlyCreator 仅查询创建者
- @return emity.MsgEmity
func (CommonDao) GetRow ¶
*
- 执行SQL脚本获取一行数据(多列)
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录
- @param sql 待执行的SQL脚本
- @param where 存放查询条件
- @return emity.MsgEmity
func (CommonDao) GetRows ¶
*
- 执行SQL脚本获取多行数据(多列)
- 注意:库名必须用${}进行包装,此脚本可返回多条记录
- @param sql SQL脚本
- @param where 存放查询条件
- @return emity.MsgEmity
func (CommonDao) GetValue ¶
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @param where 存放查询条件
- @return emity.MsgEmity
func (CommonDao) GetValueByField ¶
func (dao CommonDao) GetValueByField(entity interface{}, id interface{}, fieldName string, currentUser string) *emity.MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- @param entity 实体类
- @param id 记录编号
- @param fieldName 待取数据的字段名称集合
- @param currentUser 当前用户
- @return emity.MsgEmity 返回内容data中存放的是Map
func (CommonDao) GetValueByFieldName ¶
func (dao CommonDao) GetValueByFieldName(entity interface{}, id interface{}, fieldNames []string, currentUser string) *emity.MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- @param entity 实体类
- @param id 记录编号
- @param fieldNames 待取数据的字段名称集合
- @param currentUser 当前用户
- @return emity.MsgEmity 返回内容data中存放的是Map
func (CommonDao) GroupByField ¶
func (dao CommonDao) GroupByField(entity interface{}, sCreator string, fields map[string]string, currentUser string, onlyCreator bool) *emity.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) *emity.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) *emity.MsgEmity
*
- 根据字段名取分组数据
- @param entity 实体类
- @param sCreator 指定用户
- @param fields 字段名与别名对象
- @param currentUser 当前用户
- @param onlyCreator 用户查询限制(仅创建者可见)
- @param isGroupCount 添加分组后是否添加'数量列'
- @return
func (CommonDao) HasById ¶
*
- 检查关键值记录是否存在(返回1:存在;0:不存在)
- @param entity 实体类
- @param id 记录编号
- @return emity.MsgEmity
func (CommonDao) HasByKey ¶
func (dao CommonDao) HasByKey(entity interface{}, keyName string, keyValue interface{}) *emity.MsgEmity
*
- 检查关键值记录是否存在(返回1:存在;0:不存在)
- @param entity 实体类
- @Param keyName 字段名
- @Param keyValue 字段值
- @return emity.MsgEmity
func (CommonDao) MaxByField ¶
func (dao CommonDao) MaxByField(entity interface{}, sCreator string, field string, where map[string]interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 取表中指定字段的最大值
- @param entity 实体类
- @param sCreator 指定用户
- @param field 字段名
- @param where 查询条件
- @param currentUser 当前用户
- @param onlyCreator 用户查询限制(仅创建者可见)
- @return emity.MsgEmity
func (CommonDao) MinByField ¶
func (dao CommonDao) MinByField(entity interface{}, sCreator string, field string, where map[string]interface{}, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 取表中指定字段的最小值
- @param entity 实体类
- @param sCreator 指定用户
- @param field 字段名
- @param where 查询条件
- @param currentUser 当前用户
- @param onlyCreator 用户查询限制(仅创建者可见)
- @param whereStr 查询条件字符串
- @return
func (CommonDao) ReversalByKey ¶
func (dao CommonDao) ReversalByKey(entity interface{}, where map[string]interface{}, reversalColumn, currentUser string, onlyCreator bool) *emity.MsgEmity
*
- 根据关键值翻转值(限布尔值类型,1转2,2转1)
- @Param entity 实体类
- @Param where 存放查询条件
- @Param reversalColumn 翻转的字段名
- @Param currentUser 当前用户
- @Param onlyCreator 是否只翻转创建人创建的数据
- @return emity.MsgEmity
func (CommonDao) TransactionSql ¶
*
- 以事务方式执行多个sql
- 注意:Mapper必须存在才能执行
- @param sqls [sql, params]
- @return emity.MsgEmity 一个执行失败则回滚
type CommonService ¶
type CommonService struct{}
func (CommonService) Add ¶
func (service CommonService) Add(ctx ginutil.Context, entity interface{}, data map[string]interface{}) *emity.MsgEmity
*
- 新增
- entity 检查用数据结构
- data 数据
func (CommonService) AddCommon ¶
func (service CommonService) AddCommon(ctx ginutil.Context, entity interface{}, aData map[string]interface{}) *emity.MsgEmity
*
- 新增普通数据
- entity 检查用数据结构
- data 数据
func (CommonService) AddList ¶
func (service CommonService) AddList(ctx ginutil.Context, entitys []interface{}) *emity.MsgEmity
批量新增
func (CommonService) AddNode ¶
func (service CommonService) AddNode(ctx ginutil.Context, entity interface{}, aData map[string]interface{}) *emity.MsgEmity
*
- 新增树节点
- entity 检查用数据结构
- data 数据
func (CommonService) AddToGroup ¶
func (service CommonService) AddToGroup(ctx ginutil.Context, entity interface{}, sGroupName, sGroupValue string) *emity.MsgEmity
*
- 添加数据到指定组下
- 警告:对象必须符合树形结构要求,如:sId、sPid
- @param r Http请求对象
- @param sGroupName 分组字段名称(树节点)
- @param sGroupValue 分组字段值(树节点)
- @param entity 实体对象
- @return
func (CommonService) Adds ¶
func (service CommonService) Adds(ctx ginutil.Context, entitys []interface{}, list []map[string]interface{}) *emity.MsgEmity
批量新增
func (CommonService) ChangeSetp ¶
func (service CommonService) ChangeSetp(ctx ginutil.Context, entity interface{}, id interface{}, iSetp int, iVersion int, sMemo string, unidirectional bool) *emity.MsgEmity
*
- 修改步骤值(如果设置为单向则新值必须大于旧值)
- @param id 编号
- @param iSetp 步骤值
- @param iVersion 记录版本号
- @param sMemo 备注
- @param unidirectional 是否单向 设置为单向则新值必须大于旧值才能执行
- @param entity 实体类
- @return emity.MsgEmity 返回执行情况
func (CommonService) ChangeState ¶
func (service CommonService) ChangeState(ctx ginutil.Context, entity interface{}, id interface{}, iState int, iVersion int, sMemo string, unidirectional bool) *emity.MsgEmity
*
- 修改状态
- @param entity 实体类
- @param id 编号
- @param iState 状态值
- @param iVersion 记录版本号
- @param sMemo 备注
- @param unidirectional 是否单向 设置为单向则新值必须大于旧值才能执行
- @return emity.MsgEmity 返回执行情况
func (CommonService) ClearCache ¶
func (service CommonService) ClearCache(ctx ginutil.Context, cacheName string, sUser string) *emity.MsgEmity
*
- 清理指定用户的缓存
- @param cacheName 缓存名
- @Param sUser 用户名
- @return emity.MsgEmity
func (CommonService) CommonCheckRepeatByAdd ¶
func (service CommonService) CommonCheckRepeatByAdd(ctx ginutil.Context, dbEntity interface{}) *emity.MsgEmity
*
- 通用添加数据时重复检查方法
- dbEntity
func (CommonService) CommonCheckRepeatByAddAndTree ¶
func (service CommonService) CommonCheckRepeatByAddAndTree(ctx ginutil.Context, dbEntity interface{}) *emity.MsgEmity
*
- 通用树型结构表添加数据时重复检查方法
- dbEntity
func (CommonService) CommonCheckRepeatByEdit ¶
func (service CommonService) CommonCheckRepeatByEdit(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
*
- 通用更新数据时重复检查方法
- entity
func (CommonService) CommonCheckRepeatByEditAndTree ¶
func (service CommonService) CommonCheckRepeatByEditAndTree(ctx ginutil.Context, entity interface{}, id interface{}, sName interface{}) *emity.MsgEmity
*
- 通用树型结构表添加数据时重复检查方法
- entity
func (CommonService) CreateTree ¶
func (this CommonService) CreateTree(source interface{}, rootName, idFieldName, pIdFieldName, childFieldName string) *emity.MsgEmity
*
- List转树形结构
- @param source Map或切片结构
- @param rootName
- @param idFieldName
- @param pIdFieldName
- @param childFieldName
- @return
func (CommonService) Del ¶
func (service CommonService) Del(ctx ginutil.Context, entity interface{}, id interface{}, iVersion int) *emity.MsgEmity
*
- 删除
- @param entity 对象类型
- @param id 记录编号值
- @param iVersion 记录版本号
- @return emity.MsgEmity
func (CommonService) DelByMap ¶
func (service CommonService) DelByMap(ctx ginutil.Context, entity interface{}, where map[string]interface{}) *emity.MsgEmity
*
- 删除
- @param entity 对象类型
- @param where 执行条件
- @return emity.MsgEmity
func (CommonService) DoSql ¶
func (service CommonService) DoSql(sql string) *emity.MsgEmity
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @return emity.MsgEmity
func (CommonService) Edit ¶
func (service CommonService) Edit(ctx ginutil.Context, entity interface{}, id interface{}, iVersion int, aData map[string]interface{}) *emity.MsgEmity
*
- 修改
- @param entity 对象类型
- @param id 记录编号值
- @param iVersion 记录版本号
- @param data 待更新的字段和值
- @return emity.MsgEmity
func (CommonService) ExecSql ¶
func (service CommonService) ExecSql(sql string) *emity.MsgEmity
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @return emity.MsgEmity
func (CommonService) FindAll ¶
func (service CommonService) FindAll(ctx ginutil.Context, entity interface{}, where map[string]interface{}) *emity.MsgEmity
查询所有数据
func (CommonService) FindByDate ¶
func (service CommonService) FindByDate(ctx ginutil.Context, entity interface{}, sDateSt string, sDateEd string) *emity.MsgEmity
查询指定时间内数据
func (CommonService) FindByFields ¶
func (service CommonService) FindByFields(ctx ginutil.Context, entity interface{}, where map[string]interface{}, fieldMap map[string]string) *emity.MsgEmity
*
- 根据指定字段进行分组查询
- @Param entity 实体类
- @Param where 存放查询条件
- @param fieldMap 指定要查询的字段集合(原字段, 别名)
- @return emity.MsgEmity
func (CommonService) FindByGroup ¶
func (service CommonService) FindByGroup(ctx ginutil.Context, entity interface{}, sGroupColumn, sGroupName string) *emity.MsgEmity
*
- 查询组结构数据
- @param r Http请求对象
- @param entity 实体类
- @param sGroupColumn 分组名(树节点)所在字段名
- @param sGroupName 分组名(树节点)
- @return
func (CommonService) FindById ¶
func (service CommonService) FindById(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
*
- 根据主键查询数据
- id 主键
- entity 检查用数据结构
func (CommonService) FindByKey ¶
func (service CommonService) FindByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}) *emity.MsgEmity
*
- 根据关键值取对象集合
- @Param entity 实体类
- @Param where 存放查询条件
- @return emity.MsgEmity
func (CommonService) FindByPage ¶
func (service CommonService) FindByPage(ctx ginutil.Context, entity interface{}, findByPageParam dbinfo.FindByPageParam) *emity.MsgEmity
查询分页数据
func (CommonService) FindByRow ¶
func (service CommonService) FindByRow(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
查询指定行数据
func (CommonService) FindByTree ¶
func (service CommonService) FindByTree(ctx ginutil.Context, entity interface{}, sGroupColumn, sGroupName string) *emity.MsgEmity
*
- 读取树形结构数据
- @param entity
- @param sGroupColumn
- @param sGroupName
- @return
func (CommonService) FindCountByKey ¶
func (service CommonService) FindCountByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}) *emity.MsgEmity
*
- 根据关键值查数量
- @Param entity 实体类
- @Param where 存放查询条件
- @return emity.MsgEmity
func (CommonService) FindField ¶
func (service CommonService) FindField(ctx ginutil.Context, entity interface{}, where map[string]interface{}, fieldNames []string) *emity.MsgEmity
*
- 根据条件仅查询指定字段名数据
- @param entity 实体类
- @param where
- @param fieldNames 待取数据的字段名称集合
- @return emity.MsgEmity 返回内容data中存放的是Map
func (CommonService) FindOneByKey ¶
func (service CommonService) FindOneByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}, fields ...string) *emity.MsgEmity
*
- 根据关键值取对象集合中的第一个
- @Param entity 实体类
- @Param where 存放查询条件
- @param fields 指定要查询的字段集合
- @return emity.MsgEmity
func (CommonService) FindValueByKey ¶
func (service CommonService) FindValueByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}, fieldName string) *emity.MsgEmity
*
- 根据关键值取对象集合中的符合条件的第一条记录的指定字段
- @Param entity 实体类
- @Param where 存放查询条件
- @param fieldName 指定要查询的字段
- @return emity.MsgEmity
func (CommonService) GetRow ¶
func (service CommonService) GetRow(sql string) *emity.MsgEmity
*
- 执行SQL脚本获取一行数据(多列)
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录
- @param sql 待执行的SQL脚本
- @return emity.MsgEmity
func (CommonService) GetRows ¶
func (service CommonService) GetRows(sql string) *emity.MsgEmity
*
- 执行SQL脚本获取多行数据(多列)
- 注意:库名必须用${}进行包装,此脚本可返回多条记录
- @param sql SQL脚本
- @return emity.MsgEmity
func (CommonService) GetValue ¶
func (service CommonService) GetValue(sql string) *emity.MsgEmity
*
- 执行SQL脚本获取单行单列数据
- 注意:库名必须用${}进行包装,此脚本应只存在一条记录且为单列
- @param sql 待执行的SQL脚本
- @return emity.MsgEmity
func (CommonService) GetValueByField ¶
func (service CommonService) GetValueByField(ctx ginutil.Context, entity interface{}, id interface{}, fieldName string) *emity.MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- @param entity 实体类
- @param id
- @param fieldName 待取数据的字段名称集合
- @return emity.MsgEmity 返回内容data中存放的是Map
func (CommonService) GetValueByFieldName ¶
func (service CommonService) GetValueByFieldName(ctx ginutil.Context, entity interface{}, id interface{}, fieldNames []string) *emity.MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- @param entity 实体类
- @param id
- @param fieldNames 待取数据的字段名称集合
- @return emity.MsgEmity 返回内容data中存放的是Map
func (CommonService) GetiState ¶
func (service CommonService) GetiState(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
*
- 取记录对应的状态值
- @param entity 实体类
- @param idName 编号
- @return
func (CommonService) GetiVersion ¶
func (service CommonService) GetiVersion(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
*
- 取记录对应的版本号
- @param entity 实体类
- @param idName 编号
- @return
func (CommonService) GroupByField ¶
func (service CommonService) GroupByField(ctx ginutil.Context, entity interface{}, sCreator string, fields map[string]string) *emity.MsgEmity
*
- 根据字段名取分组数据
- @param entity 实体类
- @param sCreator 指定用户
- @param fields 字段名与别名对象
- @return
func (CommonService) GroupByFieldAndCount ¶
func (service CommonService) GroupByFieldAndCount(ctx ginutil.Context, entity interface{}, sCreator string, fields map[string]string) *emity.MsgEmity
*
- 根据字段名取分组数据及分组后数量
- @param entity 实体类
- @param sCreator 指定用户
- @param fields 字段名与别名对象
- @return
func (CommonService) HasById ¶
func (service CommonService) HasById(ctx ginutil.Context, entity interface{}, id interface{}) *emity.MsgEmity
*
- 检查关键值记录是否存在(返回1:存在;0:不存在)
- @param entity 实体类
- @Param id
- @return emity.MsgEmity
func (CommonService) HasByKey ¶
func (service CommonService) HasByKey(ctx ginutil.Context, entity interface{}, keyName string, keyValue interface{}) *emity.MsgEmity
*
- 检查关键值记录是否存在(返回1:存在;0:不存在)
- @param entity 实体类
- @Param keyName 字段名
- @Param keyValue 字段值
- @return emity.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) LookImg ¶
func (service CommonService) LookImg(ctx ginutil.Context, modelName, filename string)
*
- 获取图片
- @param ctx http请求对象
- @param modelName 模块名称
- @param filename 文件名
func (CommonService) MaxByField ¶
func (service CommonService) MaxByField(ctx ginutil.Context, entity interface{}, sCreator string, field string, where map[string]interface{}) *emity.MsgEmity
*
- 取表中指定字段的最大值
- @param entity 实体类
- @param sCreator 指定用户
- @param field 字段名
- @param where 查询条件字符串
- @return emity.MsgEmity
func (CommonService) MinByField ¶
func (service CommonService) MinByField(ctx ginutil.Context, entity interface{}, sCreator string, field string, where map[string]interface{}) *emity.MsgEmity
*
- 取表中指定字段的最小值
- @param entity 实体类
- @param sCreator 指定用户
- @param field 字段名
- @param where 查询条件
- @return emity.MsgEmity
func (CommonService) ReversalByKey ¶
func (service CommonService) ReversalByKey(ctx ginutil.Context, entity interface{}, where map[string]interface{}, reversalColumn string) *emity.MsgEmity
*
- 根据关键值翻转值(限布尔值类型,1转2,2转1)
- 警告:此方法只支持布尔值类型,且只支持翻转1和2
- @Param ctx http请求对象
- @Param entity 实体类
- @Param where 存放查询条件
- @Param reversalColumn 翻转的字段名
- @return emity.MsgEmity
func (CommonService) SupplyDbEntityAttrByAdd ¶
func (service CommonService) SupplyDbEntityAttrByAdd(ctx ginutil.Context, dbEntity interface{}, selfId string, idValuePrefix string) *emity.MsgEmity
*
- 补充数据库实体类的数据--新增
- @param dbEntity
- @param selfId 自提供的编号,防止从序列中获取
- @param idValuePrefix Id前缀
- @return
func (CommonService) UpFile ¶
*
- 上传文件
- @param ctx http请求对象
- @param modelName 模块名称
- @return emity.MsgEmity
func (CommonService) ValidEntityRepeatByAdd ¶
func (service CommonService) ValidEntityRepeatByAdd(ctx ginutil.Context, dbEntity interface{}) *emity.MsgEmity
*
- 验证新增数据是否存在重复 *
func (CommonService) ValidEntityRepeatByEdit ¶
func (service CommonService) ValidEntityRepeatByEdit(ctx ginutil.Context, entity interface{}, id interface{}, data map[string]interface{}) *emity.MsgEmity
*
- 验证更新数据是否存在重复 *
type Controller ¶
type Controller interface { GetModuleEntity() (dbinfo.Entity, error) //对应模块数据实体 GetModuleService() (interface{}, error) //对应模块业务实体 RegisterUrl() //接口注册 Enable() string //控制操作,首位9不参与用7个数代表开关,0为不限制,1为限制 CheckRepeatCombination() []string //检查待新增内容是否存在重复数据(多字段组合重复即重复)集合 CheckRepeatAlone() map[string]int //检查待新增内容是否存在重复数据(单独字段重复即重复)集合,注意:int必须是1、10、100、1000 IdValuePrefix() string //记录编号值前缀,此属性用于给id字段添加前缀,以便于在分布式系统中进行数据合并,注意:前缀只有1个字符 }
web控制层接口定义,用于规范控制层结构体
type ControllerBaseFunc ¶
type ControllerBaseFunc struct{}
func (ControllerBaseFunc) CheckRepeatAlone ¶
func (control ControllerBaseFunc) CheckRepeatAlone() map[string]int
-- 检查待新增内容是否存在重复数据(单独字段重复即重复)集合,注意:int必须是1、10、100、1000 --//
func (ControllerBaseFunc) CheckRepeatCombination ¶
func (control ControllerBaseFunc) CheckRepeatCombination() []string
检查待新增内容是否存在重复数据(多字段组合重复即重复)集合
func (ControllerBaseFunc) Enable ¶
func (control ControllerBaseFunc) Enable() string
-- 控制操作,首位9不参与用7个数代表开关,0为不限制,1为限制 --// -- 7个数的控制分别是:删除、修改、查询、导出、统计、步骤值可逆、物理删除 --// -- 其中前5个为'是否仅创建者可操作'后续为其它控制开关 --//
func (*ControllerBaseFunc) GetModuleEntity ¶
func (control *ControllerBaseFunc) GetModuleEntity() (dbinfo.Entity, error)
func (*ControllerBaseFunc) GetModuleService ¶
func (control *ControllerBaseFunc) GetModuleService() (interface{}, error)
func (ControllerBaseFunc) IdValuePrefix ¶
func (control ControllerBaseFunc) IdValuePrefix() string
type ControllerUtil ¶
type ControllerUtil struct{}
func (ControllerUtil) Add ¶
func (controlUtil ControllerUtil) Add(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 新增
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) AddRequestAttrib ¶
func (controlUtil ControllerUtil) AddRequestAttrib(ctx ginutil.Context, attribs ...[]string)
*
- 增加请求属性
- 注:函数应用于模块控制器时修改或传递到通用方法时,切勿滥用
- @Param ctx http请求对象
- @Param attribs 参数键值对数组,[name,value],如果value不存在则为”
func (ControllerUtil) AddToGroup ¶
func (controlUtil ControllerUtil) AddToGroup(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 添加数据到指定组下
- 警告:对象必须符合树形结构要求,如:sId、sPid
- ctx GinHttp上下文对象
- control 控制层
- @param sGroupName 分组字段名称(树节点)
- @param sGroupValue 分组字段值(树节点)
- @param entity 实体对象
- @return
func (ControllerUtil) Adds ¶
func (controlUtil ControllerUtil) Adds(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 批量新增
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) ClearCache ¶
func (controlUtil ControllerUtil) ClearCache(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 清理指定用户的缓存
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) Del ¶
func (controlUtil ControllerUtil) Del(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 删除
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) Edit ¶
func (controlUtil ControllerUtil) Edit(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 修改
- @param entity 对象类型
- @param id 记录编号值
- @param iVersion 记录版本号
- @param data 待更新的字段和值
- @return emity.MsgEmity
func (ControllerUtil) FindAll ¶
func (controlUtil ControllerUtil) FindAll(ctx ginutil.Context, control interface{}, attachWhere ...set.Set) *emity.MsgEmity
*
- 查询所有数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByDate ¶
func (controlUtil ControllerUtil) FindByDate(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 查询时间范围内数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByGroup ¶
func (controlUtil ControllerUtil) FindByGroup(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 查询组结构数据
- ctx GinHttp上下文对象
- control 控制层
- @return
func (ControllerUtil) FindById ¶
func (controlUtil ControllerUtil) FindById(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 根据主键查询数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByKey ¶
func (controlUtil ControllerUtil) FindByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 根据关键值取对象集合
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByPage ¶
func (controlUtil ControllerUtil) FindByPage(ctx ginutil.Context, control interface{}, injectionCondition ...set.Set) *emity.MsgEmity
*
- 查询分页数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByRow ¶
func (controlUtil ControllerUtil) FindByRow(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 查找指定行数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindByTree ¶
func (controlUtil ControllerUtil) FindByTree(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 读取树形结构数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindCountByKey ¶
func (controlUtil ControllerUtil) FindCountByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 根据关键值查数量
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindOneByKey ¶
func (controlUtil ControllerUtil) FindOneByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 根据关键值取对象集合中的第一个
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) FindValueByKey ¶
func (controlUtil ControllerUtil) FindValueByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 根据关键值取对象集合中的符合条件的第一条记录的指定字段
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) GetParams ¶
func (controlUtil ControllerUtil) GetParams(ctx ginutil.Context, entity interface{}) *emity.MsgEmity
*
- 取所有参数,并转换成对应实体属性类型(map[string]interface{})
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) GetValueByField ¶
func (controlUtil ControllerUtil) GetValueByField(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) GetValueByFieldName ¶
func (controlUtil ControllerUtil) GetValueByFieldName(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 根据字段名取指定记录编号的数据库表中对应字段的值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) Group ¶
func (controlUtil ControllerUtil) Group(ctx ginutil.Context, control interface{}, fields map[string]string) *emity.MsgEmity
*
- 根据字段名取分组数据
- ctx GinHttp上下文对象
- control 控制层
- fields 分组字段[字段名,字段别名]
func (ControllerUtil) GroupAndCount ¶
func (controlUtil ControllerUtil) GroupAndCount(ctx ginutil.Context, control interface{}, fields map[string]string) *emity.MsgEmity
*
- 根据字段名取分组数据且取数量
- ctx GinHttp上下文对象
- control 控制层
- fields 分组字段[字段名,字段别名]
func (ControllerUtil) GroupByField ¶
func (controlUtil ControllerUtil) GroupByField(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 根据字段名取分组数据
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) HasById ¶
func (controlUtil ControllerUtil) HasById(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 取表中指定字段的最小值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) HasByKey ¶
func (controlUtil ControllerUtil) HasByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 取表中指定字段的最小值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) LookImg ¶
func (controlUtil ControllerUtil) LookImg(ctx ginutil.Context, modelName, filename string)
*
- 获取图片
- @param ctx http请求对象
- @param modelName 模块名称
- @param filename 文件名
func (ControllerUtil) MaxByField ¶
func (controlUtil ControllerUtil) MaxByField(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 取表中指定字段的最大值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) MinByField ¶
func (controlUtil ControllerUtil) MinByField(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 取表中指定字段的最小值
- ctx GinHttp上下文对象
- control 控制层
func (ControllerUtil) ReversalByKey ¶
func (controlUtil ControllerUtil) ReversalByKey(ctx ginutil.Context, control interface{}) *emity.MsgEmity
*
- 根据关键值翻转值(限布尔值类型,1转2,2转1)
- 警告:此方法只支持布尔值类型,且只支持翻转1和2
- @Param ctx http请求对象
- @Param entity 实体类
- @Param where 存放查询条件
- @Param reversalColumn 翻转的字段名
- @return emity.MsgEmity
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 ginutil.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 dbinfo.FindByPageParam, onlyCreator bool) (string, string, map[string]interface{})
分页数据查询部分语句,在分页查询数据及 数据搜索时使用 返回 findByPageCountSql, findByPageSql, params
func (ModuleUtil) GetFindByPageSelectSqlByField ¶
func (mu ModuleUtil) GetFindByPageSelectSqlByField(dataInfo dbinfo.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 控制层
func (ModuleUtil) SetTableKeyServiceName ¶
func (mu ModuleUtil) SetTableKeyServiceName(name string)
*
- 设置表主键服务名称
- name 服务名称