mirror of
https://shylinux.com/x/enterprise
synced 2025-04-26 01:24:06 +08:00
add some
This commit is contained in:
parent
18fbc7fbce
commit
8e782add86
@ -113,12 +113,6 @@ func (s Table) checkOrderRole(m *ice.Message, arg ...string) bool {
|
|||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
func (s Table) recordEvent(m *ice.Message, info string, arg ...string) {
|
|
||||||
s.Table.RecordEvent(m, m.Option(model.STORE_UID), info, kit.Select(m.Option(model.UID), arg, 0))
|
|
||||||
}
|
|
||||||
func (s Table) recordEventWithName(m *ice.Message, info string) {
|
|
||||||
s.Table.RecordEventWithName(m, m.Option(model.STORE_UID), info)
|
|
||||||
}
|
|
||||||
|
|
||||||
type TableView struct {
|
type TableView struct {
|
||||||
Table
|
Table
|
||||||
@ -131,16 +125,16 @@ type TableView struct {
|
|||||||
func (s TableView) Create(m *ice.Message, arg ...string) {
|
func (s TableView) Create(m *ice.Message, arg ...string) {
|
||||||
arg = s.transPrice(m, arg...)
|
arg = s.transPrice(m, arg...)
|
||||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.STORE_UID))...)
|
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.STORE_UID))...)
|
||||||
s.recordEventWithName(m, "")
|
s.RecordEventWithName(m, "")
|
||||||
}
|
}
|
||||||
func (s TableView) Modify(m *ice.Message, arg ...string) {
|
func (s TableView) Modify(m *ice.Message, arg ...string) {
|
||||||
arg = s.transPrice(m, arg...)
|
arg = s.transPrice(m, arg...)
|
||||||
s.Table.Update(m, kit.Dict(arg), m.OptionSimple(model.STORE_UID, model.UID)...)
|
s.Table.Update(m, kit.Dict(arg), m.OptionSimple(model.STORE_UID, model.UID)...)
|
||||||
s.recordEventWithName(m, "")
|
s.RecordEventWithName(m, "")
|
||||||
}
|
}
|
||||||
func (s TableView) Remove(m *ice.Message, arg ...string) {
|
func (s TableView) Remove(m *ice.Message, arg ...string) {
|
||||||
s.Table.Delete(m, m.OptionSimple(model.STORE_UID, model.UID)...)
|
s.Table.Delete(m, m.OptionSimple(model.STORE_UID, model.UID)...)
|
||||||
s.recordEventWithName(m, "")
|
s.RecordEventWithName(m, "")
|
||||||
}
|
}
|
||||||
func (s TableView) List(m *ice.Message, arg ...string) {
|
func (s TableView) List(m *ice.Message, arg ...string) {
|
||||||
if len(arg) == 0 {
|
if len(arg) == 0 {
|
||||||
@ -160,5 +154,3 @@ func (s TableView) List(m *ice.Message, arg ...string) {
|
|||||||
type Tables struct{ Table }
|
type Tables struct{ Table }
|
||||||
|
|
||||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
||||||
|
|
||||||
func newTable() Table { return Table{Table: guanlixitong.NewTable(userStore{}, store{})} }
|
|
||||||
|
@ -380,7 +380,7 @@ func (s Order) CheckRole(m *ice.Message, arg ...string) {
|
|||||||
m.WarnNotValid(OrderStatus(kit.Int(msg.Append(model.STATUS))) != OrderCreate)
|
m.WarnNotValid(OrderStatus(kit.Int(msg.Append(model.STATUS))) != OrderCreate)
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(Order{Table: newTable()}) }
|
func init() { ice.TeamCtxCmd(Order{}) }
|
||||||
|
|
||||||
func (s Order) changeStatusFrom(m *ice.Message, from OrderStatus, which string, cb func(*ice.Message)) {
|
func (s Order) changeStatusFrom(m *ice.Message, from OrderStatus, which string, cb func(*ice.Message)) {
|
||||||
defer m.ToastProcess()()
|
defer m.ToastProcess()()
|
||||||
@ -396,13 +396,13 @@ func (s Order) changeStatusFrom(m *ice.Message, from OrderStatus, which string,
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
func (s Order) sendTemplate(m *ice.Message, to string, title string) {
|
func (s Order) sendTemplate(m *ice.Message, to string, title string) {
|
||||||
s.recordEvent(m, kit.JoinWord(kit.Cut(m.Option(model.UID), 6), title))
|
s.RecordEvent(m, kit.JoinWord(kit.Cut(m.Option(model.UID), 6), title))
|
||||||
kit.If(to == model.TO_USER_UID, func() { title = "进货" + title })
|
kit.If(to == model.TO_USER_UID, func() { title = "进货" + title })
|
||||||
kit.If(to == model.FROM_USER_UID, func() { title = "出货" + title })
|
kit.If(to == model.FROM_USER_UID, func() { title = "出货" + title })
|
||||||
kit.If(to != "" && m.Option(to) != "", func() { s.SendTemplate(m, "", m.Option(to), title) })
|
kit.If(to != "" && m.Option(to) != "", func() { s.SendTemplate(m, "", m.Option(to), title) })
|
||||||
}
|
}
|
||||||
|
|
||||||
func newOrder() Order { return Order{Table: newTable()} }
|
func newOrder() Order { return Order{} }
|
||||||
|
|
||||||
type OrderType int
|
type OrderType int
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Portal struct {
|
type Portal struct {
|
||||||
gonganxitong.Portal
|
guanlixitong.Portal
|
||||||
placeCreate string `name:"placeCreate city_name* company_name* store_type*:select store_name*" role:"void"`
|
placeCreate string `name:"placeCreate city_name* company_name* store_type*:select store_name*" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userStore{}, store{}, guanlixitong.Company{})})
|
gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userStore{}, store{})})
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,4 @@ func (s produce) List(m *ice.Message, arg ...string) {
|
|||||||
kit.If(len(arg) == 1, func() { m.Action(s.Produce) })
|
kit.If(len(arg) == 1, func() { m.Action(s.Produce) })
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(produce{Order: newOrder()}) }
|
func init() { ice.TeamCtxCmd(produce{}) }
|
||||||
|
@ -17,4 +17,4 @@ func (s purchase) List(m *ice.Message, arg ...string) {
|
|||||||
kit.If(len(arg) == 1, func() { m.Action(s.Purchase) })
|
kit.If(len(arg) == 1, func() { m.Action(s.Purchase) })
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(purchase{Order: newOrder()}) }
|
func init() { ice.TeamCtxCmd(purchase{}) }
|
||||||
|
@ -17,4 +17,4 @@ func (s sell) List(m *ice.Message, arg ...string) {
|
|||||||
kit.If(len(arg) == 1, func() { m.Action(s.Sell) })
|
kit.If(len(arg) == 1, func() { m.Action(s.Sell) })
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(sell{Order: newOrder()}) }
|
func init() { ice.TeamCtxCmd(sell{}) }
|
||||||
|
@ -18,8 +18,8 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var UserStoreRoleList = map[UserStoreRole]string{
|
var UserStoreRoleList = map[UserStoreRole]string{
|
||||||
UserStoreCreator: "creator",
|
|
||||||
UserStoreVisitor: "visitor",
|
UserStoreVisitor: "visitor",
|
||||||
|
UserStoreCreator: "creator",
|
||||||
UserStoreBoss: "boss",
|
UserStoreBoss: "boss",
|
||||||
UserStoreWorker: "worker",
|
UserStoreWorker: "worker",
|
||||||
UserStoreVendor: "vendor",
|
UserStoreVendor: "vendor",
|
||||||
|
@ -21,7 +21,7 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
|
|||||||
case model.GROUP_TYPE:
|
case model.GROUP_TYPE:
|
||||||
s.InputsList(m, GroupTypeList, arg...)
|
s.InputsList(m, GroupTypeList, arg...)
|
||||||
case model.COMPANY_UID:
|
case model.COMPANY_UID:
|
||||||
m.Cmdy(Company{}, s.Select).Cut(model.UID, model.NAME).RenameAppend(model.UID, arg[0])
|
m.Cmdy(company{}, s.Select).Cut(model.UID, model.NAME).RenameAppend(model.UID, arg[0])
|
||||||
m.DisplayInputKeyNameIconTitle()
|
m.DisplayInputKeyNameIconTitle()
|
||||||
default:
|
default:
|
||||||
s.Table.Inputs(m, arg...)
|
s.Table.Inputs(m, arg...)
|
||||||
@ -55,6 +55,6 @@ type Tables struct{ Table }
|
|||||||
|
|
||||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
||||||
|
|
||||||
func NewTable(userGroup gonganxitong.UserPlacer, group gonganxitong.Placer) Table {
|
func NewPortal(userPlace gonganxitong.UserPlacer, place gonganxitong.Placer) Portal {
|
||||||
return Table{Table: gonganxitong.NewTable(userGroup, group, company{})}
|
return Portal{Portal: gonganxitong.NewPortal(userPlace, place, company{})}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,3 @@ func (s company) FindOrCreateByName(m *ice.Message, arg ...string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(company{}) }
|
func init() { ice.TeamCtxCmd(company{}) }
|
||||||
|
|
||||||
type Company struct{ company }
|
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(Company{}) }
|
|
||||||
|
@ -12,18 +12,18 @@ const (
|
|||||||
GroupRD GroupType = iota
|
GroupRD GroupType = iota
|
||||||
GroupOP
|
GroupOP
|
||||||
GroupHR
|
GroupHR
|
||||||
GroupFinancial
|
GroupFA
|
||||||
GroupAdmin
|
GroupAdmin
|
||||||
GroupSales
|
GroupSales
|
||||||
)
|
)
|
||||||
|
|
||||||
var GroupTypeList = map[GroupType]string{
|
var GroupTypeList = map[GroupType]string{
|
||||||
GroupRD: "RD",
|
GroupRD: "RD",
|
||||||
GroupOP: "OP",
|
GroupOP: "OP",
|
||||||
GroupHR: "HR",
|
GroupHR: "HR",
|
||||||
GroupFinancial: "financial",
|
GroupFA: "FA",
|
||||||
GroupAdmin: "admin",
|
GroupAdmin: "admin",
|
||||||
GroupSales: "sales",
|
GroupSales: "sales",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s GroupType) String() string { return GroupTypeList[s] }
|
func (s GroupType) String() string { return GroupTypeList[s] }
|
||||||
|
@ -7,6 +7,4 @@ type Portal struct {
|
|||||||
placeCreate string `name:"placeCreate city_name* company_name* group_type*:select group_name*" role:"void"`
|
placeCreate string `name:"placeCreate city_name* company_name* group_type*:select group_name*" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() { gonganxitong.PortalCmd(NewPortal(userGroup{}, group{})) }
|
||||||
gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userGroup{}, group{}, company{})})
|
|
||||||
}
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
"RD": "研发",
|
"RD": "研发",
|
||||||
"OP": "运维",
|
"OP": "运维",
|
||||||
"HR": "人力",
|
"HR": "人力",
|
||||||
"financial": "财务",
|
"FA": "财务",
|
||||||
"Admin": "行政",
|
"Admin": "行政",
|
||||||
"sales": "销售",
|
"sales": "销售",
|
||||||
"icons": {
|
"icons": {
|
||||||
|
@ -4,7 +4,7 @@ import "shylinux.com/x/ice"
|
|||||||
|
|
||||||
type userGroup struct{ Table }
|
type userGroup struct{ Table }
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(userGroup{Table: NewTable(userGroup{}, group{})}) }
|
func init() { ice.TeamCtxCmd(userGroup{}) }
|
||||||
|
|
||||||
type UserGroupRole int
|
type UserGroupRole int
|
||||||
|
|
||||||
|
@ -9,15 +9,13 @@ func init() { ice.TeamCtxCmd(channel{}) }
|
|||||||
type ChannelType int
|
type ChannelType int
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ChannelRD ChannelType = iota
|
ChannelOnline ChannelType = iota
|
||||||
ChannelOP
|
ChannelOffline
|
||||||
ChannelHR
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var ChannelTypeList = map[ChannelType]string{
|
var ChannelTypeList = map[ChannelType]string{
|
||||||
ChannelRD: "RD",
|
ChannelOnline: "online",
|
||||||
ChannelOP: "OP",
|
ChannelOffline: "offline",
|
||||||
ChannelHR: "HR",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ChannelType) String() string { return ChannelTypeList[s] }
|
func (s ChannelType) String() string { return ChannelTypeList[s] }
|
@ -35,18 +35,7 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
|||||||
})
|
})
|
||||||
return s.Table.RewriteAppend(m)
|
return s.Table.RewriteAppend(m)
|
||||||
}
|
}
|
||||||
func (s Table) CheckRole(m *ice.Message, arg ...string) *ice.Message {
|
|
||||||
role := UserChannelRole(kit.Int(m.Cmd(userChannel{}, s.Select, m.OptionSimple(model.CHANNEL_UID, model.USER_UID)).Append(model.ROLE)))
|
|
||||||
m.WarnNotRight(!kit.IsIn(role.String(), append(arg, UserChannelCreator.String())...), role.String())
|
|
||||||
return m
|
|
||||||
}
|
|
||||||
func (s Table) recordEvent(m *ice.Message, info string, arg ...string) {
|
|
||||||
s.Table.RecordEvent(m, m.Option(model.CHANNEL_UID), info, kit.Select(m.Option(model.UID), arg, 0))
|
|
||||||
}
|
|
||||||
func (s Table) recordEventWithName(m *ice.Message, info string, arg ...string) {
|
|
||||||
s.Table.RecordEventWithName(m, m.Option(model.CHANNEL_UID), info)
|
|
||||||
}
|
|
||||||
|
|
||||||
type Tables struct { Table }
|
type Tables struct{ Table }
|
||||||
|
|
||||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
@ -6,10 +6,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Portal struct {
|
type Portal struct {
|
||||||
gonganxitong.Portal
|
guanlixitong.Portal
|
||||||
placeCreate string `name:"placeCreate city_name* company_name* channel_name*" role:"void"`
|
placeCreate string `name:"placeCreate city_name* company_name* channel_type*:select channel_name*" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userChannel{}, channel{})}) }
|
||||||
gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userChannel{}, channel{}, guanlixitong.Company{})})
|
|
||||||
}
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"portal": "市场营销",
|
"portal": "市场营销",
|
||||||
"": "场景应用",
|
"promotion": "促销活动",
|
||||||
"icons": {
|
"icons": {
|
||||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
"promotion": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||||
},
|
},
|
||||||
"input": {
|
"input": {
|
||||||
"My Channel": "我的场景",
|
"My Channel": "我的渠道",
|
||||||
"user_channel_role": "用户角色",
|
"user_channel_role": "用户角色",
|
||||||
"channel_name": "场景名称",
|
"channel_name": "渠道名称",
|
||||||
"channel_type": "场景类型"
|
"channel_type": "渠道类型"
|
||||||
},
|
},
|
||||||
"value": {
|
"value": {
|
||||||
"user_channel_role": {
|
"user_channel_role": {
|
||||||
@ -18,14 +18,13 @@
|
|||||||
"worker": "工作人员",
|
"worker": "工作人员",
|
||||||
"server": "服务人员",
|
"server": "服务人员",
|
||||||
"style": {
|
"style": {
|
||||||
"creator": "danger"
|
"creator": "danger",
|
||||||
|
"leader": "danger"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"channel_type": {
|
"channel_type": {
|
||||||
"term": "学期制",
|
"online": "线上",
|
||||||
"weekly": "周期性",
|
"offline": "线下"
|
||||||
"step": "阶段性",
|
|
||||||
"free": "自由式"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -11,12 +11,12 @@ type promotion struct {
|
|||||||
Table
|
Table
|
||||||
channel channel
|
channel channel
|
||||||
userChannel userChannel
|
userChannel userChannel
|
||||||
create string `name:"create title* content*" role:"leader"`
|
create string `name:"create title* content*" role:"leader"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s promotion) Create(m *ice.Message, arg ...string) {
|
func (s promotion) Create(m *ice.Message, arg ...string) {
|
||||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.CHANNEL_UID))...)
|
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.CHANNEL_UID))...)
|
||||||
s.recordEventWithName(m, "")
|
s.RecordEventWithName(m, "")
|
||||||
}
|
}
|
||||||
func (s promotion) List(m *ice.Message, arg ...string) {
|
func (s promotion) List(m *ice.Message, arg ...string) {
|
||||||
s.TablesWithRole(m, arg, s.userChannel, s.channel, s, model.TITLE, model.CONTENT).Display("")
|
s.TablesWithRole(m, arg, s.userChannel, s.channel, s, model.TITLE, model.CONTENT).Display("")
|
||||||
|
@ -1,27 +1,15 @@
|
|||||||
package shichangyingxiao
|
package shichangyingxiao
|
||||||
|
|
||||||
import "shylinux.com/x/ice"
|
import (
|
||||||
|
"shylinux.com/x/ice"
|
||||||
|
|
||||||
|
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||||
|
)
|
||||||
|
|
||||||
type userChannel struct{ Table }
|
type userChannel struct{ Table }
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(userChannel{}) }
|
func init() { ice.TeamCtxCmd(userChannel{}) }
|
||||||
|
|
||||||
type UserChannelRole int
|
type UserChannelRole = guanlixitong.UserGroupRole
|
||||||
|
|
||||||
const (
|
var UserChannelRoleList = guanlixitong.UserGroupRoleList
|
||||||
UserChannelVisitor UserChannelRole = iota
|
|
||||||
UserChannelCreator
|
|
||||||
UserChannelLeader
|
|
||||||
UserChannelWorker
|
|
||||||
UserChannelServer
|
|
||||||
)
|
|
||||||
|
|
||||||
var UserChannelRoleList = map[UserChannelRole]string{
|
|
||||||
UserChannelVisitor: "visitor",
|
|
||||||
UserChannelCreator: "creator",
|
|
||||||
UserChannelLeader: "leader",
|
|
||||||
UserChannelWorker: "worker",
|
|
||||||
UserChannelServer: "server",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s UserChannelRole) String() string { return UserChannelRoleList[s] }
|
|
||||||
|
@ -15,10 +15,10 @@ type Table struct {
|
|||||||
|
|
||||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||||
switch arg[0] {
|
switch arg[0] {
|
||||||
case model.USER_INVESTOR_ROLE:
|
case model.USER_CAPITAL_ROLE:
|
||||||
s.InputsListRole(m, UserInvestorRoleList, arg...)
|
s.InputsListRole(m, UserCapitalRoleList, arg...)
|
||||||
case model.INVESTOR_TYPE:
|
case model.CAPITAL_TYPE:
|
||||||
s.InputsList(m, InvestorTypeList, arg...)
|
s.InputsList(m, CapitalTypeList, arg...)
|
||||||
default:
|
default:
|
||||||
s.Table.Inputs(m, arg...)
|
s.Table.Inputs(m, arg...)
|
||||||
}
|
}
|
||||||
@ -26,27 +26,16 @@ func (s Table) Inputs(m *ice.Message, arg ...string) {
|
|||||||
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 {
|
||||||
switch key {
|
switch key {
|
||||||
case model.USER_INVESTOR_ROLE:
|
case model.USER_CAPITAL_ROLE:
|
||||||
value = UserInvestorRole(kit.Int(value)).String()
|
value = UserCapitalRole(kit.Int(value)).String()
|
||||||
case model.INVESTOR_TYPE:
|
case model.CAPITAL_TYPE:
|
||||||
value = InvestorType(kit.Int(value)).String()
|
value = CapitalType(kit.Int(value)).String()
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
})
|
})
|
||||||
return s.Table.RewriteAppend(m)
|
return s.Table.RewriteAppend(m)
|
||||||
}
|
}
|
||||||
func (s Table) CheckRole(m *ice.Message, arg ...string) *ice.Message {
|
|
||||||
role := UserInvestorRole(kit.Int(m.Cmd(userInvestor{}, s.Select, m.OptionSimple(model.INVESTOR_UID, model.USER_UID)).Append(model.ROLE)))
|
|
||||||
m.WarnNotRight(!kit.IsIn(role.String(), append(arg, UserInvestorCreator.String())...), role.String())
|
|
||||||
return m
|
|
||||||
}
|
|
||||||
func (s Table) recordEvent(m *ice.Message, info string, arg ...string) {
|
|
||||||
s.Table.RecordEvent(m, m.Option(model.INVESTOR_UID), info, kit.Select(m.Option(model.UID), arg, 0))
|
|
||||||
}
|
|
||||||
func (s Table) recordEventWithName(m *ice.Message, info string, arg ...string) {
|
|
||||||
s.Table.RecordEventWithName(m, m.Option(model.INVESTOR_UID), info)
|
|
||||||
}
|
|
||||||
|
|
||||||
type Tables struct { Table }
|
type Tables struct{ Table }
|
||||||
|
|
||||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
@ -9,17 +9,17 @@ import (
|
|||||||
|
|
||||||
type investment struct {
|
type investment struct {
|
||||||
Table
|
Table
|
||||||
investor investor
|
capital capital
|
||||||
userInvestor userInvestor
|
userCapital userCapital
|
||||||
create string `name:"create title* content*" role:"leader"`
|
create string `name:"create title* content*" role:"leader"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s investment) Create(m *ice.Message, arg ...string) {
|
func (s investment) Create(m *ice.Message, arg ...string) {
|
||||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.INVESTOR_UID))...)
|
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.CAPITAL_UID))...)
|
||||||
s.recordEventWithName(m, "")
|
s.RecordEventWithName(m, "")
|
||||||
}
|
}
|
||||||
func (s investment) List(m *ice.Message, arg ...string) {
|
func (s investment) List(m *ice.Message, arg ...string) {
|
||||||
s.TablesWithRole(m, arg, s.userInvestor, s.investor, s, model.TITLE, model.CONTENT).Display("")
|
s.TablesWithRole(m, arg, s.userCapital, s.capital, s, model.TITLE, model.CONTENT).Display("")
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(investment{}) }
|
func init() { ice.TeamCtxCmd(investment{}) }
|
@ -1,23 +0,0 @@
|
|||||||
package zijinlian
|
|
||||||
|
|
||||||
import "shylinux.com/x/ice"
|
|
||||||
|
|
||||||
type investor struct{ Table }
|
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(investor{}) }
|
|
||||||
|
|
||||||
type InvestorType int
|
|
||||||
|
|
||||||
const (
|
|
||||||
InvestorRD InvestorType = iota
|
|
||||||
InvestorOP
|
|
||||||
InvestorHR
|
|
||||||
)
|
|
||||||
|
|
||||||
var InvestorTypeList = map[InvestorType]string{
|
|
||||||
InvestorRD: "RD",
|
|
||||||
InvestorOP: "OP",
|
|
||||||
InvestorHR: "HR",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s InvestorType) String() string { return InvestorTypeList[s] }
|
|
@ -3,33 +3,33 @@ package model
|
|||||||
import "shylinux.com/x/mysql-story/src/db"
|
import "shylinux.com/x/mysql-story/src/db"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
UID = "uid"
|
UID = "uid"
|
||||||
NAME = "name"
|
NAME = "name"
|
||||||
TYPE = "type"
|
TYPE = "type"
|
||||||
ROLE = "role"
|
ROLE = "role"
|
||||||
TITLE = "title"
|
TITLE = "title"
|
||||||
CONTENT = "content"
|
CONTENT = "content"
|
||||||
USER_UID = "user_uid"
|
USER_UID = "user_uid"
|
||||||
USER_INVESTOR_ROLE = "user_investor_role"
|
USER_CAPITAL_ROLE = "user_capital_role"
|
||||||
INVESTOR_UID = "investor_uid"
|
CAPITAL_UID = "capital_uid"
|
||||||
INVESTOR_NAME = "investor_name"
|
CAPITAL_NAME = "capital_name"
|
||||||
INVESTOR_TYPE = "investor_type"
|
CAPITAL_TYPE = "capital_type"
|
||||||
INVESTMENT_UID = "investment_uid"
|
INVESTMENT_UID = "investment_uid"
|
||||||
COMPANY_UID = "company_uid"
|
COMPANY_UID = "company_uid"
|
||||||
CITY_UID = "city_uid"
|
CITY_UID = "city_uid"
|
||||||
)
|
)
|
||||||
|
|
||||||
type UserInvestor struct {
|
type UserCapital struct {
|
||||||
db.ModelUserPlace
|
db.ModelUserPlace
|
||||||
InvestorUID string `gorm:"type:char(32);index"`
|
CapitalUID string `gorm:"type:char(32);index"`
|
||||||
}
|
}
|
||||||
type Investor struct {
|
type Capital struct {
|
||||||
db.ModelPlace
|
db.ModelPlace
|
||||||
CompanyUID string `gorm:"type:char(32);index"`
|
CompanyUID string `gorm:"type:char(32);index"`
|
||||||
}
|
}
|
||||||
type Investment struct {
|
type Investment struct {
|
||||||
db.ModelContent
|
db.ModelContent
|
||||||
InvestorUID string `gorm:"type:char(32);index"`
|
CapitalUID string `gorm:"type:char(32);index"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { db.CmdModels("", &UserInvestor{}, &Investor{}, &Investment{}) }
|
func init() { db.CmdModels("", &UserCapital{}, &Capital{}, &Investment{}) }
|
||||||
|
@ -6,10 +6,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Portal struct {
|
type Portal struct {
|
||||||
gonganxitong.Portal
|
guanlixitong.Portal
|
||||||
placeCreate string `name:"placeCreate city_name* company_name* investor_name*" role:"void"`
|
placeCreate string `name:"placeCreate city_name* company_name* capital_type*:select capital_name*" role:"void"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userCapital{}, capital{})}) }
|
||||||
gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userInvestor{}, investor{}, guanlixitong.Company{})})
|
|
||||||
}
|
|
||||||
|
@ -1,31 +1,32 @@
|
|||||||
{
|
{
|
||||||
"portal": "资金链",
|
"portal": "资金链",
|
||||||
"": "场景应用",
|
"investment": "投资",
|
||||||
"icons": {
|
"icons": {
|
||||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
"investment": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||||
},
|
},
|
||||||
"input": {
|
"input": {
|
||||||
"My Investor": "我的场景",
|
"My Capital": "我的资本",
|
||||||
"user_investor_role": "用户角色",
|
"user_capital_role": "用户角色",
|
||||||
"investor_name": "场景名称",
|
"capital_name": "资本名称",
|
||||||
"investor_type": "场景类型"
|
"capital_type": "资本类型"
|
||||||
},
|
},
|
||||||
"value": {
|
"value": {
|
||||||
"user_investor_role": {
|
"user_capital_role": {
|
||||||
"visitor": "访客",
|
"visitor": "访客",
|
||||||
"creator": "创建人",
|
"creator": "创建人",
|
||||||
"leader": "管理人员",
|
"leader": "管理人员",
|
||||||
"worker": "工作人员",
|
"worker": "工作人员",
|
||||||
"server": "服务人员",
|
"server": "服务人员",
|
||||||
"style": {
|
"style": {
|
||||||
"creator": "danger"
|
"creator": "danger",
|
||||||
|
"leader": "danger"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"investor_type": {
|
"capital_type": {
|
||||||
"term": "学期制",
|
"bank": "银行借贷",
|
||||||
"weekly": "周期性",
|
"angel": "天使投资",
|
||||||
"step": "阶段性",
|
"venture": "风险投资",
|
||||||
"free": "自由式"
|
"private": "私募基金"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,27 +0,0 @@
|
|||||||
package zijinlian
|
|
||||||
|
|
||||||
import "shylinux.com/x/ice"
|
|
||||||
|
|
||||||
type userInvestor struct{ Table }
|
|
||||||
|
|
||||||
func init() { ice.TeamCtxCmd(userInvestor{}) }
|
|
||||||
|
|
||||||
type UserInvestorRole int
|
|
||||||
|
|
||||||
const (
|
|
||||||
UserInvestorVisitor UserInvestorRole = iota
|
|
||||||
UserInvestorCreator
|
|
||||||
UserInvestorLeader
|
|
||||||
UserInvestorWorker
|
|
||||||
UserInvestorServer
|
|
||||||
)
|
|
||||||
|
|
||||||
var UserInvestorRoleList = map[UserInvestorRole]string{
|
|
||||||
UserInvestorVisitor: "visitor",
|
|
||||||
UserInvestorCreator: "creator",
|
|
||||||
UserInvestorLeader: "leader",
|
|
||||||
UserInvestorWorker: "worker",
|
|
||||||
UserInvestorServer: "server",
|
|
||||||
}
|
|
||||||
|
|
||||||
func (s UserInvestorRole) String() string { return UserInvestorRoleList[s] }
|
|
Loading…
x
Reference in New Issue
Block a user