mirror of
https://shylinux.com/x/community
synced 2025-07-01 21:21:19 +08:00
54 lines
1.8 KiB
Go
54 lines
1.8 KiB
Go
package gonganxitong
|
|
|
|
import (
|
|
"shylinux.com/x/ice"
|
|
|
|
"shylinux.com/x/community/src/api"
|
|
"shylinux.com/x/community/src/gonganxitong/model"
|
|
)
|
|
|
|
type document struct {
|
|
Table
|
|
order string `data:"94"`
|
|
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("")
|
|
}
|
|
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.authUID(m, m.Option(s.PLACE_UID))) == "" {
|
|
return m
|
|
}
|
|
if msg := s.Select(m.Spawn(), model.PLACE_UID, m.Option(s.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
|
|
}
|
|
func (s document) authUID(m *ice.Message, arg ...string) string {
|
|
if msg := m.Cmd(s.Place, s.Select, model.UID, arg[0]); msg.Append(model.AUTH_UID) == "" {
|
|
m.Echo("本服务暂未申请认证,请到<用户名片>申请认证")
|
|
} else if m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Select, model.UID, msg.Append(model.AUTH_UID)).Append(model.AUTH_STATUS) != "2" {
|
|
m.Echo("本服务认证申请中,请等待审批")
|
|
} else {
|
|
return m.Cmd(s.Street, s.Select, model.UID, msg.Append(s.STREET_UID)).Append(model.AUTH_UID)
|
|
}
|
|
return ""
|
|
}
|
|
|
|
var DocumentVendor interface {
|
|
Folder(m *ice.Message, arg ...string) *ice.Message
|
|
}
|