From 2bc64f5784fbfcbbd20ca6a3a3e302dfcbc211ed Mon Sep 17 00:00:00 2001 From: shylinux Date: Sat, 22 Aug 2020 00:23:36 +0800 Subject: [PATCH] opt meet.miss --- core/chat/meet.go | 9 +++++---- core/wiki/feel.go | 12 ++++++++---- core/wiki/wiki.go | 1 + meta.go | 10 +++++----- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/core/chat/meet.go b/core/chat/meet.go index 4c2c27d8..255e8940 100644 --- a/core/chat/meet.go +++ b/core/chat/meet.go @@ -15,7 +15,7 @@ const ( DATE = "date" ) -var _miss_select = "time,name,性别,年龄,身高,籍贯,户口,学历,职业,公司,年薪,资产,家境,照片" +var _miss_select = "time,name,照片,性别,年龄,身高,籍贯,户口,学历,职业,公司,年薪,资产,家境" var _miss_insert = kit.List( "_input", "text", "name", "name", "_input", "text", "name", "性别", @@ -93,7 +93,7 @@ func init() { m.Push("照片", "") continue } - m.Push("照片", m.Cmdx(mdb.RENDER, web.RENDER.IMG, path.Join("/share/local", value["照片"]))) + m.Push("照片", m.Cmdx(mdb.RENDER, web.RENDER.IMG, path.Join("/share/local/usr/image/local/", m.Option(ice.MSG_DOMAIN), value["照片"]))) } else { m.Push(k, value[k]) } @@ -102,11 +102,12 @@ func init() { if m.Option(ice.MSG_USERUA) == "" { return } - m.PushAction("喜欢", "删除") + m.PushAction("喜欢", "约会") + m.Sort("time", "time_r") } else { msg.Table(func(index int, value map[string]string, head []string) { if value["key"] == "照片" { - value["value"] = m.Cmdx(mdb.RENDER, web.RENDER.IMG, path.Join("/share/local", value["value"]), "400") + value["value"] = m.Cmdx(mdb.RENDER, web.RENDER.IMG, path.Join("/share/local/usr/image/local/", m.Option(ice.MSG_DOMAIN), value["value"]), "640") } m.Push("key", value["key"]) m.Push("value", value["value"]) diff --git a/core/wiki/feel.go b/core/wiki/feel.go index f0a18034..37b1a550 100644 --- a/core/wiki/feel.go +++ b/core/wiki/feel.go @@ -20,7 +20,7 @@ func init() { )}, }, Commands: map[string]*ice.Command{ - FEEL: {Name: "feel path=auto auto 上传:button 上一页:button 下一页:button 参数:button", Help: "影音媒体", Meta: kit.Dict( + FEEL: {Name: "feel path=auto auto 上传:button 上一页:button 下一页:button 下载:button 参数:button", Help: "影音媒体", Meta: kit.Dict( "display", "/plugin/local/wiki/feel.js", "detail", []string{"标签", "删除"}, ), Action: map[string]*ice.Action{ mdb.CREATE: {Name: "create", Help: "创建", Hand: func(m *ice.Message, arg ...string) { @@ -34,6 +34,9 @@ func init() { m.Assert(os.Remove(path.Join(m.Conf(FEEL, "meta.path"), m.Option("path")))) }}, web.UPLOAD: {Name: "upload", Help: "上传", Hand: func(m *ice.Message, arg ...string) { + if m.Option(ice.MSG_DOMAIN) != "" { + m.Option("path", path.Join("local", m.Option(ice.MSG_DOMAIN), m.Option("path"))) + } _wiki_upload(m, FEEL) }}, web.SPIDE: {Name: "spide type title url poster", Help: "爬虫", Hand: func(m *ice.Message, arg ...string) { @@ -45,9 +48,10 @@ func init() { }}, }, Hand: func(m *ice.Message, c *ice.Context, cmd string, arg ...string) { m.Option("prefix", m.Conf(FEEL, "meta.path")) - if !_wiki_list(m, FEEL, kit.Select("./", arg, 0)) { - m.Echo(path.Join(m.Conf(FEEL, "meta.path"), arg[0])) - return + if m.Option(ice.MSG_DOMAIN) == "" { + _wiki_list(m, FEEL, path.Join(kit.Select("", arg, 0))+"/") + } else { + _wiki_list(m, FEEL, path.Join("local", m.Option(ice.MSG_DOMAIN), kit.Select("", arg, 0))+"/") } m.Sort("time", "time_r") }}, diff --git a/core/wiki/wiki.go b/core/wiki/wiki.go index 71151e1c..306d1b67 100644 --- a/core/wiki/wiki.go +++ b/core/wiki/wiki.go @@ -13,6 +13,7 @@ import ( ) func _wiki_list(m *ice.Message, cmd, name string, arg ...string) bool { + m.Debug(name) if strings.HasSuffix(name, "/") { m.Option(nfs.DIR_ROOT, m.Conf(cmd, "meta.path")) m.Option(nfs.DIR_TYPE, nfs.TYPE_DIR) diff --git a/meta.go b/meta.go index c35b154f..8082cf2a 100644 --- a/meta.go +++ b/meta.go @@ -187,19 +187,19 @@ func (m *Message) Sort(key string, arg ...string) *Message { } // 排序因子 - number := map[int]int{} + number := map[int]int64{} table := []map[string]string{} m.Table(func(index int, line map[string]string, head []string) { table = append(table, line) switch cmp { case "int": - number[index] = kit.Int(line[key]) + number[index] = kit.Int64(line[key]) case "int_r": - number[index] = -kit.Int(line[key]) + number[index] = -kit.Int64(line[key]) case "time": - number[index] = int(kit.Time(line[key])) + number[index] = int64(kit.Time(line[key])) case "time_r": - number[index] = -int(kit.Time(line[key])) + number[index] = -int64(kit.Time(line[key])) } })