mirror of
https://shylinux.com/x/icebergs
synced 2025-04-25 17:18:05 +08:00
opt mp
This commit is contained in:
parent
c05d3b2b55
commit
a5e7041e1f
@ -25,14 +25,13 @@ func init() {
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Option(mdb.FIELDS, kit.Select("time,hash,name,data", mdb.DETAIL, len(arg) > 0))
|
||||
m.Cmdy(mdb.SELECT, cmd, "", mdb.HASH, kit.MDB_HASH, arg)
|
||||
m.Cmd(mdb.SELECT, cmd, "", mdb.HASH, kit.MDB_HASH, arg).Table(func(index int, value map[string]string, head []string) {
|
||||
m.Push("", value, kit.Split(kit.Select("time,hash,name", "time,name", len(arg) > 0)))
|
||||
|
||||
m.Table(func(index int, value map[string]string, head []string) {
|
||||
m.PushDownload(value[kit.MDB_NAME], "/share/cache/"+value["data"])
|
||||
if len(arg) > 0 {
|
||||
switch kit.Ext(value["name"]) {
|
||||
case "png":
|
||||
m.PushImages("image", "/share/cache/"+value["data"])
|
||||
if m.PushDownload(value[kit.MDB_NAME], "/share/cache/"+value[kit.MDB_DATA]); len(arg) > 0 {
|
||||
switch {
|
||||
case kit.ExtIsImage(value[kit.MDB_NAME]):
|
||||
m.PushImages(kit.MDB_IMAGE, "/share/cache/"+value[kit.MDB_DATA])
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -40,9 +40,8 @@ func init() {
|
||||
},
|
||||
Commands: map[string]*ice.Command{
|
||||
LOCATION: {Name: "location text auto getLocation", Help: "地理位置", Action: map[string]*ice.Action{
|
||||
OPENLOCATION: {Name: "create type=text name address latitude longitude", Help: "地图", Hand: func(m *ice.Message, arg ...string) {
|
||||
}},
|
||||
GETLOCATION: {Name: "create type=text name address latitude longitude", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||
OPENLOCATION: {Name: "create type=text name address latitude longitude", Help: "地图", Hand: func(m *ice.Message, arg ...string) {}},
|
||||
GETLOCATION: {Name: "getLocation", Help: "添加", Hand: func(m *ice.Message, arg ...string) {
|
||||
_trans(arg, map[string]string{ADDRESS: "text"})
|
||||
m.Cmdy(mdb.INSERT, LOCATION, "", mdb.HASH, arg)
|
||||
}},
|
||||
|
@ -257,8 +257,8 @@ func init() {
|
||||
m.Cmdy(mdb.DELETE, RIVER, kit.Keys(kit.MDB_HASH, m.Option(ice.MSG_RIVER), USER), mdb.HASH, aaa.USERNAME, m.Option(aaa.USERNAME))
|
||||
}},
|
||||
mdb.INPUTS: {Name: "inputs", Help: "补全", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(aaa.USER)
|
||||
m.Appendv(ice.MSG_APPEND, aaa.USERNAME, aaa.USERNICK)
|
||||
m.Cmdy("aaa.user")
|
||||
m.Appendv(ice.MSG_APPEND, aaa.USERNAME, aaa.USERZONE, aaa.USERNICK)
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Option(mdb.FIELDS, kit.Select("time,username", mdb.DETAIL, len(arg) > 0))
|
||||
@ -348,6 +348,7 @@ func init() {
|
||||
|
||||
"/river": {Name: "/river", Help: "小河流", Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
if m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin) {
|
||||
m.Render(web.STATUS, 401)
|
||||
return // 没有登录
|
||||
}
|
||||
if len(arg) == 0 {
|
||||
|
@ -27,19 +27,20 @@ var Index = &ice.Context{Name: MP, Help: "小程序",
|
||||
},
|
||||
Commands: map[string]*ice.Command{
|
||||
ice.CTX_INIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Load()
|
||||
m.Cmd(web.SPIDE, mdb.CREATE, WEIXIN, m.Conf(LOGIN, kit.Keys(kit.MDB_META, WEIXIN)))
|
||||
m.Load()
|
||||
}},
|
||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Save()
|
||||
}},
|
||||
|
||||
ACCESS: {Name: "access appid auto login", Help: "认证", Action: map[string]*ice.Action{
|
||||
LOGIN: {Name: "login appid appmm", Help: "登录", Hand: func(m *ice.Message, arg ...string) {
|
||||
m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPID), m.Option(APPID))
|
||||
m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPMM), m.Option(APPMM))
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Push(APPID, m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPID)))
|
||||
m.Echo(m.Conf(LOGIN, kit.Keys(kit.MDB_META, APPID)))
|
||||
}},
|
||||
|
||||
"/login/": {Name: "/login/", Help: "认证", Action: map[string]*ice.Action{
|
||||
@ -66,7 +67,6 @@ var Index = &ice.Context{Name: MP, Help: "小程序",
|
||||
m.Cmdy(chat.SCAN)
|
||||
}
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
}},
|
||||
},
|
||||
}
|
||||
|
@ -6,19 +6,18 @@ refer "" `
|
||||
源码 https://github.com/shylinux/icebergs/blob/master/misc/mp/mp.go
|
||||
`
|
||||
image qrcode `https://weixin.qq.com`
|
||||
spark
|
||||
|
||||
chapter "应用"
|
||||
field location web.chat.location
|
||||
field paste web.chat.paste
|
||||
field scan web.chat.scan
|
||||
field feel web.chat.feel
|
||||
field paste web.chat.paste
|
||||
field location web.chat.location
|
||||
|
||||
chapter "权限"
|
||||
field access web.chat.mp.access
|
||||
field share web.share
|
||||
field user aaa.user
|
||||
field sess aaa.sess
|
||||
|
||||
chapter "项目"
|
||||
field "icebergs" web.code.git.trend args `icebergs`
|
||||
field "icebergs" web.code.inner args `usr/icebergs/ misc/mp/mp.go 1`
|
||||
field "icebergs" web.code.inner args `usr/icebergs/ misc/mp/mp.go`
|
||||
|
@ -121,7 +121,9 @@ var Index = &ice.Context{Name: WX, Help: "公众号",
|
||||
m.Cmd(web.SPIDE, mdb.CREATE, WEIXIN, m.Conf(LOGIN, kit.Keys(kit.MDB_META, WEIXIN)))
|
||||
m.Load()
|
||||
}},
|
||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Save() }},
|
||||
ice.CTX_EXIT: {Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
m.Save()
|
||||
}},
|
||||
|
||||
ACCESS: {Name: "access appid auto ticket token login", Help: "认证", Action: map[string]*ice.Action{
|
||||
LOGIN: {Name: "login appid appmm token", Help: "登录", Hand: func(m *ice.Message, arg ...string) {
|
||||
|
@ -22,5 +22,5 @@ field sess aaa.sess
|
||||
|
||||
chapter "项目"
|
||||
field "icebergs" web.code.git.trend args `icebergs`
|
||||
field "icebergs" web.code.inner args `usr/icebergs/ misc/wx/wx.go 1`
|
||||
field "icebergs" web.code.inner args `usr/icebergs/ misc/wx/wx.go`
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user