From a190cf91bfd024417e99002f9c7cda3b08f85d7f Mon Sep 17 00:00:00 2001 From: jingganjiaoyu Date: Fri, 30 Aug 2024 21:56:19 +0800 Subject: [PATCH] opt some --- src/jiaocaiziliao/model/model.go | 14 +---- src/jiaocaiziliao/userIssuer.go | 40 +----------- src/jiaowuxitong/model/model.go | 18 ++---- src/jiaowuxitong/portal.json | 2 - src/jiaowuxitong/userClass.go | 39 +----------- src/kaoshixitong/common.go | 6 +- src/kaoshixitong/model/model.go | 36 +++++------ src/kaoshixitong/portal.json | 6 +- src/kaoshixitong/userExam.go | 47 ++------------ src/main.go | 6 +- src/shichangyingxiao/channel.go | 23 ------- src/shichangyingxiao/common.go | 52 ---------------- src/shichangyingxiao/model/model.go | 43 ------------- src/shichangyingxiao/portal.go | 15 ----- src/shichangyingxiao/portal.json | 33 ---------- src/shichangyingxiao/promotion.go | 25 -------- src/shichangyingxiao/promotion.js | 9 --- src/shichangyingxiao/userChannel.go | 62 ------------------- src/zaixianketang/model/model.go | 36 +++++------ src/zaixianketang/portal.json | 2 - src/zaixianketang/userCourse.go | 47 ++------------ src/zhengshuxitong/auth.go | 23 ------- src/zhengshuxitong/cert.go | 25 -------- src/zhengshuxitong/cert.js | 9 --- src/zhengshuxitong/common.go | 52 ---------------- src/zhengshuxitong/model/model.go | 43 ------------- src/zhengshuxitong/portal.go | 15 ----- src/zhengshuxitong/portal.json | 33 ---------- src/zhengshuxitong/userAuth.go | 62 ------------------- src/zijinlian/common.go | 52 ---------------- src/zijinlian/investment.go | 25 -------- src/zijinlian/investment.js | 9 --- src/zijinlian/investor.go | 23 ------- src/zijinlian/model/model.go | 43 ------------- src/zijinlian/portal.go | 15 ----- src/zijinlian/portal.json | 33 ---------- src/zijinlian/userInvestor.go | 62 ------------------- .../web.team.kaoshixitong.portal/hash.json | 8 +++ 38 files changed, 66 insertions(+), 1027 deletions(-) delete mode 100644 src/shichangyingxiao/channel.go delete mode 100644 src/shichangyingxiao/common.go delete mode 100644 src/shichangyingxiao/model/model.go delete mode 100644 src/shichangyingxiao/portal.go delete mode 100644 src/shichangyingxiao/portal.json delete mode 100644 src/shichangyingxiao/promotion.go delete mode 100644 src/shichangyingxiao/promotion.js delete mode 100644 src/shichangyingxiao/userChannel.go delete mode 100644 src/zhengshuxitong/auth.go delete mode 100644 src/zhengshuxitong/cert.go delete mode 100644 src/zhengshuxitong/cert.js delete mode 100644 src/zhengshuxitong/common.go delete mode 100644 src/zhengshuxitong/model/model.go delete mode 100644 src/zhengshuxitong/portal.go delete mode 100644 src/zhengshuxitong/portal.json delete mode 100644 src/zhengshuxitong/userAuth.go delete mode 100644 src/zijinlian/common.go delete mode 100644 src/zijinlian/investment.go delete mode 100644 src/zijinlian/investment.js delete mode 100644 src/zijinlian/investor.go delete mode 100644 src/zijinlian/model/model.go delete mode 100644 src/zijinlian/portal.go delete mode 100644 src/zijinlian/portal.json delete mode 100644 src/zijinlian/userInvestor.go diff --git a/src/jiaocaiziliao/model/model.go b/src/jiaocaiziliao/model/model.go index e9ea3ac..66fe899 100644 --- a/src/jiaocaiziliao/model/model.go +++ b/src/jiaocaiziliao/model/model.go @@ -24,31 +24,23 @@ const ( ) type UserIssuer struct { - db.ModelWithUID - UserUID string `gorm:"type:char(32);index"` + db.ModelUserPlace IssuerUID string `gorm:"type:char(32);index"` - Role uint8 `gorm:"default:0"` } type Issuer struct { - db.ModelWithUID + db.ModelPlace CompanyUID string `gorm:"type:char(32);index"` - Name string `gorm:"type:varchar(64)"` - Type uint8 `gorm:"default:0"` Link string `gorm:"type:varchar(255)"` - Init uint8 } type Document struct { - db.ModelWithUID + db.ModelContent IssuerUID string `gorm:"type:char(32);index"` - UserUID string `gorm:"type:char(32);index"` School string `gorm:"type:varchar(32)"` Subject string `gorm:"type:varchar(32)"` Grade string `gorm:"type:varchar(32)"` Type uint8 `gorm:"default:0"` Icon string `gorm:"type:varchar(64)"` Link string `gorm:"type:varchar(255)"` - Title string `gorm:"type:varchar(64)"` - Content string } func init() { db.CmdModels("", &UserIssuer{}, &Issuer{}, &Document{}) } diff --git a/src/jiaocaiziliao/userIssuer.go b/src/jiaocaiziliao/userIssuer.go index 351baa6..fe1fd69 100644 --- a/src/jiaocaiziliao/userIssuer.go +++ b/src/jiaocaiziliao/userIssuer.go @@ -1,44 +1,8 @@ package jiaocaiziliao -import ( - "shylinux.com/x/ice" +import "shylinux.com/x/ice" - "shylinux.com/x/education/src/jiaocaiziliao/model" -) - -type userIssuer struct { - Table - issuer issuer -} - -func (s userIssuer) User(m *ice.Message, arg ...string) { - s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE) - if len(arg) == 1 { - s.Select(m, model.ISSUER_UID, arg[0]) - } else if len(arg) == 2 { - s.SelectDetail(m, model.ISSUER_UID, arg[0], model.UID, arg[1]) - } else { - return - } - m.RenameAppend(model.ROLE, model.USER_ISSUER_ROLE) - s.SelectJoinUser(m) -} -func (s userIssuer) List(m *ice.Message, arg ...string) { - s.Tables(m, s.issuer).FieldsWithCreatedAT(m, s, - model.ISSUER_NAME, model.ISSUER_TYPE, model.USER_ISSUER_ROLE, - model.COMPANY_UID, model.ISSUER_UID, - model.INIT, model.LINK, - ) - 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.ISSUER_UID), arg[1]) - } else { - return - } - s.SelectJoinCompany(m) - s.SelectJoinCity(m) -} +type userIssuer struct{ Table } func init() { ice.TeamCtxCmd(userIssuer{}) } diff --git a/src/jiaowuxitong/model/model.go b/src/jiaowuxitong/model/model.go index 50683b1..8844ec6 100644 --- a/src/jiaowuxitong/model/model.go +++ b/src/jiaowuxitong/model/model.go @@ -21,30 +21,20 @@ const ( ) type UserClass struct { - db.ModelWithUID - UserUID string `gorm:"type:char(32);index"` + db.ModelUserPlace ClassUID string `gorm:"type:char(32);index"` - Role uint8 `gorm:"default:0"` } type Class struct { - db.ModelWithUID + db.ModelPlace SchoolUID string `gorm:"type:char(32);index"` Grade string `gorm:"type:varchar(32)"` - Name string `gorm:"type:varchar(64)"` - Type uint8 `gorm:"default:0"` } type School 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 Homework struct { - db.ModelWithUID + db.ModelContent ClassUID string `gorm:"type:char(32);index"` - UserUID string `gorm:"type:char(32)"` - Title string `gorm:"type:varchar(64)"` - Content string } func init() { db.CmdModels("", &UserClass{}, &Class{}, &School{}, &Homework{}) } diff --git a/src/jiaowuxitong/portal.json b/src/jiaowuxitong/portal.json index b4fb50b..c3717bd 100644 --- a/src/jiaowuxitong/portal.json +++ b/src/jiaowuxitong/portal.json @@ -1,7 +1,5 @@ { "portal": "教务系统", - "placeCreate": "创建班级", - "placeRemove": "删除班级", "member": "班级成员", "homework": "家庭作业", "icons": { diff --git a/src/jiaowuxitong/userClass.go b/src/jiaowuxitong/userClass.go index 61b6085..e2d84a1 100644 --- a/src/jiaowuxitong/userClass.go +++ b/src/jiaowuxitong/userClass.go @@ -1,43 +1,8 @@ package jiaowuxitong -import ( - "shylinux.com/x/ice" +import "shylinux.com/x/ice" - "shylinux.com/x/education/src/jiaowuxitong/model" -) - -type userClass struct { - Table - class class - school school -} - -func (s userClass) User(m *ice.Message, arg ...string) { - s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE) - if len(arg) == 1 { - s.Select(m, model.CLASS_UID, arg[0]) - } else if len(arg) == 2 { - s.SelectDetail(m, model.CLASS_UID, arg[0], model.UID, arg[1]) - } else { - return - } - m.RenameAppend(model.ROLE, model.USER_CLASS_ROLE) - s.SelectJoinUser(m) -} -func (s userClass) List(m *ice.Message, arg ...string) { - s.Tables(m, s.class, s.school).FieldsWithCreatedAT(m, s, - model.CLASS_NAME, model.CLASS_TYPE, model.USER_CLASS_ROLE, - model.CITY_UID, model.SCHOOL_NAME, model.GRADE, model.CLASS_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.CLASS_UID), arg[1]) - } else { - return - } - s.SelectJoinCity(m) -} +type userClass struct{ Table } func init() { ice.TeamCtxCmd(userClass{Table: newTable()}) } diff --git a/src/kaoshixitong/common.go b/src/kaoshixitong/common.go index 13e1a7e..2f16b56 100644 --- a/src/kaoshixitong/common.go +++ b/src/kaoshixitong/common.go @@ -4,8 +4,8 @@ import ( "shylinux.com/x/ice" kit "shylinux.com/x/toolkits" - "shylinux.com/x/enterprise/src/guanlixitong" "shylinux.com/x/education/src/kaoshixitong/model" + "shylinux.com/x/enterprise/src/guanlixitong" ) type Table struct { @@ -47,6 +47,6 @@ func (s Table) recordEventWithName(m *ice.Message, info string, arg ...string) { s.Table.RecordEventWithName(m, m.Option(model.EXAM_UID), info) } -type Tables struct { Table } +type Tables struct{ Table } -func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {} \ No newline at end of file +func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {} diff --git a/src/kaoshixitong/model/model.go b/src/kaoshixitong/model/model.go index 8bc3b1a..7ddaee5 100644 --- a/src/kaoshixitong/model/model.go +++ b/src/kaoshixitong/model/model.go @@ -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_EXAM_ROLE = "user_exam_role" EXAM_UID = "exam_uid" EXAM_NAME = "exam_name" EXAM_TYPE = "exam_type" - QUESTION_UID = "_uid" - COMPANY_UID = "company_uid" - CITY_UID = "city_uid" + QUESTION_UID = "question_uid" + COMPANY_UID = "company_uid" + CITY_UID = "city_uid" ) type UserExam struct { - db.ModelWithUID - UserUID string `gorm:"type:char(32);index"` + db.ModelUserPlace ExamUID string `gorm:"type:char(32);index"` - Role uint8 `gorm:"default:0"` } type Exam struct { - db.ModelWithUID + db.ModelPlace CompanyUID string `gorm:"type:char(32);index"` - Name string `gorm:"type:varchar(64)"` - Type uint8 `gorm:"default:0"` } type Question struct { - db.ModelWithUID + db.ModelContent ExamUID 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("", &UserExam{}, &Exam{}, &Question{}) } \ No newline at end of file +func init() { db.CmdModels("", &UserExam{}, &Exam{}, &Question{}) } diff --git a/src/kaoshixitong/portal.json b/src/kaoshixitong/portal.json index 095bf06..895a916 100644 --- a/src/kaoshixitong/portal.json +++ b/src/kaoshixitong/portal.json @@ -1,10 +1,8 @@ { "portal": "考试系统", - "placeCreate": "创建场景", - "placeRemove": "删除场景", - "": "场景应用", + "question": "场景应用", "icons": { - "": "https://img.icons8.com/officel/80/activity-grid.png" + "question": "https://img.icons8.com/officel/80/activity-grid.png" }, "input": { "My Exam": "我的场景", diff --git a/src/kaoshixitong/userExam.go b/src/kaoshixitong/userExam.go index 95f8440..425082b 100644 --- a/src/kaoshixitong/userExam.go +++ b/src/kaoshixitong/userExam.go @@ -1,43 +1,8 @@ package kaoshixitong -import ( - "shylinux.com/x/ice" +import "shylinux.com/x/ice" - "shylinux.com/x/education/src/kaoshixitong/model" -) - -type userExam struct { - Table - exam exam -} - -func (s userExam) User(m *ice.Message, arg ...string) { - s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE) - if len(arg) == 1 { - s.Select(m, model.EXAM_UID, arg[0]) - } else if len(arg) == 2 { - s.SelectDetail(m, model.EXAM_UID, arg[0], model.UID, arg[1]) - } else { - return - } - m.RenameAppend(model.ROLE, model.USER_EXAM_ROLE) - s.SelectJoinUser(m) -} -func (s userExam) List(m *ice.Message, arg ...string) { - s.Tables(m, s.exam).FieldsWithCreatedAT(m, s, - model.EXAM_NAME, model.EXAM_TYPE, model.USER_EXAM_ROLE, - model.COMPANY_UID, model.EXAM_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.EXAM_UID), arg[1]) - } else { - return - } - s.SelectJoinCompany(m) - s.SelectJoinCity(m) -} +type userExam struct{ Table } func init() { ice.TeamCtxCmd(userExam{}) } @@ -54,9 +19,9 @@ const ( var UserExamRoleList = map[UserExamRole]string{ UserExamVisitor: "visitor", UserExamCreator: "creator", - UserExamLeader: "leader", - UserExamWorker: "worker", - UserExamServer: "server", + UserExamLeader: "leader", + UserExamWorker: "worker", + UserExamServer: "server", } -func (s UserExamRole) String() string { return UserExamRoleList[s] } \ No newline at end of file +func (s UserExamRole) String() string { return UserExamRoleList[s] } diff --git a/src/main.go b/src/main.go index a37a154..4f71df7 100644 --- a/src/main.go +++ b/src/main.go @@ -3,14 +3,12 @@ package main import ( "shylinux.com/x/ice" + _ "shylinux.com/x/education/src/jiaocaiziliao" _ "shylinux.com/x/education/src/jiaowuxitong" _ "shylinux.com/x/education/src/kaoshixitong" _ "shylinux.com/x/education/src/zaixianketang" - _ "shylinux.com/x/education/src/zhengshuxitong" - - _ "shylinux.com/x/education/src/jiaocaiziliao" ) func main() { print(ice.Run()) } -func init() { ice.Info.Titles = "云教育" } \ No newline at end of file +func init() { ice.Info.Titles = "云教育" } diff --git a/src/shichangyingxiao/channel.go b/src/shichangyingxiao/channel.go deleted file mode 100644 index ca9c44c..0000000 --- a/src/shichangyingxiao/channel.go +++ /dev/null @@ -1,23 +0,0 @@ -package shichangyingxiao - -import "shylinux.com/x/ice" - -type channel struct{ Table } - -func init() { ice.TeamCtxCmd(channel{}) } - -type ChannelType int - -const ( - ChannelRD ChannelType = iota - ChannelOP - ChannelHR -) - -var ChannelTypeList = map[ChannelType]string{ - ChannelRD: "RD", - ChannelOP: "OP", - ChannelHR: "HR", -} - -func (s ChannelType) String() string { return ChannelTypeList[s] } \ No newline at end of file diff --git a/src/shichangyingxiao/common.go b/src/shichangyingxiao/common.go deleted file mode 100644 index de346eb..0000000 --- a/src/shichangyingxiao/common.go +++ /dev/null @@ -1,52 +0,0 @@ -package shichangyingxiao - -import ( - "shylinux.com/x/ice" - kit "shylinux.com/x/toolkits" - - "shylinux.com/x/enterprise/src/guanlixitong" - "shylinux.com/x/education/src/shichangyingxiao/model" -) - -type Table struct { - guanlixitong.Table - list string `name:"list channel_uid uid auto" role:"void"` -} - -func (s Table) Inputs(m *ice.Message, arg ...string) { - switch arg[0] { - case model.USER_CHANNEL_ROLE: - s.InputsListRole(m, UserChannelRoleList, arg...) - case model.CHANNEL_TYPE: - s.InputsList(m, ChannelTypeList, arg...) - default: - s.Table.Inputs(m, arg...) - } -} -func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message { - m.RewriteAppend(func(value, key string, index int) string { - switch key { - case model.USER_CHANNEL_ROLE: - value = UserChannelRole(kit.Int(value)).String() - case model.CHANNEL_TYPE: - value = ChannelType(kit.Int(value)).String() - } - return value - }) - 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 } - -func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {} \ No newline at end of file diff --git a/src/shichangyingxiao/model/model.go b/src/shichangyingxiao/model/model.go deleted file mode 100644 index dee4a3d..0000000 --- a/src/shichangyingxiao/model/model.go +++ /dev/null @@ -1,43 +0,0 @@ -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" - 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" -) - -type UserChannel struct { - db.ModelWithUID - UserUID string `gorm:"type:char(32);index"` - ChannelUID string `gorm:"type:char(32);index"` - Role uint8 `gorm:"default:0"` -} -type Channel struct { - db.ModelWithUID - CompanyUID string `gorm:"type:char(32);index"` - Name string `gorm:"type:varchar(64)"` - Type uint8 `gorm:"default:0"` -} -type Promotion struct { - db.ModelWithUID - 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{}) } \ No newline at end of file diff --git a/src/shichangyingxiao/portal.go b/src/shichangyingxiao/portal.go deleted file mode 100644 index 9713e82..0000000 --- a/src/shichangyingxiao/portal.go +++ /dev/null @@ -1,15 +0,0 @@ -package shichangyingxiao - -import ( - "shylinux.com/x/community/src/gonganxitong" - "shylinux.com/x/enterprise/src/guanlixitong" -) - -type Portal struct { - gonganxitong.Portal - placeCreate string `name:"placeCreate city_name* company_name* channel_name*" role:"void"` -} - -func init() { - gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userChannel{}, channel{}, guanlixitong.Company{})}) -} \ No newline at end of file diff --git a/src/shichangyingxiao/portal.json b/src/shichangyingxiao/portal.json deleted file mode 100644 index cf3ae0a..0000000 --- a/src/shichangyingxiao/portal.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "portal": "市场营销", - "placeCreate": "创建场景", - "placeRemove": "删除场景", - "": "场景应用", - "icons": { - "": "https://img.icons8.com/officel/80/activity-grid.png" - }, - "input": { - "My Channel": "我的场景", - "user_channel_role": "用户角色", - "channel_name": "场景名称", - "channel_type": "场景类型" - }, - "value": { - "user_channel_role": { - "visitor": "访客", - "creator": "创建人", - "leader": "管理人员", - "worker": "工作人员", - "server": "服务人员", - "style": { - "creator": "danger" - } - }, - "channel_type": { - "term": "学期制", - "weekly": "周期性", - "step": "阶段性", - "free": "自由式" - } - } -} \ No newline at end of file diff --git a/src/shichangyingxiao/promotion.go b/src/shichangyingxiao/promotion.go deleted file mode 100644 index 43d9367..0000000 --- a/src/shichangyingxiao/promotion.go +++ /dev/null @@ -1,25 +0,0 @@ -package shichangyingxiao - -import ( - "shylinux.com/x/ice" - kit "shylinux.com/x/toolkits" - - "shylinux.com/x/education/src/shichangyingxiao/model" -) - -type promotion struct { - Table - channel channel - userChannel userChannel - create string `name:"create title* content*" role:"leader"` -} - -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.recordEventWithName(m, "") -} -func (s promotion) List(m *ice.Message, arg ...string) { - s.TablesWithRole(m, arg, s.userChannel, s.channel, s, model.TITLE, model.CONTENT).Display("") -} - -func init() { ice.TeamCtxCmd(promotion{}) } \ No newline at end of file diff --git a/src/shichangyingxiao/promotion.js b/src/shichangyingxiao/promotion.js deleted file mode 100644 index b7ff53c..0000000 --- a/src/shichangyingxiao/promotion.js +++ /dev/null @@ -1,9 +0,0 @@ -Volcanos(chat.ONIMPORT, { - _init: function(can, msg) { can.onimport.shareTitle(can, msg) - can.onimport.itemcards(can, msg, function(value) { return [ - {view: html.TITLE, list: [value.title]}, - {view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]}, - {view: html.OUTPUT, list: [value.content]}, - ] }) - }, -}) \ No newline at end of file diff --git a/src/shichangyingxiao/userChannel.go b/src/shichangyingxiao/userChannel.go deleted file mode 100644 index fa3d2b0..0000000 --- a/src/shichangyingxiao/userChannel.go +++ /dev/null @@ -1,62 +0,0 @@ -package shichangyingxiao - -import ( - "shylinux.com/x/ice" - - "shylinux.com/x/education/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) -} - -func init() { ice.TeamCtxCmd(userChannel{}) } - -type UserChannelRole int - -const ( - 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] } \ No newline at end of file diff --git a/src/zaixianketang/model/model.go b/src/zaixianketang/model/model.go index 9dcfcfc..71b3498 100644 --- a/src/zaixianketang/model/model.go +++ b/src/zaixianketang/model/model.go @@ -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_COURSE_ROLE = "user_course_role" COURSE_UID = "course_uid" COURSE_NAME = "course_name" COURSE_TYPE = "course_type" - LESSON_UID = "_uid" - COMPANY_UID = "company_uid" - CITY_UID = "city_uid" + LESSON_UID = "lesson_uid" + COMPANY_UID = "company_uid" + CITY_UID = "city_uid" ) type UserCourse struct { - db.ModelWithUID - UserUID string `gorm:"type:char(32);index"` + db.ModelUserPlace CourseUID string `gorm:"type:char(32);index"` - Role uint8 `gorm:"default:0"` } type Course struct { - db.ModelWithUID + db.ModelPlace CompanyUID string `gorm:"type:char(32);index"` - Name string `gorm:"type:varchar(64)"` - Type uint8 `gorm:"default:0"` } type Lesson struct { - db.ModelWithUID + db.ModelContent CourseUID 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("", &UserCourse{}, &Course{}, &Lesson{}) } \ No newline at end of file +func init() { db.CmdModels("", &UserCourse{}, &Course{}, &Lesson{}) } diff --git a/src/zaixianketang/portal.json b/src/zaixianketang/portal.json index dbd270c..8cc733a 100644 --- a/src/zaixianketang/portal.json +++ b/src/zaixianketang/portal.json @@ -1,7 +1,5 @@ { "portal": "在线课堂", - "placeCreate": "创建场景", - "placeRemove": "删除场景", "": "场景应用", "icons": { "": "https://img.icons8.com/officel/80/activity-grid.png" diff --git a/src/zaixianketang/userCourse.go b/src/zaixianketang/userCourse.go index 9b3197f..3e81209 100644 --- a/src/zaixianketang/userCourse.go +++ b/src/zaixianketang/userCourse.go @@ -1,43 +1,8 @@ package zaixianketang -import ( - "shylinux.com/x/ice" +import "shylinux.com/x/ice" - "shylinux.com/x/education/src/zaixianketang/model" -) - -type userCourse struct { - Table - course course -} - -func (s userCourse) User(m *ice.Message, arg ...string) { - s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE) - if len(arg) == 1 { - s.Select(m, model.COURSE_UID, arg[0]) - } else if len(arg) == 2 { - s.SelectDetail(m, model.COURSE_UID, arg[0], model.UID, arg[1]) - } else { - return - } - m.RenameAppend(model.ROLE, model.USER_COURSE_ROLE) - s.SelectJoinUser(m) -} -func (s userCourse) List(m *ice.Message, arg ...string) { - s.Tables(m, s.course).FieldsWithCreatedAT(m, s, - model.COURSE_NAME, model.COURSE_TYPE, model.USER_COURSE_ROLE, - model.COMPANY_UID, model.COURSE_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.COURSE_UID), arg[1]) - } else { - return - } - s.SelectJoinCompany(m) - s.SelectJoinCity(m) -} +type userCourse struct{ Table } func init() { ice.TeamCtxCmd(userCourse{}) } @@ -54,9 +19,9 @@ const ( var UserCourseRoleList = map[UserCourseRole]string{ UserCourseVisitor: "visitor", UserCourseCreator: "creator", - UserCourseLeader: "leader", - UserCourseWorker: "worker", - UserCourseServer: "server", + UserCourseLeader: "leader", + UserCourseWorker: "worker", + UserCourseServer: "server", } -func (s UserCourseRole) String() string { return UserCourseRoleList[s] } \ No newline at end of file +func (s UserCourseRole) String() string { return UserCourseRoleList[s] } diff --git a/src/zhengshuxitong/auth.go b/src/zhengshuxitong/auth.go deleted file mode 100644 index 45bf125..0000000 --- a/src/zhengshuxitong/auth.go +++ /dev/null @@ -1,23 +0,0 @@ -package zhengshuxitong - -import "shylinux.com/x/ice" - -type auth struct{ Table } - -func init() { ice.TeamCtxCmd(auth{}) } - -type AuthType int - -const ( - AuthRD AuthType = iota - AuthOP - AuthHR -) - -var AuthTypeList = map[AuthType]string{ - AuthRD: "RD", - AuthOP: "OP", - AuthHR: "HR", -} - -func (s AuthType) String() string { return AuthTypeList[s] } \ No newline at end of file diff --git a/src/zhengshuxitong/cert.go b/src/zhengshuxitong/cert.go deleted file mode 100644 index 21bb0cb..0000000 --- a/src/zhengshuxitong/cert.go +++ /dev/null @@ -1,25 +0,0 @@ -package zhengshuxitong - -import ( - "shylinux.com/x/ice" - kit "shylinux.com/x/toolkits" - - "shylinux.com/x/education/src/zhengshuxitong/model" -) - -type cert struct { - Table - auth auth - userAuth userAuth - create string `name:"create title* content*" role:"leader"` -} - -func (s cert) Create(m *ice.Message, arg ...string) { - s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.AUTH_UID))...) - s.recordEventWithName(m, "") -} -func (s cert) List(m *ice.Message, arg ...string) { - s.TablesWithRole(m, arg, s.userAuth, s.auth, s, model.TITLE, model.CONTENT).Display("") -} - -func init() { ice.TeamCtxCmd(cert{}) } \ No newline at end of file diff --git a/src/zhengshuxitong/cert.js b/src/zhengshuxitong/cert.js deleted file mode 100644 index b7ff53c..0000000 --- a/src/zhengshuxitong/cert.js +++ /dev/null @@ -1,9 +0,0 @@ -Volcanos(chat.ONIMPORT, { - _init: function(can, msg) { can.onimport.shareTitle(can, msg) - can.onimport.itemcards(can, msg, function(value) { return [ - {view: html.TITLE, list: [value.title]}, - {view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]}, - {view: html.OUTPUT, list: [value.content]}, - ] }) - }, -}) \ No newline at end of file diff --git a/src/zhengshuxitong/common.go b/src/zhengshuxitong/common.go deleted file mode 100644 index c45204b..0000000 --- a/src/zhengshuxitong/common.go +++ /dev/null @@ -1,52 +0,0 @@ -package zhengshuxitong - -import ( - "shylinux.com/x/ice" - kit "shylinux.com/x/toolkits" - - "shylinux.com/x/enterprise/src/guanlixitong" - "shylinux.com/x/education/src/zhengshuxitong/model" -) - -type Table struct { - guanlixitong.Table - list string `name:"list auth_uid uid auto" role:"void"` -} - -func (s Table) Inputs(m *ice.Message, arg ...string) { - switch arg[0] { - case model.USER_AUTH_ROLE: - s.InputsListRole(m, UserAuthRoleList, arg...) - case model.AUTH_TYPE: - s.InputsList(m, AuthTypeList, arg...) - default: - s.Table.Inputs(m, arg...) - } -} -func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message { - m.RewriteAppend(func(value, key string, index int) string { - switch key { - case model.USER_AUTH_ROLE: - value = UserAuthRole(kit.Int(value)).String() - case model.AUTH_TYPE: - value = AuthType(kit.Int(value)).String() - } - return value - }) - return s.Table.RewriteAppend(m) -} -func (s Table) CheckRole(m *ice.Message, arg ...string) *ice.Message { - role := UserAuthRole(kit.Int(m.Cmd(userAuth{}, s.Select, m.OptionSimple(model.AUTH_UID, model.USER_UID)).Append(model.ROLE))) - m.WarnNotRight(!kit.IsIn(role.String(), append(arg, UserAuthCreator.String())...), role.String()) - return m -} -func (s Table) recordEvent(m *ice.Message, info string, arg ...string) { - s.Table.RecordEvent(m, m.Option(model.AUTH_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.AUTH_UID), info) -} - -type Tables struct { Table } - -func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {} \ No newline at end of file diff --git a/src/zhengshuxitong/model/model.go b/src/zhengshuxitong/model/model.go deleted file mode 100644 index 9edafb0..0000000 --- a/src/zhengshuxitong/model/model.go +++ /dev/null @@ -1,43 +0,0 @@ -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" - USER_AUTH_ROLE = "user_auth_role" - AUTH_UID = "auth_uid" - AUTH_NAME = "auth_name" - AUTH_TYPE = "auth_type" - CERT_UID = "_uid" - COMPANY_UID = "company_uid" - CITY_UID = "city_uid" -) - -type UserAuth struct { - db.ModelWithUID - UserUID string `gorm:"type:char(32);index"` - AuthUID string `gorm:"type:char(32);index"` - Role uint8 `gorm:"default:0"` -} -type Auth struct { - db.ModelWithUID - CompanyUID string `gorm:"type:char(32);index"` - Name string `gorm:"type:varchar(64)"` - Type uint8 `gorm:"default:0"` -} -type Cert struct { - db.ModelWithUID - AuthUID 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("", &UserAuth{}, &Auth{}, &Cert{}) } \ No newline at end of file diff --git a/src/zhengshuxitong/portal.go b/src/zhengshuxitong/portal.go deleted file mode 100644 index e601b6c..0000000 --- a/src/zhengshuxitong/portal.go +++ /dev/null @@ -1,15 +0,0 @@ -package zhengshuxitong - -import ( - "shylinux.com/x/community/src/gonganxitong" - "shylinux.com/x/enterprise/src/guanlixitong" -) - -type Portal struct { - gonganxitong.Portal - placeCreate string `name:"placeCreate city_name* company_name* auth_name*" role:"void"` -} - -func init() { - gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userAuth{}, auth{}, guanlixitong.Company{})}) -} \ No newline at end of file diff --git a/src/zhengshuxitong/portal.json b/src/zhengshuxitong/portal.json deleted file mode 100644 index 37e58c4..0000000 --- a/src/zhengshuxitong/portal.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "portal": "证书系统", - "placeCreate": "创建场景", - "placeRemove": "删除场景", - "": "场景应用", - "icons": { - "": "https://img.icons8.com/officel/80/activity-grid.png" - }, - "input": { - "My Auth": "我的场景", - "user_auth_role": "用户角色", - "auth_name": "场景名称", - "auth_type": "场景类型" - }, - "value": { - "user_auth_role": { - "visitor": "访客", - "creator": "创建人", - "leader": "管理人员", - "worker": "工作人员", - "server": "服务人员", - "style": { - "creator": "danger" - } - }, - "auth_type": { - "term": "学期制", - "weekly": "周期性", - "step": "阶段性", - "free": "自由式" - } - } -} \ No newline at end of file diff --git a/src/zhengshuxitong/userAuth.go b/src/zhengshuxitong/userAuth.go deleted file mode 100644 index b11c4c3..0000000 --- a/src/zhengshuxitong/userAuth.go +++ /dev/null @@ -1,62 +0,0 @@ -package zhengshuxitong - -import ( - "shylinux.com/x/ice" - - "shylinux.com/x/education/src/zhengshuxitong/model" -) - -type userAuth struct { - Table - auth auth -} - -func (s userAuth) User(m *ice.Message, arg ...string) { - s.FieldsWithCreatedAT(m, s, model.USER_UID, model.ROLE) - if len(arg) == 1 { - s.Select(m, model.AUTH_UID, arg[0]) - } else if len(arg) == 2 { - s.SelectDetail(m, model.AUTH_UID, arg[0], model.UID, arg[1]) - } else { - return - } - m.RenameAppend(model.ROLE, model.USER_AUTH_ROLE) - s.SelectJoinUser(m) -} -func (s userAuth) List(m *ice.Message, arg ...string) { - s.Tables(m, s.auth).FieldsWithCreatedAT(m, s, - model.AUTH_NAME, model.AUTH_TYPE, model.USER_AUTH_ROLE, - model.COMPANY_UID, model.AUTH_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.AUTH_UID), arg[1]) - } else { - return - } - s.SelectJoinCompany(m) - s.SelectJoinCity(m) -} - -func init() { ice.TeamCtxCmd(userAuth{}) } - -type UserAuthRole int - -const ( - UserAuthVisitor UserAuthRole = iota - UserAuthCreator - UserAuthLeader - UserAuthWorker - UserAuthServer -) - -var UserAuthRoleList = map[UserAuthRole]string{ - UserAuthVisitor: "visitor", - UserAuthCreator: "creator", - UserAuthLeader: "leader", - UserAuthWorker: "worker", - UserAuthServer: "server", -} - -func (s UserAuthRole) String() string { return UserAuthRoleList[s] } \ No newline at end of file diff --git a/src/zijinlian/common.go b/src/zijinlian/common.go deleted file mode 100644 index 214bc09..0000000 --- a/src/zijinlian/common.go +++ /dev/null @@ -1,52 +0,0 @@ -package zijinlian - -import ( - "shylinux.com/x/ice" - kit "shylinux.com/x/toolkits" - - "shylinux.com/x/enterprise/src/guanlixitong" - "shylinux.com/x/education/src/zijinlian/model" -) - -type Table struct { - guanlixitong.Table - list string `name:"list investor_uid uid auto" role:"void"` -} - -func (s Table) Inputs(m *ice.Message, arg ...string) { - switch arg[0] { - case model.USER_INVESTOR_ROLE: - s.InputsListRole(m, UserInvestorRoleList, arg...) - case model.INVESTOR_TYPE: - s.InputsList(m, InvestorTypeList, arg...) - default: - s.Table.Inputs(m, arg...) - } -} -func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message { - m.RewriteAppend(func(value, key string, index int) string { - switch key { - case model.USER_INVESTOR_ROLE: - value = UserInvestorRole(kit.Int(value)).String() - case model.INVESTOR_TYPE: - value = InvestorType(kit.Int(value)).String() - } - return value - }) - 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 } - -func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {} \ No newline at end of file diff --git a/src/zijinlian/investment.go b/src/zijinlian/investment.go deleted file mode 100644 index 95859ab..0000000 --- a/src/zijinlian/investment.go +++ /dev/null @@ -1,25 +0,0 @@ -package zijinlian - -import ( - "shylinux.com/x/ice" - kit "shylinux.com/x/toolkits" - - "shylinux.com/x/education/src/zijinlian/model" -) - -type investment struct { - Table - investor investor - userInvestor userInvestor - create string `name:"create title* content*" role:"leader"` -} - -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.recordEventWithName(m, "") -} -func (s investment) List(m *ice.Message, arg ...string) { - s.TablesWithRole(m, arg, s.userInvestor, s.investor, s, model.TITLE, model.CONTENT).Display("") -} - -func init() { ice.TeamCtxCmd(investment{}) } \ No newline at end of file diff --git a/src/zijinlian/investment.js b/src/zijinlian/investment.js deleted file mode 100644 index b7ff53c..0000000 --- a/src/zijinlian/investment.js +++ /dev/null @@ -1,9 +0,0 @@ -Volcanos(chat.ONIMPORT, { - _init: function(can, msg) { can.onimport.shareTitle(can, msg) - can.onimport.itemcards(can, msg, function(value) { return [ - {view: html.TITLE, list: [value.title]}, - {view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]}, - {view: html.OUTPUT, list: [value.content]}, - ] }) - }, -}) \ No newline at end of file diff --git a/src/zijinlian/investor.go b/src/zijinlian/investor.go deleted file mode 100644 index b4984d9..0000000 --- a/src/zijinlian/investor.go +++ /dev/null @@ -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] } \ No newline at end of file diff --git a/src/zijinlian/model/model.go b/src/zijinlian/model/model.go deleted file mode 100644 index 980b7e3..0000000 --- a/src/zijinlian/model/model.go +++ /dev/null @@ -1,43 +0,0 @@ -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" - USER_INVESTOR_ROLE = "user_investor_role" - INVESTOR_UID = "investor_uid" - INVESTOR_NAME = "investor_name" - INVESTOR_TYPE = "investor_type" - INVESTMENT_UID = "_uid" - COMPANY_UID = "company_uid" - CITY_UID = "city_uid" -) - -type UserInvestor struct { - db.ModelWithUID - UserUID string `gorm:"type:char(32);index"` - InvestorUID string `gorm:"type:char(32);index"` - Role uint8 `gorm:"default:0"` -} -type Investor struct { - db.ModelWithUID - CompanyUID string `gorm:"type:char(32);index"` - Name string `gorm:"type:varchar(64)"` - Type uint8 `gorm:"default:0"` -} -type Investment struct { - db.ModelWithUID - 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{}) } \ No newline at end of file diff --git a/src/zijinlian/portal.go b/src/zijinlian/portal.go deleted file mode 100644 index a4a5ae6..0000000 --- a/src/zijinlian/portal.go +++ /dev/null @@ -1,15 +0,0 @@ -package zijinlian - -import ( - "shylinux.com/x/community/src/gonganxitong" - "shylinux.com/x/enterprise/src/guanlixitong" -) - -type Portal struct { - gonganxitong.Portal - placeCreate string `name:"placeCreate city_name* company_name* investor_name*" role:"void"` -} - -func init() { - gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(userInvestor{}, investor{}, guanlixitong.Company{})}) -} \ No newline at end of file diff --git a/src/zijinlian/portal.json b/src/zijinlian/portal.json deleted file mode 100644 index 3d70e48..0000000 --- a/src/zijinlian/portal.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "portal": "资金链", - "placeCreate": "创建场景", - "placeRemove": "删除场景", - "": "场景应用", - "icons": { - "": "https://img.icons8.com/officel/80/activity-grid.png" - }, - "input": { - "My Investor": "我的场景", - "user_investor_role": "用户角色", - "investor_name": "场景名称", - "investor_type": "场景类型" - }, - "value": { - "user_investor_role": { - "visitor": "访客", - "creator": "创建人", - "leader": "管理人员", - "worker": "工作人员", - "server": "服务人员", - "style": { - "creator": "danger" - } - }, - "investor_type": { - "term": "学期制", - "weekly": "周期性", - "step": "阶段性", - "free": "自由式" - } - } -} \ No newline at end of file diff --git a/src/zijinlian/userInvestor.go b/src/zijinlian/userInvestor.go deleted file mode 100644 index 7b551ac..0000000 --- a/src/zijinlian/userInvestor.go +++ /dev/null @@ -1,62 +0,0 @@ -package zijinlian - -import ( - "shylinux.com/x/ice" - - "shylinux.com/x/education/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) -} - -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] } \ No newline at end of file diff --git a/usr/local/export/web.team.kaoshixitong.portal/hash.json b/usr/local/export/web.team.kaoshixitong.portal/hash.json index b7b31ff..6ffa9f7 100644 --- a/usr/local/export/web.team.kaoshixitong.portal/hash.json +++ b/usr/local/export/web.team.kaoshixitong.portal/hash.json @@ -36,6 +36,14 @@ "time": "2024-08-28 10:02:38.269" } }, + "72eb3fc89623556cfa348503328811e1": { + "meta": { + "icons": "https://img.icons8.com/officel/80/activity-grid.png", + "index": "web.team.kaoshixitong.question", + "name": "场景应用", + "time": "2024-08-30 09:39:07.245" + } + }, "ab6b14b549c110a29e13f8ea06e75b08": { "meta": { "icons": "https://img.icons8.com/officel/80/qr-code.png",