logics

package
v3.1.0-rc.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDownExcelHttpHeader

func AddDownExcelHttpHeader(c *gin.Context, name string)

func BuildExcelFromData

func BuildExcelFromData(objID string, fields map[string]Property, filter []string, data []interface{}, sheet *xlsx.Sheet, defLang lang.DefaultCCLanguageIf) error

BuildExcelFromData product excel from data

func BuildExcelTemplate

func BuildExcelTemplate(url, objID, filename string, header http.Header, defLang lang.DefaultCCLanguageIf) error

BuildExcelTemplate return httpcode, error

func BuildHostExcelFromData

func BuildHostExcelFromData(objID string, fields map[string]Property, filter []string, data []interface{}, sheet *xlsx.Sheet, defLang lang.DefaultCCLanguageIf) error

BuildHostExcelFromData product excel from data

func ConvAttrOption

func ConvAttrOption(attrItems map[int]map[string]interface{})

func GetExcelData

func GetExcelData(sheet *xlsx.Sheet, fields map[string]Property, defFields common.KvMap, isCheckHeader bool, firstRow int, defLang lang.DefaultCCLanguageIf) (map[int]map[string]interface{}, []string, error)

GetExcelData excel数据,一个kv结构,key行数(excel中的行数),value内容

func GetFilterFields

func GetFilterFields(objID string) []string

GetFilterFields 不需要展示字段

func GetHostData

func GetHostData(appIDStr, hostIDStr, apiAddr string, header http.Header) ([]interface{}, error)

GetHostData get host data from excel

func GetImportHosts

func GetImportHosts(f *xlsx.File, url string, header http.Header, defLang lang.DefaultCCLanguageIf) (map[int]map[string]interface{}, []string, error)

GetImportHosts get import hosts return inst array data, errmsg collection, error

func GetImportInsts

func GetImportInsts(f *xlsx.File, objID, url string, header http.Header, headerRow int, isInst bool, defLang lang.DefaultCCLanguageIf) (map[int]map[string]interface{}, []string, error)

GetImportInsts get insts from excel file

func GetInstData

func GetInstData(ownerID, objID, instIDStr, apiAddr string, header http.Header, kvMap map[string]string) ([]interface{}, error)

GetInstData get inst data

func GetLanguageByHTTPRequest

func GetLanguageByHTTPRequest(c *gin.Context) string

func GetObjFieldIDs

func GetObjFieldIDs(objID, url string, filterFields []string, header http.Header) (map[string]Property, error)

GetObjFieldIDs get object fields

func GetObjectData

func GetObjectData(ownerID, objID, apiAddr string, header http.Header) ([]interface{}, error)

GetObjectData get object data

func GetPropertyFieldDesc

func GetPropertyFieldDesc(lang language.DefaultCCLanguageIf) map[string]string

func GetPropertyFieldType

func GetPropertyFieldType(lang language.DefaultCCLanguageIf) map[string]string

func GetRawExcelData

func GetRawExcelData(sheet *xlsx.Sheet, defFields common.KvMap, firstRow int, defLang lang.DefaultCCLanguageIf) (map[int]map[string]interface{}, []string, error)

GetExcelData excel数据,一个kv结构,key行数(excel中的行数),value内容

func GetUserAppPri

func GetUserAppPri(apiAddr string, userName string, ownerID, lang string) (userPriveApp map[int64][]string, rolePrivi map[string][]string, modelConfigPrivi map[string][]string, sysPrivi []string, mainLineObjIDArr []string)

GetUserAppPri get user privilege

func ProductExcelCommentSheet

func ProductExcelCommentSheet(excel *xlsx.File, defLang lang.DefaultCCLanguageIf)

ProductExcelHealer Excel comment sheet,

func SetProxyHeader

func SetProxyHeader(c *gin.Context)

Types

type Property

type Property struct {
	ID                     string
	Name                   string
	PropertyType           string
	Option                 interface{}
	IsPre                  bool
	IsRequire              bool
	Group                  string
	Index                  int
	ExcelColIndex          int
	NotObjPropery          bool //Not an attribute of the object, indicating that the field to be exported is needed for export,
	AsstObjPrimaryProperty []Property
	IsOnly                 bool
	AsstObjID              string
}

Property object fields

type PropertyGroup

type PropertyGroup struct {
	Name  string
	Index int
	ID    string
}

PropertyGroup property group

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL