This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-10-04 12:23:30 +08:00
parent 109a06534b
commit f3421afe4a
12 changed files with 19 additions and 31 deletions

View File

@ -9,8 +9,8 @@ const (
TYPE = "type"
TITLE = "title"
CONTENT = "content"
AVATAR = "avatar"
BACKGROUND = "background"
AVATAR = "avatar"
BACKGROUND = "background"
USER_UID = "user_uid"
USER_LIBRARY_ROLE = "user_library_role"
LIBRARY_UID = "library_uid"
@ -19,8 +19,8 @@ const (
DOCUMENT_TYPE = "document_type"
SCHOOL_NAME = "school_name"
SCHOOL_INFO = "school_info"
SCHOOL_AVATAR = "school_avatar"
SCHOOL_BACKGROUND = "school_background"
SCHOOL_AVATAR = "school_avatar"
SCHOOL_BACKGROUND = "school_background"
CITY_UID = "city_uid"
CITY_NAME = "city_name"
LINK = "link"

View File

@ -12,7 +12,6 @@
"library_name": "文库名称",
"library_type": "文库类型",
"document_type": "文档类型",
"school_name": "学校名称",
"school": "学校",
"subject": "学科",
"grade": "年级"

View File

@ -45,8 +45,9 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
})
return s.Table.RewriteAppend(m)
}
func (s Table) SelectJoinSchool(m *ice.Message) *ice.Message {
return s.SelectJoin(m, school{}, model.NAME, model.CITY_UID)
func (s Table) SelectJoinSchool(m *ice.Message) {
s.SelectJoin(m, school{}, model.NAME, model.CITY_UID)
s.SelectJoinCity(m)
}
func (s Table) CheckRole(m *ice.Message, arg ...string) {
role := UserClassRole(s.UserPlaceRole(m))

View File

@ -6,7 +6,7 @@ type homework struct {
Table
fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"teacher"`
remove string `name:"remove" role:"leader"`
remove string `name:"remove" role:"teacher"`
}
func (s homework) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }

View File

@ -1,8 +1,6 @@
{
"portal": "教务系统",
"portal": "教务系统", "member": "班级成员",
"homework": "家庭作业",
"member": "班级成员",
"school": "学校信息",
"icons": {
"homework": "https://img.icons8.com/officel/80/homework.png"
},
@ -11,7 +9,6 @@
"user_class_role": "用户角色",
"class_name": "班级名称",
"class_type": "班级类型",
"school_name": "学校名称",
"grade": "入学年份"
},
"value": {

View File

@ -2,7 +2,6 @@ package jiaowuxitong
import (
"shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
"shylinux.com/x/education/src/jiaowuxitong/model"
)
@ -23,24 +22,22 @@ func (s school) FindOrCreateByName(m *ice.Message, arg ...string) {
}
}
func (s school) Modify(m *ice.Message, arg ...string) {
s.Update(m, kit.Dict(m.OptionSimple(model.INFO)), m.OptionSimple(model.UID)...)
s.Update(m, m.OptionSimple(model.INFO), m.OptionSimple(model.UID)...)
}
func (s school) List(m *ice.Message, arg ...string) {
if len(arg) == 0 {
s.CityList(m)
} else if len(arg) == 1 {
msg := s.CityList(m.Spawn(), arg[0])
} else if msg := s.CityList(m.Spawn(), arg[0]); len(arg) == 1 {
s.Select(m, model.CITY_UID, msg.Append(model.UID))
} else if len(arg) == 2 {
msg := s.CityList(m.Spawn(), arg[0])
s.Select(m, model.CITY_UID, msg.Append(model.UID), model.NAME, arg[1])
if m.Append(model.AUTH_UID) == "" && m.IsTech() {
if m.Append(model.AUTH_UID) == "" {
m.EchoInfoButton("请申请学校认证", s.AuthCreate)
}
}
}
func (s school) AuthCreate(m *ice.Message, arg ...string) {
msg := m.Cmd("web.team.gonganxitong.city", s.Select, model.UID, m.Option(model.CITY_UID))
msg := s.CityCmd(m, s.Select, model.UID, m.Option(model.CITY_UID))
s.Table.AuthCreate(m, 5, msg.Append(model.AUTH_UID), m.OptionSimple(model.UID)...)
}

View File

@ -5,17 +5,15 @@ import "shylinux.com/x/mysql-story/src/db"
const (
UID = "uid"
NAME = "name"
INFO = "info"
TYPE = "type"
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 = "question_uid"
SCHOOL_UID = "school_uid"
CITY_UID = "city_uid"
)
type UserExam struct {

View File

@ -7,7 +7,7 @@ import (
type Portal struct {
jiaowuxitong.Portal
placeCreate string `name:"placeCreate city_name* school_name* exam_name* exam_type*:select" role:"void"`
placeCreate string `name:"placeCreate city_name* school_name* exam_name* exam_type:select" role:"void"`
}
func init() { gonganxitong.PortalCmd(Portal{Portal: jiaowuxitong.NewPortal(userExam{}, exam{})}) }

View File

@ -8,8 +8,7 @@
"My Exam": "我的考试",
"user_exam_role": "用户角色",
"exam_name": "考试名称",
"exam_type": "考试类型",
"school_name": "学校名称"
"exam_type": "考试类型"
},
"value": {
"user_exam_role": {

View File

@ -5,17 +5,15 @@ import "shylinux.com/x/mysql-story/src/db"
const (
UID = "uid"
NAME = "name"
INFO = "info"
TYPE = "type"
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 = "lesson_uid"
SCHOOL_UID = "school_uid"
CITY_UID = "city_uid"
)
type UserCourse struct {

View File

@ -7,7 +7,7 @@ import (
type Portal struct {
jiaowuxitong.Portal
placeCreate string `name:"placeCreate city_name* school_name* course_name* course_type*:select" role:"void"`
placeCreate string `name:"placeCreate city_name* school_name* course_name* course_type:select" role:"void"`
}
func init() { gonganxitong.PortalCmd(Portal{Portal: jiaowuxitong.NewPortal(userCourse{}, course{})}) }

View File

@ -8,8 +8,7 @@
"My Course": "我的课程",
"user_course_role": "用户角色",
"course_name": "课程名称",
"course_type": "课程类型",
"school_name": "学校名称"
"course_type": "课程类型"
},
"value": {
"user_course_role": {