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 {
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{}) }

View File

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

View File

@ -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{}) }

View File

@ -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

View File

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

View File

@ -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{}) }

View File

@ -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{}) }

View File

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

View File

@ -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{})}) }

View File

@ -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{}) }

View File

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

View File

@ -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{}) }

View File

@ -14,30 +14,22 @@ const (
CHANNEL_UID = "channel_uid"
CHANNEL_NAME = "channel_name"
CHANNEL_TYPE = "channel_type"
PROMOTION_UID = "_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{}) }

View File

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

View File

@ -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{}) }

View File

@ -14,30 +14,22 @@ const (
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"
)
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{}) }

View File

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

View File

@ -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{}) }