| 123456789101112131415161718192021222324252627282930313233 |
- package postgre
- type FuncTest struct {
- }
- func (f FuncTest) TestAdd(optUserId int, jsonStr string, verfStr string) (err error) {
- result := map[string]interface{}{}
- //err = getClient().Exec("select demo_tmp_user_add(? ,? ,? )",optUserId,jsonStr,verfStr).Error
- err = getClient().Raw("select demo_tmp_user_add(? ,? ,? )", optUserId, jsonStr, verfStr).Scan(&result).Error
- return
- }
- func (f FuncTest) TestQuery32(optUserId int, jsonStr string, verfStr string) (rst string, err error) {
- var result string
- //row1,err_ := getClient().Raw("select demo_tmp_user_query(? ,? ,? )",optUserId,jsonStr,verfStr).Rows()
- err = getClient().Raw("select demo_tmp_user_query(? ,? ,? )", optUserId, jsonStr, verfStr).Scan(&result).Error
- //row1.Scan(&result)
- //println(result)
- //if err != nil {
- // st := err.Error()
- // t1 := strings.Split(st, ";")[0]
- // comma1 := strings.Index(t1, "errcode:")
- // comma2 := strings.Index(t1, "errmemo:")
- // println(comma1, comma2)
- // pos := strings.Index(t1[comma1:], ",err")
- // println(pos)
- // println(t1[comma1:13])
- // println(t1[comma2:])
- //}
- return
- }
|