first commit
This commit is contained in:
55
model/v1/autogen_model_pastebin_model.go
Normal file
55
model/v1/autogen_model_pastebin_model.go
Normal file
@@ -0,0 +1,55 @@
|
||||
// Code generated by protoc-gen-coco. DO NOT EDIT.
|
||||
// source: model/v1/pastebin_model.proto
|
||||
// generate at: 2023-09-30 21:44:38
|
||||
|
||||
package modelv1
|
||||
|
||||
const TableNameModelPastebin = "pastebin"
|
||||
|
||||
func (t *ModelPastebin) TableName() string {
|
||||
return "pastebin"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetIdField() string {
|
||||
return "_id"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetCreatedAtField() string {
|
||||
return "created_at"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetExpiredAtField() string {
|
||||
return "expired_at"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetShortIdField() string {
|
||||
return "short_id"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetTitleField() string {
|
||||
return "title"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetAuthorField() string {
|
||||
return "author"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetContentField() string {
|
||||
return "content"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetLangField() string {
|
||||
return "lang"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetPasswordField() string {
|
||||
return "password"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetNeedPasswordField() string {
|
||||
return "need_password"
|
||||
}
|
||||
|
||||
func (m *ModelPastebin) GetEditableField() string {
|
||||
return "editable"
|
||||
}
|
||||
249
model/v1/pastebin_model.pb.go
Normal file
249
model/v1/pastebin_model.pb.go
Normal file
@@ -0,0 +1,249 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.31.0
|
||||
// protoc (unknown)
|
||||
// source: model/v1/pastebin_model.proto
|
||||
|
||||
package modelv1
|
||||
|
||||
import (
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// @table_name: pastebin
|
||||
type ModelPastebin struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // ID
|
||||
CreatedAt int64 `protobuf:"varint,2,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // 创建时间
|
||||
ExpiredAt int64 `protobuf:"varint,3,opt,name=expired_at,json=expiredAt,proto3" json:"expired_at,omitempty"` // 过期时间
|
||||
ShortId string `protobuf:"bytes,4,opt,name=short_id,json=shortId,proto3" json:"short_id,omitempty"` // ID别名
|
||||
Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` // 标题
|
||||
Author string `protobuf:"bytes,6,opt,name=author,proto3" json:"author,omitempty"` // 作者
|
||||
Content string `protobuf:"bytes,7,opt,name=content,proto3" json:"content,omitempty"` // 内容
|
||||
Lang string `protobuf:"bytes,8,opt,name=lang,proto3" json:"lang,omitempty"` // 语言
|
||||
Password string `protobuf:"bytes,9,opt,name=password,proto3" json:"password,omitempty"` // 是否需要密码
|
||||
NeedPassword bool `protobuf:"varint,10,opt,name=need_password,json=needPassword,proto3" json:"need_password,omitempty"` // 是否需要密码
|
||||
Editable bool `protobuf:"varint,11,opt,name=editable,proto3" json:"editable,omitempty"` // 是否可以修改
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) Reset() {
|
||||
*x = ModelPastebin{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_model_v1_pastebin_model_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ModelPastebin) ProtoMessage() {}
|
||||
|
||||
func (x *ModelPastebin) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_model_v1_pastebin_model_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ModelPastebin.ProtoReflect.Descriptor instead.
|
||||
func (*ModelPastebin) Descriptor() ([]byte, []int) {
|
||||
return file_model_v1_pastebin_model_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetId() int64 {
|
||||
if x != nil {
|
||||
return x.Id
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetCreatedAt() int64 {
|
||||
if x != nil {
|
||||
return x.CreatedAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetExpiredAt() int64 {
|
||||
if x != nil {
|
||||
return x.ExpiredAt
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetShortId() string {
|
||||
if x != nil {
|
||||
return x.ShortId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetAuthor() string {
|
||||
if x != nil {
|
||||
return x.Author
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetContent() string {
|
||||
if x != nil {
|
||||
return x.Content
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetLang() string {
|
||||
if x != nil {
|
||||
return x.Lang
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetPassword() string {
|
||||
if x != nil {
|
||||
return x.Password
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetNeedPassword() bool {
|
||||
if x != nil {
|
||||
return x.NeedPassword
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ModelPastebin) GetEditable() bool {
|
||||
if x != nil {
|
||||
return x.Editable
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var File_model_v1_pastebin_model_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_model_v1_pastebin_model_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x73, 0x74, 0x65,
|
||||
0x62, 0x69, 0x6e, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x08, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x22, 0xb1, 0x02, 0x0a, 0x0d, 0x4d, 0x6f,
|
||||
0x64, 0x65, 0x6c, 0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63,
|
||||
0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52,
|
||||
0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78,
|
||||
0x70, 0x69, 0x72, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
|
||||
0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x41, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x68, 0x6f,
|
||||
0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x73, 0x68, 0x6f,
|
||||
0x72, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x75,
|
||||
0x74, 0x68, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68,
|
||||
0x6f, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x07, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04,
|
||||
0x6c, 0x61, 0x6e, 0x67, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6c, 0x61, 0x6e, 0x67,
|
||||
0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x09, 0x20, 0x01,
|
||||
0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x23, 0x0a, 0x0d,
|
||||
0x6e, 0x65, 0x65, 0x64, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x0a, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x0c, 0x6e, 0x65, 0x65, 0x64, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
|
||||
0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x64, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x0b, 0x20,
|
||||
0x01, 0x28, 0x08, 0x52, 0x08, 0x65, 0x64, 0x69, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x42, 0x8b, 0x01,
|
||||
0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x76, 0x31, 0x42, 0x12,
|
||||
0x50, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x70, 0x61, 0x73, 0x74, 0x65, 0x62, 0x69, 0x6e, 0x2f, 0x61,
|
||||
0x70, 0x69, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65,
|
||||
0x6c, 0x2f, 0x76, 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4d,
|
||||
0x58, 0x58, 0xaa, 0x02, 0x08, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08,
|
||||
0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x4d, 0x6f, 0x64, 0x65, 0x6c,
|
||||
0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
|
||||
0x02, 0x09, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_model_v1_pastebin_model_proto_rawDescOnce sync.Once
|
||||
file_model_v1_pastebin_model_proto_rawDescData = file_model_v1_pastebin_model_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_model_v1_pastebin_model_proto_rawDescGZIP() []byte {
|
||||
file_model_v1_pastebin_model_proto_rawDescOnce.Do(func() {
|
||||
file_model_v1_pastebin_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_v1_pastebin_model_proto_rawDescData)
|
||||
})
|
||||
return file_model_v1_pastebin_model_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_model_v1_pastebin_model_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_model_v1_pastebin_model_proto_goTypes = []interface{}{
|
||||
(*ModelPastebin)(nil), // 0: model.v1.ModelPastebin
|
||||
}
|
||||
var file_model_v1_pastebin_model_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_model_v1_pastebin_model_proto_init() }
|
||||
func file_model_v1_pastebin_model_proto_init() {
|
||||
if File_model_v1_pastebin_model_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_model_v1_pastebin_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ModelPastebin); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_model_v1_pastebin_model_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_model_v1_pastebin_model_proto_goTypes,
|
||||
DependencyIndexes: file_model_v1_pastebin_model_proto_depIdxs,
|
||||
MessageInfos: file_model_v1_pastebin_model_proto_msgTypes,
|
||||
}.Build()
|
||||
File_model_v1_pastebin_model_proto = out.File
|
||||
file_model_v1_pastebin_model_proto_rawDesc = nil
|
||||
file_model_v1_pastebin_model_proto_goTypes = nil
|
||||
file_model_v1_pastebin_model_proto_depIdxs = nil
|
||||
}
|
||||
21
model/v1/pastebin_model.proto
Normal file
21
model/v1/pastebin_model.proto
Normal file
@@ -0,0 +1,21 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package model.v1;
|
||||
|
||||
option go_package = "./;modelv1";
|
||||
|
||||
|
||||
// @table_name: pastebin
|
||||
message ModelPastebin {
|
||||
int64 id = 1; // ID
|
||||
int64 created_at = 2; // 创建时间
|
||||
int64 expired_at = 3; // 过期时间
|
||||
string short_id = 4; // ID别名
|
||||
string title = 5; // 标题
|
||||
string author = 6; // 作者
|
||||
string content = 7; // 内容
|
||||
string lang = 8; // 语言
|
||||
string password = 9; // 是否需要密码
|
||||
bool need_password = 10; // 是否需要密码
|
||||
bool editable = 11; // 是否可以修改
|
||||
}
|
||||
Reference in New Issue
Block a user