update pb files

This commit is contained in:
Yavolte 2025-07-22 16:58:03 +08:00
parent fde965bbd1
commit 74446b2e3f
6 changed files with 38 additions and 14 deletions

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-aeus. DO NOT EDIT.
// source: organize.proto
// date: 2025-06-22 11:09:05
// date: 2025-07-22 16:57:29
package pb

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-aeus. DO NOT EDIT.
// source: organize.proto
// date: 2025-06-22 11:09:05
// date: 2025-07-22 16:57:29
package pb

View File

@ -32,8 +32,9 @@ type Setting struct {
CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt int64 `protobuf:"varint,3,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"`
Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
Value string `protobuf:"bytes,5,opt,name=value,proto3" json:"value,omitempty"`
Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"`
Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"`
Value string `protobuf:"bytes,6,opt,name=value,proto3" json:"value,omitempty"`
Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@ -96,6 +97,13 @@ func (x *Setting) GetName() string {
return ""
}
func (x *Setting) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *Setting) GetValue() string {
if x != nil {
return x.Value
@ -339,7 +347,7 @@ var File_system_proto protoreflect.FileDescriptor
const file_system_proto_rawDesc = "" +
"\n" +
"\fsystem.proto\x12\x06system\x1a\x0faeus/rest.proto\x1a\x17validate/validate.proto\x1a google/protobuf/descriptor.proto\x1a\x1cgoogle/api/annotations.proto\"\xd8\x03\n" +
"\fsystem.proto\x12\x06system\x1a\x0faeus/rest.proto\x1a\x17validate/validate.proto\x1a google/protobuf/descriptor.proto\x1a\x1cgoogle/api/annotations.proto\"\xc0\x04\n" +
"\aSetting\x12$\n" +
"\x02id\x18\x01 \x01(\x03B\x14\xb2\xb9\x19\x10\n" +
"\n" +
@ -349,10 +357,12 @@ const file_system_proto_rawDesc = "" +
"\n" +
"updated_at\x18\x03 \x01(\x03B&\xb2\xb9\x19\"\x12\f更新时间\x1a\x12search;view;exportR\tupdatedAt\x12N\n" +
"\x04name\x18\x04 \x01(\tB:\xfaB\x04r\x02\x18\x14\xb2\xb9\x19/\n" +
"\asize:60\x12\t配置项2\x0freadonly:update:\brequiredR\x04name\x12K\n" +
"\x05value\x18\x05 \x01(\tB5\xfaB\x05r\x03\x18\x80\x04\xb2\xb9\x19)\n" +
"\bsize:512\x12\t配置值*\btextarea:\brequiredR\x05value\x12l\n" +
"\vdescription\x18\x06 \x01(\tBJ\xfaB\x05r\x03\x18\x80\b\xb2\xb9\x19>\n" +
"\asize:60\x12\t配置项2\x0freadonly:update:\brequiredR\x04name\x12e\n" +
"\x04type\x18\x05 \x01(\tBQ\xfaB\x04r\x02\x18\x14\xb2\xb9\x19F\n" +
"\asize:20\x12\f数据类型:\brequiredR#text:文本;number:数字;json:JSONR\x04type\x12L\n" +
"\x05value\x18\x06 \x01(\tB6\xfaB\x05r\x03\x18\x80\b\xb2\xb9\x19*\n" +
"\tsize:1024\x12\t配置值*\btextarea:\brequiredR\x05value\x12l\n" +
"\vdescription\x18\a \x01(\tBJ\xfaB\x05r\x03\x18\x80\b\xb2\xb9\x19>\n" +
"\tsize:1024\x12\f备注说明\x1a\x19create;update;view;export*\btextareaR\vdescription:\x0e\xba\xb9\x19\n" +
"\n" +
"\bsettings\"\xe2\x05\n" +

View File

@ -73,10 +73,21 @@ func (m *Setting) validate(all bool) error {
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetValue()) > 512 {
if utf8.RuneCountInString(m.GetType()) > 20 {
err := SettingValidationError{
field: "Type",
reason: "value length must be at most 20 runes",
}
if !all {
return err
}
errors = append(errors, err)
}
if utf8.RuneCountInString(m.GetValue()) > 1024 {
err := SettingValidationError{
field: "Value",
reason: "value length must be at most 512 runes",
reason: "value length must be at most 1024 runes",
}
if !all {
return err

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-aeus. DO NOT EDIT.
// source: system.proto
// date: 2025-06-22 11:09:05
// date: 2025-07-22 16:57:29
package pb

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-aeus. DO NOT EDIT.
// source: system.proto
// date: 2025-06-22 11:09:05
// date: 2025-07-22 16:57:29
package pb
@ -13,7 +13,8 @@ type SettingModel struct {
CreatedAt int64 `json:"created_at" yaml:"createdAt" xml:"createdAt" gorm:"column:created_at" comment:"创建时间" scenarios:"search;view;export"`
UpdatedAt int64 `json:"updated_at" yaml:"updatedAt" xml:"updatedAt" gorm:"column:updated_at" comment:"更新时间" scenarios:"search;view;export"`
Name string `json:"name" yaml:"name" xml:"name" gorm:"size:60;column:name" comment:"配置项" props:"readonly:update" rule:"required"`
Value string `json:"value" yaml:"value" xml:"value" gorm:"size:512;column:value" comment:"配置值" format:"textarea" rule:"required"`
Type string `json:"type" yaml:"type" xml:"type" gorm:"size:20;column:type" comment:"数据类型" rule:"required" enum:"text:文本;number:数字;json:JSON"`
Value string `json:"value" yaml:"value" xml:"value" gorm:"size:1024;column:value" comment:"配置值" format:"textarea" rule:"required"`
Description string `json:"description" yaml:"description" xml:"description" gorm:"size:1024;column:description" comment:"备注说明" scenarios:"create;update;view;export" format:"textarea"`
}
@ -26,6 +27,7 @@ func (m *SettingModel) FromValue(x *Setting) {
m.CreatedAt = x.CreatedAt
m.UpdatedAt = x.UpdatedAt
m.Name = x.Name
m.Type = x.Type
m.Value = x.Value
m.Description = x.Description
}
@ -36,6 +38,7 @@ func (m *SettingModel) ToValue() (x *Setting) {
x.CreatedAt = m.CreatedAt
x.UpdatedAt = m.UpdatedAt
x.Name = m.Name
x.Type = m.Type
x.Value = m.Value
x.Description = m.Description
return x