Documentation
¶
Index ¶
- Constants
- Variables
- func GenMemberStat(metas []*ReportMeta, passState int64) (res map[int64][]interface{}, err error)
- func Genform(res map[string][]*ReportFlowItem) (form map[string][24]*ReportFlowItem)
- func Genres(opt *OptReport, tempres map[string]map[int64]*ReportFlowItem, ...) (res map[string][]*ReportFlowItem)
- func Gentempres(opt *OptReport, mnames map[int64]string, metas []*ReportMeta) (tempres map[string]map[int64]*ReportFlowItem)
- func IsImgType(fileType string) bool
- func LogFieldTemp(field string, nw interface{}, old interface{}, diffTemp bool) (s string)
- func SubReflect(ot reflect.Type, ov reflect.Value, key string, vals []string, ...)
- type Action
- type ActionParam
- type AddOption
- type AuditInfo
- type Auth
- type BatchOption
- type CancelOption
- type Change
- type Column
- type ConfigItem
- type DayPager
- type EngineOption
- type EsCommon
- type Flow
- type Forbid
- type InfoResOption
- type ListResOption
- type ListRscItem
- type ListTask
- type ListTaskItem
- type MetaItem
- type NetConfOper
- type OptReport
- type OptReportSubmit
- type ParamsQueryLog
- type ReportFlowItem
- type ReportMeta
- type ReportSubmitContent
- type ReportSubmitItem
- type ReportSubmitRes
- type ReportSubmitState
- type SearchAuditLog
- type SearchAuditLogParam
- type SearchLogResult
- type SearchParams
- type SearchRes
- type SubmitOptions
- type SyncMessage
- type TaskReport
- type Tip
- type TrackAudit
- type TrackInfo
- type TrackParam
- type TrackRsc
- type UpdateOption
- type UpsertItem
- type UserInfo
- type WeightLog
Constants ¶
const ( LogBusinessAudit = int(231) LogTypeAuditSubmit = int(1) LogTypeAuditJump = int(2) LogTypeAuditAdd = int(3) LogTypeAuditCancel = int(4) LogBusinessTask = int(232) LogTypeTaskDispatch = int(1) LogTypeTaskConsumer = int(2) LogTYpeTaskWeight = int(3) LogBusinessResource = int(233) LogTypeFormAuditor = int(1) // 审核员提交变更 LogTypeFromAdd = int(2) // 业务添加资源 LogTypeFromCancle = int(3) // 业务注销资源 LogBusinessNet = int(234) //流程流转 LogTypeNetTrigger = int(1) //流程流转 LogFromBatch = "批量提交" LogFromSingle = "单个提交" LogFromStart = "启动" LogFromJump = "跳流程" LogFromCancle = "取消流程" LogBusinessNetConf = int(235) //流程配置 LogTypeNetConf = int(1) //流程网配置 LogTypeTokenConf = int(2) //令牌配置 LogTypeFlowConf = int(3) //节点配置 LogTypeTranConf = int(4) //变迁配置 LogTypeTokenBindConf = int(5) //令牌绑定配置 LogTypeDirConf = int(6) //有向线配置 //流程配置的操作 LogNetActionNew = "创建" LogNetActionUpdate = "更新" LogNetActionDisable = "禁用" LogNetActionAvailable = "启用" //流程配置的更新字段 LogFieldPID = "pid" LogFieldChName = "ch_name" LogFieldName = "name" LogFieldTokenID = "token_id" LogFieldStartFlow = "start_flow" LogFieldTrigger = "trigger" LogFieldLimit = "limit" LogFieldDirection = "direction" LogFieldOrder = "order" LogFieldGuard = "guard" LogFieldOutput = "output" )
..
const ( Dispatch = "ds" Delay = "dy" Submit = "st_%d_%d" // 参数1:提交状态(任务提交,资源提交,任务关闭) 参数2:提交前属于谁 Release = "rl" RscState = "rs_%d" UseTime = "ut" SetKey = "report_set" In = "in" Out = "out" //type TypeMeta = int8(0) TypeTotal = int8(1) TypeCreate = int8(2) //每日任务增量 TypeDaySubmit = int8(3) //每日任务提交信息 TypeDayUserSubmit = int8(4) //每日审核人员提交信息 )
hash fields
const ( // DefaultZeroInt form default zero DefaultZeroInt = int64(-12345) )
Variables ¶
var LogFieldDesc = map[string]string{ LogFieldPID: "父网", LogFieldChName: "中文名", LogFieldName: "英文名", LogFieldTokenID: "令牌", LogFieldStartFlow: "初始节点", LogFieldTrigger: "触发类型", LogFieldLimit: "限制", LogFieldDirection: "指向", LogFieldOrder: "顺序", LogFieldGuard: "通行条件", LogFieldOutput: "输出规则", }
LogFieldDesc 日志中的变更字段描述
var UpdateKeys = map[string]struct{}{
"mid": {},
"content": {},
"extra1": {},
"extra2": {},
"extra3": {},
"extra4": {},
"extra5": {},
"extra6": {},
"extra1s": {},
"extra2s": {},
"extra3s": {},
"extra4s": {},
"extratime1": {},
"octime": {},
"ptime": {},
"metadata": {},
}
UpdateKeys 可更新的资源字段
Functions ¶
func GenMemberStat ¶
func GenMemberStat(metas []*ReportMeta, passState int64) (res map[int64][]interface{}, err error)
GenMemberStat 个人24小时统计报表
func Genform ¶
func Genform(res map[string][]*ReportFlowItem) (form map[string][24]*ReportFlowItem)
Genform 元数据的加工函数,进出审核表格
func Genres ¶
func Genres(opt *OptReport, tempres map[string]map[int64]*ReportFlowItem, mnames map[int64]string) (res map[string][]*ReportFlowItem)
Genres 元数据的加工函数,进出审核柱状图2
func Gentempres ¶
func Gentempres(opt *OptReport, mnames map[int64]string, metas []*ReportMeta) (tempres map[string]map[int64]*ReportFlowItem)
Gentempres 元数据的加工函数,进出审核柱状图1
func LogFieldTemp ¶
LogFieldTemp 指定模板和字段,组建变更日志字段
Types ¶
type Action ¶
type Action struct { Name string `json:"name"` URL string `json:"url"` Method string `json:"method"` Response string `json:"response"` Extra string `json:"extra,omitempty"` Params map[string]*ActionParam `json:"params"` }
Action 下发到前端的组件
type ActionParam ¶
ActionParam 烦人啊,动态的打回理由是必传参数
type AddOption ¶
type AddOption struct { resource.Resource State int `form:"state" json:"state"` NetID int64 `form:"net_id" json:"net_id" validate:"required"` }
AddOption add option
type AuditInfo ¶
type AuditInfo struct { UnDoStat *task.UnDOStat `json:"undo_stat"` Task *task.Task `json:"task"` Flow *net.TransitionInfo `json:"flow"` Resource *resource.Res `json:"resource"` OperHistorys []string `json:"historys"` IFrame string `json:"iframe_url,omitempty"` UserInfo *UserInfo `json:"user_info"` UserGroup map[int64]*common.Group `json:"user_group"` Hit []string `json:"hit"` Actions []*Action `json:"actions"` }
AuditInfo 审核详情页
type Auth ¶
type Auth struct { OK bool `json:"ok"` Admin bool `json:"admin"` Business map[int64]int64 `json:"business"` }
Auth auth
type BatchOption ¶
type BatchOption struct { BusinessID int64 `form:"business_id" json:"business_id" validate:"required"` NetID int64 `form:"net_id" json:"net_id"` UID int64 `form:"uid" json:"uid"` Debug int8 `form:"debug" json:"debug"` Uname string `form:"uname" json:"uname"` RIDs []int64 `form:"rids,split" json:"rids" validate:"gt=0,dive,gt=0"` Binds []int64 `form:"binds,split" json:"binds" validate:"gt=0,dive,gt=0"` RejectReason string `form:"reject_reason"` ReasonID int64 `form:"reason_id" default:"0"` Notify int8 `form:"notify"` }
BatchOption 批量提交
type CancelOption ¶
type CancelOption struct { BusinessID int64 `form:"business_id" validate:"required" json:"business_id"` Oids []string `form:"oids,split" validate:"required" json:"oids"` Reason string `form:"reason" json:"reason"` }
CancelOption .
type Change ¶
type Change struct { Opt *SubmitOptions `json:"opt"` Flow *Flow `json:"flow"` }
Change for log
func (*Change) GetSubmitOper ¶
GetSubmitOper .
type Column ¶
type Column struct { Name string `json:"name"` ChName string `json:"chname"` Enum map[int64]string `json:"enum,omitempty"` }
Column .
type ConfigItem ¶
type ConfigItem struct { Name string `json:"name"` Desc string `json:"desc"` Username string `json:"uname"` }
ConfigItem .
type DayPager ¶
type DayPager struct { Pn string `json:"pn"` IsFirst bool `json:"is_first"` //第一页 IsLast bool `json:"is_last"` //最后一页 }
DayPager 按天分页
type EngineOption ¶
type EngineOption struct { common.BaseOptions TaskID int64 `json:"task_id" form:"task_id"` Result *resource.Result `json:"resource_result" form:"resource_result" submit:"object"` // 资源的修改内容,要传就全传,否则传空 Forbid *Forbid `json:"forbid_params" submit:"json"` ExtraData map[string]interface{} `json:"extra_data" submit:"map"` }
EngineOption .
type Flow ¶
type Flow struct { SubmitToken *net.TokenPackage `json:"submit_token"` ResultToken *net.TokenPackage `json:"result_token"` NewFlowID int64 `json:"new_flow_id"` OldFlowID json.Number `json:"old_flow_id"` }
Flow for log
type Forbid ¶
type Forbid struct { Notify int `json:"notify"` Reason string `json:"reason"` Duration int64 `json:"duration"` Comment string `json:"comment"` Img string `json:"img"` }
Forbid 封禁参数
type ListResOption ¶
type ListResOption struct { common.Pager common.BaseOptions BusinessID int64 `form:"business_id"` FlowID int64 `form:"flow_id"` }
ListResOption .
type ListRscItem ¶
type ListRscItem struct { resource.Res FlowID int64 `json:"flow_id"` UserInfo *UserInfo `json:"user_info"` UserGroup map[int64]*common.Group `json:"user_group"` Hit []string `json:"hit"` }
ListRscItem .
type ListTask ¶
type ListTask struct { *task.Task GTstr string `json:"gtime"` CTstr string `json:"ctime"` MTstr string `json:"mtime"` UserName string `json:"uid"` MidStr string `json:"mid"` }
ListTask 转化gtime
type ListTaskItem ¶
type ListTaskItem struct { ListTask WaitTime string `json:"wait_time"` OID string `json:"oid"` Content string `json:"content"` UserInfo *UserInfo `json:"user_info"` UserGroup map[int64]*common.Group `json:"user_group"` Metas map[string]interface{} `json:"metas"` }
ListTaskItem .
type NetConfOper ¶
type NetConfOper struct { OID int64 `json:"oid"` Action string `json:"action"` UID int64 `json:"uid"` Uname string `json:"uname"` NetID int64 `json:"net_id"` ChName string `json:"ch_name"` FlowID int64 `json:"flow_id"` TranID int64 `json:"tran_id"` Diff []string `json:"diff"` }
NetConfOper 流程配置日志
type OptReport ¶
type OptReport struct { BizID int64 `form:"business_id" validate:"required"` FlowID int64 `form:"flow_id"` UName string `form:"username"` Bt string `form:"bt"` Btime time.Time Et string `form:"et"` Etime time.Time Type int8 `form:"type"` }
OptReport 参数
type OptReportSubmit ¶
type OptReportSubmit struct { BizID int64 `form:"business_id" validate:"required"` FlowID int64 `form:"flow_id"` Bt string `form:"bt"` Et string `form:"et"` Pn string `form:"pn"` }
OptReportSubmit 参数
type ParamsQueryLog ¶
type ParamsQueryLog struct { Business int `reflect:"business"` Type int `default:"0" reflect:"type,omitdefault"` Uname []string `reflect:"uname"` UID []int64 `reflect:"uid"` Oid []int64 `reflect:"oid"` Action []string `reflect:"action"` CtimeFrom string `reflect:"ctime,from"` CtimeTo string `reflect:"ctime,to"` Int0 []int64 `reflect:"int_0"` Int0From string `reflect:"int_0,from"` Int0To string `reflect:"int_0,to"` Int1 []int64 `reflect:"int_1"` Int1From string `reflect:"int_1,from"` Int1To string `reflect:"int_1,to"` Int2 []int64 `reflect:"int_2"` Int2From string `reflect:"int_2,from"` Int3To string `reflect:"int_2,to"` Str0 []string `reflect:"str_0"` Str1 []string `reflect:"str_1"` Str2 []string `reflect:"str_2"` }
ParamsQueryLog .
type ReportFlowItem ¶
type ReportFlowItem struct { Hour string `json:"hour"` In int64 `json:"in"` Out int64 `json:"out"` }
ReportFlowItem 流量
type ReportMeta ¶
ReportMeta .
type ReportSubmitContent ¶
type ReportSubmitItem ¶
type ReportSubmitItem struct { StatDate string `json:"stat_date"` CreateCnt int64 `json:"create_cnt"` UID int64 `json:"uid"` Username string `json:"username"` AvgDur string `json:"avg_dur"` AvgUtime string `json:"avg_utime"` FlowID int64 `json:"flow_id"` SubmitCnt int64 `json:"submit_cnt"` StateCnt map[string]*ReportSubmitState `json:"state_cnt"` }
ReportSubmitItem .
type ReportSubmitRes ¶
type ReportSubmitRes struct { Order []string `json:"order"` //表格列顺序 Header map[string]string `json:"header"` //表格头 Rows [][]map[string]string `json:"rows"` //表格内容体 }
ReportSubmitRes .
type ReportSubmitState ¶
ReportSubmitState .
type SearchAuditLog ¶
type SearchAuditLog struct { RID int64 `json:"rid"` OID string `json:"oid"` TaskID int64 `json:"task_id"` State string `json:"state"` Stime string `json:"stime"` UID int64 `json:"uid"` Uname string `json:"uname"` Department string `json:"department"` Extra string `json:"extra"` }
SearchAuditLog 审核日志记录
type SearchAuditLogParam ¶
type SearchAuditLogParam struct { RID []int64 OID []string `form:"oid,split" validate:"omitempty,max=30,dive,gt=0"` Username []string `form:"username,split"` CtimeFrom string `form:"ctime_from"` CtimeTo string `form:"ctime_to"` Ps int `form:"ps" validate:"gt=0,max=50" default:"10"` Pn int `form:"pn" validate:"gt=0" default:"1"` TaskID []int64 `form:"task_id,split" validate:"omitempty,max=30"` State string `form:"state"` BusinessID int64 `form:"business_id" validate:"required,gt=0"` }
SearchAuditLogParam 搜索行为日志参数
type SearchLogResult ¶
type SearchLogResult struct { Result []struct { UID int64 `json:"uid"` Uname string `json:"uname"` OID int64 `json:"oid"` Type int8 `json:"type"` Action string `json:"action"` Str0 string `json:"str_0"` Str1 string `json:"str_1"` Str2 string `json:"str_2"` Int0 int64 `json:"int_0"` Int1 int64 `json:"int_1"` Int2 int64 `json:"int_2"` Ctime string `json:"ctime"` Extra string `json:"extra_data"` } `json:"result"` Page struct { Num int `json:"num"` Size int `json:"size"` Total int `json:"total"` } `json:"page"` }
type SearchParams ¶
type SearchParams struct { common.Pager Debug int8 `form:"debug" reflect:"ignore"` FilterOff bool `form:"state_filter_off" reflect:"ignore"` BusinessID int64 `form:"business_id" validate:"required" reflect:"business_id"` OID []string `form:"oid,split" reflect:"oid"` FlowID int64 `form:"flow_id" default:"-12345" reflect:"flow_id,omitdefault"` State int64 `form:"state" default:"-12345" reflect:"state,omitdefault"` Mid int64 `form:"mid" default:"-12345" reflect:"mid,omitdefault"` CtimeFrom string `form:"ctime_from" reflect:"ctime,from"` CtimeTo string `form:"ctime_to" reflect:"ctime,to"` Extra1 string `form:"extra1" reflect:"extra1" parse:"[]int"` Extra2 string `form:"extra2" reflect:"extra2" parse:"int"` Extra3 string `form:"extra3" reflect:"extra3" parse:"int"` Extra4 string `form:"extra4" reflect:"extra4" parse:"int"` Extra5 string `form:"extra4" reflect:"extra5" parse:"int"` Extra6 string `form:"extra4" reflect:"extra6" parse:"int"` Extra1s string `form:"extra1s" reflect:"extra1s" ` Extra2s string `form:"extra2s" reflect:"extra2s" ` Extra3s string `form:"extra3s" reflect:"extra3s" ` Extra4s string `form:"extra4s" reflect:"extra4s" ` ExtraTime1 string `form:"extratime1" reflect:"extratime1" ` //TODO 具体用到了再看怎么解析 KeyWord string `form:"keyWords" reflect:"ignore"` CtimeOrder string `form:"ctime_order" reflect:"ignore"` //TODO 等octime导入后要按照octime筛选 }
SearchParams ..
type SearchRes ¶
type SearchRes struct { Resources []*ListRscItem `json:"result"` Page struct { Num int `json:"num"` Size int `json:"size"` Total int `json:"total"` } `json:"page"` }
SearchRes search list.
type SubmitOptions ¶
type SubmitOptions struct { EngineOption NewFlowID int64 `json:"newflow_id"` BindStr string `json:"binds"` Binds []int64 `json:"-"` }
SubmitOptions 审核结果提交参数
type SyncMessage ¶
type SyncMessage struct { URL string Uname string `json:"auditor"` MID int64 `json:"uid"` OID string `json:"oid"` RejectReason string `json:"reason"` FlowData map[string]interface{} `json:"flow_data"` ExtraData map[string]interface{} `json:"extra_data"` ForbidParams map[string]interface{} `json:"forbid_params"` Attribute map[string]int8 `json:"attribute"` }
SyncMessage .
type TaskReport ¶
type TaskReport struct { ID int64 `json:"id"` BusinessID int64 `json:"business_id"` FlowID int64 `json:"flow_id"` Type int8 `json:"type"` UID int64 `json:"uid" gorm:"column:uid"` StatDate time.Time `json:"stat_date"` Content string `json:"content"` }
TaskReport 任务报表
func (*TaskReport) TableName ¶
func (t *TaskReport) TableName() string
type Tip ¶
type Tip struct { Success []int64 `json:"success"` Async []int64 `json:"async"` Fail map[int64]string `json:"fail"` }
Tip 批量提交的错误提示
type TrackAudit ¶
type TrackAudit struct { Ctime string `json:"ctime"` FlowID []int64 `json:"flow_id"` FlowName string `json:"flow_name"` State string `json:"state"` Uname string `json:"uname"` }
TrackAudit 操作日志信息追踪
type TrackInfo ¶
type TrackInfo struct { Add []*TrackRsc `json:"add"` Audit []*TrackAudit `json:"audit"` Relation [][]int `json:"relation"` }
TrackInfo 信息追踪汇总
type TrackParam ¶
type TrackParam struct { BusinessID int64 `form:"business_id" validate:"required,gt=0"` OID string `form:"oid" validate:"required,gt=0"` Pn int `form:"pn" validate:"gt=0" default:"1"` Ps int `form:"ps" validate:"gt=0,max=30" default:"10"` LastPageTime string `form:"last_page_time"` }
TrackParam 信息追踪参数
type TrackRsc ¶
type TrackRsc struct { Ctime string `json:"ctime"` Content string `json:"content"` Detail map[string]interface{} `json:"detail"` }
TrackRsc 资源信息追踪
type UpdateOption ¶
type UpdateOption struct { BusinessID int64 `form:"business_id" json:"business_id" validate:"required"` NetID int64 `form:"net_id" json:"net_id" validate:"required"` OID string `form:"oid" json:"oid" validate:"required"` Update map[string]interface{} `json:"update"` }
UpdateOption update option
type UpsertItem ¶
type UpsertItem struct { ID int64 `json:"id"` State int `json:"state"` Extra1 int64 `json:"extra1"` Extra2 int64 `json:"extra2"` Extra3 int64 `json:"extra3"` Extra4 int64 `json:"extra4"` }
UpsertItem 更新搜索的items
type UserInfo ¶
type UserInfo struct { Mid int64 `json:"mid"` Name string `json:"name"` Official member.OfficialInfo `json:"official"` Follower int64 `json:"follower"` }
UserInfo .
type WeightLog ¶
type WeightLog struct { UPtime string `json:"uptime"` Mid int64 `json:"mid"` MemName string `json:"member_name"` // up主名称 Fans int64 `json:"fans"` FansWeight int64 `json:"fans_weight"` Group string `json:"group"` GroupWeight int64 `json:"group_weight"` WaitTime string `json:"wait_time"` WaitWeight int64 `json:"wait_weight"` EqualWeight int64 `json:"config_weight"` ConfigItems []*ConfigItem `json:"config_items"` Weight int64 `json:"weight"` }
WeightLog task log