Documentation ¶
Index ¶
- Variables
- type IgnoreURL
- type IgnoreURLBase
- func (IgnoreURLBase) BaseColumnNames() string
- func (IgnoreURLBase) BaseEntity() dbinfo.Entity
- func (IgnoreURLBase) GetDataInfo(name string) *dbinfo.DataInfo
- func (IgnoreURLBase) New() dbinfo.Entity
- func (IgnoreURLBase) OwnerName() string
- func (IgnoreURLBase) OwnerTable() string
- func (IgnoreURLBase) TableName() string
- type IgnoreURLController
- func (control IgnoreURLController) Add(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) CheckIgnoreUrl(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) CheckRepeatAlone() map[string]int
- func (control IgnoreURLController) ClearCache(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) Del(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) Edit(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) FindAll(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) FindByDate(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) FindById(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) FindByKey(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) FindByPage(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) FindByRow(ctx ginutil.Context) interface{}
- func (control IgnoreURLController) RegisterUrl()
- type IgnoreURLService
- type SimpleIgonoreURL
Constants ¶
This section is empty.
Variables ¶
var IgnoreURL_tableName = ""
Functions ¶
This section is empty.
Types ¶
type IgnoreURL ¶
type IgnoreURL struct { IgnoreURLBase GsMustLoginText string `json:"sMustLoginText" gorm:"<-:false;column:sMustLoginText"` //必须登录(布尔值,1:是;2:否) }
*
- 拦截器忽略路径'IgnoreURL'表结构体
- 警告:非数据库字段禁止在此添加,应该创建扩展结构体中添加
- @author HuangXinBian
type IgnoreURLBase ¶
type IgnoreURLBase struct { GsId string `json:"sId" gorm:"column:sId; type:varchar; NOT NULL; primary_key"` //记录编号 GsUrlName string `json:"sUrlName" gorm:"column:sUrlName; type:varchar; NOT NULL"` //路径名称类别 GsIgnoreUrl string `json:"sIgnoreUrl" gorm:"column:sIgnoreUrl; type:varchar; NOT NULL"` //路径集合 GiMustLogin int `json:"iMustLogin" gorm:"column:iMustLogin; type:int; NOT NULL; DEFAULT '1'"` //必须登录(布尔值,1:是;2:否) GsOnlyUserType string `json:"sOnlyUserType" gorm:"column:sOnlyUserType; type:varchar"` //限用户类型(分号分隔) GsMemo string `json:"sMemo" gorm:"column:sMemo; type:varchar"` //备注 GsCreator string `json:"sCreator" gorm:"column:sCreator; type:varchar; NOT NULL; DEFAULT '00000000'"` //创建者 GdCreateDate time.Time `json:"dCreateDate" gorm:"column:dCreateDate; type:datetime; NOT NULL"` //创建时间 GsModifieder string `json:"sModifieder" gorm:"column:sModifieder; type:varchar; NOT NULL; DEFAULT '00000000'"` //修改人 GdModifiedDate time.Time `json:"dModifiedDate" gorm:"column:dModifiedDate; type:datetime; NOT NULL"` //修改时间 GiState int `json:"iState" gorm:"column:iState; type:int; NOT NULL; DEFAULT '1'"` //版本 GiIndex int `json:"iIndex" gorm:"column:iIndex; type:int; NOT NULL; DEFAULT '1'"` //序号 GiVersion int `json:"iVersion" gorm:"column:iVersion; type:int; NOT NULL; DEFAULT '1'"` //版本号 }
*
- 拦截器忽略路径'IgnoreURL'表结构体
- 警告:非数据库字段禁止在此添加,应该创建扩展结构体中添加
- @author HuangXinBian
func (IgnoreURLBase) BaseColumnNames ¶
func (IgnoreURLBase) BaseColumnNames() string
*
- 结构体映射表的字段名串
- @return
func (IgnoreURLBase) BaseEntity ¶
func (IgnoreURLBase) BaseEntity() dbinfo.Entity
*
- 取基础实体,用于在子类(嵌套结构体)时同样获得基类
func (IgnoreURLBase) GetDataInfo ¶
func (IgnoreURLBase) GetDataInfo(name string) *dbinfo.DataInfo
*
- 取数据结构信息
- @param name 字段名
- @return
func (IgnoreURLBase) OwnerName ¶
func (IgnoreURLBase) OwnerName() string
*
- 结构体映射库名,去除'Dev_'等前缀
- @return
func (IgnoreURLBase) TableName ¶
func (IgnoreURLBase) TableName() string
*
- 结构体映射表名,处理结构体名称与表名不一致的情况
- @return
type IgnoreURLController ¶
type IgnoreURLController struct { app.ControllerBaseFunc ModuleEntity IgnoreURL ModuleService IgnoreURLService }
@Controller 拦截器忽略路径控制器
func (IgnoreURLController) Add ¶
func (control IgnoreURLController) Add(ctx ginutil.Context) interface{}
#region @Api {title=新增} @param {name=data dataType=json paramType=body explain=IgnoreURL结构数据 explainType=IgnoreURL required=true} @return {type=json explainType=MsgEntity<IgnoreURL> explain=返回对象} @RequestMapping {name=Add type=POST value=/ignore/url/add} #endregion
func (IgnoreURLController) CheckIgnoreUrl ¶
func (control IgnoreURLController) CheckIgnoreUrl(ctx ginutil.Context) interface{}
#region @Api {title=验证指定url是否在可忽略的访问路径中(给内部拦截器用,直接返回Boolean)} @param {name=sUrl dataType=string paramType=query explain=待检验的url required=true} @param {name=sUserType dataType=string paramType=query explain=待检验的用户类型 required=false} @param {name=iMustLogin dataType=int paramType=query explain=是否必须登录,1:是;2:否 required=false} @return {type=bool explain=返回是否在可忽略的访问路径中} @RequestMapping {name=FindByPage type=POST value=/ignore/url/check} #endregion
func (IgnoreURLController) CheckRepeatAlone ¶
func (control IgnoreURLController) CheckRepeatAlone() map[string]int
-- 检查待新增内容是否存在重复数据(单独字段重复即重复)集合,注意:int必须是1、10、100、1000 --//
func (IgnoreURLController) ClearCache ¶
func (control IgnoreURLController) ClearCache(ctx ginutil.Context) interface{}
#region @Api {title=清理缓存 explain=直接操作数据库的情况下需要手工更新缓存} @return {type=MsgEntity explain=返回分页数据} @RequestMapping {name=FindByPage type=POST value=/ignore/url/clear/cache} #endregion
func (IgnoreURLController) Del ¶
func (control IgnoreURLController) Del(ctx ginutil.Context) interface{}
#region @Api {title=删除数据} @param {name=sId dataType=string paramType=query explain=记录编号 required=true} @param {name=iVersion dataType=int paramType=query explain=版本号 required=true} @return {type=json explainType=MsgEntity<int> explain=返回影响数} @RequestMapping {name=Del type=POST value=/ignore/url/del} #endregion
func (IgnoreURLController) Edit ¶
func (control IgnoreURLController) Edit(ctx ginutil.Context) interface{}
#region @Api {title=修改数据} @param {name=data dataType=json paramType=body explain=IgnoreURL结构数据 explainType=IgnoreURL required=true} @return {type=json explainType=MsgEntity<int> explain=返回码值} @RequestMapping {name=Edit type=POST value=/ignore/url/edit} #endregion
func (IgnoreURLController) FindAll ¶
func (control IgnoreURLController) FindAll(ctx ginutil.Context) interface{}
#region @Api {title=查询全部} @param {name=data dataType=json paramType=body explain=map[string]interface结构数据 explainType=IgnoreURL required=true} @return {type=json explainType=MsgEntity<IgnoreURL> explain=返回数组[]map[string]interface} @RequestMapping {name=FindAll type=POST value=/ignore/url/find/all} #endregion
func (IgnoreURLController) FindByDate ¶
func (control IgnoreURLController) FindByDate(ctx ginutil.Context) interface{}
#region @Api {title=查询指定时间内数据} @param {name=sDateSt dataType=string paramType=query explain=格式:YYYY-MM-DD HH:mm:ss required=true} @param {name=sDateEd dataType=string paramType=query explain=格式:YYYY-MM-DD HH:mm:ss required=true} @return {type=json explainType=MsgEntity<IgnoreURL> explain=返回数组[]map[string]interface} @RequestMapping {name=FindByDate type=POST value=/ignore/url/find/date} #endregion
func (IgnoreURLController) FindById ¶
func (control IgnoreURLController) FindById(ctx ginutil.Context) interface{}
#region @Api {title=根据记录编号取对象} @param {name=sId dataType=string paramType=query explain=记录编号 required=true} @return {type=json explainType=MsgEntity<IgnoreURL> explain=返回对象} @RequestMapping {name=FindById type=POST value=/ignore/url/find/id} #endregion
func (IgnoreURLController) FindByKey ¶
func (control IgnoreURLController) FindByKey(ctx ginutil.Context) interface{}
#region @Api {title=根据关键值取对象集合} @param {name=data dataType=json paramType=body explain=IgnoreURL结构数据 explainType=IgnoreURL required=true} @return {type=json explainType=MsgEntity<IgnoreURL> explain=返回数组[]map[string]interface} @RequestMapping {name=FindByKey type=POST value=/ignore/url/find/key} #endregion
func (IgnoreURLController) FindByPage ¶
func (control IgnoreURLController) FindByPage(ctx ginutil.Context) interface{}
#region @Api {title=查询分页数据} @param {name=data dataType=json paramType=body explain=FindByPageParam结构数据 explainType=FindByPageParam<IgnoreURL> required=true} @return {type=json explainType=MsgEntity<Page<IgnoreURL>> explain=返回分页数据} @RequestMapping {name=FindByPage type=POST value=/ignore/url/find/page} #endregion
func (IgnoreURLController) FindByRow ¶
func (control IgnoreURLController) FindByRow(ctx ginutil.Context) interface{}
#region @Api {title=根据记录编号查询符合分页数据的某条记录} @param {name=sId dataType=string paramType=query explain=记录编号 required=true} @return {type=json explainType=MsgEntity<IgnoreURL> explain=返回数组[]map[string]interface} @RequestMapping {name=FindByRow type=POST value=/ignore/url/find/page/row} #endregion
type IgnoreURLService ¶
type IgnoreURLService struct {
app.ServiceBaseFunc
}
*
- 拦截器忽略路径IgnoreURL表基本业务操作结构体
func (IgnoreURLService) CheckIgnoreUrl ¶
func (iu IgnoreURLService) CheckIgnoreUrl(sUrl string, isMustLogin bool, sUserType string) *msgentity.MsgEntity
*
- 验证指定url是否在可忽略的访问路径中(给内部拦截器用,直接返回Boolean)
- @param sUrl 待检验的url
- @param isMustLogin 是否必须登录
- @param sUserType 待检验的用户类型
- @return
func (IgnoreURLService) ClearCache ¶
func (iu IgnoreURLService) ClearCache(ctx ginutil.Context, cacheName, sUser string) *msgentity.MsgEntity
* * 清理缓存 * @return
type SimpleIgonoreURL ¶
type SimpleIgonoreURL struct { GsIgnoreUrl string `json:"sIgnoreUrl"` GiMustLogin int64 `json:"iMustLogin"` GsOnlyUserType string `json:"sOnlyUserType"` }
*
- 简版'忽略路径'结构体