mirror of
https://shylinux.com/x/community
synced 2025-07-01 13:14:44 +08:00
add some
This commit is contained in:
parent
629d18fce5
commit
d73ed5b838
@ -118,6 +118,14 @@ func (s Table) InputsListValue(m *ice.Message, list ice.Any, key string) string
|
|||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
func (s Table) TransPrice(m *ice.Message, arg []string, field ...string) []string {
|
||||||
|
for i := 0; i < len(arg)-1; i += 2 {
|
||||||
|
if kit.IndexOf(field, arg[0]) > -1 {
|
||||||
|
arg[i+1] = kit.Format(kit.Int(kit.Float(arg[i+1]) * 100))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return arg
|
||||||
|
}
|
||||||
func (s Table) ValueModel(m *ice.Message, action ice.Any, arg ...string) *ice.Message {
|
func (s Table) ValueModel(m *ice.Message, action ice.Any, arg ...string) *ice.Message {
|
||||||
defer m.Options(db.DB, m.Configv(db.DB)).Set(ice.MSG_OPTION, db.DB)
|
defer m.Options(db.DB, m.Configv(db.DB)).Set(ice.MSG_OPTION, db.DB)
|
||||||
defer m.Options(db.MODEL, m.Configv(db.MODEL)).Set(ice.MSG_OPTION, db.MODEL)
|
defer m.Options(db.MODEL, m.Configv(db.MODEL)).Set(ice.MSG_OPTION, db.MODEL)
|
||||||
@ -563,8 +571,8 @@ func PortalCmd(portal ice.Any) {
|
|||||||
}
|
}
|
||||||
cmd("portal", portal)
|
cmd("portal", portal)
|
||||||
cmd("goodslist", goodslist{Table: table})
|
cmd("goodslist", goodslist{Table: table})
|
||||||
cmd("quotalist", goodslist{Table: table})
|
cmd("quotalist", quotalist{Table: table})
|
||||||
cmd("spendlist", goodslist{Table: table})
|
cmd("spendlist", spendlist{Table: table})
|
||||||
cmd("paymentlist", paymentlist{Table: table})
|
cmd("paymentlist", paymentlist{Table: table})
|
||||||
cmd("meeting", meeting{Table: table})
|
cmd("meeting", meeting{Table: table})
|
||||||
cmd("document", document{Table: table})
|
cmd("document", document{Table: table})
|
||||||
|
@ -4,7 +4,7 @@ import "shylinux.com/x/ice"
|
|||||||
|
|
||||||
type contract struct {
|
type contract struct {
|
||||||
Table
|
Table
|
||||||
order string `data:"94"`
|
order string `data:"95"`
|
||||||
fields string `data:"title"`
|
fields string `data:"title"`
|
||||||
create string `name:"create title*" role:"leader"`
|
create string `name:"create title*" role:"leader"`
|
||||||
remove string `name:"remove" role:"leader"`
|
remove string `name:"remove" role:"leader"`
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
type document struct {
|
type document struct {
|
||||||
Table
|
Table
|
||||||
order string `data:"93"`
|
order string `data:"94"`
|
||||||
fields string `data:"folder_id,vendor,user_uid"`
|
fields string `data:"folder_id,vendor,user_uid"`
|
||||||
open string `name:"open" style:"notice" role:"void"`
|
open string `name:"open" style:"notice" role:"void"`
|
||||||
}
|
}
|
||||||
|
@ -12,36 +12,56 @@ type goodslist struct {
|
|||||||
Table
|
Table
|
||||||
order string `data:"91"`
|
order string `data:"91"`
|
||||||
fields string `data:"name,price,title,content,user_uid"`
|
fields string `data:"name,price,title,content,user_uid"`
|
||||||
create string `name:"create name* title* content*" role:"leader"`
|
create string `name:"create name* price* title* content*" role:"leader"`
|
||||||
remove string `name:"remove" role:"leader"`
|
remove string `name:"remove" role:"leader"`
|
||||||
payfor string `name:"payfor" help:"购买" style:"notice" role:"worker"`
|
payfor string `name:"payfor" help:"购买" style:"notice" role:"worker"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s goodslist) AfterMigrate(m *ice.Message, arg ...string) {
|
func (s goodslist) AfterMigrate(m *ice.Message, arg ...string) {
|
||||||
s.Table.AfterMigrate(m, arg...)
|
s.Table.AfterMigrate(m, arg...)
|
||||||
s.insert(m, "service", "2-1", "1000", "初级版")
|
s.insert(m, "service", "3-1", "1000", "初级版")
|
||||||
s.insert(m, "service", "2-2", "3000", "高级版")
|
s.insert(m, "service", "3-2", "3000", "高级版")
|
||||||
s.insert(m, "service", "2-3", "5000", "旗舰版")
|
s.insert(m, "service", "3-3", "5000", "旗舰版")
|
||||||
s.insert(m, "company", "5-1", "10000", "企业初级版")
|
s.insert(m, "company", "4-1", "10000", "企业初级版")
|
||||||
s.insert(m, "company", "5-2", "30000", "企业高级版")
|
s.insert(m, "company", "4-2", "30000", "企业高级版")
|
||||||
s.insert(m, "company", "5-3", "50000", "企业旗舰版")
|
s.insert(m, "company", "4-3", "50000", "企业旗舰版")
|
||||||
|
s.insert(m, "school", "5-1", "10000", "教育初级版")
|
||||||
|
s.insert(m, "school", "5-2", "30000", "教育高级版")
|
||||||
|
s.insert(m, "school", "5-3", "50000", "教育旗舰版")
|
||||||
|
}
|
||||||
|
func (s goodslist) Create(m *ice.Message, arg ...string) {
|
||||||
|
s.ValueCreate(m, s.TransPrice(m, arg, model.PRICE)...)
|
||||||
}
|
}
|
||||||
func (s goodslist) List(m *ice.Message, arg ...string) {
|
func (s goodslist) List(m *ice.Message, arg ...string) {
|
||||||
if s.PrefixPortal(m) == api.RENZHENGSHOUQUAN_PORTAL {
|
if len(arg) == 1 {
|
||||||
msg := m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Select, model.UID, arg[0])
|
if s.PrefixPortal(m) == api.RENZHENGSHOUQUAN_PORTAL {
|
||||||
switch kit.Int(msg.Append(model.AUTH_TYPE)) {
|
msg := m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Table.Select, model.UID, arg[0])
|
||||||
case 3:
|
switch kit.Int(msg.Append(model.AUTH_TYPE)) {
|
||||||
s.Select(m, model.PLACE_UID, "service")
|
case 3:
|
||||||
case 4:
|
s.Table.Select(m, model.PLACE_UID, "service")
|
||||||
s.Select(m, model.PLACE_UID, "company")
|
case 4:
|
||||||
}
|
s.Table.Select(m, model.PLACE_UID, "company")
|
||||||
m.PushAction(s.Payfor).Action()
|
case 5:
|
||||||
} else {
|
s.Table.Select(m, model.PLACE_UID, "school")
|
||||||
s.Select(m, model.PLACE_UID, "service")
|
}
|
||||||
m.PushAction(s.Payfor).Action()
|
m.PushAction(s.Payfor).Action()
|
||||||
if s.IsLeader(m) {
|
} else {
|
||||||
m.Action(s.Create)
|
if s.IsLeader(m) {
|
||||||
|
s.Table.Select(m, model.PLACE_UID, "service")
|
||||||
|
m.PushAction(s.Payfor).Action()
|
||||||
|
}
|
||||||
|
msg := s.Table.Select(m.Spawn(), model.PLACE_UID, arg[0])
|
||||||
|
if s.IsLeader(m) {
|
||||||
|
msg.PushAction(s.Payfor, s.Table.Remove).Action(s.Table.Create)
|
||||||
|
} else {
|
||||||
|
msg.PushAction(s.Payfor).Action()
|
||||||
|
}
|
||||||
|
m.Copy(msg)
|
||||||
|
s.SelectJoinUser(m)
|
||||||
}
|
}
|
||||||
|
} else if len(arg) == 2 {
|
||||||
|
m.Cmdy(quotalist{}, s.Select, model.GOODSLIST_UID, arg[1])
|
||||||
|
m.Action(s.Payfor)
|
||||||
}
|
}
|
||||||
m.Display("")
|
m.Display("")
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
Volcanos(chat.ONIMPORT, {
|
Volcanos(chat.ONIMPORT, {
|
||||||
_init: function(can, msg) {
|
_init: function(can, msg) {
|
||||||
|
if (can.Option(UID)) {
|
||||||
|
can.onimport.myView(can, msg, function(value) { return [
|
||||||
|
{view: html.TITLE, list: [value.vendor]},
|
||||||
|
{view: html.OUTPUT, list: [value.total+"M"]},
|
||||||
|
] }, function() {
|
||||||
|
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
can.onimport.myView(can, msg, function(value) { return [
|
can.onimport.myView(can, msg, function(value) { return [
|
||||||
{view: html.TITLE, list: [value.title, "¥ "+value.price/100+" / 月", can.onimport.titleAction(can, value)]},
|
{view: html.TITLE, list: [value.title, "¥ "+value.price/100+" / 月", can.onimport.titleAction(can, value)]},
|
||||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
type meeting struct {
|
type meeting struct {
|
||||||
Table
|
Table
|
||||||
order string `data:"92"`
|
order string `data:"93"`
|
||||||
role string `data:"leader,worker"`
|
role string `data:"leader,worker"`
|
||||||
fields string `data:"user_id,vendor"`
|
fields string `data:"user_id,vendor"`
|
||||||
config string `name:"config place_uid* user_uid* user_id* vendor*"`
|
config string `name:"config place_uid* user_uid* user_id* vendor*"`
|
||||||
|
@ -112,6 +112,8 @@ const (
|
|||||||
ACCESS_TOKEN = "access_token"
|
ACCESS_TOKEN = "access_token"
|
||||||
EXPIRE_TIME = "expire_time"
|
EXPIRE_TIME = "expire_time"
|
||||||
PRICE = "price"
|
PRICE = "price"
|
||||||
|
TOTAL = "total"
|
||||||
|
GOODSLIST_UID = "goodslist_uid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Sess struct {
|
type Sess struct {
|
||||||
@ -157,16 +159,17 @@ type Quotalist struct {
|
|||||||
db.ModelWithUID
|
db.ModelWithUID
|
||||||
PlaceUID string `gorm:"type:char(32);index"`
|
PlaceUID string `gorm:"type:char(32);index"`
|
||||||
UserUID string `gorm:"type:char(32)"`
|
UserUID string `gorm:"type:char(32)"`
|
||||||
GoodslistUID string `gorm:"type:char(32)"`
|
GoodslistUID string `gorm:"type:char(32);index"`
|
||||||
Vendor string `gorm:"type:varchar(128)"`
|
Vendor string `gorm:"type:varchar(128)"`
|
||||||
Total int
|
Total int
|
||||||
Count int
|
|
||||||
}
|
}
|
||||||
type Spendlist struct {
|
type Spendlist struct {
|
||||||
db.ModelWithUID
|
db.ModelWithUID
|
||||||
PlaceUID string `gorm:"type:char(32);index"`
|
PlaceUID string `gorm:"type:char(32);index"`
|
||||||
UserUID string `gorm:"type:char(32)"`
|
UserUID string `gorm:"type:char(32)"`
|
||||||
QuotalistUID string `gorm:"type:char(32)"`
|
QuotalistUID string `gorm:"type:char(32)"`
|
||||||
|
Vendor string `gorm:"type:varchar(128)"`
|
||||||
|
Total int
|
||||||
Count int
|
Count int
|
||||||
}
|
}
|
||||||
type Paymentlist struct {
|
type Paymentlist struct {
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
type paymentlist struct {
|
type paymentlist struct {
|
||||||
Table
|
Table
|
||||||
order string `data:"91"`
|
order string `data:"92"`
|
||||||
auth_uid string `data:""`
|
auth_uid string `data:""`
|
||||||
fields string `data:"title,content,amount,paymentlist_status,user_uid"`
|
fields string `data:"title,content,amount,paymentlist_status,user_uid"`
|
||||||
create string `name:"create amount* title* content" role:"leader"`
|
create string `name:"create amount* title* content" role:"leader"`
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
type photo struct {
|
type photo struct {
|
||||||
Table
|
Table
|
||||||
order string `data:"95"`
|
order string `data:"96"`
|
||||||
fields string `data:"space_id,access_token,expire_time,vendor"`
|
fields string `data:"space_id,access_token,expire_time,vendor"`
|
||||||
remove string `name:"remove" role:"worker"`
|
remove string `name:"remove" role:"worker"`
|
||||||
upload string `name:"upload" role:"worker"`
|
upload string `name:"upload" role:"worker"`
|
||||||
|
@ -14,10 +14,6 @@
|
|||||||
"auth": "认证", "authCreate": "认证申请", "authCity": "城市认证", "authPersonal": "个人认证", "authService": "服务认证", "authCompany": "公司认证",
|
"auth": "认证", "authCreate": "认证申请", "authCity": "城市认证", "authPersonal": "个人认证", "authService": "服务认证", "authCompany": "公司认证",
|
||||||
"config": "配置", "code": "编程", "data": "数据", "cache": "缓存",
|
"config": "配置", "code": "编程", "data": "数据", "cache": "缓存",
|
||||||
"icons": {
|
"icons": {
|
||||||
"user": "https://img.icons8.com/officel/80/qr-code.png",
|
|
||||||
"city": "https://img.icons8.com/officel/80/qr-code.png",
|
|
||||||
"street": "https://img.icons8.com/officel/80/qr-code.png",
|
|
||||||
|
|
||||||
"goodslist": "https://img.icons8.com/officel/80/online-store.png",
|
"goodslist": "https://img.icons8.com/officel/80/online-store.png",
|
||||||
"paymentlist": "https://img.icons8.com/officel/80/online-payment-with-a-credit-card.png",
|
"paymentlist": "https://img.icons8.com/officel/80/online-payment-with-a-credit-card.png",
|
||||||
"meeting": "https://img.icons8.com/officel/80/video-conference.png",
|
"meeting": "https://img.icons8.com/officel/80/video-conference.png",
|
||||||
@ -100,7 +96,7 @@
|
|||||||
"creator": "创建人",
|
"creator": "创建人",
|
||||||
"landlord": "房东",
|
"landlord": "房东",
|
||||||
"tenant": "租客",
|
"tenant": "租客",
|
||||||
"admin": "管理员",
|
"admin": "管家",
|
||||||
"style": {
|
"style": {
|
||||||
"creator": "danger",
|
"creator": "danger",
|
||||||
"landlord": "danger"
|
"landlord": "danger"
|
||||||
|
@ -1,15 +1,42 @@
|
|||||||
package gonganxitong
|
package gonganxitong
|
||||||
|
|
||||||
import "shylinux.com/x/ice"
|
import (
|
||||||
|
"shylinux.com/x/ice"
|
||||||
|
kit "shylinux.com/x/toolkits"
|
||||||
|
|
||||||
|
"shylinux.com/x/community/src/api"
|
||||||
|
"shylinux.com/x/community/src/gonganxitong/model"
|
||||||
|
)
|
||||||
|
|
||||||
type quotalist struct {
|
type quotalist struct {
|
||||||
Table
|
Table
|
||||||
fields string `data:"title,content,user_uid"`
|
fields string `data:"vendor,total"`
|
||||||
create string `name:"create title* content*" role:"leader"`
|
|
||||||
remove string `name:"remove" role:"leader"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s quotalist) AfterMigrate(m *ice.Message, arg ...string) {
|
||||||
|
s.Table.AfterMigrate(m, arg...)
|
||||||
|
s.insert(m, "service", "3-1", "1000", api.GONGANXITONG_DOCUMENT)
|
||||||
|
s.insert(m, "service", "3-1", "1000", api.GONGANXITONG_PHOTO)
|
||||||
|
}
|
||||||
|
func (s quotalist) insert(m *ice.Message, auth, level, total string, arg ...string) {
|
||||||
|
s.Insert(m, model.UID, kit.Hashs(auth, level, kit.Select(m.PrefixKey(), arg, 0)), model.GOODSLIST_UID, kit.Hashs(auth, level), model.PLACE_UID, auth,
|
||||||
|
model.TOTAL, total, model.VENDOR, kit.Select(m.PrefixKey(), arg, 0))
|
||||||
|
}
|
||||||
func (s quotalist) List(m *ice.Message, arg ...string) {
|
func (s quotalist) List(m *ice.Message, arg ...string) {
|
||||||
|
s.Select(m, model.PLACE_UID, arg[0])
|
||||||
|
if s.PrefixPortal(m) == api.RENZHENGSHOUQUAN_PORTAL {
|
||||||
|
msg := m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Table.Select, model.UID, arg[0])
|
||||||
|
switch kit.Int(msg.Append(model.AUTH_TYPE)) {
|
||||||
|
case 3:
|
||||||
|
s.Table.Select(m, model.PLACE_UID, "service")
|
||||||
|
case 4:
|
||||||
|
s.Table.Select(m, model.PLACE_UID, "company")
|
||||||
|
case 5:
|
||||||
|
s.Table.Select(m, model.PLACE_UID, "school")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(quotalist{Table: newTable()}) }
|
func init() { ice.TeamCtxCmd(quotalist{Table: newTable()}) }
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package gonganxitong
|
package gonganxitong
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"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/mdb"
|
||||||
"shylinux.com/x/icebergs/base/nfs"
|
"shylinux.com/x/icebergs/base/nfs"
|
||||||
|
"shylinux.com/x/icebergs/base/web"
|
||||||
kit "shylinux.com/x/toolkits"
|
kit "shylinux.com/x/toolkits"
|
||||||
|
|
||||||
"shylinux.com/x/community/src/gonganxitong/model"
|
"shylinux.com/x/community/src/gonganxitong/model"
|
||||||
@ -13,12 +16,14 @@ import (
|
|||||||
|
|
||||||
type user struct {
|
type user struct {
|
||||||
Table
|
Table
|
||||||
setting setting
|
setting setting
|
||||||
template string `data:"4b-Z_r8dZmm1pHdd2h4A10VVYX4OIHvemlLjsHKBj2s"`
|
template string `data:"4b-Z_r8dZmm1pHdd2h4A10VVYX4OIHvemlLjsHKBj2s"`
|
||||||
create string `name:"create open_id* avatar usernick"`
|
create string `name:"create open_id* avatar usernick"`
|
||||||
modify string `name:"modify info" role:"void"`
|
modify string `name:"modify info" role:"void"`
|
||||||
list string `name:"list uid auto" role:"void"`
|
list string `name:"list uid auto" role:"void"`
|
||||||
email string `name:"email email*"`
|
email string `name:"email email*"`
|
||||||
|
setCookie string `name:"setCookie" help:"切换" role:"void"`
|
||||||
|
sendCookie string `name:"sendCookie" help:"授权" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s user) Create(m *ice.Message, arg ...string) {
|
func (s user) Create(m *ice.Message, arg ...string) {
|
||||||
@ -37,17 +42,24 @@ func (s user) Modify(m *ice.Message, arg ...string) {
|
|||||||
func (s user) Remove(m *ice.Message, arg ...string) {
|
func (s user) Remove(m *ice.Message, arg ...string) {
|
||||||
s.Delete(m, m.OptionSimple(model.UID)...)
|
s.Delete(m, m.OptionSimple(model.UID)...)
|
||||||
}
|
}
|
||||||
|
func (s user) SelectTotal(m *ice.Message, arg ...string) string {
|
||||||
|
msg := m.Spawn()
|
||||||
|
s.Fields(msg, "count(*) AS total")
|
||||||
|
return s.Select(msg, arg...).Append("total")
|
||||||
|
}
|
||||||
func (s user) List(m *ice.Message, arg ...string) {
|
func (s user) List(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
if m.IsTech() {
|
if m.IsTech() {
|
||||||
s.Limit(m, 100)
|
s.Limit(m, 100)
|
||||||
s.Select(m, arg...).Table(func(value ice.Maps) {
|
s.Select(m, arg...).Table(func(value ice.Maps) {
|
||||||
if value[model.UID] != m.Option(model.USER_UID) {
|
if value[model.UID] != m.Option(model.USER_UID) {
|
||||||
m.PushButton(s.SetCookie, s.Remove)
|
m.PushButton(s.SetCookie)
|
||||||
} else {
|
} else {
|
||||||
m.PushButton()
|
m.PushButton()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
m.EchoQRCode(m.MergePodCmd("", m.PrefixKey()+"/action/sendCookie", ice.FROM_DAEMON, m.Option(ice.MSG_DAEMON))).Echo("<br/>").Echo("请扫码授权")
|
||||||
|
m.StatusTimeCount(mdb.TOTAL, s.SelectTotal(m))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
s.SelectDetail(m, model.UID, arg[0])
|
s.SelectDetail(m, model.UID, arg[0])
|
||||||
@ -67,6 +79,13 @@ func (s user) SendTemplate(m *ice.Message, arg ...string) { // from uid url type
|
|||||||
"time11", time.Now().Format("2006年01月02日 15:04"), "thing18", kit.Select(kit.Select(m.Option(ice.MSG_USERNAME), m.Option(ice.MSG_USERNICK)), arg, 0),
|
"time11", time.Now().Format("2006年01月02日 15:04"), "thing18", kit.Select(kit.Select(m.Option(ice.MSG_USERNAME), m.Option(ice.MSG_USERNICK)), arg, 0),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
func (s user) SendCookie(m *ice.Message, arg ...string) {
|
||||||
|
if m.Option(ice.MSG_METHOD) == http.MethodGet {
|
||||||
|
m.EchoInfoButton("请确认授权", s.SendCookie)
|
||||||
|
} else {
|
||||||
|
m.Cmd(web.SPACE, m.Option(ice.FROM_DAEMON), "cookie", m.Option(model.USER_UID), model.USER_UID)
|
||||||
|
}
|
||||||
|
}
|
||||||
func (s user) SetCookie(m *ice.Message, arg ...string) {
|
func (s user) SetCookie(m *ice.Message, arg ...string) {
|
||||||
m.ProcessCookie(model.USER_UID, m.Option(model.UID))
|
m.ProcessCookie(model.USER_UID, m.Option(model.UID))
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ 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"
|
||||||
@ -46,7 +47,7 @@ func (s tencentdocument) List(m *ice.Message, arg ...string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (s tencentdocument) Config(m *ice.Message, arg ...string) {
|
func (s tencentdocument) Config(m *ice.Message, arg ...string) {
|
||||||
m.Cmdy("web.team.gonganxitong.document", s.Config, m.OptionSimple(model.PLACE_UID, model.USER_UID, model.FOLDER_ID), model.VENDOR, m.PrefixKey())
|
m.Cmdy(api.GONGANXITONG_DOCUMENT, s.Config, m.OptionSimple(model.PLACE_UID, model.USER_UID, model.FOLDER_ID), model.VENDOR, m.PrefixKey())
|
||||||
}
|
}
|
||||||
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])
|
||||||
@ -69,13 +70,13 @@ func (s tencentdocument) Auth(m *ice.Message, arg ...string) {
|
|||||||
if m.Option("code") == "" {
|
if m.Option("code") == "" {
|
||||||
m.ProcessOpen(kit.MergeURL("https://docs.qq.com/oauth/v2/authorize",
|
m.ProcessOpen(kit.MergeURL("https://docs.qq.com/oauth/v2/authorize",
|
||||||
model.CLIENT_ID, m.Config(model.CLIENT_ID),
|
model.CLIENT_ID, m.Config(model.CLIENT_ID),
|
||||||
"redirect_uri", m.MergePodCmd("", m.PrefixKey()+"/action/auth"),
|
"redirect_uri", m.MergePodCmd("", m.PrefixKey()+"/action/"+m.ActionKey()),
|
||||||
"response_type", "code", "scope", "all", "state", m.Option(model.AUTH_UID),
|
"response_type", "code", "scope", "all", "state", m.Option(model.AUTH_UID),
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
m.Cmdy(web.SPIDE, ice.DEV, kit.MergeURL("https://docs.qq.com/oauth/v2/token",
|
m.Cmdy(web.SPIDE, ice.DEV, kit.MergeURL("https://docs.qq.com/oauth/v2/token",
|
||||||
model.CLIENT_ID, m.Config(model.CLIENT_ID), model.CLIENT_SECRET, m.Config(model.CLIENT_SECRET),
|
model.CLIENT_ID, m.Config(model.CLIENT_ID), model.CLIENT_SECRET, m.Config(model.CLIENT_SECRET),
|
||||||
"redirect_uri", m.MergePodCmd("", m.PrefixKey()+"/action/auth"),
|
"redirect_uri", m.MergePodCmd("", m.PrefixKey()+"/action/"+m.ActionKey()),
|
||||||
"grant_type", "authorization_code", "code", m.Option("code"),
|
"grant_type", "authorization_code", "code", m.Option("code"),
|
||||||
))
|
))
|
||||||
if m.IsErr() {
|
if m.IsErr() {
|
||||||
|
@ -3,12 +3,14 @@ package {{.Option "zone"}}
|
|||||||
import "shylinux.com/x/ice"
|
import "shylinux.com/x/ice"
|
||||||
|
|
||||||
type {{.Option "name"}} struct {
|
type {{.Option "name"}} struct {
|
||||||
Table
|
Tables
|
||||||
fields string `data:"title,content,user_uid"`
|
fields string `data:"title,content,user_uid"`
|
||||||
create string `name:"create title* content*" role:"leader"`
|
create string `name:"create title* content*" role:"leader"`
|
||||||
remove string `name:"remove" role:"leader"`
|
remove string `name:"remove" role:"leader"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
func (s {{.Option "name"}}) List(m *ice.Message, arg ...string) {
|
||||||
|
// s.ValueList(m, arg).Display("")
|
||||||
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd({{.Option "name"}}{}) }
|
func init() { ice.TeamCtxCmd({{.Option "name"}}{}) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user