mirror of
https://shylinux.com/x/enterprise
synced 2025-04-25 09:08:06 +08:00
add some
This commit is contained in:
parent
ea1d354e02
commit
cde3aeb19c
@ -20,23 +20,16 @@ const (
|
||||
)
|
||||
|
||||
type UserRepos struct {
|
||||
db.ModelWithUID
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
db.ModelUserPlace
|
||||
ReposUID string `gorm:"type:char(32);index"`
|
||||
Role uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Repos struct {
|
||||
db.ModelWithUID
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Type uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Release struct {
|
||||
db.ModelWithUID
|
||||
db.ModelContent
|
||||
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{}) }
|
||||
|
@ -1,7 +1,5 @@
|
||||
{
|
||||
"portal": "系统开发",
|
||||
"placeCreate": "创建项目",
|
||||
"placeRemove": "删除项目",
|
||||
"member": "项目成员",
|
||||
"release": "版本发布",
|
||||
"icons": {
|
||||
|
@ -1,43 +1,8 @@
|
||||
package development
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/development/model"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
type userRepos struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userRepos{}) }
|
||||
|
||||
|
@ -54,17 +54,12 @@ const (
|
||||
)
|
||||
|
||||
type UserStore struct {
|
||||
db.ModelWithUID
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
db.ModelUserPlace
|
||||
StoreUID string `gorm:"type:char(32);index"`
|
||||
Role uint8 `gorm:"default:0"`
|
||||
Init uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Store struct {
|
||||
db.ModelWithUID
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Type uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Shop struct {
|
||||
db.ModelWithUID
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"portal": "供应链", "placeCreate": "创建生意", "placeRemove": "删除生意",
|
||||
"portal": "供应链",
|
||||
"goods": "商品", "sell": "出货", "purchase": "进货", "expense": "开支",
|
||||
"payment": "付款", "express": "寄货", "return": "退贷", "refund": "退款",
|
||||
"process": "生产", "again": "再来一单",
|
||||
|
@ -1,44 +1,8 @@
|
||||
package gongyinglian
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/gongyinglian/model"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
type userStore struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userStore{}) }
|
||||
|
||||
|
@ -20,29 +20,19 @@ const (
|
||||
)
|
||||
|
||||
type UserGroup struct {
|
||||
db.ModelWithUID
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
db.ModelUserPlace
|
||||
GroupUID string `gorm:"type:char(32);index"`
|
||||
Role uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Group struct {
|
||||
db.ModelWithUID
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Type uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Company struct {
|
||||
db.ModelWithUID
|
||||
CityUID string `gorm:"type:char(32);index:idx_city"`
|
||||
Name string `gorm:"type:varchar(64);index:idx_city"`
|
||||
Info string
|
||||
db.ModelStreet
|
||||
}
|
||||
type Target struct {
|
||||
db.ModelWithUID
|
||||
db.ModelContent
|
||||
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{}) }
|
||||
|
@ -1,7 +1,5 @@
|
||||
{
|
||||
"portal": "管理系统",
|
||||
"placeCreate": "创建团队",
|
||||
"placeRemove": "退出团队",
|
||||
"target": "目标计划",
|
||||
"member": "团队成员",
|
||||
"icons": {
|
||||
|
@ -1,43 +1,8 @@
|
||||
package guanlixitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong/model"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
type userGroup struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userGroup{Table: NewTable(userGroup{}, group{})}) }
|
||||
|
||||
|
@ -20,23 +20,16 @@ const (
|
||||
)
|
||||
|
||||
type UserCloud struct {
|
||||
db.ModelWithUID
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
db.ModelUserPlace
|
||||
CloudUID string `gorm:"type:char(32);index"`
|
||||
Role uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Cloud struct {
|
||||
db.ModelWithUID
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Type uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Publish struct {
|
||||
db.ModelWithUID
|
||||
db.ModelContent
|
||||
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{}) }
|
||||
|
@ -1,7 +1,5 @@
|
||||
{
|
||||
"portal": "系统运维",
|
||||
"placeCreate": "创建集群",
|
||||
"placeRemove": "删除集群",
|
||||
"publish": "系统发布",
|
||||
"icons": {
|
||||
"publish": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
|
@ -1,43 +1,8 @@
|
||||
package operation
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/operation/model"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
type userCloud struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userCloud{}) }
|
||||
|
||||
|
@ -3,41 +3,33 @@ package model
|
||||
import "shylinux.com/x/mysql-story/src/db"
|
||||
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
USER_CHANNEL_ROLE = "user_channel_role"
|
||||
CHANNEL_UID = "channel_uid"
|
||||
CHANNEL_NAME = "channel_name"
|
||||
CHANNEL_TYPE = "channel_type"
|
||||
PROMOTION_UID = "_uid"
|
||||
COMPANY_UID = "company_uid"
|
||||
CITY_UID = "city_uid"
|
||||
PROMOTION_UID = "promotion_uid"
|
||||
COMPANY_UID = "company_uid"
|
||||
CITY_UID = "city_uid"
|
||||
)
|
||||
|
||||
type UserChannel struct {
|
||||
db.ModelWithUID
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
db.ModelUserPlace
|
||||
ChannelUID string `gorm:"type:char(32);index"`
|
||||
Role uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Channel struct {
|
||||
db.ModelWithUID
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Type uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Promotion struct {
|
||||
db.ModelWithUID
|
||||
db.ModelContent
|
||||
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{}) }
|
@ -1,7 +1,5 @@
|
||||
{
|
||||
"portal": "市场营销",
|
||||
"placeCreate": "创建场景",
|
||||
"placeRemove": "删除场景",
|
||||
"": "场景应用",
|
||||
"icons": {
|
||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
|
@ -1,43 +1,8 @@
|
||||
package shichangyingxiao
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/shichangyingxiao/model"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
type userChannel struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userChannel{}) }
|
||||
|
||||
@ -54,9 +19,9 @@ const (
|
||||
var UserChannelRoleList = map[UserChannelRole]string{
|
||||
UserChannelVisitor: "visitor",
|
||||
UserChannelCreator: "creator",
|
||||
UserChannelLeader: "leader",
|
||||
UserChannelWorker: "worker",
|
||||
UserChannelServer: "server",
|
||||
UserChannelLeader: "leader",
|
||||
UserChannelWorker: "worker",
|
||||
UserChannelServer: "server",
|
||||
}
|
||||
|
||||
func (s UserChannelRole) String() string { return UserChannelRoleList[s] }
|
@ -3,41 +3,33 @@ package model
|
||||
import "shylinux.com/x/mysql-story/src/db"
|
||||
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
USER_INVESTOR_ROLE = "user_investor_role"
|
||||
INVESTOR_UID = "investor_uid"
|
||||
INVESTOR_NAME = "investor_name"
|
||||
INVESTOR_TYPE = "investor_type"
|
||||
INVESTMENT_UID = "_uid"
|
||||
INVESTMENT_UID = "investment_uid"
|
||||
COMPANY_UID = "company_uid"
|
||||
CITY_UID = "city_uid"
|
||||
CITY_UID = "city_uid"
|
||||
)
|
||||
|
||||
type UserInvestor struct {
|
||||
db.ModelWithUID
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
db.ModelUserPlace
|
||||
InvestorUID string `gorm:"type:char(32);index"`
|
||||
Role uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Investor struct {
|
||||
db.ModelWithUID
|
||||
db.ModelPlace
|
||||
CompanyUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Type uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Investment struct {
|
||||
db.ModelWithUID
|
||||
db.ModelContent
|
||||
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{}) }
|
@ -1,7 +1,5 @@
|
||||
{
|
||||
"portal": "资金链",
|
||||
"placeCreate": "创建场景",
|
||||
"placeRemove": "删除场景",
|
||||
"": "场景应用",
|
||||
"icons": {
|
||||
"": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
|
@ -1,43 +1,8 @@
|
||||
package zijinlian
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/zijinlian/model"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
type userInvestor struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(userInvestor{}) }
|
||||
|
||||
@ -54,9 +19,9 @@ const (
|
||||
var UserInvestorRoleList = map[UserInvestorRole]string{
|
||||
UserInvestorVisitor: "visitor",
|
||||
UserInvestorCreator: "creator",
|
||||
UserInvestorLeader: "leader",
|
||||
UserInvestorWorker: "worker",
|
||||
UserInvestorServer: "server",
|
||||
UserInvestorLeader: "leader",
|
||||
UserInvestorWorker: "worker",
|
||||
UserInvestorServer: "server",
|
||||
}
|
||||
|
||||
func (s UserInvestorRole) String() string { return UserInvestorRoleList[s] }
|
Loading…
x
Reference in New Issue
Block a user