本文整理匯總了Golang中github.com/mikeshimura/dbflute/df.List.Add方法的典型用法代碼示例。如果您正苦於以下問題:Golang List.Add方法的具體用法?Golang List.Add怎麽用?Golang List.Add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/mikeshimura/dbflute/df.List
的用法示例。
在下文中一共展示了List.Add方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: ReplacePageTotal
func (r *GoReport) ReplacePageTotal() {
if r.PageTotal == false {
return
}
lines := strings.Split(r.Converter.Text, "\n")
list := new(df.List)
for i, line := range lines {
if len(line) < 8 {
continue
}
if line[0:7] == "v\tPAGE\t" {
h := new(pagehist)
h.line = i
h.page = AtoiPanic(line[7:])
list.Add(h)
//fmt.Printf("hist %v \n", h)
}
}
for i, line := range lines {
if strings.Index(line, "{#TotalPage#}") > -1 {
total := r.getTotalPage(i, list)
//fmt.Printf("total :%v\n", total)
lines[i] = strings.Replace(lines[i], "{#TotalPage#}", strconv.Itoa(total), -1)
}
}
buf := new(bytes.Buffer)
for _, line := range lines {
buf.WriteString(line + "\n")
}
r.Converter.Text = buf.String()
}
示例2: Transaction
func (p *Customer) Transaction(transactions []interface{}) {
transactionResult := new(df.List)
for _, transaction := range transactions {
var tran map[string]interface{} = transaction.(map[string]interface{})
res := p.executeEachTransaction(tran)
transactionResult.Add(res)
}
p.context.JSON(200, dfweb.SetNormalFetchResult(transactionResult))
}
示例3: GetDbs
func (p *SysTable) GetDbs() {
cbx := cb.CreateSysTableCB()
cbx.Query().SetDelFlag_Equal(0)
cbx.Query().SetTableName_Equal("DbName")
cbx.Query().AddOrderBy_Key1_Asc()
res, err := bhv.SysTableBhv_I.SelectList(cbx, p.tx)
if err != nil {
panic(err.Error())
}
reslist := new(df.List)
for _, ent := range res.List.GetAsArray() {
entx := ent.(*entity.SysTable)
cmap := make(map[string]string)
cmap["value"] = entx.GetKey1()
cmap["label"] = entx.GetKey1()
reslist.Add(cmap)
}
p.context.JSON(200, dfweb.SetNormalFetchResult(reslist))
}
示例4: getSecData
func (p *Employee) getSecData() {
cbx := cb.CreateUserTableCB()
cbx.Query().SetDelFlag_Equal(0)
cbx.Query().SetTableName_Equal("section")
cbx.Query().AddOrderBy_Key1_Asc()
res, err := bhv.UserTableBhv_I.SelectList(cbx, p.tx)
if err != nil {
panic(err.Error())
}
reslist := new(df.List)
cmap := make(map[string]interface{})
cmap["value"] = 0
cmap["label"] = ""
reslist.Add(cmap)
for _, ent := range res.List.GetAsArray() {
entx := ent.(*entity.UserTable)
cmap := make(map[string]interface{})
cmap["value"] = entx.GetId()
cmap["label"] = entx.GetS1Data().String
reslist.Add(cmap)
}
p.context.JSON(200, dfweb.SetNormalFetchResult(reslist))
}