This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-08-30 21:56:29 +08:00
parent ea1d354e02
commit cde3aeb19c
18 changed files with 60 additions and 326 deletions

View File

@ -20,23 +20,16 @@ const (
) )
type UserRepos struct { type UserRepos struct {
db.ModelWithUID db.ModelUserPlace
UserUID string `gorm:"type:char(32);index"`
ReposUID string `gorm:"type:char(32);index"` ReposUID string `gorm:"type:char(32);index"`
Role uint8 `gorm:"default:0"`
} }
type Repos struct { type Repos struct {
db.ModelWithUID db.ModelPlace
CompanyUID string `gorm:"type:char(32);index"` CompanyUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(64)"`
Type uint8 `gorm:"default:0"`
} }
type Release struct { type Release struct {
db.ModelWithUID db.ModelContent
ReposUID string `gorm:"type:char(32);index"` ReposUID string `gorm:"type:char(32);index"`
UserUID string `gorm:"type:char(32);index"`
Title string `gorm:"type:varchar(64)"`
Content string
} }
func init() { db.CmdModels("", &UserRepos{}, &Repos{}, &Release{}) } func init() { db.CmdModels("", &UserRepos{}, &Repos{}, &Release{}) }

View File

@ -1,7 +1,5 @@
{ {
"portal": "系统开发", "portal": "系统开发",
"placeCreate": "创建项目",
"placeRemove": "删除项目",
"member": "项目成员", "member": "项目成员",
"release": "版本发布", "release": "版本发布",
"icons": { "icons": {

View File

@ -1,43 +1,8 @@
package development package development
import ( import "shylinux.com/x/ice"
"shylinux.com/x/ice"
"shylinux.com/x/enterprise/src/development/model" type userRepos struct{ Table }
)
type userRepos struct {
Table
repos repos
}
func (s userRepos) User(m *ice.Message, arg ...string) {
s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE)
if len(arg) == 1 {
s.Select(m, model.REPOS_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.REPOS_UID, arg[0], model.UID, arg[1])
} else {
return
}
m.RenameAppend(model.ROLE, model.USER_REPOS_ROLE)
s.SelectJoinUser(m)
}
func (s userRepos) List(m *ice.Message, arg ...string) {
s.Tables(m, s.repos).FieldsWithCreatedAT(m, s,
model.REPOS_NAME, model.REPOS_TYPE, model.USER_REPOS_ROLE,
model.COMPANY_UID, model.REPOS_UID,
)
if len(arg) == 1 {
s.Select(m, model.USER_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.USER_UID, arg[0], model.REPOS_UID, arg[1])
} else {
return
}
s.SelectJoinCompany(m)
s.SelectJoinCity(m)
}
func init() { ice.TeamCtxCmd(userRepos{}) } func init() { ice.TeamCtxCmd(userRepos{}) }

View File

@ -54,17 +54,12 @@ const (
) )
type UserStore struct { type UserStore struct {
db.ModelWithUID db.ModelUserPlace
UserUID string `gorm:"type:char(32);index"`
StoreUID string `gorm:"type:char(32);index"` StoreUID string `gorm:"type:char(32);index"`
Role uint8 `gorm:"default:0"`
Init uint8 `gorm:"default:0"`
} }
type Store struct { type Store struct {
db.ModelWithUID db.ModelPlace
CompanyUID string `gorm:"type:char(32);index"` CompanyUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(64)"`
Type uint8 `gorm:"default:0"`
} }
type Shop struct { type Shop struct {
db.ModelWithUID db.ModelWithUID

View File

@ -1,5 +1,5 @@
{ {
"portal": "供应链", "placeCreate": "创建生意", "placeRemove": "删除生意", "portal": "供应链",
"goods": "商品", "sell": "出货", "purchase": "进货", "expense": "开支", "goods": "商品", "sell": "出货", "purchase": "进货", "expense": "开支",
"payment": "付款", "express": "寄货", "return": "退贷", "refund": "退款", "payment": "付款", "express": "寄货", "return": "退贷", "refund": "退款",
"process": "生产", "again": "再来一单", "process": "生产", "again": "再来一单",

View File

@ -1,44 +1,8 @@
package gongyinglian package gongyinglian
import ( import "shylinux.com/x/ice"
"shylinux.com/x/ice"
"shylinux.com/x/enterprise/src/gongyinglian/model" type userStore struct{ Table }
)
type userStore struct {
Table
store store
}
func (s userStore) User(m *ice.Message, arg ...string) {
s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE)
if len(arg) == 1 {
s.Select(m, model.STORE_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.STORE_UID, arg[0], model.UID, arg[1])
} else {
return
}
m.RenameAppend(model.ROLE, model.USER_STORE_ROLE)
s.SelectJoinUser(m)
}
func (s userStore) List(m *ice.Message, arg ...string) {
s.Tables(m, s.store).FieldsWithCreatedAT(m, s,
model.STORE_NAME, model.STORE_TYPE, model.USER_STORE_ROLE,
model.COMPANY_UID, model.STORE_UID,
model.INIT,
)
if len(arg) == 1 {
s.Select(m, model.USER_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.USER_UID, arg[0], s.Key(s, model.STORE_UID), arg[1])
} else {
return
}
s.SelectJoinCompany(m)
s.SelectJoinCity(m)
}
func init() { ice.TeamCtxCmd(userStore{}) } func init() { ice.TeamCtxCmd(userStore{}) }

View File

@ -20,29 +20,19 @@ const (
) )
type UserGroup struct { type UserGroup struct {
db.ModelWithUID db.ModelUserPlace
UserUID string `gorm:"type:char(32);index"`
GroupUID string `gorm:"type:char(32);index"` GroupUID string `gorm:"type:char(32);index"`
Role uint8 `gorm:"default:0"`
} }
type Group struct { type Group struct {
db.ModelWithUID db.ModelPlace
CompanyUID string `gorm:"type:char(32);index"` CompanyUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(64)"`
Type uint8 `gorm:"default:0"`
} }
type Company struct { type Company struct {
db.ModelWithUID db.ModelStreet
CityUID string `gorm:"type:char(32);index:idx_city"`
Name string `gorm:"type:varchar(64);index:idx_city"`
Info string
} }
type Target struct { type Target struct {
db.ModelWithUID db.ModelContent
GroupUID string `gorm:"type:char(32);index"` GroupUID string `gorm:"type:char(32);index"`
UserUID string `gorm:"type:char(32)"`
Title string `gorm:"type:varchar(64)"`
Content string
} }
func init() { db.CmdModels("", &UserGroup{}, &Group{}, &Company{}, &Target{}) } func init() { db.CmdModels("", &UserGroup{}, &Group{}, &Company{}, &Target{}) }

View File

@ -1,7 +1,5 @@
{ {
"portal": "管理系统", "portal": "管理系统",
"placeCreate": "创建团队",
"placeRemove": "退出团队",
"target": "目标计划", "target": "目标计划",
"member": "团队成员", "member": "团队成员",
"icons": { "icons": {

View File

@ -1,43 +1,8 @@
package guanlixitong package guanlixitong
import ( import "shylinux.com/x/ice"
"shylinux.com/x/ice"
"shylinux.com/x/enterprise/src/guanlixitong/model" type userGroup struct{ Table }
)
type userGroup struct {
Table
group group
company company
}
func (s userGroup) User(m *ice.Message, arg ...string) {
s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE)
if len(arg) == 1 {
s.Select(m, model.GROUP_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.GROUP_UID, arg[0], model.UID, arg[1])
} else {
return
}
m.RenameAppend(model.ROLE, model.USER_GROUP_ROLE)
s.SelectJoinUser(m)
}
func (s userGroup) List(m *ice.Message, arg ...string) {
s.Tables(m, s.group, s.company).FieldsWithCreatedAT(m, s,
model.GROUP_NAME, model.GROUP_TYPE, model.USER_GROUP_ROLE,
model.CITY_UID, model.COMPANY_NAME, model.GROUP_UID,
)
if len(arg) == 1 {
s.Select(m, model.USER_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.USER_UID, arg[0], s.Key(s, model.GROUP_UID), arg[1])
} else {
return
}
s.SelectJoinCity(m)
}
func init() { ice.TeamCtxCmd(userGroup{Table: NewTable(userGroup{}, group{})}) } func init() { ice.TeamCtxCmd(userGroup{Table: NewTable(userGroup{}, group{})}) }

View File

@ -20,23 +20,16 @@ const (
) )
type UserCloud struct { type UserCloud struct {
db.ModelWithUID db.ModelUserPlace
UserUID string `gorm:"type:char(32);index"`
CloudUID string `gorm:"type:char(32);index"` CloudUID string `gorm:"type:char(32);index"`
Role uint8 `gorm:"default:0"`
} }
type Cloud struct { type Cloud struct {
db.ModelWithUID db.ModelPlace
CompanyUID string `gorm:"type:char(32);index"` CompanyUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(64)"`
Type uint8 `gorm:"default:0"`
} }
type Publish struct { type Publish struct {
db.ModelWithUID db.ModelContent
CloudUID string `gorm:"type:char(32);index"` CloudUID string `gorm:"type:char(32);index"`
UserUID string `gorm:"type:char(32);index"`
Title string `gorm:"type:varchar(64)"`
Content string
} }
func init() { db.CmdModels("", &UserCloud{}, &Cloud{}, &Publish{}) } func init() { db.CmdModels("", &UserCloud{}, &Cloud{}, &Publish{}) }

View File

@ -1,7 +1,5 @@
{ {
"portal": "系统运维", "portal": "系统运维",
"placeCreate": "创建集群",
"placeRemove": "删除集群",
"publish": "系统发布", "publish": "系统发布",
"icons": { "icons": {
"publish": "https://img.icons8.com/officel/80/activity-grid.png" "publish": "https://img.icons8.com/officel/80/activity-grid.png"

View File

@ -1,43 +1,8 @@
package operation package operation
import ( import "shylinux.com/x/ice"
"shylinux.com/x/ice"
"shylinux.com/x/enterprise/src/operation/model" type userCloud struct{ Table }
)
type userCloud struct {
Table
cloud cloud
}
func (s userCloud) User(m *ice.Message, arg ...string) {
s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE)
if len(arg) == 1 {
s.Select(m, model.CLOUD_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.CLOUD_UID, arg[0], model.UID, arg[1])
} else {
return
}
m.RenameAppend(model.ROLE, model.USER_CLOUD_ROLE)
s.SelectJoinUser(m)
}
func (s userCloud) List(m *ice.Message, arg ...string) {
s.Tables(m, s.cloud).FieldsWithCreatedAT(m, s,
model.CLOUD_NAME, model.CLOUD_TYPE, model.USER_CLOUD_ROLE,
model.COMPANY_UID, model.CLOUD_UID,
)
if len(arg) == 1 {
s.Select(m, model.USER_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.USER_UID, arg[0], s.Key(s, model.CLOUD_UID), arg[1])
} else {
return
}
s.SelectJoinCompany(m)
s.SelectJoinCity(m)
}
func init() { ice.TeamCtxCmd(userCloud{}) } func init() { ice.TeamCtxCmd(userCloud{}) }

View File

@ -3,41 +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_CHANNEL_ROLE = "user_channel_role" USER_CHANNEL_ROLE = "user_channel_role"
CHANNEL_UID = "channel_uid" CHANNEL_UID = "channel_uid"
CHANNEL_NAME = "channel_name" CHANNEL_NAME = "channel_name"
CHANNEL_TYPE = "channel_type" CHANNEL_TYPE = "channel_type"
PROMOTION_UID = "_uid" PROMOTION_UID = "promotion_uid"
COMPANY_UID = "company_uid" COMPANY_UID = "company_uid"
CITY_UID = "city_uid" CITY_UID = "city_uid"
) )
type UserChannel struct { type UserChannel struct {
db.ModelWithUID db.ModelUserPlace
UserUID string `gorm:"type:char(32);index"`
ChannelUID string `gorm:"type:char(32);index"` ChannelUID string `gorm:"type:char(32);index"`
Role uint8 `gorm:"default:0"`
} }
type Channel struct { type Channel struct {
db.ModelWithUID db.ModelPlace
CompanyUID string `gorm:"type:char(32);index"` CompanyUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(64)"`
Type uint8 `gorm:"default:0"`
} }
type Promotion struct { type Promotion struct {
db.ModelWithUID db.ModelContent
ChannelUID string `gorm:"type:char(32);index"` ChannelUID string `gorm:"type:char(32);index"`
UserUID string `gorm:"type:char(32);index"`
Title string `gorm:"type:varchar(64)"`
Content string
} }
func init() { db.CmdModels("", &UserChannel{}, &Channel{}, &Promotion{}) }
func init() { db.CmdModels("", &UserChannel{}, &Channel{}, &Promotion{}) }

View File

@ -1,7 +1,5 @@
{ {
"portal": "市场营销", "portal": "市场营销",
"placeCreate": "创建场景",
"placeRemove": "删除场景",
"": "场景应用", "": "场景应用",
"icons": { "icons": {
"": "https://img.icons8.com/officel/80/activity-grid.png" "": "https://img.icons8.com/officel/80/activity-grid.png"

View File

@ -1,43 +1,8 @@
package shichangyingxiao package shichangyingxiao
import ( import "shylinux.com/x/ice"
"shylinux.com/x/ice"
"shylinux.com/x/enterprise/src/shichangyingxiao/model" type userChannel struct{ Table }
)
type userChannel struct {
Table
channel channel
}
func (s userChannel) User(m *ice.Message, arg ...string) {
s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE)
if len(arg) == 1 {
s.Select(m, model.CHANNEL_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.CHANNEL_UID, arg[0], model.UID, arg[1])
} else {
return
}
m.RenameAppend(model.ROLE, model.USER_CHANNEL_ROLE)
s.SelectJoinUser(m)
}
func (s userChannel) List(m *ice.Message, arg ...string) {
s.Tables(m, s.channel).FieldsWithCreatedAT(m, s,
model.CHANNEL_NAME, model.CHANNEL_TYPE, model.USER_CHANNEL_ROLE,
model.COMPANY_UID, model.CHANNEL_UID,
)
if len(arg) == 1 {
s.Select(m, model.USER_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.USER_UID, arg[0], s.Key(s, model.CHANNEL_UID), arg[1])
} else {
return
}
s.SelectJoinCompany(m)
s.SelectJoinCity(m)
}
func init() { ice.TeamCtxCmd(userChannel{}) } func init() { ice.TeamCtxCmd(userChannel{}) }
@ -54,9 +19,9 @@ const (
var UserChannelRoleList = map[UserChannelRole]string{ var UserChannelRoleList = map[UserChannelRole]string{
UserChannelVisitor: "visitor", UserChannelVisitor: "visitor",
UserChannelCreator: "creator", UserChannelCreator: "creator",
UserChannelLeader: "leader", UserChannelLeader: "leader",
UserChannelWorker: "worker", UserChannelWorker: "worker",
UserChannelServer: "server", UserChannelServer: "server",
} }
func (s UserChannelRole) String() string { return UserChannelRoleList[s] } func (s UserChannelRole) String() string { return UserChannelRoleList[s] }

View File

@ -3,41 +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_INVESTOR_ROLE = "user_investor_role"
INVESTOR_UID = "investor_uid" INVESTOR_UID = "investor_uid"
INVESTOR_NAME = "investor_name" INVESTOR_NAME = "investor_name"
INVESTOR_TYPE = "investor_type" INVESTOR_TYPE = "investor_type"
INVESTMENT_UID = "_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 UserInvestor struct {
db.ModelWithUID db.ModelUserPlace
UserUID string `gorm:"type:char(32);index"`
InvestorUID string `gorm:"type:char(32);index"` InvestorUID string `gorm:"type:char(32);index"`
Role uint8 `gorm:"default:0"`
} }
type Investor struct { type Investor struct {
db.ModelWithUID db.ModelPlace
CompanyUID string `gorm:"type:char(32);index"` CompanyUID string `gorm:"type:char(32);index"`
Name string `gorm:"type:varchar(64)"`
Type uint8 `gorm:"default:0"`
} }
type Investment struct { type Investment struct {
db.ModelWithUID db.ModelContent
InvestorUID string `gorm:"type:char(32);index"` InvestorUID string `gorm:"type:char(32);index"`
UserUID string `gorm:"type:char(32);index"`
Title string `gorm:"type:varchar(64)"`
Content string
} }
func init() { db.CmdModels("", &UserInvestor{}, &Investor{}, &Investment{}) }
func init() { db.CmdModels("", &UserInvestor{}, &Investor{}, &Investment{}) }

View File

@ -1,7 +1,5 @@
{ {
"portal": "资金链", "portal": "资金链",
"placeCreate": "创建场景",
"placeRemove": "删除场景",
"": "场景应用", "": "场景应用",
"icons": { "icons": {
"": "https://img.icons8.com/officel/80/activity-grid.png" "": "https://img.icons8.com/officel/80/activity-grid.png"

View File

@ -1,43 +1,8 @@
package zijinlian package zijinlian
import ( import "shylinux.com/x/ice"
"shylinux.com/x/ice"
"shylinux.com/x/enterprise/src/zijinlian/model" type userInvestor struct{ Table }
)
type userInvestor struct {
Table
investor investor
}
func (s userInvestor) User(m *ice.Message, arg ...string) {
s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE)
if len(arg) == 1 {
s.Select(m, model.INVESTOR_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.INVESTOR_UID, arg[0], model.UID, arg[1])
} else {
return
}
m.RenameAppend(model.ROLE, model.USER_INVESTOR_ROLE)
s.SelectJoinUser(m)
}
func (s userInvestor) List(m *ice.Message, arg ...string) {
s.Tables(m, s.investor).FieldsWithCreatedAT(m, s,
model.INVESTOR_NAME, model.INVESTOR_TYPE, model.USER_INVESTOR_ROLE,
model.COMPANY_UID, model.INVESTOR_UID,
)
if len(arg) == 1 {
s.Select(m, model.USER_UID, arg[0])
} else if len(arg) == 2 {
s.SelectDetail(m, model.USER_UID, arg[0], s.Key(s, model.INVESTOR_UID), arg[1])
} else {
return
}
s.SelectJoinCompany(m)
s.SelectJoinCity(m)
}
func init() { ice.TeamCtxCmd(userInvestor{}) } func init() { ice.TeamCtxCmd(userInvestor{}) }
@ -54,9 +19,9 @@ const (
var UserInvestorRoleList = map[UserInvestorRole]string{ var UserInvestorRoleList = map[UserInvestorRole]string{
UserInvestorVisitor: "visitor", UserInvestorVisitor: "visitor",
UserInvestorCreator: "creator", UserInvestorCreator: "creator",
UserInvestorLeader: "leader", UserInvestorLeader: "leader",
UserInvestorWorker: "worker", UserInvestorWorker: "worker",
UserInvestorServer: "server", UserInvestorServer: "server",
} }
func (s UserInvestorRole) String() string { return UserInvestorRoleList[s] } func (s UserInvestorRole) String() string { return UserInvestorRoleList[s] }