mirror of
https://shylinux.com/x/community
synced 2025-07-02 05:31:20 +08:00
add some
This commit is contained in:
parent
0979482309
commit
15bc07af13
@ -441,7 +441,7 @@ func (s Portal) SendTemplate(m *ice.Message, arg ...string) {
|
|||||||
s.AutoCmd(m, user{}, s.SendTemplate, arg[1], arg[2], link, kit.JoinWord(m.Option(model.PORTAL_NAME), arg[3]), name, kit.Cut(uid, 6))
|
s.AutoCmd(m, user{}, s.SendTemplate, arg[1], arg[2], link, kit.JoinWord(m.Option(model.PORTAL_NAME), arg[3]), name, kit.Cut(uid, 6))
|
||||||
}
|
}
|
||||||
func (s Table) Button(m *ice.Message, info string, arg ...ice.Any) *ice.Message {
|
func (s Table) Button(m *ice.Message, info string, arg ...ice.Any) *ice.Message {
|
||||||
kit.If(!m.IsErr() && m.Length() == 0, func() { m.Options(ctx.STYLE, html.FORM).EchoInfoButton(info, arg...).Action() })
|
kit.If(!m.IsErr() && m.Length() == 0, func() { m.Options(ctx.STYLE, html.FORM).EchoInfoButton(info, arg...).Action() }, func() { m.Action(arg...) })
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
func (s Table) DisplayBase(m *ice.Message, file string) *ice.Message {
|
func (s Table) DisplayBase(m *ice.Message, file string) *ice.Message {
|
||||||
|
@ -15,6 +15,7 @@ const (
|
|||||||
BACKGROUND = "background"
|
BACKGROUND = "background"
|
||||||
CREATED_AT = "created_at"
|
CREATED_AT = "created_at"
|
||||||
UPDATED_AT = "updated_at"
|
UPDATED_AT = "updated_at"
|
||||||
|
DELETED_AT = "deleted_at"
|
||||||
USER_UID = "user_uid"
|
USER_UID = "user_uid"
|
||||||
USER_NAME = "user_name"
|
USER_NAME = "user_name"
|
||||||
USER_INFO = "user_info"
|
USER_INFO = "user_info"
|
||||||
@ -119,6 +120,7 @@ const (
|
|||||||
PAYMENTLIST_UID = "paymentlist_uid"
|
PAYMENTLIST_UID = "paymentlist_uid"
|
||||||
SPENDLIST_UID = "spendlist_uid"
|
SPENDLIST_UID = "spendlist_uid"
|
||||||
SPACE_ID = "space_id"
|
SPACE_ID = "space_id"
|
||||||
|
SIZE = "size"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Sess struct {
|
type Sess struct {
|
||||||
|
@ -13,6 +13,7 @@ type photo struct {
|
|||||||
auth string `data:"issued"`
|
auth string `data:"issued"`
|
||||||
fields string `data:"space_id,access_token,expire_time,vendor"`
|
fields string `data:"space_id,access_token,expire_time,vendor"`
|
||||||
upload string `name:"upload" role:"worker"`
|
upload string `name:"upload" role:"worker"`
|
||||||
|
rename string `name:"rename newname" role:"worker"`
|
||||||
trash string `name:"trash" role:"worker"`
|
trash string `name:"trash" role:"worker"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,21 +22,24 @@ func (s photo) Config(m *ice.Message, arg ...string) {
|
|||||||
}
|
}
|
||||||
func (s photo) List(m *ice.Message, arg ...string) {
|
func (s photo) List(m *ice.Message, arg ...string) {
|
||||||
s.cmdy(m, PhotoVendor.Folder, kit.Slice(arg, 1)...)
|
s.cmdy(m, PhotoVendor.Folder, kit.Slice(arg, 1)...)
|
||||||
m.PushAction(s.Trash).Display("")
|
m.PushAction(s.Rename, s.Trash).Display("")
|
||||||
if len(arg) == 1 {
|
if len(arg) == 1 {
|
||||||
s.Button(m, "请上传文件", s.Upload)
|
s.Button(m, "请上传文件", s.Upload)
|
||||||
s.SpendlistCheck(m, 0)
|
s.SpendlistCheck(m, 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (s photo) Upload(m *ice.Message, arg ...string) {
|
func (s photo) Upload(m *ice.Message, arg ...string) {
|
||||||
up := kit.Simple(m.Optionv(ice.MSG_UPLOAD))
|
if up := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); s.SpendlistCheck(m, kit.Int(up[2])) {
|
||||||
if s.SpendlistCheck(m, kit.Int(up[2])) {
|
|
||||||
s.cmdy(m, "")
|
s.cmdy(m, "")
|
||||||
|
s.SpendlistUpdate(m, m.Append(model.SIZE))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
func (s photo) Rename(m *ice.Message, arg ...string) {
|
||||||
|
s.cmdy(m, "")
|
||||||
|
}
|
||||||
func (s photo) Trash(m *ice.Message, arg ...string) {
|
func (s photo) Trash(m *ice.Message, arg ...string) {
|
||||||
s.cmdy(m, "")
|
s.cmdy(m, "")
|
||||||
s.SpendlistUpdate(m, m.Append("size"))
|
s.SpendlistUpdate(m, m.Append(model.SIZE))
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(photo{Table: newTable()}) }
|
func init() { ice.TeamCtxCmd(photo{Table: newTable()}) }
|
||||||
@ -56,6 +60,7 @@ func (s photo) cmdy(m *ice.Message, action ice.Any, arg ...string) {
|
|||||||
var PhotoVendor interface {
|
var PhotoVendor interface {
|
||||||
Folder(m *ice.Message, arg ...string)
|
Folder(m *ice.Message, arg ...string)
|
||||||
Upload(m *ice.Message, arg ...string)
|
Upload(m *ice.Message, arg ...string)
|
||||||
|
Rename(m *ice.Message, arg ...string)
|
||||||
Trash(m *ice.Message, arg ...string)
|
Trash(m *ice.Message, arg ...string)
|
||||||
Token(m *ice.Message, arg ...string)
|
Token(m *ice.Message, arg ...string)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package gonganxitong
|
package gonganxitong
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
|
|
||||||
"shylinux.com/x/ice"
|
"shylinux.com/x/ice"
|
||||||
"shylinux.com/x/icebergs/base/aaa"
|
"shylinux.com/x/icebergs/base/aaa"
|
||||||
"shylinux.com/x/icebergs/base/ctx"
|
"shylinux.com/x/icebergs/base/ctx"
|
||||||
@ -197,6 +199,45 @@ func (s Portal) PlaceRemove(m *ice.Message, arg ...string) {
|
|||||||
m.Cmd("", s.BeforePlaceRemove, m.OptionSimple(model.USER_UID, model.UID))
|
m.Cmd("", s.BeforePlaceRemove, m.OptionSimple(model.USER_UID, model.UID))
|
||||||
m.Cmdy(s.UserPlace, s.Delete, m.OptionSimple(model.USER_UID, model.UID))
|
m.Cmdy(s.UserPlace, s.Delete, m.OptionSimple(model.USER_UID, model.UID))
|
||||||
}
|
}
|
||||||
|
func (s Portal) PlaceCheck(m *ice.Message, arg ...string) {
|
||||||
|
s.Tables(m, kit.Format("LEFT JOIN %s ON %s = %s and %s IS NULL",
|
||||||
|
s.TableNames(s.UserPlace),
|
||||||
|
s.Key(s.UserPlace, s.Keys(s.Place, model.UID)),
|
||||||
|
s.Key(s.Place, model.UID),
|
||||||
|
s.Key(s.UserPlace, model.DELETED_AT),
|
||||||
|
)).Fields(m,
|
||||||
|
s.Key(s.Place, model.UID),
|
||||||
|
s.Key(s.Place, model.NAME),
|
||||||
|
s.Key(s.Place, model.INFO),
|
||||||
|
s.Key(s.Place, model.AUTH_UID),
|
||||||
|
)
|
||||||
|
m.Cmdy(s.Place, s.Table.Select, kit.Format("%s IS NULL", model.USER_UID))
|
||||||
|
m.PushAction(s.PlaceTrash)
|
||||||
|
}
|
||||||
|
func (s Portal) PlaceTrash(m *ice.Message, arg ...string) {
|
||||||
|
for key, _ := range m.Target().Commands {
|
||||||
|
if strings.HasPrefix(key, "_") {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if key == m.CommandKey() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if key == "portal" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
m.Cmd(key, s.PlaceTrash)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
func (s Table) PlaceTrash(m *ice.Message, arg ...string) {
|
||||||
|
m.Push("key", m.PrefixKey())
|
||||||
|
if s.Place == nil {
|
||||||
|
m.Push("table", "")
|
||||||
|
m.Push("place_uid", "")
|
||||||
|
} else {
|
||||||
|
m.Push("table", s.TableNames(s.Place))
|
||||||
|
m.Push("place_uid", s.Keys(s.Place, model.UID))
|
||||||
|
}
|
||||||
|
}
|
||||||
func (s Portal) PlaceList(m *ice.Message, arg ...string) *ice.Message {
|
func (s Portal) PlaceList(m *ice.Message, arg ...string) *ice.Message {
|
||||||
s.Tables(m, s.Place).FieldsWithCreatedAT(m, s.UserPlace, s.Keys(s.Place, model.UID),
|
s.Tables(m, s.Place).FieldsWithCreatedAT(m, s.UserPlace, s.Keys(s.Place, model.UID),
|
||||||
s.Keys(s.Place, model.NAME), s.Keys(s.Place, model.TYPE), s.Keys(s.UserPlace, model.ROLE),
|
s.Keys(s.Place, model.NAME), s.Keys(s.Place, model.TYPE), s.Keys(s.UserPlace, model.ROLE),
|
||||||
|
@ -9,15 +9,16 @@ import (
|
|||||||
|
|
||||||
type setting struct {
|
type setting struct {
|
||||||
Table
|
Table
|
||||||
recent recent
|
recent recent
|
||||||
service service
|
service service
|
||||||
order string `data:"103"`
|
order string `data:"103"`
|
||||||
role string `data:"leader,worker,server"`
|
role string `data:"leader,worker,server"`
|
||||||
short string `data:"name"`
|
short string `data:"name"`
|
||||||
field string `data:"name,type,help"`
|
field string `data:"name,type,help"`
|
||||||
fields string `data:"name,value"`
|
fields string `data:"name,value"`
|
||||||
create string `name:"create name* type* help" role:"tech"`
|
create string `name:"create name* type* help" role:"tech"`
|
||||||
update string `name:"update" role:"void"`
|
update string `name:"update" role:"void"`
|
||||||
|
placeTrash string `name:"placeTrash" help:"删除数据" style:"danger" role:"leader"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s setting) Init(m *ice.Message, arg ...string) {
|
func (s setting) Init(m *ice.Message, arg ...string) {
|
||||||
@ -41,11 +42,17 @@ func (s setting) List(m *ice.Message, arg ...string) {
|
|||||||
msg := s.Select(m.Spawn(), model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID))
|
msg := s.Select(m.Spawn(), model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID))
|
||||||
msg.Table(func(value ice.Maps) { data[value[model.NAME]] = value[model.VALUE] })
|
msg.Table(func(value ice.Maps) { data[value[model.NAME]] = value[model.VALUE] })
|
||||||
s.Hash.List(m).Table(func(value ice.Maps) { m.Push(model.VALUE, data[value[model.NAME]]) }).Action()
|
s.Hash.List(m).Table(func(value ice.Maps) { m.Push(model.VALUE, data[value[model.NAME]]) }).Action()
|
||||||
|
m.Action(s.PlaceTrash)
|
||||||
} else if len(arg) == 2 {
|
} else if len(arg) == 2 {
|
||||||
s.SelectDetail(m, model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID), model.NAME, arg[1])
|
s.SelectDetail(m, model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID), model.NAME, arg[1])
|
||||||
}
|
}
|
||||||
s.DisplayBase(m, "").DisplayCSS("")
|
s.DisplayBase(m, "").DisplayCSS("")
|
||||||
}
|
}
|
||||||
|
func (s setting) PlaceTrash(m *ice.Message, arg ...string) {
|
||||||
|
// m.Cmdy(s.UserPlace, s.Select, model.PLACE_UID, m.Option(model.PLACE_UID))
|
||||||
|
m.Cmdy(s.Place, s.Select, model.UID, m.Option(model.PLACE_UID))
|
||||||
|
m.DisplayTable()
|
||||||
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(setting{Table: newTable()}) }
|
func init() { ice.TeamCtxCmd(setting{Table: newTable()}) }
|
||||||
|
|
||||||
|
@ -3,4 +3,5 @@ $output fieldset.story>form.option>div.item.text { display:none; }
|
|||||||
$output fieldset.story>form.option>div.item.icon.delete { display:none; }
|
$output fieldset.story>form.option>div.item.icon.delete { display:none; }
|
||||||
$output fieldset.story>div.output>div.item>div.output div.title>div.action { display:none; }
|
$output fieldset.story>div.output>div.item>div.output div.title>div.action { display:none; }
|
||||||
$output fieldset.story>div.status { display:none; }
|
$output fieldset.story>div.status { display:none; }
|
||||||
|
$output fieldset.story>div.output>div.code { display:flex; flex-direction:column; align-items:center; }
|
||||||
$output>div.project div.list { padding-left:10px; margin-left:20px; clear:both; }
|
$output>div.project div.list { padding-left:10px; margin-left:20px; clear:both; }
|
@ -17,7 +17,7 @@ type admin struct {
|
|||||||
|
|
||||||
func (s admin) List(m *ice.Message, arg ...string) {
|
func (s admin) List(m *ice.Message, arg ...string) {
|
||||||
if m.Option("view") == "admin" {
|
if m.Option("view") == "admin" {
|
||||||
m.Cmdy(s.auth, arg[0]).Cut(model.SERVICE_UID, model.PLACE_UID)
|
m.Cmdy(s.auth, s.Select, model.FROM_UID, arg[0], model.STATUS, AuthIssued).Cut(model.SERVICE_UID, model.PLACE_UID)
|
||||||
s.SelectJoinRecent(m, "")
|
s.SelectJoinRecent(m, "")
|
||||||
s.SelectJoinService(m)
|
s.SelectJoinService(m)
|
||||||
m.Display("").DisplayCSS("").Sort("service_name,place_name")
|
m.Display("").DisplayCSS("").Sort("service_name,place_name")
|
||||||
|
@ -19,6 +19,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
index: function(can, msg, value, target) {
|
index: function(can, msg, value, target) {
|
||||||
can.onimport.itemlist(can, msg.Table(function(item) {
|
can.onimport.itemlist(can, msg.Table(function(item) {
|
||||||
item._hash = [value.service_name.split(" ")[0], item.name], item.__title = item.name
|
item._hash = [value.service_name.split(" ")[0], item.name], item.__title = item.name
|
||||||
|
if (item.enable == "false" || can.base.isIn(item.index, "web.team.gonganxitong.credit", "web.team.gonganxitong.setting") || item.order > 500) { return }
|
||||||
return item
|
return item
|
||||||
}), function(event, item, show, target) {
|
}), function(event, item, show, target) {
|
||||||
if (show) { return }
|
if (show) { return }
|
||||||
|
@ -19,6 +19,9 @@ type Auth struct {
|
|||||||
revoke string `name:"revoke" role:"leader,worker"`
|
revoke string `name:"revoke" role:"leader,worker"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s Auth) Remove(m *ice.Message, arg ...string) {
|
||||||
|
s.Delete(m)
|
||||||
|
}
|
||||||
func (s Auth) List(m *ice.Message, arg ...string) {
|
func (s Auth) List(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 1 {
|
if len(arg) == 1 {
|
||||||
s.Select(m, model.FROM_UID, arg[0]).Action()
|
s.Select(m, model.FROM_UID, arg[0]).Action()
|
||||||
@ -31,11 +34,11 @@ func (s Auth) List(m *ice.Message, arg ...string) {
|
|||||||
m.Table(func(value ice.Maps) {
|
m.Table(func(value ice.Maps) {
|
||||||
switch AuthStatus(kit.Int(value[model.AUTH_STATUS])) {
|
switch AuthStatus(kit.Int(value[model.AUTH_STATUS])) {
|
||||||
case AuthCreate:
|
case AuthCreate:
|
||||||
m.PushButton(s.Issue)
|
m.PushButton(s.Issue, s.Remove)
|
||||||
case AuthIssued:
|
case AuthIssued:
|
||||||
m.PushButton(s.Revoke)
|
m.PushButton(s.Revoke)
|
||||||
case AuthRevoked:
|
case AuthRevoked:
|
||||||
m.PushButton(s.Issue)
|
m.PushButton(s.Issue, s.Remove)
|
||||||
default:
|
default:
|
||||||
m.PushButton()
|
m.PushButton()
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,10 @@ func (s Table) AuthList(m *ice.Message, auth_uid string, cb func(value ice.Maps,
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
func (s Table) authSort(m *ice.Message, arg ...string) {
|
||||||
|
s.RewriteAppend(m)
|
||||||
|
m.Sort("auth_status,auth_type,created_at", []string{"issued"}, []string{"personal", "root", "city", "street", "school", "company", "service"}, ice.STR_R)
|
||||||
|
}
|
||||||
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||||
m.RewriteAppend(func(value, key string, index int) string {
|
m.RewriteAppend(func(value, key string, index int) string {
|
||||||
if _, e := strconv.ParseInt(value, 10, 64); e != nil {
|
if _, e := strconv.ParseInt(value, 10, 64); e != nil {
|
||||||
|
@ -31,6 +31,7 @@ type smh struct {
|
|||||||
libraryRemove string `name:"libraryRemove" role:"worker"`
|
libraryRemove string `name:"libraryRemove" role:"worker"`
|
||||||
spaceCreate string `name:"spaceCreate" role:"worker"`
|
spaceCreate string `name:"spaceCreate" role:"worker"`
|
||||||
spaceRemove string `name:"spaceRemove" role:"worker"`
|
spaceRemove string `name:"spaceRemove" role:"worker"`
|
||||||
|
rename string `name:"rename"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s smh) Init(m *ice.Message, arg ...string) {
|
func (s smh) Init(m *ice.Message, arg ...string) {
|
||||||
@ -150,12 +151,21 @@ func (s smh) Upload(m *ice.Message, arg ...string) {
|
|||||||
}
|
}
|
||||||
s.spide(m, http.MethodPost, kit.MergeURL(kit.Format("file/%s/%s/%s", msg.Append(model.LIBRARY_ID), arg[1], kit.Value(res, "confirmKey")),
|
s.spide(m, http.MethodPost, kit.MergeURL(kit.Format("file/%s/%s/%s", msg.Append(model.LIBRARY_ID), arg[1], kit.Value(res, "confirmKey")),
|
||||||
"confirm", "confirm", "conflict_resolution_strategy", "rename", msg.AppendSimple(model.ACCESS_TOKEN)))
|
"confirm", "confirm", "conflict_resolution_strategy", "rename", msg.AppendSimple(model.ACCESS_TOKEN)))
|
||||||
|
s.spaceSize(m, msg, arg...)
|
||||||
|
}
|
||||||
|
func (s smh) spaceSize(m, msg *ice.Message, arg ...string) {
|
||||||
|
s.spide(m, http.MethodGet, kit.MergeURL(kit.Format("space/%s/%s/size", msg.Append(model.LIBRARY_ID), arg[1]), msg.AppendSimple(model.ACCESS_TOKEN)))
|
||||||
|
m.Push("size", kit.Value(kit.UnMarshal(m.Result()), "size"))
|
||||||
|
}
|
||||||
|
func (s smh) Rename(m *ice.Message, arg ...string) {
|
||||||
|
msg := s.token(m)
|
||||||
|
m.Info("what %v", m.FormatChain())
|
||||||
|
s.spide(m, http.MethodPut, kit.MergeURL(kit.Format("file/%s/%s/%s", msg.Append(model.LIBRARY_ID), arg[1], m.Option("newname")), msg.AppendSimple(model.ACCESS_TOKEN)), "from", m.Option(model.NAME))
|
||||||
}
|
}
|
||||||
func (s smh) Trash(m *ice.Message, arg ...string) {
|
func (s smh) Trash(m *ice.Message, arg ...string) {
|
||||||
msg := s.token(m)
|
msg := s.token(m)
|
||||||
s.spide(m, http.MethodDelete, kit.MergeURL(kit.Format("file/%s/%s/%s", msg.Append(model.LIBRARY_ID), arg[1], m.Option(model.NAME)), msg.AppendSimple(model.ACCESS_TOKEN)))
|
s.spide(m, http.MethodDelete, kit.MergeURL(kit.Format("file/%s/%s/%s", msg.Append(model.LIBRARY_ID), arg[1], m.Option(model.NAME)), msg.AppendSimple(model.ACCESS_TOKEN)))
|
||||||
s.spide(m, http.MethodGet, kit.MergeURL(kit.Format("space/%s/%s/size", msg.Append(model.LIBRARY_ID), arg[1]), msg.AppendSimple(model.ACCESS_TOKEN)))
|
s.spaceSize(m, msg, arg...)
|
||||||
m.Push("size", kit.Value(kit.UnMarshal(m.Result()), "size"))
|
|
||||||
}
|
}
|
||||||
func (s smh) Token(m *ice.Message, arg ...string) {
|
func (s smh) Token(m *ice.Message, arg ...string) {
|
||||||
if arg[1] == "" || arg[2] < m.Time() {
|
if arg[1] == "" || arg[2] < m.Time() {
|
||||||
|
@ -3,6 +3,7 @@ package model
|
|||||||
import "shylinux.com/x/mysql-story/src/db"
|
import "shylinux.com/x/mysql-story/src/db"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
UID = "uid"
|
||||||
NAME = "name"
|
NAME = "name"
|
||||||
LINK = "link"
|
LINK = "link"
|
||||||
VENDOR = "vendor"
|
VENDOR = "vendor"
|
||||||
@ -17,6 +18,7 @@ const (
|
|||||||
REFRESH_TOKEN = "refresh_token"
|
REFRESH_TOKEN = "refresh_token"
|
||||||
EXPIRED_TIME = "expired_time"
|
EXPIRED_TIME = "expired_time"
|
||||||
FOLDER_ID = "folder_id"
|
FOLDER_ID = "folder_id"
|
||||||
|
DOCUMENT_UID = "document_uid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Tencentdocument struct {
|
type Tencentdocument struct {
|
||||||
|
@ -7,7 +7,6 @@ import (
|
|||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
|
|
||||||
"shylinux.com/x/community/src/api"
|
|
||||||
"shylinux.com/x/community/src/gonganxitong"
|
"shylinux.com/x/community/src/gonganxitong"
|
||||||
"shylinux.com/x/community/src/renzhengshouquan"
|
"shylinux.com/x/community/src/renzhengshouquan"
|
||||||
"shylinux.com/x/community/src/renzhengshouquan/external/tencentdocument/model"
|
"shylinux.com/x/community/src/renzhengshouquan/external/tencentdocument/model"
|
||||||
@ -21,7 +20,8 @@ type tencentdocument struct {
|
|||||||
fields string `data:"user_id,access_token,expired_time,user_uid"`
|
fields string `data:"user_id,access_token,expired_time,user_uid"`
|
||||||
auth string `name:"auth" help:"授权" role:"worker"`
|
auth string `name:"auth" help:"授权" role:"worker"`
|
||||||
remove string `name:"remove" role:"worker"`
|
remove string `name:"remove" role:"worker"`
|
||||||
config string `name:"config folder_id*:select" style:"notice" role:"worker"`
|
folderBind string `name:"folderBind folder_id*:select" help:"绑定" style:"notice" role:"worker"`
|
||||||
|
folderUnbind string `name:"folderUnbind" help:"解绑" style:"danger" role:"worker"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s tencentdocument) Inputs(m *ice.Message, arg ...string) {
|
func (s tencentdocument) Inputs(m *ice.Message, arg ...string) {
|
||||||
@ -39,15 +39,25 @@ func (s tencentdocument) List(m *ice.Message, arg ...string) {
|
|||||||
} else if len(arg) == 2 {
|
} else if len(arg) == 2 {
|
||||||
s.AuthList(m, arg[0], func(value ice.Maps, auth bool) {
|
s.AuthList(m, arg[0], func(value ice.Maps, auth bool) {
|
||||||
if auth {
|
if auth {
|
||||||
m.PushButton(s.Config)
|
msg := s.cmdy(m.Spawn(), s.Select, model.PLACE_UID, value[model.PLACE_UID])
|
||||||
|
if msg.Append(model.FOLDER_ID) == "" {
|
||||||
|
m.Push(model.FOLDER_ID, "").Push(model.DOCUMENT_UID, "").PushButton(s.FolderBind)
|
||||||
|
} else {
|
||||||
|
m.Push(model.FOLDER_ID, msg.Append(model.FOLDER_ID))
|
||||||
|
m.Push(model.DOCUMENT_UID, msg.Append(model.UID))
|
||||||
|
m.PushButton(s.FolderUnbind)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
m.PushButton()
|
m.Push(model.FOLDER_ID, "").Push(model.DOCUMENT_UID, "").PushButton()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (s tencentdocument) Config(m *ice.Message, arg ...string) {
|
func (s tencentdocument) FolderBind(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(api.GONGANXITONG_DOCUMENT, s.Config, m.OptionSimple(model.PLACE_UID, model.USER_UID, model.FOLDER_ID), model.VENDOR, m.PrefixKey())
|
s.cmdy(m, s.Config, m.OptionSimple(model.PLACE_UID, model.USER_UID, model.FOLDER_ID), model.VENDOR, m.PrefixKey())
|
||||||
|
}
|
||||||
|
func (s tencentdocument) FolderUnbind(m *ice.Message, arg ...string) {
|
||||||
|
s.cmdy(m.Options(model.UID, m.Option(model.DOCUMENT_UID)), s.Delete)
|
||||||
}
|
}
|
||||||
func (s tencentdocument) Folder(m *ice.Message, arg ...string) *ice.Message {
|
func (s tencentdocument) Folder(m *ice.Message, arg ...string) *ice.Message {
|
||||||
msg := s.Select(m.Spawn(), model.AUTH_UID, arg[0])
|
msg := s.Select(m.Spawn(), model.AUTH_UID, arg[0])
|
||||||
@ -96,3 +106,7 @@ func (s tencentdocument) Auth(m *ice.Message, arg ...string) {
|
|||||||
func init() { ice.TeamCtxCmd(tencentdocument{}) }
|
func init() { ice.TeamCtxCmd(tencentdocument{}) }
|
||||||
|
|
||||||
func init() { gonganxitong.DocumentVendor = tencentdocument{} }
|
func init() { gonganxitong.DocumentVendor = tencentdocument{} }
|
||||||
|
|
||||||
|
func (s tencentdocument) cmdy(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||||
|
return m.Cmdy(append([]ice.Any{"web.team.gonganxitong.document"}, arg...)...)
|
||||||
|
}
|
||||||
|
@ -12,6 +12,7 @@ const (
|
|||||||
AUTH_UID = "auth_uid"
|
AUTH_UID = "auth_uid"
|
||||||
AUTH_STATUS = "auth_status"
|
AUTH_STATUS = "auth_status"
|
||||||
USER_ID = "user_id"
|
USER_ID = "user_id"
|
||||||
|
MEETING_UID = "meeting_uid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Tencentmeeting struct {
|
type Tencentmeeting struct {
|
||||||
|
@ -15,7 +15,6 @@ import (
|
|||||||
"shylinux.com/x/icebergs/base/web"
|
"shylinux.com/x/icebergs/base/web"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
|
|
||||||
"shylinux.com/x/community/src/api"
|
|
||||||
"shylinux.com/x/community/src/gonganxitong"
|
"shylinux.com/x/community/src/gonganxitong"
|
||||||
"shylinux.com/x/community/src/renzhengshouquan"
|
"shylinux.com/x/community/src/renzhengshouquan"
|
||||||
"shylinux.com/x/community/src/renzhengshouquan/external/tencentmeeting/model"
|
"shylinux.com/x/community/src/renzhengshouquan/external/tencentmeeting/model"
|
||||||
@ -23,12 +22,13 @@ import (
|
|||||||
|
|
||||||
type tencentmeeting struct {
|
type tencentmeeting struct {
|
||||||
renzhengshouquan.Table
|
renzhengshouquan.Table
|
||||||
order string `data:"12"`
|
order string `data:"12"`
|
||||||
fields string `data:"app_id,sdk_id,secret_id,secret_key,user_id,user_uid"`
|
fields string `data:"app_id,sdk_id,secret_id,secret_key,user_id,user_uid"`
|
||||||
create string `name:"create app_id* sdk_id* secret_id* secret_key* user_id*" role:"worker"`
|
create string `name:"create app_id* sdk_id* secret_id* secret_key* user_id*" role:"worker"`
|
||||||
remove string `name:"remove" role:"worker"`
|
remove string `name:"remove" role:"worker"`
|
||||||
list string `name:"list auth_uid uid auto" role:"worker"`
|
list string `name:"list auth_uid uid auto" role:"worker"`
|
||||||
config string `name:"config user_id:select" style:"notice" role:"worker"`
|
userBind string `name:"folderBind user_id*:select" help:"绑定" style:"notice" role:"worker"`
|
||||||
|
userUnbind string `name:"folderUnbind" help:"解绑" style:"danger" role:"worker"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s tencentmeeting) Inputs(m *ice.Message, arg ...string) {
|
func (s tencentmeeting) Inputs(m *ice.Message, arg ...string) {
|
||||||
@ -44,15 +44,25 @@ func (s tencentmeeting) List(m *ice.Message, arg ...string) {
|
|||||||
} else if len(arg) == 2 {
|
} else if len(arg) == 2 {
|
||||||
s.AuthList(m, arg[0], func(value ice.Maps, auth bool) {
|
s.AuthList(m, arg[0], func(value ice.Maps, auth bool) {
|
||||||
if auth {
|
if auth {
|
||||||
m.PushButton(s.Config)
|
msg := s.cmdy(m.Spawn(), s.Select, model.PLACE_UID, value[model.PLACE_UID])
|
||||||
|
if msg.Append(model.USER_ID) == "" {
|
||||||
|
m.Push(model.USER_ID, "").Push(model.MEETING_UID, "").PushButton(s.UserBind)
|
||||||
|
} else {
|
||||||
|
m.Push(model.USER_ID, msg.Append(model.USER_ID))
|
||||||
|
m.Push(model.MEETING_UID, msg.Append(model.UID))
|
||||||
|
m.PushButton(s.UserUnbind)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
m.PushButton()
|
m.Push(model.USER_ID, "").Push(model.MEETING_UID, "").PushButton()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (s tencentmeeting) Config(m *ice.Message, arg ...string) {
|
func (s tencentmeeting) UserBind(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy(api.GONGANXITONG_MEETING, s.Config, m.OptionSimple(model.PLACE_UID, model.USER_UID, model.USER_ID), model.VENDOR, m.PrefixKey())
|
s.cmdy(m, s.Config, m.OptionSimple(model.PLACE_UID, model.USER_UID, model.USER_ID), model.VENDOR, m.PrefixKey())
|
||||||
|
}
|
||||||
|
func (s tencentmeeting) UserUnbind(m *ice.Message, arg ...string) {
|
||||||
|
s.cmdy(m.Options(model.UID, m.Option(model.MEETING_UID)), s.Delete)
|
||||||
}
|
}
|
||||||
func (s tencentmeeting) UserList(m *ice.Message, arg ...string) *ice.Message {
|
func (s tencentmeeting) UserList(m *ice.Message, arg ...string) *ice.Message {
|
||||||
s.spide(m, "", "users/list", "operator_id", "$user_id", "operator_id_type", "1", "page", "1", "page_size", "10")
|
s.spide(m, "", "users/list", "operator_id", "$user_id", "operator_id_type", "1", "page", "1", "page_size", "10")
|
||||||
@ -100,6 +110,9 @@ func init() { ice.TeamCtxCmd(tencentmeeting{}) }
|
|||||||
|
|
||||||
func init() { gonganxitong.MeetingVendor = tencentmeeting{} }
|
func init() { gonganxitong.MeetingVendor = tencentmeeting{} }
|
||||||
|
|
||||||
|
func (s tencentmeeting) cmdy(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||||
|
return m.Cmdy(append([]ice.Any{"web.team.gonganxitong.meeting"}, arg...)...)
|
||||||
|
}
|
||||||
func (s tencentmeeting) spide(m *ice.Message, method, api string, arg ...ice.Any) *ice.Message {
|
func (s tencentmeeting) spide(m *ice.Message, method, api string, arg ...ice.Any) *ice.Message {
|
||||||
msg := s.Select(m.Spawn(), m.OptionSimple(model.AUTH_UID)...)
|
msg := s.Select(m.Spawn(), m.OptionSimple(model.AUTH_UID)...)
|
||||||
if msg.Length() == 0 {
|
if msg.Length() == 0 {
|
||||||
|
@ -113,10 +113,6 @@ func (s profile) Enter(m *ice.Message, arg ...string) {}
|
|||||||
|
|
||||||
func init() { ice.TeamCtxCmd(profile{}) }
|
func init() { ice.TeamCtxCmd(profile{}) }
|
||||||
|
|
||||||
func (s Table) authSort(m *ice.Message, arg ...string) {
|
|
||||||
s.RewriteAppend(m)
|
|
||||||
m.Sort("auth_status,auth_type,created_at", []string{"issued"}, []string{"personal", "root", "city", "street", "school", "company", "service"}, ice.STR_R)
|
|
||||||
}
|
|
||||||
func (s profile) settingProfile(m *ice.Message, arg ...string) *ice.Message {
|
func (s profile) settingProfile(m *ice.Message, arg ...string) *ice.Message {
|
||||||
return s.SettingCmdy(m, s.Select, arg, model.NAME, "profile", model.VALUE, "on")
|
return s.SettingCmdy(m, s.Select, arg, model.NAME, "profile", model.VALUE, "on")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user