mirror of
https://shylinux.com/x/icebergs
synced 2025-06-26 10:27:31 +08:00
opt share
This commit is contained in:
parent
771c8ebc9d
commit
cbd9c74357
@ -244,7 +244,7 @@ func (f *Frame) scan(m *ice.Message, h, line string, r io.Reader) *Frame {
|
||||
continue // 空行
|
||||
}
|
||||
|
||||
m.Cmdx(mdb.INSERT, SOURCE, kit.Keys(kit.MDB_HASH, h), mdb.LIST, kit.MDB_TEXT, bio.Text())
|
||||
// m.Cmdx(mdb.INSERT, SOURCE, kit.Keys(kit.MDB_HASH, h), mdb.LIST, kit.MDB_TEXT, bio.Text())
|
||||
f.count++
|
||||
|
||||
if len(bio.Text()) == 0 {
|
||||
|
@ -44,7 +44,7 @@ func _dream_show(m *ice.Message, name string) {
|
||||
|
||||
// 任务模板
|
||||
if m.Option("template") != "" {
|
||||
for _, file := range []string{"etc/miss.sh", "src/main.shy", "src/main.go", "go.mod"} {
|
||||
for _, file := range []string{"etc/miss.sh", "src/main.shy", "src/main.go", "go.mod", "Makefile"} {
|
||||
if _, e := os.Stat(path.Join(p, file)); os.IsNotExist(e) {
|
||||
switch m.Cmdy(nfs.COPY, path.Join(p, file), path.Join(m.Option("template"), file)); file {
|
||||
case "go.mod":
|
||||
|
@ -320,7 +320,6 @@ func init() {
|
||||
m.Optionv("content_data", data)
|
||||
|
||||
data = kit.KeyValue(map[string]interface{}{}, "", data)
|
||||
m.Debug("res: %s", kit.Formats(data))
|
||||
m.Push("", data)
|
||||
}
|
||||
})
|
||||
|
@ -110,12 +110,14 @@ func init() {
|
||||
}},
|
||||
}, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) {
|
||||
if arg[0] == "_share" {
|
||||
switch msg := m.Cmd(web.SHARE, arg[1]); msg.Append("type") {
|
||||
case "storm":
|
||||
m.Debug(msg.Format("meta"))
|
||||
arg[0] = msg.Append("river")
|
||||
arg[1] = msg.Append("storm")
|
||||
m.Option("title", msg.Append("name"))
|
||||
switch msg := m.Cmd(web.SHARE, arg[1]); msg.Append(kit.MDB_TYPE) {
|
||||
case STORM:
|
||||
m.Debug(msg.Format(kit.MDB_META))
|
||||
arg[0] = msg.Append(RIVER)
|
||||
arg[1] = msg.Append(STORM)
|
||||
m.Option(kit.MDB_TITLE, msg.Append(kit.MDB_NAME))
|
||||
default:
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if m.Warn(m.Option(ice.MSG_USERNAME) == "", ice.ErrNotLogin) {
|
||||
|
@ -12,16 +12,6 @@ import (
|
||||
)
|
||||
|
||||
func _river_list(m *ice.Message) {
|
||||
if m.Option(web.SHARE) != "" && m.Option(web.SHARE) != "" {
|
||||
m.Option(ice.MSG_RIVER, m.Option(RIVER))
|
||||
if m.Cmd(m.Prefix(AUTH), m.Option(web.SHARE)).Append(kit.MDB_TYPE) == USER {
|
||||
if m.Cmd(m.Prefix(USER), m.Option(ice.MSG_USERNAME)).Append(ice.MSG_USERNAME) == "" {
|
||||
m.Cmd(m.Prefix(USER), mdb.INSERT, aaa.USERNAME, m.Option(ice.MSG_USERNAME))
|
||||
// 加入群组
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m.Set(ice.MSG_OPTION, kit.MDB_HASH)
|
||||
m.Set(ice.MSG_OPTION, kit.MDB_NAME)
|
||||
|
||||
@ -31,6 +21,27 @@ func _river_list(m *ice.Message) {
|
||||
})
|
||||
})
|
||||
}
|
||||
func _river_share(m *ice.Message) {
|
||||
if m.Option(web.SHARE) == "" || m.Option(RIVER) == "" {
|
||||
return
|
||||
}
|
||||
|
||||
msg := m.Spawn()
|
||||
msg.Option(mdb.FIELDS, "type,name,text,river,storm")
|
||||
if res := msg.Cmd(web.SHARE, m.Option(web.SHARE)); res.Append(kit.MDB_TYPE) == RIVER {
|
||||
msg.Option(ice.MSG_RIVER, res.Append(RIVER))
|
||||
} else {
|
||||
if res := msg.Cmd(m.Prefix(AUTH), m.Option(web.SHARE)); res.Append(kit.MDB_TYPE) == USER {
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if msg.Cmd(m.Prefix(USER), m.Option(ice.MSG_USERNAME)).Append(aaa.USERNAME) == "" {
|
||||
msg.Cmd(m.Prefix(USER), mdb.INSERT, aaa.USERNAME, m.Option(ice.MSG_USERNAME))
|
||||
// 加入群组
|
||||
}
|
||||
}
|
||||
func _river_proxy(m *ice.Message, pod string) (proxy []string) {
|
||||
if p := kit.Select(m.Option(POD), pod); p != "" {
|
||||
proxy = append(proxy, web.SPACE, p)
|
||||
@ -321,6 +332,7 @@ func init() {
|
||||
return // 没有登录
|
||||
}
|
||||
if len(arg) == 0 {
|
||||
_river_share(m)
|
||||
_river_list(m)
|
||||
return // 群组列表
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user