本文整理汇总了Golang中github.com/Centny/gwf/netw/impl.RCM_Cmd类的典型用法代码示例。如果您正苦于以下问题:Golang RCM_Cmd类的具体用法?Golang RCM_Cmd怎么用?Golang RCM_Cmd使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RCM_Cmd类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: UpdateBankPaper
func UpdateBankPaper(rc *impl.RCM_Cmd) (interface{}, error) {
var uid, bankId int64
var paperIds, p2bIds, ext string
err := rc.ValidF(`
uid,R|I,R:0;
bankId,R|I,R:0;
paperIds,R|S,L:0;
p2bIds,O|S,L:0;
ext,O|S,L:0;
`, &uid, &bankId, &paperIds, &p2bIds, &ext)
if err != nil {
log.E("UpdateBankPaper arg err:%v", err)
return 0, err
}
extParse := []P2b_Paper{}
json.Unmarshal([]byte(ext), &extParse)
rs := []P2b_Paper{}
paperIdsArr := []int64{}
err = json.Unmarshal([]byte(paperIds), &paperIdsArr)
if err != nil {
return nil, err
}
if p2bIds == "" {
p2bIds = "0"
}
sql_ := "delete from ebs_p2b where bank_id=? and tid not in (" + p2bIds + ")"
var conn *sql.DB = dbMgr.DbConn()
tx, err := conn.Begin()
if err != nil {
return nil, err
}
//同步练习
for _, v := range extParse {
fmt.Println(tx.Exec("insert into ebs_p2b (tid,bank_id,paper_id,status,add1) values (?,?,?,'N','P')", v.P2bId, bankId, v.PId))
}
//同步练习
if ext != "" {
sql_ += " and add1='P'"
} else {
sql_ += " and (add1!='P' or add1 is null)"
}
log.D("%s", sql_)
if _, err := tx.Exec(sql_, bankId); err != nil {
tx.Rollback()
return nil, err
}
for _, v := range paperIdsArr {
if res, err := tx.Exec("insert into ebs_p2b (bank_id,paper_id,status) values (?,?,'N')", bankId, v); err != nil {
tx.Rollback()
return nil, err
} else {
p2bId, _ := res.LastInsertId()
rs = append(rs, P2b_Paper{p2bId, v})
}
}
return rs, tx.Commit()
}
开发者ID:tomlovzki,项目名称:ebs,代码行数:60,代码来源:api.go
示例2: CreateBank
func CreateBank(rc *impl.RCM_Cmd) (interface{}, error) {
log.D("rc CreateBank")
var uid int64
var uname string
var bName string
err := rc.ValidF(`
uid,R|I,R:0;
uname,R|S,L:0;
bName,R|S,L:0;
`, &uid, &uname, &bName)
if err != nil {
log.E("CreateBank arg err:%v", err)
return 0, err
}
b := &bank.BANK{}
b.UId = &uid
b.Name = &bName
b.UName = &uname
b.Status = bank.GetString("N")
b.Public = bank.GetInt(1)
if n, err := b.C(nil); err != nil {
log.E("CreateBank err:%v", err)
return 0, err
} else {
return n, nil
}
}
开发者ID:tomlovzki,项目名称:ebs,代码行数:28,代码来源:srv.go
示例3: AttendBankInfo
func AttendBankInfo(rc *impl.RCM_Cmd) (interface{}, error) {
var bankIds string
err := rc.ValidF(`
bankIds,R|S,L:0;
`, &bankIds)
if err != nil {
log.E("AttendBankInfo arg err:%v", err)
return 0, err
}
return bank.AttendBankInfo(bankIds)
}
开发者ID:tomlovzki,项目名称:ebs,代码行数:11,代码来源:api.go
示例4: GetBankItemCnt
func GetBankItemCnt(rc *impl.RCM_Cmd) (interface{}, error) {
var bankIds string
err := rc.ValidF(`
bankIds,R|S,L:0;
`, &bankIds)
if err != nil {
log.E("GetBankItemCnt arg err:%v", err)
return 0, err
}
return bank.GetBankQcAndPc(bankIds)
}
开发者ID:tomlovzki,项目名称:ebs,代码行数:11,代码来源:api.go
示例5: ListBankPaper
func ListBankPaper(rc *impl.RCM_Cmd) (interface{}, error) {
var uid, bankId int64
err := rc.ValidF(`
uid,O|I,R:0;
bankId,R|I,R:0;
`, &uid, &bankId)
if err != nil {
log.E("ListBankPaper arg err:%v", err)
return 0, err
}
return bank.FuncListBankPaper(uid, bankId)
}
开发者ID:tomlovzki,项目名称:ebs,代码行数:12,代码来源:api.go
示例6: GetBankPaperScore
func GetBankPaperScore(rc *impl.RCM_Cmd) (interface{}, error) {
var bankId, paperId int64
err := rc.ValidF(`
bankId,R|I,R:0;
paperId,R|I,R:0;
`, &bankId, &paperId)
if err != nil {
log.E("GetBankPaperScore arg err:%v", err)
return 0, err
}
return bank.GetBankPaperScore(bankId, paperId)
}
开发者ID:tomlovzki,项目名称:ebs,代码行数:12,代码来源:api.go
示例7: GetUsrPaperRecord
func GetUsrPaperRecord(rc *impl.RCM_Cmd) (interface{}, error) {
var p2bIds string
var uid int64
err := rc.ValidF(`
p2bIds,R|S,L:0;
userId,R|I,R:0;
`, &p2bIds, &uid)
if err != nil {
log.E("GetUsrPaperRecord arg err:%v", err)
return 0, err
}
return bank.GetUsrPaperRecord(uid, p2bIds)
}
开发者ID:tomlovzki,项目名称:ebs,代码行数:13,代码来源:api.go
示例8: EditBank
func EditBank(rc *impl.RCM_Cmd) (interface{}, error) {
var bName string
var id int64
err := rc.ValidF(`
bName,R|S,L:0;
id,R|I,R:0;
`, &bName, &id)
if err != nil {
log.E("EditBank arg err:%v", err)
return 0, err
}
b := &bank.BANK{}
b.Tid = &id
b.Name = &bName
return nil, b.U(nil)
}
开发者ID:tomlovzki,项目名称:ebs,代码行数:16,代码来源:srv.go
示例9: CallC
func CallC(rc *impl.RCM_Cmd) (interface{}, error) {
var cid = rc.Kvs().StrVal("cid")
log.D("run_rc_s doing call_c by cid(%v)", cid)
var cmd = rcs.CmdC(cid)
if cmd == nil {
return util.Map{
"code": -1,
"err": "not found",
}, nil
}
var name = rc.StrVal("name")
var args = rc.MapVal("args")
log.D("run_rc_s call client by name(%v),args(%v)", name, util.S2Json(args))
var res, err = cmd.Exec_m(name, args)
log.D("run_rc_s call client result->%v", util.S2Json(res))
return res, err
}
开发者ID:Centny,项目名称:cswf,代码行数:17,代码来源:run_rc_s.go
示例10: Args_s
func Args_s(rc *impl.RCM_Cmd) (interface{}, error) {
log.D("run_rc_s doing Args_s->%v", string(rc.Data()))
return rc.StrVal("val"), nil
}
开发者ID:Centny,项目名称:cswf,代码行数:4,代码来源:run_rc_s.go
注:本文中的github.com/Centny/gwf/netw/impl.RCM_Cmd类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论