This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-09-19 20:58:54 +08:00
parent 8aaa85dc83
commit 4270108ae2
7 changed files with 19 additions and 11 deletions

View File

@ -4,13 +4,11 @@ import "shylinux.com/x/ice"
type version struct {
Table
fields string `data:"title,content"`
fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
}
func (s version) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
func (s version) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
func (s version) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
func (s version) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
func init() { ice.TeamCtxCmd(version{}) }

View File

@ -9,11 +9,15 @@ func init() { ice.TeamCtxCmd(cloud{}) }
type CloudType int
const (
CloudAliyun CloudType = iota
CloudSystem CloudType = iota
CloudLocal
CloudAliyun
CloudTencent
)
var CloudTypeList = map[CloudType]string{
CloudSystem: "system",
CloudLocal: "local",
CloudAliyun: "aliyun",
CloudTencent: "tencent",
}

View File

@ -7,7 +7,7 @@ import (
type Portal struct {
guanlixitong.Portal
placeCreate string `name:"placeCreate city_name* company_name* cloud_name*" cloud_type*:select role:"void"`
placeCreate string `name:"placeCreate city_name* company_name* cloud_name* cloud_type*:select" role:"void"`
}
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userCloud{}, cloud{})}) }

View File

@ -23,6 +23,8 @@
}
},
"cloud_type": {
"system": "系统云",
"local": "本地云",
"aliyun": "阿里云",
"tencent": "腾讯云"
}

View File

@ -4,13 +4,11 @@ import "shylinux.com/x/ice"
type release struct {
Table
fields string `data:"title,content"`
fields string `data:"title,content,user_uid"`
create string `name:"create title* content*" role:"leader"`
remove string `name:"remove" role:"leader"`
}
func (s release) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
func (s release) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
func (s release) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
func (s release) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
func init() { ice.TeamCtxCmd(release{}) }

View File

@ -25,7 +25,7 @@ func (s file) Upload(m *ice.Message, arg ...string) {
up := kit.Simple(m.Optionv(ice.MSG_UPLOAD))
p := s.path(m, m.Option(model.STORAGE_UID), up[1])
m.Cmdy(web.CACHE, web.WATCH, up[0], p)
s.ValueCreate(m, model.TYPE, kit.Format(FilePath), model.TITLE, up[1], model.CONTENT, "", model.SIZE, up[2])
s.ValueCreate(m, model.TITLE, up[1], model.CONTENT, "", model.TYPE, kit.Format(FilePath), model.SIZE, up[2])
s.DashboardUpdate(m)
}
func (s file) Right(m *ice.Message, arg ...string) {
@ -35,6 +35,10 @@ func (s file) Right(m *ice.Message, arg ...string) {
func (s file) List(m *ice.Message, arg ...string) {
if s.ValueList(m, arg).Display(""); len(arg) == 1 {
m.Action(s.Upload)
if m.Length() == 0 {
m.SetResult()
s.Button(m, m.Trans("please upload file", "请上传文件"), s.Upload)
}
} else if len(arg) == 2 {
m.PushQRCode(cli.QRCODE, kit.MergeURL2(m.Option(ice.MSG_USERWEB), m.Resource(s.path(m, arg[0], m.Append(model.TITLE)))))
m.EchoImages(m.Resource(s.path(m, arg[0], m.Append(model.TITLE))))

View File

@ -32,6 +32,8 @@ type Storage struct {
type File struct {
db.ModelContent
StorageUID string `gorm:"type:char(32);index"`
Type uint8 `gorm:"default:0"`
Size int `gorm:"default:0"`
}
func init() { db.CmdModels("", &UserStorage{}, &Storage{}, &File{}) }