From f1685f82dba7f2b9e20a9cfddce97f21bd646ae4 Mon Sep 17 00:00:00 2001 From: shy Date: Sat, 14 Sep 2024 00:36:25 +0800 Subject: [PATCH] add some --- src/jiaocaiziliao/document.go | 19 ++++--------------- src/jiaocaiziliao/document.js | 2 +- src/jiaowuxitong/homework.go | 6 +++--- src/jiaowuxitong/homework.js | 2 +- src/kaoshixitong/question.go | 6 +++--- src/kaoshixitong/question.js | 2 +- src/zaixianketang/lesson.go | 6 +++--- src/zaixianketang/lesson.js | 2 +- 8 files changed, 17 insertions(+), 28 deletions(-) diff --git a/src/jiaocaiziliao/document.go b/src/jiaocaiziliao/document.go index ea86bbb..4c12174 100644 --- a/src/jiaocaiziliao/document.go +++ b/src/jiaocaiziliao/document.go @@ -1,11 +1,6 @@ package jiaocaiziliao -import ( - "shylinux.com/x/ice" - kit "shylinux.com/x/toolkits" - - "shylinux.com/x/education/src/jiaocaiziliao/model" -) +import "shylinux.com/x/ice" type document struct { Table @@ -14,15 +9,9 @@ type document struct { remove string `name:"remove" role:"teacher"` } -func (s document) Create(m *ice.Message, arg ...string) { - s.Table.ValueCreate(m, kit.TransArgKeys(arg, model.DOCUMENT_TYPE, model.TYPE)...) -} -func (s document) Remove(m *ice.Message, arg ...string) { - s.Table.ValueRemove(m, arg...) -} -func (s document) List(m *ice.Message, arg ...string) { - s.Table.ValueList(m, arg).Display("") -} +func (s document) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) } +func (s document) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) } +func (s document) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") } func init() { ice.TeamCtxCmd(document{}) } diff --git a/src/jiaocaiziliao/document.js b/src/jiaocaiziliao/document.js index f0ad505..51191be 100644 --- a/src/jiaocaiziliao/document.js +++ b/src/jiaocaiziliao/document.js @@ -1,6 +1,6 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { - can.onimport.itemcards(can, msg, function(value) { return [ + can.onimport.myView(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)]}, {view: html.STATUS, list: [value.school, value.grade, value.subject]}, diff --git a/src/jiaowuxitong/homework.go b/src/jiaowuxitong/homework.go index a598763..558d000 100644 --- a/src/jiaowuxitong/homework.go +++ b/src/jiaowuxitong/homework.go @@ -9,8 +9,8 @@ type homework struct { remove string `name:"remove" role:"leader"` } -func (s homework) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) } -func (s homework) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) } -func (s homework) List(m *ice.Message, arg ...string) { s.Table.ValueList(m, arg).Display("") } +func (s homework) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) } +func (s homework) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) } +func (s homework) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") } func init() { ice.TeamCtxCmd(homework{}) } diff --git a/src/jiaowuxitong/homework.js b/src/jiaowuxitong/homework.js index b9d05bc..3be5f6e 100644 --- a/src/jiaowuxitong/homework.js +++ b/src/jiaowuxitong/homework.js @@ -1,6 +1,6 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { - can.onimport.itemcards(can, msg, function(value) { return [ + can.onimport.myView(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]}, diff --git a/src/kaoshixitong/question.go b/src/kaoshixitong/question.go index b4307a6..d868163 100644 --- a/src/kaoshixitong/question.go +++ b/src/kaoshixitong/question.go @@ -9,8 +9,8 @@ type question struct { remove string `name:"remove" role:"teacher"` } -func (s question) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) } -func (s question) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) } -func (s question) List(m *ice.Message, arg ...string) { s.Table.ValueList(m, arg).Display("") } +func (s question) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) } +func (s question) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) } +func (s question) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") } func init() { ice.TeamCtxCmd(question{}) } diff --git a/src/kaoshixitong/question.js b/src/kaoshixitong/question.js index b9d05bc..3be5f6e 100644 --- a/src/kaoshixitong/question.js +++ b/src/kaoshixitong/question.js @@ -1,6 +1,6 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { - can.onimport.itemcards(can, msg, function(value) { return [ + can.onimport.myView(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]}, diff --git a/src/zaixianketang/lesson.go b/src/zaixianketang/lesson.go index 144be98..97f7b01 100644 --- a/src/zaixianketang/lesson.go +++ b/src/zaixianketang/lesson.go @@ -9,8 +9,8 @@ type lesson struct { remove string `name:"remove" role:"teacher"` } -func (s lesson) Create(m *ice.Message, arg ...string) { s.Table.ValueCreate(m, arg...) } -func (s lesson) Remove(m *ice.Message, arg ...string) { s.Table.ValueRemove(m, arg...) } -func (s lesson) List(m *ice.Message, arg ...string) { s.Table.ValueList(m, arg).Display("") } +func (s lesson) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) } +func (s lesson) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) } +func (s lesson) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") } func init() { ice.TeamCtxCmd(lesson{}) } diff --git a/src/zaixianketang/lesson.js b/src/zaixianketang/lesson.js index b9d05bc..3be5f6e 100644 --- a/src/zaixianketang/lesson.js +++ b/src/zaixianketang/lesson.js @@ -1,6 +1,6 @@ Volcanos(chat.ONIMPORT, { _init: function(can, msg) { - can.onimport.itemcards(can, msg, function(value) { return [ + can.onimport.myView(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]},