mirror of
https://shylinux.com/x/community
synced 2025-07-03 05:51:20 +08:00
48 lines
1.3 KiB
Go
48 lines
1.3 KiB
Go
package gonganxitong
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
|
|
"shylinux.com/x/community/src/gonganxitong/model"
|
|
)
|
|
|
|
type document struct {
|
|
Table
|
|
order string `data:"94"`
|
|
auth string `data:"issued"`
|
|
role string `data:"leader,worker"`
|
|
fields string `data:"folder_id,vendor,user_uid"`
|
|
open string `name:"open" style:"notice" role:"void"`
|
|
}
|
|
|
|
func (s document) Config(m *ice.Message, arg ...string) {
|
|
s.InsertOrUpdate(m, arg, m.OptionSimple(model.PLACE_UID)...)
|
|
}
|
|
func (s document) List(m *ice.Message, arg ...string) {
|
|
s.cmdy(m, DocumentVendor.Folder).PushAction(s.Open).Display("")
|
|
if len(arg) == 1 {
|
|
s.SpendlistCheck(m, 0)
|
|
}
|
|
}
|
|
func (s document) Open(m *ice.Message, arg ...string) {
|
|
m.ProcessOpen(m.Option(model.LINK))
|
|
}
|
|
|
|
func init() { ice.TeamCtxCmd(document{Table: newTable()}) }
|
|
|
|
func (s document) cmdy(m *ice.Message, action ice.Any, arg ...string) *ice.Message {
|
|
if m.Option(model.AUTH_UID, s.StreetAuthUID(m, m.Option(model.PLACE_UID))) == "" {
|
|
return m
|
|
}
|
|
if msg := s.Select(m.Spawn(), m.OptionSimple(model.PLACE_UID)...); msg.Append("folder_id") == "" {
|
|
m.Echo("本服务暂未配置,请联系公司管理员配置")
|
|
} else {
|
|
m.Cmdy(msg.Append(model.VENDOR), action, m.Option(model.AUTH_UID), msg.Append("folder_id"))
|
|
}
|
|
return m
|
|
}
|
|
|
|
var DocumentVendor interface {
|
|
Folder(m *ice.Message, arg ...string) *ice.Message
|
|
}
|