diff --git a/internal/conf/conf.pb.go b/internal/conf/conf.pb.go index 955e93e..49adea4 100644 --- a/internal/conf/conf.pb.go +++ b/internal/conf/conf.pb.go @@ -25,11 +25,25 @@ const ( type Bootstrap struct { state protoimpl.MessageState `protogen:"open.v1"` Server *Server `protobuf:"bytes,1,opt,name=server,proto3" json:"server,omitempty"` - Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Jwt *JWT `protobuf:"bytes,3,opt,name=jwt,proto3" json:"jwt,omitempty"` - Casbin *Casbin `protobuf:"bytes,4,opt,name=casbin,proto3" json:"casbin,omitempty"` - Captcha *Captcha `protobuf:"bytes,5,opt,name=captcha,proto3" json:"captcha,omitempty"` - Upload *Upload `protobuf:"bytes,6,opt,name=upload,proto3" json:"upload,omitempty"` + Jwt *JWT `protobuf:"bytes,2,opt,name=jwt,proto3" json:"jwt,omitempty"` + System *System `protobuf:"bytes,3,opt,name=system,proto3" json:"system,omitempty"` + Captcha *Captcha `protobuf:"bytes,4,opt,name=captcha,proto3" json:"captcha,omitempty"` + Mysql *Mysql `protobuf:"bytes,5,opt,name=mysql,proto3" json:"mysql,omitempty"` + Pgsql *Pgsql `protobuf:"bytes,6,opt,name=pgsql,proto3" json:"pgsql,omitempty"` + Sqlite *Sqlite `protobuf:"bytes,7,opt,name=sqlite,proto3" json:"sqlite,omitempty"` + Redis *Redis `protobuf:"bytes,8,opt,name=redis,proto3" json:"redis,omitempty"` + Local *Local `protobuf:"bytes,9,opt,name=local,proto3" json:"local,omitempty"` + Qiniu *Qiniu `protobuf:"bytes,10,opt,name=qiniu,proto3" json:"qiniu,omitempty"` + Minio *Minio `protobuf:"bytes,11,opt,name=minio,proto3" json:"minio,omitempty"` + AliyunOss *AliyunOss `protobuf:"bytes,12,opt,name=aliyun_oss,json=aliyunOss,proto3" json:"aliyun_oss,omitempty"` + TencentCos *TencentCos `protobuf:"bytes,13,opt,name=tencent_cos,json=tencentCos,proto3" json:"tencent_cos,omitempty"` + AwsS3 *AwsS3 `protobuf:"bytes,14,opt,name=aws_s3,json=awsS3,proto3" json:"aws_s3,omitempty"` + CloudflareR2 *CloudflareR2 `protobuf:"bytes,15,opt,name=cloudflare_r2,json=cloudflareR2,proto3" json:"cloudflare_r2,omitempty"` + HuaweiObs *HuaweiObs `protobuf:"bytes,16,opt,name=huawei_obs,json=huaweiObs,proto3" json:"huawei_obs,omitempty"` + Email *Email `protobuf:"bytes,17,opt,name=email,proto3" json:"email,omitempty"` + Excel *Excel `protobuf:"bytes,18,opt,name=excel,proto3" json:"excel,omitempty"` + Cors *Cors `protobuf:"bytes,19,opt,name=cors,proto3" json:"cors,omitempty"` + Zap *Zap `protobuf:"bytes,20,opt,name=zap,proto3" json:"zap,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -71,13 +85,6 @@ func (x *Bootstrap) GetServer() *Server { return nil } -func (x *Bootstrap) GetData() *Data { - if x != nil { - return x.Data - } - return nil -} - func (x *Bootstrap) GetJwt() *JWT { if x != nil { return x.Jwt @@ -85,9 +92,9 @@ func (x *Bootstrap) GetJwt() *JWT { return nil } -func (x *Bootstrap) GetCasbin() *Casbin { +func (x *Bootstrap) GetSystem() *System { if x != nil { - return x.Casbin + return x.System } return nil } @@ -99,9 +106,114 @@ func (x *Bootstrap) GetCaptcha() *Captcha { return nil } -func (x *Bootstrap) GetUpload() *Upload { +func (x *Bootstrap) GetMysql() *Mysql { if x != nil { - return x.Upload + return x.Mysql + } + return nil +} + +func (x *Bootstrap) GetPgsql() *Pgsql { + if x != nil { + return x.Pgsql + } + return nil +} + +func (x *Bootstrap) GetSqlite() *Sqlite { + if x != nil { + return x.Sqlite + } + return nil +} + +func (x *Bootstrap) GetRedis() *Redis { + if x != nil { + return x.Redis + } + return nil +} + +func (x *Bootstrap) GetLocal() *Local { + if x != nil { + return x.Local + } + return nil +} + +func (x *Bootstrap) GetQiniu() *Qiniu { + if x != nil { + return x.Qiniu + } + return nil +} + +func (x *Bootstrap) GetMinio() *Minio { + if x != nil { + return x.Minio + } + return nil +} + +func (x *Bootstrap) GetAliyunOss() *AliyunOss { + if x != nil { + return x.AliyunOss + } + return nil +} + +func (x *Bootstrap) GetTencentCos() *TencentCos { + if x != nil { + return x.TencentCos + } + return nil +} + +func (x *Bootstrap) GetAwsS3() *AwsS3 { + if x != nil { + return x.AwsS3 + } + return nil +} + +func (x *Bootstrap) GetCloudflareR2() *CloudflareR2 { + if x != nil { + return x.CloudflareR2 + } + return nil +} + +func (x *Bootstrap) GetHuaweiObs() *HuaweiObs { + if x != nil { + return x.HuaweiObs + } + return nil +} + +func (x *Bootstrap) GetEmail() *Email { + if x != nil { + return x.Email + } + return nil +} + +func (x *Bootstrap) GetExcel() *Excel { + if x != nil { + return x.Excel + } + return nil +} + +func (x *Bootstrap) GetCors() *Cors { + if x != nil { + return x.Cors + } + return nil +} + +func (x *Bootstrap) GetZap() *Zap { + if x != nil { + return x.Zap } return nil } @@ -158,58 +270,6 @@ func (x *Server) GetGrpc() *Server_GRPC { return nil } -type Data struct { - state protoimpl.MessageState `protogen:"open.v1"` - Database *Data_Database `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"` - Redis *Data_Redis `protobuf:"bytes,2,opt,name=redis,proto3" json:"redis,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Data) Reset() { - *x = Data{} - mi := &file_conf_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Data) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Data) ProtoMessage() {} - -func (x *Data) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[2] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Data.ProtoReflect.Descriptor instead. -func (*Data) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{2} -} - -func (x *Data) GetDatabase() *Data_Database { - if x != nil { - return x.Database - } - return nil -} - -func (x *Data) GetRedis() *Data_Redis { - if x != nil { - return x.Redis - } - return nil -} - type JWT struct { state protoimpl.MessageState `protogen:"open.v1"` SigningKey string `protobuf:"bytes,1,opt,name=signing_key,json=signingKey,proto3" json:"signing_key,omitempty"` @@ -222,7 +282,7 @@ type JWT struct { func (x *JWT) Reset() { *x = JWT{} - mi := &file_conf_proto_msgTypes[3] + mi := &file_conf_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -234,7 +294,7 @@ func (x *JWT) String() string { func (*JWT) ProtoMessage() {} func (x *JWT) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[3] + mi := &file_conf_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -247,7 +307,7 @@ func (x *JWT) ProtoReflect() protoreflect.Message { // Deprecated: Use JWT.ProtoReflect.Descriptor instead. func (*JWT) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{3} + return file_conf_proto_rawDescGZIP(), []int{2} } func (x *JWT) GetSigningKey() string { @@ -278,28 +338,36 @@ func (x *JWT) GetIssuer() string { return "" } -type Casbin struct { +type System struct { state protoimpl.MessageState `protogen:"open.v1"` - ModelPath string `protobuf:"bytes,1,opt,name=model_path,json=modelPath,proto3" json:"model_path,omitempty"` + Env string `protobuf:"bytes,1,opt,name=env,proto3" json:"env,omitempty"` + DbType string `protobuf:"bytes,2,opt,name=db_type,json=dbType,proto3" json:"db_type,omitempty"` + OssType string `protobuf:"bytes,3,opt,name=oss_type,json=ossType,proto3" json:"oss_type,omitempty"` + UseRedis bool `protobuf:"varint,4,opt,name=use_redis,json=useRedis,proto3" json:"use_redis,omitempty"` + UseMultipoint bool `protobuf:"varint,5,opt,name=use_multipoint,json=useMultipoint,proto3" json:"use_multipoint,omitempty"` + IplimitCount int32 `protobuf:"varint,6,opt,name=iplimit_count,json=iplimitCount,proto3" json:"iplimit_count,omitempty"` + IplimitTime int32 `protobuf:"varint,7,opt,name=iplimit_time,json=iplimitTime,proto3" json:"iplimit_time,omitempty"` + RouterPrefix string `protobuf:"bytes,8,opt,name=router_prefix,json=routerPrefix,proto3" json:"router_prefix,omitempty"` + UseStrictAuth bool `protobuf:"varint,9,opt,name=use_strict_auth,json=useStrictAuth,proto3" json:"use_strict_auth,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *Casbin) Reset() { - *x = Casbin{} - mi := &file_conf_proto_msgTypes[4] +func (x *System) Reset() { + *x = System{} + mi := &file_conf_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Casbin) String() string { +func (x *System) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Casbin) ProtoMessage() {} +func (*System) ProtoMessage() {} -func (x *Casbin) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[4] +func (x *System) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -310,18 +378,74 @@ func (x *Casbin) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Casbin.ProtoReflect.Descriptor instead. -func (*Casbin) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{4} +// Deprecated: Use System.ProtoReflect.Descriptor instead. +func (*System) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{3} } -func (x *Casbin) GetModelPath() string { +func (x *System) GetEnv() string { if x != nil { - return x.ModelPath + return x.Env } return "" } +func (x *System) GetDbType() string { + if x != nil { + return x.DbType + } + return "" +} + +func (x *System) GetOssType() string { + if x != nil { + return x.OssType + } + return "" +} + +func (x *System) GetUseRedis() bool { + if x != nil { + return x.UseRedis + } + return false +} + +func (x *System) GetUseMultipoint() bool { + if x != nil { + return x.UseMultipoint + } + return false +} + +func (x *System) GetIplimitCount() int32 { + if x != nil { + return x.IplimitCount + } + return 0 +} + +func (x *System) GetIplimitTime() int32 { + if x != nil { + return x.IplimitTime + } + return 0 +} + +func (x *System) GetRouterPrefix() string { + if x != nil { + return x.RouterPrefix + } + return "" +} + +func (x *System) GetUseStrictAuth() bool { + if x != nil { + return x.UseStrictAuth + } + return false +} + type Captcha struct { state protoimpl.MessageState `protogen:"open.v1"` KeyLong int32 `protobuf:"varint,1,opt,name=key_long,json=keyLong,proto3" json:"key_long,omitempty"` @@ -335,7 +459,7 @@ type Captcha struct { func (x *Captcha) Reset() { *x = Captcha{} - mi := &file_conf_proto_msgTypes[5] + mi := &file_conf_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -347,7 +471,7 @@ func (x *Captcha) String() string { func (*Captcha) ProtoMessage() {} func (x *Captcha) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[5] + mi := &file_conf_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -360,7 +484,7 @@ func (x *Captcha) ProtoReflect() protoreflect.Message { // Deprecated: Use Captcha.ProtoReflect.Descriptor instead. func (*Captcha) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{5} + return file_conf_proto_rawDescGZIP(), []int{4} } func (x *Captcha) GetKeyLong() int32 { @@ -398,37 +522,152 @@ func (x *Captcha) GetOpenCaptchaTimeout() int32 { return 0 } -type Upload struct { +type Mysql struct { state protoimpl.MessageState `protogen:"open.v1"` - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` - MaxSize int64 `protobuf:"varint,3,opt,name=max_size,json=maxSize,proto3" json:"max_size,omitempty"` - Local *Upload_Local `protobuf:"bytes,4,opt,name=local,proto3" json:"local,omitempty"` - Aliyun *Upload_Aliyun `protobuf:"bytes,5,opt,name=aliyun,proto3" json:"aliyun,omitempty"` - Tencent *Upload_Tencent `protobuf:"bytes,6,opt,name=tencent,proto3" json:"tencent,omitempty"` - Qiniu *Upload_Qiniu `protobuf:"bytes,7,opt,name=qiniu,proto3" json:"qiniu,omitempty"` - Minio *Upload_Minio `protobuf:"bytes,8,opt,name=minio,proto3" json:"minio,omitempty"` - AwsS3 *Upload_AwsS3 `protobuf:"bytes,9,opt,name=aws_s3,json=awsS3,proto3" json:"aws_s3,omitempty"` - HuaweiObs *Upload_HuaweiObs `protobuf:"bytes,10,opt,name=huawei_obs,json=huaweiObs,proto3" json:"huawei_obs,omitempty"` - CloudflareR2 *Upload_CloudflareR2 `protobuf:"bytes,11,opt,name=cloudflare_r2,json=cloudflareR2,proto3" json:"cloudflare_r2,omitempty"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Port string `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"` + Config string `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` + DbName string `protobuf:"bytes,4,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` + Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` + MaxIdleConns int32 `protobuf:"varint,7,opt,name=max_idle_conns,json=maxIdleConns,proto3" json:"max_idle_conns,omitempty"` + MaxOpenConns int32 `protobuf:"varint,8,opt,name=max_open_conns,json=maxOpenConns,proto3" json:"max_open_conns,omitempty"` + LogMode string `protobuf:"bytes,9,opt,name=log_mode,json=logMode,proto3" json:"log_mode,omitempty"` + LogZap bool `protobuf:"varint,10,opt,name=log_zap,json=logZap,proto3" json:"log_zap,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *Upload) Reset() { - *x = Upload{} +func (x *Mysql) Reset() { + *x = Mysql{} + mi := &file_conf_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Mysql) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Mysql) ProtoMessage() {} + +func (x *Mysql) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[5] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Mysql.ProtoReflect.Descriptor instead. +func (*Mysql) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{5} +} + +func (x *Mysql) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Mysql) GetPort() string { + if x != nil { + return x.Port + } + return "" +} + +func (x *Mysql) GetConfig() string { + if x != nil { + return x.Config + } + return "" +} + +func (x *Mysql) GetDbName() string { + if x != nil { + return x.DbName + } + return "" +} + +func (x *Mysql) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *Mysql) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *Mysql) GetMaxIdleConns() int32 { + if x != nil { + return x.MaxIdleConns + } + return 0 +} + +func (x *Mysql) GetMaxOpenConns() int32 { + if x != nil { + return x.MaxOpenConns + } + return 0 +} + +func (x *Mysql) GetLogMode() string { + if x != nil { + return x.LogMode + } + return "" +} + +func (x *Mysql) GetLogZap() bool { + if x != nil { + return x.LogZap + } + return false +} + +type Pgsql struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Port string `protobuf:"bytes,2,opt,name=port,proto3" json:"port,omitempty"` + Config string `protobuf:"bytes,3,opt,name=config,proto3" json:"config,omitempty"` + DbName string `protobuf:"bytes,4,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` + Username string `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` + MaxIdleConns int32 `protobuf:"varint,7,opt,name=max_idle_conns,json=maxIdleConns,proto3" json:"max_idle_conns,omitempty"` + MaxOpenConns int32 `protobuf:"varint,8,opt,name=max_open_conns,json=maxOpenConns,proto3" json:"max_open_conns,omitempty"` + LogMode string `protobuf:"bytes,9,opt,name=log_mode,json=logMode,proto3" json:"log_mode,omitempty"` + LogZap bool `protobuf:"varint,10,opt,name=log_zap,json=logZap,proto3" json:"log_zap,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Pgsql) Reset() { + *x = Pgsql{} mi := &file_conf_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Upload) String() string { +func (x *Pgsql) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Upload) ProtoMessage() {} +func (*Pgsql) ProtoMessage() {} -func (x *Upload) ProtoReflect() protoreflect.Message { +func (x *Pgsql) ProtoReflect() protoreflect.Message { mi := &file_conf_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -440,86 +679,1283 @@ func (x *Upload) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Upload.ProtoReflect.Descriptor instead. -func (*Upload) Descriptor() ([]byte, []int) { +// Deprecated: Use Pgsql.ProtoReflect.Descriptor instead. +func (*Pgsql) Descriptor() ([]byte, []int) { return file_conf_proto_rawDescGZIP(), []int{6} } -func (x *Upload) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *Upload) GetPath() string { +func (x *Pgsql) GetPath() string { if x != nil { return x.Path } return "" } -func (x *Upload) GetMaxSize() int64 { +func (x *Pgsql) GetPort() string { if x != nil { - return x.MaxSize + return x.Port + } + return "" +} + +func (x *Pgsql) GetConfig() string { + if x != nil { + return x.Config + } + return "" +} + +func (x *Pgsql) GetDbName() string { + if x != nil { + return x.DbName + } + return "" +} + +func (x *Pgsql) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *Pgsql) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *Pgsql) GetMaxIdleConns() int32 { + if x != nil { + return x.MaxIdleConns } return 0 } -func (x *Upload) GetLocal() *Upload_Local { +func (x *Pgsql) GetMaxOpenConns() int32 { if x != nil { - return x.Local + return x.MaxOpenConns + } + return 0 +} + +func (x *Pgsql) GetLogMode() string { + if x != nil { + return x.LogMode + } + return "" +} + +func (x *Pgsql) GetLogZap() bool { + if x != nil { + return x.LogZap + } + return false +} + +type Sqlite struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + DbName string `protobuf:"bytes,2,opt,name=db_name,json=dbName,proto3" json:"db_name,omitempty"` + MaxIdleConns int32 `protobuf:"varint,3,opt,name=max_idle_conns,json=maxIdleConns,proto3" json:"max_idle_conns,omitempty"` + MaxOpenConns int32 `protobuf:"varint,4,opt,name=max_open_conns,json=maxOpenConns,proto3" json:"max_open_conns,omitempty"` + LogMode string `protobuf:"bytes,5,opt,name=log_mode,json=logMode,proto3" json:"log_mode,omitempty"` + LogZap bool `protobuf:"varint,6,opt,name=log_zap,json=logZap,proto3" json:"log_zap,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Sqlite) Reset() { + *x = Sqlite{} + mi := &file_conf_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Sqlite) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Sqlite) ProtoMessage() {} + +func (x *Sqlite) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[7] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Sqlite.ProtoReflect.Descriptor instead. +func (*Sqlite) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{7} +} + +func (x *Sqlite) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Sqlite) GetDbName() string { + if x != nil { + return x.DbName + } + return "" +} + +func (x *Sqlite) GetMaxIdleConns() int32 { + if x != nil { + return x.MaxIdleConns + } + return 0 +} + +func (x *Sqlite) GetMaxOpenConns() int32 { + if x != nil { + return x.MaxOpenConns + } + return 0 +} + +func (x *Sqlite) GetLogMode() string { + if x != nil { + return x.LogMode + } + return "" +} + +func (x *Sqlite) GetLogZap() bool { + if x != nil { + return x.LogZap + } + return false +} + +type Redis struct { + state protoimpl.MessageState `protogen:"open.v1"` + UseCluster bool `protobuf:"varint,1,opt,name=use_cluster,json=useCluster,proto3" json:"use_cluster,omitempty"` + Addr string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"` + Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + Db int32 `protobuf:"varint,4,opt,name=db,proto3" json:"db,omitempty"` + ClusterAddrs []string `protobuf:"bytes,5,rep,name=cluster_addrs,json=clusterAddrs,proto3" json:"cluster_addrs,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Redis) Reset() { + *x = Redis{} + mi := &file_conf_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Redis) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Redis) ProtoMessage() {} + +func (x *Redis) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Redis.ProtoReflect.Descriptor instead. +func (*Redis) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{8} +} + +func (x *Redis) GetUseCluster() bool { + if x != nil { + return x.UseCluster + } + return false +} + +func (x *Redis) GetAddr() string { + if x != nil { + return x.Addr + } + return "" +} + +func (x *Redis) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +func (x *Redis) GetDb() int32 { + if x != nil { + return x.Db + } + return 0 +} + +func (x *Redis) GetClusterAddrs() []string { + if x != nil { + return x.ClusterAddrs } return nil } -func (x *Upload) GetAliyun() *Upload_Aliyun { +type Local struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + StorePath string `protobuf:"bytes,2,opt,name=store_path,json=storePath,proto3" json:"store_path,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Local) Reset() { + *x = Local{} + mi := &file_conf_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Local) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Local) ProtoMessage() {} + +func (x *Local) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[9] if x != nil { - return x.Aliyun + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Local.ProtoReflect.Descriptor instead. +func (*Local) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{9} +} + +func (x *Local) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *Local) GetStorePath() string { + if x != nil { + return x.StorePath + } + return "" +} + +type Qiniu struct { + state protoimpl.MessageState `protogen:"open.v1"` + Zone string `protobuf:"bytes,1,opt,name=zone,proto3" json:"zone,omitempty"` + Bucket string `protobuf:"bytes,2,opt,name=bucket,proto3" json:"bucket,omitempty"` + ImgPath string `protobuf:"bytes,3,opt,name=img_path,json=imgPath,proto3" json:"img_path,omitempty"` + UseHttps bool `protobuf:"varint,4,opt,name=use_https,json=useHttps,proto3" json:"use_https,omitempty"` + AccessKey string `protobuf:"bytes,5,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` + SecretKey string `protobuf:"bytes,6,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` + UseCdnDomains bool `protobuf:"varint,7,opt,name=use_cdn_domains,json=useCdnDomains,proto3" json:"use_cdn_domains,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Qiniu) Reset() { + *x = Qiniu{} + mi := &file_conf_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Qiniu) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Qiniu) ProtoMessage() {} + +func (x *Qiniu) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[10] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Qiniu.ProtoReflect.Descriptor instead. +func (*Qiniu) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{10} +} + +func (x *Qiniu) GetZone() string { + if x != nil { + return x.Zone + } + return "" +} + +func (x *Qiniu) GetBucket() string { + if x != nil { + return x.Bucket + } + return "" +} + +func (x *Qiniu) GetImgPath() string { + if x != nil { + return x.ImgPath + } + return "" +} + +func (x *Qiniu) GetUseHttps() bool { + if x != nil { + return x.UseHttps + } + return false +} + +func (x *Qiniu) GetAccessKey() string { + if x != nil { + return x.AccessKey + } + return "" +} + +func (x *Qiniu) GetSecretKey() string { + if x != nil { + return x.SecretKey + } + return "" +} + +func (x *Qiniu) GetUseCdnDomains() bool { + if x != nil { + return x.UseCdnDomains + } + return false +} + +type Minio struct { + state protoimpl.MessageState `protogen:"open.v1"` + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + AccessKeyId string `protobuf:"bytes,2,opt,name=access_key_id,json=accessKeyId,proto3" json:"access_key_id,omitempty"` + AccessKeySecret string `protobuf:"bytes,3,opt,name=access_key_secret,json=accessKeySecret,proto3" json:"access_key_secret,omitempty"` + BucketName string `protobuf:"bytes,4,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` + UseSsl bool `protobuf:"varint,5,opt,name=use_ssl,json=useSsl,proto3" json:"use_ssl,omitempty"` + BasePath string `protobuf:"bytes,6,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"` + BucketUrl string `protobuf:"bytes,7,opt,name=bucket_url,json=bucketUrl,proto3" json:"bucket_url,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Minio) Reset() { + *x = Minio{} + mi := &file_conf_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Minio) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Minio) ProtoMessage() {} + +func (x *Minio) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[11] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Minio.ProtoReflect.Descriptor instead. +func (*Minio) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{11} +} + +func (x *Minio) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *Minio) GetAccessKeyId() string { + if x != nil { + return x.AccessKeyId + } + return "" +} + +func (x *Minio) GetAccessKeySecret() string { + if x != nil { + return x.AccessKeySecret + } + return "" +} + +func (x *Minio) GetBucketName() string { + if x != nil { + return x.BucketName + } + return "" +} + +func (x *Minio) GetUseSsl() bool { + if x != nil { + return x.UseSsl + } + return false +} + +func (x *Minio) GetBasePath() string { + if x != nil { + return x.BasePath + } + return "" +} + +func (x *Minio) GetBucketUrl() string { + if x != nil { + return x.BucketUrl + } + return "" +} + +type AliyunOss struct { + state protoimpl.MessageState `protogen:"open.v1"` + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + AccessKeyId string `protobuf:"bytes,2,opt,name=access_key_id,json=accessKeyId,proto3" json:"access_key_id,omitempty"` + AccessKeySecret string `protobuf:"bytes,3,opt,name=access_key_secret,json=accessKeySecret,proto3" json:"access_key_secret,omitempty"` + BucketName string `protobuf:"bytes,4,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` + BucketUrl string `protobuf:"bytes,5,opt,name=bucket_url,json=bucketUrl,proto3" json:"bucket_url,omitempty"` + BasePath string `protobuf:"bytes,6,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AliyunOss) Reset() { + *x = AliyunOss{} + mi := &file_conf_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AliyunOss) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AliyunOss) ProtoMessage() {} + +func (x *AliyunOss) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[12] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AliyunOss.ProtoReflect.Descriptor instead. +func (*AliyunOss) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{12} +} + +func (x *AliyunOss) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *AliyunOss) GetAccessKeyId() string { + if x != nil { + return x.AccessKeyId + } + return "" +} + +func (x *AliyunOss) GetAccessKeySecret() string { + if x != nil { + return x.AccessKeySecret + } + return "" +} + +func (x *AliyunOss) GetBucketName() string { + if x != nil { + return x.BucketName + } + return "" +} + +func (x *AliyunOss) GetBucketUrl() string { + if x != nil { + return x.BucketUrl + } + return "" +} + +func (x *AliyunOss) GetBasePath() string { + if x != nil { + return x.BasePath + } + return "" +} + +type TencentCos struct { + state protoimpl.MessageState `protogen:"open.v1"` + Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` + SecretId string `protobuf:"bytes,3,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"` + SecretKey string `protobuf:"bytes,4,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` + BaseUrl string `protobuf:"bytes,5,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"` + PathPrefix string `protobuf:"bytes,6,opt,name=path_prefix,json=pathPrefix,proto3" json:"path_prefix,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *TencentCos) Reset() { + *x = TencentCos{} + mi := &file_conf_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *TencentCos) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TencentCos) ProtoMessage() {} + +func (x *TencentCos) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[13] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use TencentCos.ProtoReflect.Descriptor instead. +func (*TencentCos) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{13} +} + +func (x *TencentCos) GetBucket() string { + if x != nil { + return x.Bucket + } + return "" +} + +func (x *TencentCos) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *TencentCos) GetSecretId() string { + if x != nil { + return x.SecretId + } + return "" +} + +func (x *TencentCos) GetSecretKey() string { + if x != nil { + return x.SecretKey + } + return "" +} + +func (x *TencentCos) GetBaseUrl() string { + if x != nil { + return x.BaseUrl + } + return "" +} + +func (x *TencentCos) GetPathPrefix() string { + if x != nil { + return x.PathPrefix + } + return "" +} + +type AwsS3 struct { + state protoimpl.MessageState `protogen:"open.v1"` + Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` + Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + S3ForcePathStyle bool `protobuf:"varint,4,opt,name=s3_force_path_style,json=s3ForcePathStyle,proto3" json:"s3_force_path_style,omitempty"` + DisableSsl bool `protobuf:"varint,5,opt,name=disable_ssl,json=disableSsl,proto3" json:"disable_ssl,omitempty"` + SecretId string `protobuf:"bytes,6,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"` + SecretKey string `protobuf:"bytes,7,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` + BaseUrl string `protobuf:"bytes,8,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"` + PathPrefix string `protobuf:"bytes,9,opt,name=path_prefix,json=pathPrefix,proto3" json:"path_prefix,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AwsS3) Reset() { + *x = AwsS3{} + mi := &file_conf_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AwsS3) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AwsS3) ProtoMessage() {} + +func (x *AwsS3) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[14] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AwsS3.ProtoReflect.Descriptor instead. +func (*AwsS3) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{14} +} + +func (x *AwsS3) GetBucket() string { + if x != nil { + return x.Bucket + } + return "" +} + +func (x *AwsS3) GetRegion() string { + if x != nil { + return x.Region + } + return "" +} + +func (x *AwsS3) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *AwsS3) GetS3ForcePathStyle() bool { + if x != nil { + return x.S3ForcePathStyle + } + return false +} + +func (x *AwsS3) GetDisableSsl() bool { + if x != nil { + return x.DisableSsl + } + return false +} + +func (x *AwsS3) GetSecretId() string { + if x != nil { + return x.SecretId + } + return "" +} + +func (x *AwsS3) GetSecretKey() string { + if x != nil { + return x.SecretKey + } + return "" +} + +func (x *AwsS3) GetBaseUrl() string { + if x != nil { + return x.BaseUrl + } + return "" +} + +func (x *AwsS3) GetPathPrefix() string { + if x != nil { + return x.PathPrefix + } + return "" +} + +type CloudflareR2 struct { + state protoimpl.MessageState `protogen:"open.v1"` + Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` + BaseUrl string `protobuf:"bytes,2,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"` + Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` + AccountId string `protobuf:"bytes,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` + AccessKeyId string `protobuf:"bytes,5,opt,name=access_key_id,json=accessKeyId,proto3" json:"access_key_id,omitempty"` + SecretAccessKey string `protobuf:"bytes,6,opt,name=secret_access_key,json=secretAccessKey,proto3" json:"secret_access_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CloudflareR2) Reset() { + *x = CloudflareR2{} + mi := &file_conf_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CloudflareR2) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CloudflareR2) ProtoMessage() {} + +func (x *CloudflareR2) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[15] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CloudflareR2.ProtoReflect.Descriptor instead. +func (*CloudflareR2) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{15} +} + +func (x *CloudflareR2) GetBucket() string { + if x != nil { + return x.Bucket + } + return "" +} + +func (x *CloudflareR2) GetBaseUrl() string { + if x != nil { + return x.BaseUrl + } + return "" +} + +func (x *CloudflareR2) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *CloudflareR2) GetAccountId() string { + if x != nil { + return x.AccountId + } + return "" +} + +func (x *CloudflareR2) GetAccessKeyId() string { + if x != nil { + return x.AccessKeyId + } + return "" +} + +func (x *CloudflareR2) GetSecretAccessKey() string { + if x != nil { + return x.SecretAccessKey + } + return "" +} + +type HuaweiObs struct { + state protoimpl.MessageState `protogen:"open.v1"` + Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Bucket string `protobuf:"bytes,2,opt,name=bucket,proto3" json:"bucket,omitempty"` + Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + AccessKey string `protobuf:"bytes,4,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` + SecretKey string `protobuf:"bytes,5,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *HuaweiObs) Reset() { + *x = HuaweiObs{} + mi := &file_conf_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *HuaweiObs) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HuaweiObs) ProtoMessage() {} + +func (x *HuaweiObs) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[16] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HuaweiObs.ProtoReflect.Descriptor instead. +func (*HuaweiObs) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{16} +} + +func (x *HuaweiObs) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *HuaweiObs) GetBucket() string { + if x != nil { + return x.Bucket + } + return "" +} + +func (x *HuaweiObs) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *HuaweiObs) GetAccessKey() string { + if x != nil { + return x.AccessKey + } + return "" +} + +func (x *HuaweiObs) GetSecretKey() string { + if x != nil { + return x.SecretKey + } + return "" +} + +type Email struct { + state protoimpl.MessageState `protogen:"open.v1"` + To string `protobuf:"bytes,1,opt,name=to,proto3" json:"to,omitempty"` + Port int32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + From string `protobuf:"bytes,3,opt,name=from,proto3" json:"from,omitempty"` + Host string `protobuf:"bytes,4,opt,name=host,proto3" json:"host,omitempty"` + IsSsl bool `protobuf:"varint,5,opt,name=is_ssl,json=isSsl,proto3" json:"is_ssl,omitempty"` + Secret string `protobuf:"bytes,6,opt,name=secret,proto3" json:"secret,omitempty"` + Nickname string `protobuf:"bytes,7,opt,name=nickname,proto3" json:"nickname,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Email) Reset() { + *x = Email{} + mi := &file_conf_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Email) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Email) ProtoMessage() {} + +func (x *Email) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[17] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Email.ProtoReflect.Descriptor instead. +func (*Email) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{17} +} + +func (x *Email) GetTo() string { + if x != nil { + return x.To + } + return "" +} + +func (x *Email) GetPort() int32 { + if x != nil { + return x.Port + } + return 0 +} + +func (x *Email) GetFrom() string { + if x != nil { + return x.From + } + return "" +} + +func (x *Email) GetHost() string { + if x != nil { + return x.Host + } + return "" +} + +func (x *Email) GetIsSsl() bool { + if x != nil { + return x.IsSsl + } + return false +} + +func (x *Email) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +func (x *Email) GetNickname() string { + if x != nil { + return x.Nickname + } + return "" +} + +type Excel struct { + state protoimpl.MessageState `protogen:"open.v1"` + Dir string `protobuf:"bytes,1,opt,name=dir,proto3" json:"dir,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Excel) Reset() { + *x = Excel{} + mi := &file_conf_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Excel) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Excel) ProtoMessage() {} + +func (x *Excel) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[18] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Excel.ProtoReflect.Descriptor instead. +func (*Excel) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{18} +} + +func (x *Excel) GetDir() string { + if x != nil { + return x.Dir + } + return "" +} + +type Cors struct { + state protoimpl.MessageState `protogen:"open.v1"` + Mode string `protobuf:"bytes,1,opt,name=mode,proto3" json:"mode,omitempty"` + Whitelist []*CorsWhitelist `protobuf:"bytes,2,rep,name=whitelist,proto3" json:"whitelist,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Cors) Reset() { + *x = Cors{} + mi := &file_conf_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Cors) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Cors) ProtoMessage() {} + +func (x *Cors) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[19] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Cors.ProtoReflect.Descriptor instead. +func (*Cors) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{19} +} + +func (x *Cors) GetMode() string { + if x != nil { + return x.Mode + } + return "" +} + +func (x *Cors) GetWhitelist() []*CorsWhitelist { + if x != nil { + return x.Whitelist } return nil } -func (x *Upload) GetTencent() *Upload_Tencent { - if x != nil { - return x.Tencent - } - return nil +type CorsWhitelist struct { + state protoimpl.MessageState `protogen:"open.v1"` + AllowOrigin string `protobuf:"bytes,1,opt,name=allow_origin,json=allowOrigin,proto3" json:"allow_origin,omitempty"` + AllowHeaders string `protobuf:"bytes,2,opt,name=allow_headers,json=allowHeaders,proto3" json:"allow_headers,omitempty"` + AllowMethods string `protobuf:"bytes,3,opt,name=allow_methods,json=allowMethods,proto3" json:"allow_methods,omitempty"` + ExposeHeaders string `protobuf:"bytes,4,opt,name=expose_headers,json=exposeHeaders,proto3" json:"expose_headers,omitempty"` + AllowCredentials bool `protobuf:"varint,5,opt,name=allow_credentials,json=allowCredentials,proto3" json:"allow_credentials,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (x *Upload) GetQiniu() *Upload_Qiniu { - if x != nil { - return x.Qiniu - } - return nil +func (x *CorsWhitelist) Reset() { + *x = CorsWhitelist{} + mi := &file_conf_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } -func (x *Upload) GetMinio() *Upload_Minio { - if x != nil { - return x.Minio - } - return nil +func (x *CorsWhitelist) String() string { + return protoimpl.X.MessageStringOf(x) } -func (x *Upload) GetAwsS3() *Upload_AwsS3 { +func (*CorsWhitelist) ProtoMessage() {} + +func (x *CorsWhitelist) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[20] if x != nil { - return x.AwsS3 + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms } - return nil + return mi.MessageOf(x) } -func (x *Upload) GetHuaweiObs() *Upload_HuaweiObs { - if x != nil { - return x.HuaweiObs - } - return nil +// Deprecated: Use CorsWhitelist.ProtoReflect.Descriptor instead. +func (*CorsWhitelist) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{20} } -func (x *Upload) GetCloudflareR2() *Upload_CloudflareR2 { +func (x *CorsWhitelist) GetAllowOrigin() string { if x != nil { - return x.CloudflareR2 + return x.AllowOrigin } - return nil + return "" +} + +func (x *CorsWhitelist) GetAllowHeaders() string { + if x != nil { + return x.AllowHeaders + } + return "" +} + +func (x *CorsWhitelist) GetAllowMethods() string { + if x != nil { + return x.AllowMethods + } + return "" +} + +func (x *CorsWhitelist) GetExposeHeaders() string { + if x != nil { + return x.ExposeHeaders + } + return "" +} + +func (x *CorsWhitelist) GetAllowCredentials() bool { + if x != nil { + return x.AllowCredentials + } + return false +} + +type Zap struct { + state protoimpl.MessageState `protogen:"open.v1"` + Level string `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"` + Format string `protobuf:"bytes,2,opt,name=format,proto3" json:"format,omitempty"` + Prefix string `protobuf:"bytes,3,opt,name=prefix,proto3" json:"prefix,omitempty"` + Director string `protobuf:"bytes,4,opt,name=director,proto3" json:"director,omitempty"` + ShowLine bool `protobuf:"varint,5,opt,name=show_line,json=showLine,proto3" json:"show_line,omitempty"` + EncodeLevel string `protobuf:"bytes,6,opt,name=encode_level,json=encodeLevel,proto3" json:"encode_level,omitempty"` + StacktraceKey string `protobuf:"bytes,7,opt,name=stacktrace_key,json=stacktraceKey,proto3" json:"stacktrace_key,omitempty"` + LogInConsole bool `protobuf:"varint,8,opt,name=log_in_console,json=logInConsole,proto3" json:"log_in_console,omitempty"` + RetentionDay int32 `protobuf:"varint,9,opt,name=retention_day,json=retentionDay,proto3" json:"retention_day,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *Zap) Reset() { + *x = Zap{} + mi := &file_conf_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Zap) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Zap) ProtoMessage() {} + +func (x *Zap) ProtoReflect() protoreflect.Message { + mi := &file_conf_proto_msgTypes[21] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Zap.ProtoReflect.Descriptor instead. +func (*Zap) Descriptor() ([]byte, []int) { + return file_conf_proto_rawDescGZIP(), []int{21} +} + +func (x *Zap) GetLevel() string { + if x != nil { + return x.Level + } + return "" +} + +func (x *Zap) GetFormat() string { + if x != nil { + return x.Format + } + return "" +} + +func (x *Zap) GetPrefix() string { + if x != nil { + return x.Prefix + } + return "" +} + +func (x *Zap) GetDirector() string { + if x != nil { + return x.Director + } + return "" +} + +func (x *Zap) GetShowLine() bool { + if x != nil { + return x.ShowLine + } + return false +} + +func (x *Zap) GetEncodeLevel() string { + if x != nil { + return x.EncodeLevel + } + return "" +} + +func (x *Zap) GetStacktraceKey() string { + if x != nil { + return x.StacktraceKey + } + return "" +} + +func (x *Zap) GetLogInConsole() bool { + if x != nil { + return x.LogInConsole + } + return false +} + +func (x *Zap) GetRetentionDay() int32 { + if x != nil { + return x.RetentionDay + } + return 0 } type Server_HTTP struct { @@ -533,7 +1969,7 @@ type Server_HTTP struct { func (x *Server_HTTP) Reset() { *x = Server_HTTP{} - mi := &file_conf_proto_msgTypes[7] + mi := &file_conf_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -545,7 +1981,7 @@ func (x *Server_HTTP) String() string { func (*Server_HTTP) ProtoMessage() {} func (x *Server_HTTP) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[7] + mi := &file_conf_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -593,7 +2029,7 @@ type Server_GRPC struct { func (x *Server_GRPC) Reset() { *x = Server_GRPC{} - mi := &file_conf_proto_msgTypes[8] + mi := &file_conf_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -605,7 +2041,7 @@ func (x *Server_GRPC) String() string { func (*Server_GRPC) ProtoMessage() {} func (x *Server_GRPC) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[8] + mi := &file_conf_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -642,844 +2078,38 @@ func (x *Server_GRPC) GetTimeout() *durationpb.Duration { return nil } -type Data_Database struct { - state protoimpl.MessageState `protogen:"open.v1"` - Driver string `protobuf:"bytes,1,opt,name=driver,proto3" json:"driver,omitempty"` - Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"` - TablePrefix string `protobuf:"bytes,3,opt,name=table_prefix,json=tablePrefix,proto3" json:"table_prefix,omitempty"` - MaxIdleConns int32 `protobuf:"varint,4,opt,name=max_idle_conns,json=maxIdleConns,proto3" json:"max_idle_conns,omitempty"` - MaxOpenConns int32 `protobuf:"varint,5,opt,name=max_open_conns,json=maxOpenConns,proto3" json:"max_open_conns,omitempty"` - MaxLifetime int32 `protobuf:"varint,6,opt,name=max_lifetime,json=maxLifetime,proto3" json:"max_lifetime,omitempty"` - LogMode bool `protobuf:"varint,7,opt,name=log_mode,json=logMode,proto3" json:"log_mode,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Data_Database) Reset() { - *x = Data_Database{} - mi := &file_conf_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Data_Database) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Data_Database) ProtoMessage() {} - -func (x *Data_Database) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[9] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Data_Database.ProtoReflect.Descriptor instead. -func (*Data_Database) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{2, 0} -} - -func (x *Data_Database) GetDriver() string { - if x != nil { - return x.Driver - } - return "" -} - -func (x *Data_Database) GetSource() string { - if x != nil { - return x.Source - } - return "" -} - -func (x *Data_Database) GetTablePrefix() string { - if x != nil { - return x.TablePrefix - } - return "" -} - -func (x *Data_Database) GetMaxIdleConns() int32 { - if x != nil { - return x.MaxIdleConns - } - return 0 -} - -func (x *Data_Database) GetMaxOpenConns() int32 { - if x != nil { - return x.MaxOpenConns - } - return 0 -} - -func (x *Data_Database) GetMaxLifetime() int32 { - if x != nil { - return x.MaxLifetime - } - return 0 -} - -func (x *Data_Database) GetLogMode() bool { - if x != nil { - return x.LogMode - } - return false -} - -type Data_Redis struct { - state protoimpl.MessageState `protogen:"open.v1"` - Addr string `protobuf:"bytes,1,opt,name=addr,proto3" json:"addr,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - Db int32 `protobuf:"varint,3,opt,name=db,proto3" json:"db,omitempty"` - UseCluster bool `protobuf:"varint,4,opt,name=use_cluster,json=useCluster,proto3" json:"use_cluster,omitempty"` - ClusterAddrs []string `protobuf:"bytes,5,rep,name=cluster_addrs,json=clusterAddrs,proto3" json:"cluster_addrs,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Data_Redis) Reset() { - *x = Data_Redis{} - mi := &file_conf_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Data_Redis) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Data_Redis) ProtoMessage() {} - -func (x *Data_Redis) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[10] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Data_Redis.ProtoReflect.Descriptor instead. -func (*Data_Redis) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{2, 1} -} - -func (x *Data_Redis) GetAddr() string { - if x != nil { - return x.Addr - } - return "" -} - -func (x *Data_Redis) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *Data_Redis) GetDb() int32 { - if x != nil { - return x.Db - } - return 0 -} - -func (x *Data_Redis) GetUseCluster() bool { - if x != nil { - return x.UseCluster - } - return false -} - -func (x *Data_Redis) GetClusterAddrs() []string { - if x != nil { - return x.ClusterAddrs - } - return nil -} - -type Upload_Local struct { - state protoimpl.MessageState `protogen:"open.v1"` - StorePath string `protobuf:"bytes,1,opt,name=store_path,json=storePath,proto3" json:"store_path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Upload_Local) Reset() { - *x = Upload_Local{} - mi := &file_conf_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Upload_Local) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Upload_Local) ProtoMessage() {} - -func (x *Upload_Local) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[11] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Upload_Local.ProtoReflect.Descriptor instead. -func (*Upload_Local) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{6, 0} -} - -func (x *Upload_Local) GetStorePath() string { - if x != nil { - return x.StorePath - } - return "" -} - -type Upload_Aliyun struct { - state protoimpl.MessageState `protogen:"open.v1"` - Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - AccessKeyId string `protobuf:"bytes,2,opt,name=access_key_id,json=accessKeyId,proto3" json:"access_key_id,omitempty"` - AccessKeySecret string `protobuf:"bytes,3,opt,name=access_key_secret,json=accessKeySecret,proto3" json:"access_key_secret,omitempty"` - BucketName string `protobuf:"bytes,4,opt,name=bucket_name,json=bucketName,proto3" json:"bucket_name,omitempty"` - BucketUrl string `protobuf:"bytes,5,opt,name=bucket_url,json=bucketUrl,proto3" json:"bucket_url,omitempty"` - BasePath string `protobuf:"bytes,6,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Upload_Aliyun) Reset() { - *x = Upload_Aliyun{} - mi := &file_conf_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Upload_Aliyun) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Upload_Aliyun) ProtoMessage() {} - -func (x *Upload_Aliyun) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[12] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Upload_Aliyun.ProtoReflect.Descriptor instead. -func (*Upload_Aliyun) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{6, 1} -} - -func (x *Upload_Aliyun) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *Upload_Aliyun) GetAccessKeyId() string { - if x != nil { - return x.AccessKeyId - } - return "" -} - -func (x *Upload_Aliyun) GetAccessKeySecret() string { - if x != nil { - return x.AccessKeySecret - } - return "" -} - -func (x *Upload_Aliyun) GetBucketName() string { - if x != nil { - return x.BucketName - } - return "" -} - -func (x *Upload_Aliyun) GetBucketUrl() string { - if x != nil { - return x.BucketUrl - } - return "" -} - -func (x *Upload_Aliyun) GetBasePath() string { - if x != nil { - return x.BasePath - } - return "" -} - -type Upload_Tencent struct { - state protoimpl.MessageState `protogen:"open.v1"` - Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` - Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` - SecretId string `protobuf:"bytes,3,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"` - SecretKey string `protobuf:"bytes,4,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` - BaseUrl string `protobuf:"bytes,5,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"` - PathPrefix string `protobuf:"bytes,6,opt,name=path_prefix,json=pathPrefix,proto3" json:"path_prefix,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Upload_Tencent) Reset() { - *x = Upload_Tencent{} - mi := &file_conf_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Upload_Tencent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Upload_Tencent) ProtoMessage() {} - -func (x *Upload_Tencent) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[13] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Upload_Tencent.ProtoReflect.Descriptor instead. -func (*Upload_Tencent) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{6, 2} -} - -func (x *Upload_Tencent) GetBucket() string { - if x != nil { - return x.Bucket - } - return "" -} - -func (x *Upload_Tencent) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *Upload_Tencent) GetSecretId() string { - if x != nil { - return x.SecretId - } - return "" -} - -func (x *Upload_Tencent) GetSecretKey() string { - if x != nil { - return x.SecretKey - } - return "" -} - -func (x *Upload_Tencent) GetBaseUrl() string { - if x != nil { - return x.BaseUrl - } - return "" -} - -func (x *Upload_Tencent) GetPathPrefix() string { - if x != nil { - return x.PathPrefix - } - return "" -} - -type Upload_Qiniu struct { - state protoimpl.MessageState `protogen:"open.v1"` - Zone string `protobuf:"bytes,1,opt,name=zone,proto3" json:"zone,omitempty"` - Bucket string `protobuf:"bytes,2,opt,name=bucket,proto3" json:"bucket,omitempty"` - ImgPath string `protobuf:"bytes,3,opt,name=img_path,json=imgPath,proto3" json:"img_path,omitempty"` - AccessKey string `protobuf:"bytes,4,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` - SecretKey string `protobuf:"bytes,5,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` - UseHttps bool `protobuf:"varint,6,opt,name=use_https,json=useHttps,proto3" json:"use_https,omitempty"` - UseCdnDomains bool `protobuf:"varint,7,opt,name=use_cdn_domains,json=useCdnDomains,proto3" json:"use_cdn_domains,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Upload_Qiniu) Reset() { - *x = Upload_Qiniu{} - mi := &file_conf_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Upload_Qiniu) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Upload_Qiniu) ProtoMessage() {} - -func (x *Upload_Qiniu) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[14] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Upload_Qiniu.ProtoReflect.Descriptor instead. -func (*Upload_Qiniu) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{6, 3} -} - -func (x *Upload_Qiniu) GetZone() string { - if x != nil { - return x.Zone - } - return "" -} - -func (x *Upload_Qiniu) GetBucket() string { - if x != nil { - return x.Bucket - } - return "" -} - -func (x *Upload_Qiniu) GetImgPath() string { - if x != nil { - return x.ImgPath - } - return "" -} - -func (x *Upload_Qiniu) GetAccessKey() string { - if x != nil { - return x.AccessKey - } - return "" -} - -func (x *Upload_Qiniu) GetSecretKey() string { - if x != nil { - return x.SecretKey - } - return "" -} - -func (x *Upload_Qiniu) GetUseHttps() bool { - if x != nil { - return x.UseHttps - } - return false -} - -func (x *Upload_Qiniu) GetUseCdnDomains() bool { - if x != nil { - return x.UseCdnDomains - } - return false -} - -type Upload_Minio struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Secret string `protobuf:"bytes,2,opt,name=secret,proto3" json:"secret,omitempty"` - Bucket string `protobuf:"bytes,3,opt,name=bucket,proto3" json:"bucket,omitempty"` - Endpoint string `protobuf:"bytes,4,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - BasePath string `protobuf:"bytes,5,opt,name=base_path,json=basePath,proto3" json:"base_path,omitempty"` - UseSsl bool `protobuf:"varint,6,opt,name=use_ssl,json=useSsl,proto3" json:"use_ssl,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Upload_Minio) Reset() { - *x = Upload_Minio{} - mi := &file_conf_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Upload_Minio) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Upload_Minio) ProtoMessage() {} - -func (x *Upload_Minio) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[15] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Upload_Minio.ProtoReflect.Descriptor instead. -func (*Upload_Minio) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{6, 4} -} - -func (x *Upload_Minio) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Upload_Minio) GetSecret() string { - if x != nil { - return x.Secret - } - return "" -} - -func (x *Upload_Minio) GetBucket() string { - if x != nil { - return x.Bucket - } - return "" -} - -func (x *Upload_Minio) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *Upload_Minio) GetBasePath() string { - if x != nil { - return x.BasePath - } - return "" -} - -func (x *Upload_Minio) GetUseSsl() bool { - if x != nil { - return x.UseSsl - } - return false -} - -type Upload_AwsS3 struct { - state protoimpl.MessageState `protogen:"open.v1"` - Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` - Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"` - Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - SecretId string `protobuf:"bytes,4,opt,name=secret_id,json=secretId,proto3" json:"secret_id,omitempty"` - SecretKey string `protobuf:"bytes,5,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` - BaseUrl string `protobuf:"bytes,6,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"` - PathPrefix string `protobuf:"bytes,7,opt,name=path_prefix,json=pathPrefix,proto3" json:"path_prefix,omitempty"` - S3ForcePathStyle bool `protobuf:"varint,8,opt,name=s3_force_path_style,json=s3ForcePathStyle,proto3" json:"s3_force_path_style,omitempty"` - DisableSsl bool `protobuf:"varint,9,opt,name=disable_ssl,json=disableSsl,proto3" json:"disable_ssl,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Upload_AwsS3) Reset() { - *x = Upload_AwsS3{} - mi := &file_conf_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Upload_AwsS3) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Upload_AwsS3) ProtoMessage() {} - -func (x *Upload_AwsS3) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[16] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Upload_AwsS3.ProtoReflect.Descriptor instead. -func (*Upload_AwsS3) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{6, 5} -} - -func (x *Upload_AwsS3) GetBucket() string { - if x != nil { - return x.Bucket - } - return "" -} - -func (x *Upload_AwsS3) GetRegion() string { - if x != nil { - return x.Region - } - return "" -} - -func (x *Upload_AwsS3) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *Upload_AwsS3) GetSecretId() string { - if x != nil { - return x.SecretId - } - return "" -} - -func (x *Upload_AwsS3) GetSecretKey() string { - if x != nil { - return x.SecretKey - } - return "" -} - -func (x *Upload_AwsS3) GetBaseUrl() string { - if x != nil { - return x.BaseUrl - } - return "" -} - -func (x *Upload_AwsS3) GetPathPrefix() string { - if x != nil { - return x.PathPrefix - } - return "" -} - -func (x *Upload_AwsS3) GetS3ForcePathStyle() bool { - if x != nil { - return x.S3ForcePathStyle - } - return false -} - -func (x *Upload_AwsS3) GetDisableSsl() bool { - if x != nil { - return x.DisableSsl - } - return false -} - -type Upload_HuaweiObs struct { - state protoimpl.MessageState `protogen:"open.v1"` - Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Bucket string `protobuf:"bytes,2,opt,name=bucket,proto3" json:"bucket,omitempty"` - Endpoint string `protobuf:"bytes,3,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - AccessKey string `protobuf:"bytes,4,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"` - SecretKey string `protobuf:"bytes,5,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Upload_HuaweiObs) Reset() { - *x = Upload_HuaweiObs{} - mi := &file_conf_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Upload_HuaweiObs) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Upload_HuaweiObs) ProtoMessage() {} - -func (x *Upload_HuaweiObs) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[17] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Upload_HuaweiObs.ProtoReflect.Descriptor instead. -func (*Upload_HuaweiObs) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{6, 6} -} - -func (x *Upload_HuaweiObs) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Upload_HuaweiObs) GetBucket() string { - if x != nil { - return x.Bucket - } - return "" -} - -func (x *Upload_HuaweiObs) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *Upload_HuaweiObs) GetAccessKey() string { - if x != nil { - return x.AccessKey - } - return "" -} - -func (x *Upload_HuaweiObs) GetSecretKey() string { - if x != nil { - return x.SecretKey - } - return "" -} - -type Upload_CloudflareR2 struct { - state protoimpl.MessageState `protogen:"open.v1"` - Bucket string `protobuf:"bytes,1,opt,name=bucket,proto3" json:"bucket,omitempty"` - BaseUrl string `protobuf:"bytes,2,opt,name=base_url,json=baseUrl,proto3" json:"base_url,omitempty"` - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - AccountId string `protobuf:"bytes,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` - AccessKeyId string `protobuf:"bytes,5,opt,name=access_key_id,json=accessKeyId,proto3" json:"access_key_id,omitempty"` - SecretAccessKey string `protobuf:"bytes,6,opt,name=secret_access_key,json=secretAccessKey,proto3" json:"secret_access_key,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Upload_CloudflareR2) Reset() { - *x = Upload_CloudflareR2{} - mi := &file_conf_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Upload_CloudflareR2) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Upload_CloudflareR2) ProtoMessage() {} - -func (x *Upload_CloudflareR2) ProtoReflect() protoreflect.Message { - mi := &file_conf_proto_msgTypes[18] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use Upload_CloudflareR2.ProtoReflect.Descriptor instead. -func (*Upload_CloudflareR2) Descriptor() ([]byte, []int) { - return file_conf_proto_rawDescGZIP(), []int{6, 7} -} - -func (x *Upload_CloudflareR2) GetBucket() string { - if x != nil { - return x.Bucket - } - return "" -} - -func (x *Upload_CloudflareR2) GetBaseUrl() string { - if x != nil { - return x.BaseUrl - } - return "" -} - -func (x *Upload_CloudflareR2) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Upload_CloudflareR2) GetAccountId() string { - if x != nil { - return x.AccountId - } - return "" -} - -func (x *Upload_CloudflareR2) GetAccessKeyId() string { - if x != nil { - return x.AccessKeyId - } - return "" -} - -func (x *Upload_CloudflareR2) GetSecretAccessKey() string { - if x != nil { - return x.SecretAccessKey - } - return "" -} - var File_conf_proto protoreflect.FileDescriptor const file_conf_proto_rawDesc = "" + "\n" + "\n" + "conf.proto\x12\n" + - "kratos.api\x1a\x1egoogle/protobuf/duration.proto\"\x87\x02\n" + + "kratos.api\x1a\x1egoogle/protobuf/duration.proto\"\x80\a\n" + "\tBootstrap\x12*\n" + - "\x06server\x18\x01 \x01(\v2\x12.kratos.api.ServerR\x06server\x12$\n" + - "\x04data\x18\x02 \x01(\v2\x10.kratos.api.DataR\x04data\x12!\n" + - "\x03jwt\x18\x03 \x01(\v2\x0f.kratos.api.JWTR\x03jwt\x12*\n" + - "\x06casbin\x18\x04 \x01(\v2\x12.kratos.api.CasbinR\x06casbin\x12-\n" + - "\acaptcha\x18\x05 \x01(\v2\x13.kratos.api.CaptchaR\acaptcha\x12*\n" + - "\x06upload\x18\x06 \x01(\v2\x12.kratos.api.UploadR\x06upload\"\xb8\x02\n" + + "\x06server\x18\x01 \x01(\v2\x12.kratos.api.ServerR\x06server\x12!\n" + + "\x03jwt\x18\x02 \x01(\v2\x0f.kratos.api.JWTR\x03jwt\x12*\n" + + "\x06system\x18\x03 \x01(\v2\x12.kratos.api.SystemR\x06system\x12-\n" + + "\acaptcha\x18\x04 \x01(\v2\x13.kratos.api.CaptchaR\acaptcha\x12'\n" + + "\x05mysql\x18\x05 \x01(\v2\x11.kratos.api.MysqlR\x05mysql\x12'\n" + + "\x05pgsql\x18\x06 \x01(\v2\x11.kratos.api.PgsqlR\x05pgsql\x12*\n" + + "\x06sqlite\x18\a \x01(\v2\x12.kratos.api.SqliteR\x06sqlite\x12'\n" + + "\x05redis\x18\b \x01(\v2\x11.kratos.api.RedisR\x05redis\x12'\n" + + "\x05local\x18\t \x01(\v2\x11.kratos.api.LocalR\x05local\x12'\n" + + "\x05qiniu\x18\n" + + " \x01(\v2\x11.kratos.api.QiniuR\x05qiniu\x12'\n" + + "\x05minio\x18\v \x01(\v2\x11.kratos.api.MinioR\x05minio\x124\n" + + "\n" + + "aliyun_oss\x18\f \x01(\v2\x15.kratos.api.AliyunOssR\taliyunOss\x127\n" + + "\vtencent_cos\x18\r \x01(\v2\x16.kratos.api.TencentCosR\n" + + "tencentCos\x12(\n" + + "\x06aws_s3\x18\x0e \x01(\v2\x11.kratos.api.AwsS3R\x05awsS3\x12=\n" + + "\rcloudflare_r2\x18\x0f \x01(\v2\x18.kratos.api.CloudflareR2R\fcloudflareR2\x124\n" + + "\n" + + "huawei_obs\x18\x10 \x01(\v2\x15.kratos.api.HuaweiObsR\thuaweiObs\x12'\n" + + "\x05email\x18\x11 \x01(\v2\x11.kratos.api.EmailR\x05email\x12'\n" + + "\x05excel\x18\x12 \x01(\v2\x11.kratos.api.ExcelR\x05excel\x12$\n" + + "\x04cors\x18\x13 \x01(\v2\x10.kratos.api.CorsR\x04cors\x12!\n" + + "\x03zap\x18\x14 \x01(\v2\x0f.kratos.api.ZapR\x03zap\"\xb8\x02\n" + "\x06Server\x12+\n" + "\x04http\x18\x01 \x01(\v2\x17.kratos.api.Server.HTTPR\x04http\x12+\n" + "\x04grpc\x18\x02 \x01(\v2\x17.kratos.api.Server.GRPCR\x04grpc\x1ai\n" + @@ -1490,60 +2120,94 @@ const file_conf_proto_rawDesc = "" + "\x04GRPC\x12\x18\n" + "\anetwork\x18\x01 \x01(\tR\anetwork\x12\x12\n" + "\x04addr\x18\x02 \x01(\tR\x04addr\x123\n" + - "\atimeout\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"\xe5\x03\n" + - "\x04Data\x125\n" + - "\bdatabase\x18\x01 \x01(\v2\x19.kratos.api.Data.DatabaseR\bdatabase\x12,\n" + - "\x05redis\x18\x02 \x01(\v2\x16.kratos.api.Data.RedisR\x05redis\x1a\xe7\x01\n" + - "\bDatabase\x12\x16\n" + - "\x06driver\x18\x01 \x01(\tR\x06driver\x12\x16\n" + - "\x06source\x18\x02 \x01(\tR\x06source\x12!\n" + - "\ftable_prefix\x18\x03 \x01(\tR\vtablePrefix\x12$\n" + - "\x0emax_idle_conns\x18\x04 \x01(\x05R\fmaxIdleConns\x12$\n" + - "\x0emax_open_conns\x18\x05 \x01(\x05R\fmaxOpenConns\x12!\n" + - "\fmax_lifetime\x18\x06 \x01(\x05R\vmaxLifetime\x12\x19\n" + - "\blog_mode\x18\a \x01(\bR\alogMode\x1a\x8d\x01\n" + - "\x05Redis\x12\x12\n" + - "\x04addr\x18\x01 \x01(\tR\x04addr\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x0e\n" + - "\x02db\x18\x03 \x01(\x05R\x02db\x12\x1f\n" + - "\vuse_cluster\x18\x04 \x01(\bR\n" + - "useCluster\x12#\n" + - "\rcluster_addrs\x18\x05 \x03(\tR\fclusterAddrs\"\x82\x01\n" + + "\atimeout\x18\x03 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"\x82\x01\n" + "\x03JWT\x12\x1f\n" + "\vsigning_key\x18\x01 \x01(\tR\n" + "signingKey\x12!\n" + "\fexpires_time\x18\x02 \x01(\tR\vexpiresTime\x12\x1f\n" + "\vbuffer_time\x18\x03 \x01(\tR\n" + "bufferTime\x12\x16\n" + - "\x06issuer\x18\x04 \x01(\tR\x06issuer\"'\n" + - "\x06Casbin\x12\x1d\n" + - "\n" + - "model_path\x18\x01 \x01(\tR\tmodelPath\"\xb5\x01\n" + + "\x06issuer\x18\x04 \x01(\tR\x06issuer\"\xa7\x02\n" + + "\x06System\x12\x10\n" + + "\x03env\x18\x01 \x01(\tR\x03env\x12\x17\n" + + "\adb_type\x18\x02 \x01(\tR\x06dbType\x12\x19\n" + + "\boss_type\x18\x03 \x01(\tR\aossType\x12\x1b\n" + + "\tuse_redis\x18\x04 \x01(\bR\buseRedis\x12%\n" + + "\x0euse_multipoint\x18\x05 \x01(\bR\ruseMultipoint\x12#\n" + + "\riplimit_count\x18\x06 \x01(\x05R\fiplimitCount\x12!\n" + + "\fiplimit_time\x18\a \x01(\x05R\viplimitTime\x12#\n" + + "\rrouter_prefix\x18\b \x01(\tR\frouterPrefix\x12&\n" + + "\x0fuse_strict_auth\x18\t \x01(\bR\ruseStrictAuth\"\xb5\x01\n" + "\aCaptcha\x12\x19\n" + "\bkey_long\x18\x01 \x01(\x05R\akeyLong\x12\x1b\n" + "\timg_width\x18\x02 \x01(\x05R\bimgWidth\x12\x1d\n" + "\n" + "img_height\x18\x03 \x01(\x05R\timgHeight\x12!\n" + "\fopen_captcha\x18\x04 \x01(\x05R\vopenCaptcha\x120\n" + - "\x14open_captcha_timeout\x18\x05 \x01(\x05R\x12openCaptchaTimeout\"\x91\x0f\n" + - "\x06Upload\x12\x12\n" + - "\x04type\x18\x01 \x01(\tR\x04type\x12\x12\n" + - "\x04path\x18\x02 \x01(\tR\x04path\x12\x19\n" + - "\bmax_size\x18\x03 \x01(\x03R\amaxSize\x12.\n" + - "\x05local\x18\x04 \x01(\v2\x18.kratos.api.Upload.LocalR\x05local\x121\n" + - "\x06aliyun\x18\x05 \x01(\v2\x19.kratos.api.Upload.AliyunR\x06aliyun\x124\n" + - "\atencent\x18\x06 \x01(\v2\x1a.kratos.api.Upload.TencentR\atencent\x12.\n" + - "\x05qiniu\x18\a \x01(\v2\x18.kratos.api.Upload.QiniuR\x05qiniu\x12.\n" + - "\x05minio\x18\b \x01(\v2\x18.kratos.api.Upload.MinioR\x05minio\x12/\n" + - "\x06aws_s3\x18\t \x01(\v2\x18.kratos.api.Upload.AwsS3R\x05awsS3\x12;\n" + + "\x14open_captcha_timeout\x18\x05 \x01(\x05R\x12openCaptchaTimeout\"\x98\x02\n" + + "\x05Mysql\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n" + + "\x04port\x18\x02 \x01(\tR\x04port\x12\x16\n" + + "\x06config\x18\x03 \x01(\tR\x06config\x12\x17\n" + + "\adb_name\x18\x04 \x01(\tR\x06dbName\x12\x1a\n" + + "\busername\x18\x05 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x06 \x01(\tR\bpassword\x12$\n" + + "\x0emax_idle_conns\x18\a \x01(\x05R\fmaxIdleConns\x12$\n" + + "\x0emax_open_conns\x18\b \x01(\x05R\fmaxOpenConns\x12\x19\n" + + "\blog_mode\x18\t \x01(\tR\alogMode\x12\x17\n" + + "\alog_zap\x18\n" + + " \x01(\bR\x06logZap\"\x98\x02\n" + + "\x05Pgsql\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x12\n" + + "\x04port\x18\x02 \x01(\tR\x04port\x12\x16\n" + + "\x06config\x18\x03 \x01(\tR\x06config\x12\x17\n" + + "\adb_name\x18\x04 \x01(\tR\x06dbName\x12\x1a\n" + + "\busername\x18\x05 \x01(\tR\busername\x12\x1a\n" + + "\bpassword\x18\x06 \x01(\tR\bpassword\x12$\n" + + "\x0emax_idle_conns\x18\a \x01(\x05R\fmaxIdleConns\x12$\n" + + "\x0emax_open_conns\x18\b \x01(\x05R\fmaxOpenConns\x12\x19\n" + + "\blog_mode\x18\t \x01(\tR\alogMode\x12\x17\n" + + "\alog_zap\x18\n" + + " \x01(\bR\x06logZap\"\xb5\x01\n" + + "\x06Sqlite\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x17\n" + + "\adb_name\x18\x02 \x01(\tR\x06dbName\x12$\n" + + "\x0emax_idle_conns\x18\x03 \x01(\x05R\fmaxIdleConns\x12$\n" + + "\x0emax_open_conns\x18\x04 \x01(\x05R\fmaxOpenConns\x12\x19\n" + + "\blog_mode\x18\x05 \x01(\tR\alogMode\x12\x17\n" + + "\alog_zap\x18\x06 \x01(\bR\x06logZap\"\x8d\x01\n" + + "\x05Redis\x12\x1f\n" + + "\vuse_cluster\x18\x01 \x01(\bR\n" + + "useCluster\x12\x12\n" + + "\x04addr\x18\x02 \x01(\tR\x04addr\x12\x1a\n" + + "\bpassword\x18\x03 \x01(\tR\bpassword\x12\x0e\n" + + "\x02db\x18\x04 \x01(\x05R\x02db\x12#\n" + + "\rcluster_addrs\x18\x05 \x03(\tR\fclusterAddrs\":\n" + + "\x05Local\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x1d\n" + "\n" + - "huawei_obs\x18\n" + - " \x01(\v2\x1c.kratos.api.Upload.HuaweiObsR\thuaweiObs\x12D\n" + - "\rcloudflare_r2\x18\v \x01(\v2\x1f.kratos.api.Upload.CloudflareR2R\fcloudflareR2\x1a&\n" + - "\x05Local\x12\x1d\n" + + "store_path\x18\x02 \x01(\tR\tstorePath\"\xd1\x01\n" + + "\x05Qiniu\x12\x12\n" + + "\x04zone\x18\x01 \x01(\tR\x04zone\x12\x16\n" + + "\x06bucket\x18\x02 \x01(\tR\x06bucket\x12\x19\n" + + "\bimg_path\x18\x03 \x01(\tR\aimgPath\x12\x1b\n" + + "\tuse_https\x18\x04 \x01(\bR\buseHttps\x12\x1d\n" + "\n" + - "store_path\x18\x01 \x01(\tR\tstorePath\x1a\xd1\x01\n" + - "\x06Aliyun\x12\x1a\n" + + "access_key\x18\x05 \x01(\tR\taccessKey\x12\x1d\n" + + "\n" + + "secret_key\x18\x06 \x01(\tR\tsecretKey\x12&\n" + + "\x0fuse_cdn_domains\x18\a \x01(\bR\ruseCdnDomains\"\xe9\x01\n" + + "\x05Minio\x12\x1a\n" + + "\bendpoint\x18\x01 \x01(\tR\bendpoint\x12\"\n" + + "\raccess_key_id\x18\x02 \x01(\tR\vaccessKeyId\x12*\n" + + "\x11access_key_secret\x18\x03 \x01(\tR\x0faccessKeySecret\x12\x1f\n" + + "\vbucket_name\x18\x04 \x01(\tR\n" + + "bucketName\x12\x17\n" + + "\ause_ssl\x18\x05 \x01(\bR\x06useSsl\x12\x1b\n" + + "\tbase_path\x18\x06 \x01(\tR\bbasePath\x12\x1d\n" + + "\n" + + "bucket_url\x18\a \x01(\tR\tbucketUrl\"\xd4\x01\n" + + "\tAliyunOss\x12\x1a\n" + "\bendpoint\x18\x01 \x01(\tR\bendpoint\x12\"\n" + "\raccess_key_id\x18\x02 \x01(\tR\vaccessKeyId\x12*\n" + "\x11access_key_secret\x18\x03 \x01(\tR\x0faccessKeySecret\x12\x1f\n" + @@ -1551,8 +2215,9 @@ const file_conf_proto_rawDesc = "" + "bucketName\x12\x1d\n" + "\n" + "bucket_url\x18\x05 \x01(\tR\tbucketUrl\x12\x1b\n" + - "\tbase_path\x18\x06 \x01(\tR\bbasePath\x1a\xb1\x01\n" + - "\aTencent\x12\x16\n" + + "\tbase_path\x18\x06 \x01(\tR\bbasePath\"\xb4\x01\n" + + "\n" + + "TencentCos\x12\x16\n" + "\x06bucket\x18\x01 \x01(\tR\x06bucket\x12\x16\n" + "\x06region\x18\x02 \x01(\tR\x06region\x12\x1b\n" + "\tsecret_id\x18\x03 \x01(\tR\bsecretId\x12\x1d\n" + @@ -1560,45 +2225,20 @@ const file_conf_proto_rawDesc = "" + "secret_key\x18\x04 \x01(\tR\tsecretKey\x12\x19\n" + "\bbase_url\x18\x05 \x01(\tR\abaseUrl\x12\x1f\n" + "\vpath_prefix\x18\x06 \x01(\tR\n" + - "pathPrefix\x1a\xd1\x01\n" + - "\x05Qiniu\x12\x12\n" + - "\x04zone\x18\x01 \x01(\tR\x04zone\x12\x16\n" + - "\x06bucket\x18\x02 \x01(\tR\x06bucket\x12\x19\n" + - "\bimg_path\x18\x03 \x01(\tR\aimgPath\x12\x1d\n" + - "\n" + - "access_key\x18\x04 \x01(\tR\taccessKey\x12\x1d\n" + - "\n" + - "secret_key\x18\x05 \x01(\tR\tsecretKey\x12\x1b\n" + - "\tuse_https\x18\x06 \x01(\bR\buseHttps\x12&\n" + - "\x0fuse_cdn_domains\x18\a \x01(\bR\ruseCdnDomains\x1a\x99\x01\n" + - "\x05Minio\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + - "\x06secret\x18\x02 \x01(\tR\x06secret\x12\x16\n" + - "\x06bucket\x18\x03 \x01(\tR\x06bucket\x12\x1a\n" + - "\bendpoint\x18\x04 \x01(\tR\bendpoint\x12\x1b\n" + - "\tbase_path\x18\x05 \x01(\tR\bbasePath\x12\x17\n" + - "\ause_ssl\x18\x06 \x01(\bR\x06useSsl\x1a\x9b\x02\n" + + "pathPrefix\"\x9b\x02\n" + "\x05AwsS3\x12\x16\n" + "\x06bucket\x18\x01 \x01(\tR\x06bucket\x12\x16\n" + "\x06region\x18\x02 \x01(\tR\x06region\x12\x1a\n" + - "\bendpoint\x18\x03 \x01(\tR\bendpoint\x12\x1b\n" + - "\tsecret_id\x18\x04 \x01(\tR\bsecretId\x12\x1d\n" + + "\bendpoint\x18\x03 \x01(\tR\bendpoint\x12-\n" + + "\x13s3_force_path_style\x18\x04 \x01(\bR\x10s3ForcePathStyle\x12\x1f\n" + + "\vdisable_ssl\x18\x05 \x01(\bR\n" + + "disableSsl\x12\x1b\n" + + "\tsecret_id\x18\x06 \x01(\tR\bsecretId\x12\x1d\n" + "\n" + - "secret_key\x18\x05 \x01(\tR\tsecretKey\x12\x19\n" + - "\bbase_url\x18\x06 \x01(\tR\abaseUrl\x12\x1f\n" + - "\vpath_prefix\x18\a \x01(\tR\n" + - "pathPrefix\x12-\n" + - "\x13s3_force_path_style\x18\b \x01(\bR\x10s3ForcePathStyle\x12\x1f\n" + - "\vdisable_ssl\x18\t \x01(\bR\n" + - "disableSsl\x1a\x91\x01\n" + - "\tHuaweiObs\x12\x12\n" + - "\x04path\x18\x01 \x01(\tR\x04path\x12\x16\n" + - "\x06bucket\x18\x02 \x01(\tR\x06bucket\x12\x1a\n" + - "\bendpoint\x18\x03 \x01(\tR\bendpoint\x12\x1d\n" + - "\n" + - "access_key\x18\x04 \x01(\tR\taccessKey\x12\x1d\n" + - "\n" + - "secret_key\x18\x05 \x01(\tR\tsecretKey\x1a\xc4\x01\n" + + "secret_key\x18\a \x01(\tR\tsecretKey\x12\x19\n" + + "\bbase_url\x18\b \x01(\tR\abaseUrl\x12\x1f\n" + + "\vpath_prefix\x18\t \x01(\tR\n" + + "pathPrefix\"\xc4\x01\n" + "\fCloudflareR2\x12\x16\n" + "\x06bucket\x18\x01 \x01(\tR\x06bucket\x12\x19\n" + "\bbase_url\x18\x02 \x01(\tR\abaseUrl\x12\x12\n" + @@ -1606,7 +2246,44 @@ const file_conf_proto_rawDesc = "" + "\n" + "account_id\x18\x04 \x01(\tR\taccountId\x12\"\n" + "\raccess_key_id\x18\x05 \x01(\tR\vaccessKeyId\x12*\n" + - "\x11secret_access_key\x18\x06 \x01(\tR\x0fsecretAccessKeyB\x18Z\x16kra/internal/conf;confb\x06proto3" + "\x11secret_access_key\x18\x06 \x01(\tR\x0fsecretAccessKey\"\x91\x01\n" + + "\tHuaweiObs\x12\x12\n" + + "\x04path\x18\x01 \x01(\tR\x04path\x12\x16\n" + + "\x06bucket\x18\x02 \x01(\tR\x06bucket\x12\x1a\n" + + "\bendpoint\x18\x03 \x01(\tR\bendpoint\x12\x1d\n" + + "\n" + + "access_key\x18\x04 \x01(\tR\taccessKey\x12\x1d\n" + + "\n" + + "secret_key\x18\x05 \x01(\tR\tsecretKey\"\x9e\x01\n" + + "\x05Email\x12\x0e\n" + + "\x02to\x18\x01 \x01(\tR\x02to\x12\x12\n" + + "\x04port\x18\x02 \x01(\x05R\x04port\x12\x12\n" + + "\x04from\x18\x03 \x01(\tR\x04from\x12\x12\n" + + "\x04host\x18\x04 \x01(\tR\x04host\x12\x15\n" + + "\x06is_ssl\x18\x05 \x01(\bR\x05isSsl\x12\x16\n" + + "\x06secret\x18\x06 \x01(\tR\x06secret\x12\x1a\n" + + "\bnickname\x18\a \x01(\tR\bnickname\"\x19\n" + + "\x05Excel\x12\x10\n" + + "\x03dir\x18\x01 \x01(\tR\x03dir\"S\n" + + "\x04Cors\x12\x12\n" + + "\x04mode\x18\x01 \x01(\tR\x04mode\x127\n" + + "\twhitelist\x18\x02 \x03(\v2\x19.kratos.api.CorsWhitelistR\twhitelist\"\xd0\x01\n" + + "\rCorsWhitelist\x12!\n" + + "\fallow_origin\x18\x01 \x01(\tR\vallowOrigin\x12#\n" + + "\rallow_headers\x18\x02 \x01(\tR\fallowHeaders\x12#\n" + + "\rallow_methods\x18\x03 \x01(\tR\fallowMethods\x12%\n" + + "\x0eexpose_headers\x18\x04 \x01(\tR\rexposeHeaders\x12+\n" + + "\x11allow_credentials\x18\x05 \x01(\bR\x10allowCredentials\"\x99\x02\n" + + "\x03Zap\x12\x14\n" + + "\x05level\x18\x01 \x01(\tR\x05level\x12\x16\n" + + "\x06format\x18\x02 \x01(\tR\x06format\x12\x16\n" + + "\x06prefix\x18\x03 \x01(\tR\x06prefix\x12\x1a\n" + + "\bdirector\x18\x04 \x01(\tR\bdirector\x12\x1b\n" + + "\tshow_line\x18\x05 \x01(\bR\bshowLine\x12!\n" + + "\fencode_level\x18\x06 \x01(\tR\vencodeLevel\x12%\n" + + "\x0estacktrace_key\x18\a \x01(\tR\rstacktraceKey\x12$\n" + + "\x0elog_in_console\x18\b \x01(\bR\flogInConsole\x12#\n" + + "\rretention_day\x18\t \x01(\x05R\fretentionDayB\x18Z\x16kra/internal/conf;confb\x06proto3" var ( file_conf_proto_rawDescOnce sync.Once @@ -1620,55 +2297,65 @@ func file_conf_proto_rawDescGZIP() []byte { return file_conf_proto_rawDescData } -var file_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_conf_proto_msgTypes = make([]protoimpl.MessageInfo, 24) var file_conf_proto_goTypes = []any{ (*Bootstrap)(nil), // 0: kratos.api.Bootstrap (*Server)(nil), // 1: kratos.api.Server - (*Data)(nil), // 2: kratos.api.Data - (*JWT)(nil), // 3: kratos.api.JWT - (*Casbin)(nil), // 4: kratos.api.Casbin - (*Captcha)(nil), // 5: kratos.api.Captcha - (*Upload)(nil), // 6: kratos.api.Upload - (*Server_HTTP)(nil), // 7: kratos.api.Server.HTTP - (*Server_GRPC)(nil), // 8: kratos.api.Server.GRPC - (*Data_Database)(nil), // 9: kratos.api.Data.Database - (*Data_Redis)(nil), // 10: kratos.api.Data.Redis - (*Upload_Local)(nil), // 11: kratos.api.Upload.Local - (*Upload_Aliyun)(nil), // 12: kratos.api.Upload.Aliyun - (*Upload_Tencent)(nil), // 13: kratos.api.Upload.Tencent - (*Upload_Qiniu)(nil), // 14: kratos.api.Upload.Qiniu - (*Upload_Minio)(nil), // 15: kratos.api.Upload.Minio - (*Upload_AwsS3)(nil), // 16: kratos.api.Upload.AwsS3 - (*Upload_HuaweiObs)(nil), // 17: kratos.api.Upload.HuaweiObs - (*Upload_CloudflareR2)(nil), // 18: kratos.api.Upload.CloudflareR2 - (*durationpb.Duration)(nil), // 19: google.protobuf.Duration + (*JWT)(nil), // 2: kratos.api.JWT + (*System)(nil), // 3: kratos.api.System + (*Captcha)(nil), // 4: kratos.api.Captcha + (*Mysql)(nil), // 5: kratos.api.Mysql + (*Pgsql)(nil), // 6: kratos.api.Pgsql + (*Sqlite)(nil), // 7: kratos.api.Sqlite + (*Redis)(nil), // 8: kratos.api.Redis + (*Local)(nil), // 9: kratos.api.Local + (*Qiniu)(nil), // 10: kratos.api.Qiniu + (*Minio)(nil), // 11: kratos.api.Minio + (*AliyunOss)(nil), // 12: kratos.api.AliyunOss + (*TencentCos)(nil), // 13: kratos.api.TencentCos + (*AwsS3)(nil), // 14: kratos.api.AwsS3 + (*CloudflareR2)(nil), // 15: kratos.api.CloudflareR2 + (*HuaweiObs)(nil), // 16: kratos.api.HuaweiObs + (*Email)(nil), // 17: kratos.api.Email + (*Excel)(nil), // 18: kratos.api.Excel + (*Cors)(nil), // 19: kratos.api.Cors + (*CorsWhitelist)(nil), // 20: kratos.api.CorsWhitelist + (*Zap)(nil), // 21: kratos.api.Zap + (*Server_HTTP)(nil), // 22: kratos.api.Server.HTTP + (*Server_GRPC)(nil), // 23: kratos.api.Server.GRPC + (*durationpb.Duration)(nil), // 24: google.protobuf.Duration } var file_conf_proto_depIdxs = []int32{ 1, // 0: kratos.api.Bootstrap.server:type_name -> kratos.api.Server - 2, // 1: kratos.api.Bootstrap.data:type_name -> kratos.api.Data - 3, // 2: kratos.api.Bootstrap.jwt:type_name -> kratos.api.JWT - 4, // 3: kratos.api.Bootstrap.casbin:type_name -> kratos.api.Casbin - 5, // 4: kratos.api.Bootstrap.captcha:type_name -> kratos.api.Captcha - 6, // 5: kratos.api.Bootstrap.upload:type_name -> kratos.api.Upload - 7, // 6: kratos.api.Server.http:type_name -> kratos.api.Server.HTTP - 8, // 7: kratos.api.Server.grpc:type_name -> kratos.api.Server.GRPC - 9, // 8: kratos.api.Data.database:type_name -> kratos.api.Data.Database - 10, // 9: kratos.api.Data.redis:type_name -> kratos.api.Data.Redis - 11, // 10: kratos.api.Upload.local:type_name -> kratos.api.Upload.Local - 12, // 11: kratos.api.Upload.aliyun:type_name -> kratos.api.Upload.Aliyun - 13, // 12: kratos.api.Upload.tencent:type_name -> kratos.api.Upload.Tencent - 14, // 13: kratos.api.Upload.qiniu:type_name -> kratos.api.Upload.Qiniu - 15, // 14: kratos.api.Upload.minio:type_name -> kratos.api.Upload.Minio - 16, // 15: kratos.api.Upload.aws_s3:type_name -> kratos.api.Upload.AwsS3 - 17, // 16: kratos.api.Upload.huawei_obs:type_name -> kratos.api.Upload.HuaweiObs - 18, // 17: kratos.api.Upload.cloudflare_r2:type_name -> kratos.api.Upload.CloudflareR2 - 19, // 18: kratos.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration - 19, // 19: kratos.api.Server.GRPC.timeout:type_name -> google.protobuf.Duration - 20, // [20:20] is the sub-list for method output_type - 20, // [20:20] is the sub-list for method input_type - 20, // [20:20] is the sub-list for extension type_name - 20, // [20:20] is the sub-list for extension extendee - 0, // [0:20] is the sub-list for field type_name + 2, // 1: kratos.api.Bootstrap.jwt:type_name -> kratos.api.JWT + 3, // 2: kratos.api.Bootstrap.system:type_name -> kratos.api.System + 4, // 3: kratos.api.Bootstrap.captcha:type_name -> kratos.api.Captcha + 5, // 4: kratos.api.Bootstrap.mysql:type_name -> kratos.api.Mysql + 6, // 5: kratos.api.Bootstrap.pgsql:type_name -> kratos.api.Pgsql + 7, // 6: kratos.api.Bootstrap.sqlite:type_name -> kratos.api.Sqlite + 8, // 7: kratos.api.Bootstrap.redis:type_name -> kratos.api.Redis + 9, // 8: kratos.api.Bootstrap.local:type_name -> kratos.api.Local + 10, // 9: kratos.api.Bootstrap.qiniu:type_name -> kratos.api.Qiniu + 11, // 10: kratos.api.Bootstrap.minio:type_name -> kratos.api.Minio + 12, // 11: kratos.api.Bootstrap.aliyun_oss:type_name -> kratos.api.AliyunOss + 13, // 12: kratos.api.Bootstrap.tencent_cos:type_name -> kratos.api.TencentCos + 14, // 13: kratos.api.Bootstrap.aws_s3:type_name -> kratos.api.AwsS3 + 15, // 14: kratos.api.Bootstrap.cloudflare_r2:type_name -> kratos.api.CloudflareR2 + 16, // 15: kratos.api.Bootstrap.huawei_obs:type_name -> kratos.api.HuaweiObs + 17, // 16: kratos.api.Bootstrap.email:type_name -> kratos.api.Email + 18, // 17: kratos.api.Bootstrap.excel:type_name -> kratos.api.Excel + 19, // 18: kratos.api.Bootstrap.cors:type_name -> kratos.api.Cors + 21, // 19: kratos.api.Bootstrap.zap:type_name -> kratos.api.Zap + 22, // 20: kratos.api.Server.http:type_name -> kratos.api.Server.HTTP + 23, // 21: kratos.api.Server.grpc:type_name -> kratos.api.Server.GRPC + 20, // 22: kratos.api.Cors.whitelist:type_name -> kratos.api.CorsWhitelist + 24, // 23: kratos.api.Server.HTTP.timeout:type_name -> google.protobuf.Duration + 24, // 24: kratos.api.Server.GRPC.timeout:type_name -> google.protobuf.Duration + 25, // [25:25] is the sub-list for method output_type + 25, // [25:25] is the sub-list for method input_type + 25, // [25:25] is the sub-list for extension type_name + 25, // [25:25] is the sub-list for extension extendee + 0, // [0:25] is the sub-list for field type_name } func init() { file_conf_proto_init() } @@ -1682,7 +2369,7 @@ func file_conf_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_conf_proto_rawDesc), len(file_conf_proto_rawDesc)), NumEnums: 0, - NumMessages: 19, + NumMessages: 24, NumExtensions: 0, NumServices: 0, }, diff --git a/internal/conf/conf.proto b/internal/conf/conf.proto index 5b7e485..45d22d4 100644 --- a/internal/conf/conf.proto +++ b/internal/conf/conf.proto @@ -7,11 +7,25 @@ import "google/protobuf/duration.proto"; message Bootstrap { Server server = 1; - Data data = 2; - JWT jwt = 3; - Casbin casbin = 4; - Captcha captcha = 5; - Upload upload = 6; + JWT jwt = 2; + System system = 3; + Captcha captcha = 4; + Mysql mysql = 5; + Pgsql pgsql = 6; + Sqlite sqlite = 7; + Redis redis = 8; + Local local = 9; + Qiniu qiniu = 10; + Minio minio = 11; + AliyunOss aliyun_oss = 12; + TencentCos tencent_cos = 13; + AwsS3 aws_s3 = 14; + CloudflareR2 cloudflare_r2 = 15; + HuaweiObs huawei_obs = 16; + Email email = 17; + Excel excel = 18; + Cors cors = 19; + Zap zap = 20; } message Server { @@ -29,27 +43,6 @@ message Server { GRPC grpc = 2; } -message Data { - message Database { - string driver = 1; - string source = 2; - string table_prefix = 3; - int32 max_idle_conns = 4; - int32 max_open_conns = 5; - int32 max_lifetime = 6; - bool log_mode = 7; - } - message Redis { - string addr = 1; - string password = 2; - int32 db = 3; - bool use_cluster = 4; - repeated string cluster_addrs = 5; - } - Database database = 1; - Redis redis = 2; -} - message JWT { string signing_key = 1; string expires_time = 2; @@ -57,8 +50,16 @@ message JWT { string issuer = 4; } -message Casbin { - string model_path = 1; +message System { + string env = 1; + string db_type = 2; + string oss_type = 3; + bool use_redis = 4; + bool use_multipoint = 5; + int32 iplimit_count = 6; + int32 iplimit_time = 7; + string router_prefix = 8; + bool use_strict_auth = 9; } message Captcha { @@ -69,80 +70,157 @@ message Captcha { int32 open_captcha_timeout = 5; } -message Upload { - string type = 1; - string path = 2; - int64 max_size = 3; - - message Local { - string store_path = 1; - } - message Aliyun { - string endpoint = 1; - string access_key_id = 2; - string access_key_secret = 3; - string bucket_name = 4; - string bucket_url = 5; - string base_path = 6; - } - message Tencent { - string bucket = 1; - string region = 2; - string secret_id = 3; - string secret_key = 4; - string base_url = 5; - string path_prefix = 6; - } - message Qiniu { - string zone = 1; - string bucket = 2; - string img_path = 3; - string access_key = 4; - string secret_key = 5; - bool use_https = 6; - bool use_cdn_domains = 7; - } - message Minio { - string id = 1; - string secret = 2; - string bucket = 3; - string endpoint = 4; - string base_path = 5; - bool use_ssl = 6; - } - message AwsS3 { - string bucket = 1; - string region = 2; - string endpoint = 3; - string secret_id = 4; - string secret_key = 5; - string base_url = 6; - string path_prefix = 7; - bool s3_force_path_style = 8; - bool disable_ssl = 9; - } - message HuaweiObs { - string path = 1; - string bucket = 2; - string endpoint = 3; - string access_key = 4; - string secret_key = 5; - } - message CloudflareR2 { - string bucket = 1; - string base_url = 2; - string path = 3; - string account_id = 4; - string access_key_id = 5; - string secret_access_key = 6; - } - - Local local = 4; - Aliyun aliyun = 5; - Tencent tencent = 6; - Qiniu qiniu = 7; - Minio minio = 8; - AwsS3 aws_s3 = 9; - HuaweiObs huawei_obs = 10; - CloudflareR2 cloudflare_r2 = 11; + +message Mysql { + string path = 1; + string port = 2; + string config = 3; + string db_name = 4; + string username = 5; + string password = 6; + int32 max_idle_conns = 7; + int32 max_open_conns = 8; + string log_mode = 9; + bool log_zap = 10; +} + +message Pgsql { + string path = 1; + string port = 2; + string config = 3; + string db_name = 4; + string username = 5; + string password = 6; + int32 max_idle_conns = 7; + int32 max_open_conns = 8; + string log_mode = 9; + bool log_zap = 10; +} + +message Sqlite { + string path = 1; + string db_name = 2; + int32 max_idle_conns = 3; + int32 max_open_conns = 4; + string log_mode = 5; + bool log_zap = 6; +} + +message Redis { + bool use_cluster = 1; + string addr = 2; + string password = 3; + int32 db = 4; + repeated string cluster_addrs = 5; +} + +message Local { + string path = 1; + string store_path = 2; +} + +message Qiniu { + string zone = 1; + string bucket = 2; + string img_path = 3; + bool use_https = 4; + string access_key = 5; + string secret_key = 6; + bool use_cdn_domains = 7; +} + +message Minio { + string endpoint = 1; + string access_key_id = 2; + string access_key_secret = 3; + string bucket_name = 4; + bool use_ssl = 5; + string base_path = 6; + string bucket_url = 7; +} + +message AliyunOss { + string endpoint = 1; + string access_key_id = 2; + string access_key_secret = 3; + string bucket_name = 4; + string bucket_url = 5; + string base_path = 6; +} + +message TencentCos { + string bucket = 1; + string region = 2; + string secret_id = 3; + string secret_key = 4; + string base_url = 5; + string path_prefix = 6; +} + +message AwsS3 { + string bucket = 1; + string region = 2; + string endpoint = 3; + bool s3_force_path_style = 4; + bool disable_ssl = 5; + string secret_id = 6; + string secret_key = 7; + string base_url = 8; + string path_prefix = 9; +} + +message CloudflareR2 { + string bucket = 1; + string base_url = 2; + string path = 3; + string account_id = 4; + string access_key_id = 5; + string secret_access_key = 6; +} + +message HuaweiObs { + string path = 1; + string bucket = 2; + string endpoint = 3; + string access_key = 4; + string secret_key = 5; +} + +message Email { + string to = 1; + int32 port = 2; + string from = 3; + string host = 4; + bool is_ssl = 5; + string secret = 6; + string nickname = 7; +} + +message Excel { + string dir = 1; +} + +message Cors { + string mode = 1; + repeated CorsWhitelist whitelist = 2; +} + +message CorsWhitelist { + string allow_origin = 1; + string allow_headers = 2; + string allow_methods = 3; + string expose_headers = 4; + bool allow_credentials = 5; +} + +message Zap { + string level = 1; + string format = 2; + string prefix = 3; + string director = 4; + bool show_line = 5; + string encode_level = 6; + string stacktrace_key = 7; + bool log_in_console = 8; + int32 retention_day = 9; } diff --git a/internal/data/data.go b/internal/data/data.go index 41d06e6..c898756 100644 --- a/internal/data/data.go +++ b/internal/data/data.go @@ -1,6 +1,7 @@ package data import ( + "fmt" "kra/internal/conf" "kra/internal/data/query" @@ -20,8 +21,10 @@ type Data struct { } // NewDB 创建数据库连接 -func NewDB(c *conf.Data) (*gorm.DB, error) { - db, err := gorm.Open(mysql.Open(c.Database.Source), &gorm.Config{ +func NewDB(c *conf.Mysql) (*gorm.DB, error) { + dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?%s", + c.Username, c.Password, c.Path, c.Port, c.DbName, c.Config) + db, err := gorm.Open(mysql.Open(dsn), &gorm.Config{ Logger: logger.Default.LogMode(logger.Info), }) if err != nil { diff --git a/web/config/routes.ts b/web/config/routes.ts index c8fbf91..dc37f75 100644 --- a/web/config/routes.ts +++ b/web/config/routes.ts @@ -1,47 +1,83 @@ /** * @name umi 的路由配置 - * @description 只支持 path,component,routes,redirect,wrappers,name,icon 的配置 - * @param path path 只支持两种占位符配置,第一种是动态参数 :id 的形式,第二种是 * 通配符,通配符只能出现路由字符串的最后。 - * @param component 配置 location 和 path 匹配后用于渲染的 React 组件路径。可以是绝对路径,也可以是相对路径,如果是相对路径,会从 src/pages 开始找起。 - * @param routes 配置子路由,通常在需要为多个路径增加 layout 组件时使用。 - * @param redirect 配置路由跳转 - * @param wrappers 配置路由组件的包装组件,通过包装组件可以为当前的路由组件组合进更多的功能。 比如,可以用于路由级别的权限校验 - * @param name 配置路由的标题,默认读取国际化文件 menu.ts 中 menu.xxxx 的值,如配置 name 为 login,则读取 menu.ts 中 menu.login 的取值作为标题 - * @param icon 配置路由的图标,取值参考 https://ant.design/components/icon-cn, 注意去除风格后缀和大小写,如想要配置图标为 则取值应为 stepBackward 或 StepBackward,如想要配置图标为 则取值应为 user 或者 User - * @doc https://umijs.org/docs/guides/routes + * @description 与 GVA 保持一致的路由结构 */ export default [ { - path: "/user", + path: '/user', layout: false, routes: [ { - name: "login", - path: "/user/login", - component: "./user/login", + name: 'login', + path: '/user/login', + component: './user/login', }, ], }, { - path: "/welcome", - name: "welcome", - icon: "smile", - component: "./Welcome", + path: '/dashboard', + name: 'dashboard', + icon: 'dashboard', + component: './dashboard', }, { - name: "admin", - icon: "crown", - path: "/admins", - access: "canAdmin", - component: "./admins", + path: '/system', + name: 'system', + icon: 'setting', + access: 'canAdmin', + routes: [ + { + path: '/system/user', + name: 'user', + icon: 'user', + component: './system/user', + }, + { + path: '/system/authority', + name: 'authority', + icon: 'team', + component: './system/authority', + }, + { + path: '/system/menu', + name: 'menu', + icon: 'menu', + component: './system/menu', + }, + { + path: '/system/api', + name: 'api', + icon: 'api', + component: './system/api', + }, + { + path: '/system/dictionary', + name: 'dictionary', + icon: 'book', + component: './system/dictionary', + }, + { + path: '/system/operation', + name: 'operation', + icon: 'fileSearch', + component: './system/operation', + }, + ], }, { - path: "/", - redirect: "/welcome", + path: '/person', + name: 'person', + icon: 'idcard', + component: './person', + hideInMenu: true, }, { - component: "404", + path: '/', + redirect: '/dashboard', + }, + { + path: '*', layout: false, - path: "./*", + component: './404', }, ]; diff --git a/web/src/pages/404.tsx b/web/src/pages/404.tsx index 9734cc5..0ebb05c 100644 --- a/web/src/pages/404.tsx +++ b/web/src/pages/404.tsx @@ -1,20 +1,22 @@ -import { history, useIntl } from '@umijs/max'; -import { Button, Card, Result } from 'antd'; -import React from 'react'; +/** + * 404 页面 + */ +import { Button, Result } from 'antd'; +import { history } from '@umijs/max'; -const NoFoundPage: React.FC = () => ( - +const NotFoundPage: React.FC = () => { + return ( history.push('/')}> - {useIntl().formatMessage({ id: 'pages.404.buttonText' })} + 返回首页 } /> - -); + ); +}; -export default NoFoundPage; +export default NotFoundPage; diff --git a/web/src/pages/dashboard/index.tsx b/web/src/pages/dashboard/index.tsx new file mode 100644 index 0000000..87a2c44 --- /dev/null +++ b/web/src/pages/dashboard/index.tsx @@ -0,0 +1,41 @@ +/** + * 仪表盘页面 + */ +import { PageContainer } from '@ant-design/pro-components'; +import { Card, Col, Row, Statistic } from 'antd'; +import { UserOutlined, TeamOutlined, ApiOutlined, MenuOutlined } from '@ant-design/icons'; + +const Dashboard: React.FC = () => { + return ( + + + + + } /> + + + + + } /> + + + + + } /> + + + + + } /> + + + + +

这是一个基于 Kratos 框架的后台管理系统,前端使用 React + Ant Design Pro。

+

功能与 GVA (gin-vue-admin) 保持一致。

+
+
+ ); +}; + +export default Dashboard; diff --git a/web/src/pages/person/index.tsx b/web/src/pages/person/index.tsx new file mode 100644 index 0000000..be60cfa --- /dev/null +++ b/web/src/pages/person/index.tsx @@ -0,0 +1,338 @@ +/** + * 个人中心页面 + * 与 GVA person.vue 保持一致的功能 + */ +import { + EditOutlined, + PhoneOutlined, + MailOutlined, + LockOutlined, + UserOutlined, + EnvironmentOutlined, + BankOutlined, +} from '@ant-design/icons'; +import { PageContainer } from '@ant-design/pro-components'; +import { + Card, + Avatar, + Button, + Form, + Input, + Modal, + message, + Row, + Col, + Typography, + Tag, + Timeline, + Statistic, + Tabs, + Space, +} from 'antd'; +import { useState, useEffect } from 'react'; +import { useModel } from '@umijs/max'; +import { setSelfInfo, changePassword } from '@/services/system/user'; + +const { Title, Text } = Typography; + +const PersonPage: React.FC = () => { + const { initialState, setInitialState } = useModel('@@initialState'); + const userInfo = initialState?.currentUser || {}; + + const [editNickName, setEditNickName] = useState(false); + const [nickName, setNickName] = useState(''); + const [passwordModalVisible, setPasswordModalVisible] = useState(false); + const [phoneModalVisible, setPhoneModalVisible] = useState(false); + const [emailModalVisible, setEmailModalVisible] = useState(false); + const [phoneCountdown, setPhoneCountdown] = useState(0); + const [emailCountdown, setEmailCountdown] = useState(0); + + const [passwordForm] = Form.useForm(); + const [phoneForm] = Form.useForm(); + const [emailForm] = Form.useForm(); + + // 修改昵称 + const handleEditNickName = () => { + setNickName(userInfo.nickName || ''); + setEditNickName(true); + }; + + const handleSaveNickName = async () => { + const res = await setSelfInfo({ nickName }); + if (res.code === 0) { + message.success('修改成功'); + setInitialState((s) => ({ + ...s, + currentUser: { ...s?.currentUser, nickName }, + })); + setEditNickName(false); + } + }; + + // 修改密码 + const handleChangePassword = async (values: any) => { + if (values.newPassword !== values.confirmPassword) { + message.error('两次密码不一致'); + return; + } + const res = await changePassword({ + password: values.password, + newPassword: values.newPassword, + }); + if (res.code === 0) { + message.success('修改密码成功'); + setPasswordModalVisible(false); + passwordForm.resetFields(); + } + }; + + // 获取手机验证码 + const getPhoneCode = () => { + setPhoneCountdown(60); + const timer = setInterval(() => { + setPhoneCountdown((prev) => { + if (prev <= 1) { + clearInterval(timer); + return 0; + } + return prev - 1; + }); + }, 1000); + }; + + // 修改手机号 + const handleChangePhone = async (values: any) => { + const res = await setSelfInfo({ phone: values.phone }); + if (res.code === 0) { + message.success('修改成功'); + setInitialState((s) => ({ + ...s, + currentUser: { ...s?.currentUser, phone: values.phone }, + })); + setPhoneModalVisible(false); + phoneForm.resetFields(); + } + }; + + // 获取邮箱验证码 + const getEmailCode = () => { + setEmailCountdown(60); + const timer = setInterval(() => { + setEmailCountdown((prev) => { + if (prev <= 1) { + clearInterval(timer); + return 0; + } + return prev - 1; + }); + }, 1000); + }; + + // 修改邮箱 + const handleChangeEmail = async (values: any) => { + const res = await setSelfInfo({ email: values.email }); + if (res.code === 0) { + message.success('修改成功'); + setInitialState((s) => ({ + ...s, + currentUser: { ...s?.currentUser, email: values.email }, + })); + setEmailModalVisible(false); + emailForm.resetFields(); + } + }; + + // 活动数据 + const activities = [ + { timestamp: '2024-01-10', title: '完成项目里程碑', content: '成功完成第三季度主要项目开发任务', color: 'blue' }, + { timestamp: '2024-01-11', title: '代码审核完成', content: '完成核心模块代码审核,提出多项改进建议', color: 'green' }, + { timestamp: '2024-01-12', title: '技术分享会', content: '主持团队技术分享会,分享前端性能优化经验', color: 'orange' }, + { timestamp: '2024-01-13', title: '新功能上线', content: '成功上线用户反馈的新特性', color: 'red' }, + ]; + + return ( + + {/* 顶部个人信息卡片 */} + +
+ + + } /> + + + + {!editNickName ? ( + <> + {userInfo.nickName} + + + + )} + + + 中国·北京市·朝阳区 + 北京翻转极光科技有限公司 + 技术部·前端事业群 + + + + + + + {/* 左侧信息栏 */} + + + + + 手机号码:{userInfo.phone || '未设置'} + + + + 邮箱地址:{userInfo.email || '未设置'} + + + + 账号密码:已设置 + + + + + + + + GoLang + JavaScript + Vue + Gorm + + + + + + {/* 右侧内容区 */} + + + + + + + + + ), + }, + { + key: 'activities', + label: '近期动态', + children: ( + ({ + color: item.color, + children: ( + <> + {item.title} +
+ {item.content} +
+ {item.timestamp} + + ), + }))} /> + ), + }, + ]} + /> + + + + + {/* 修改密码弹窗 */} + { setPasswordModalVisible(false); passwordForm.resetFields(); }} + onOk={() => passwordForm.submit()} + > +
+ + + + + + + ({ + validator(_, value) { + if (!value || getFieldValue('newPassword') === value) return Promise.resolve(); + return Promise.reject(new Error('两次密码不一致')); + }, + }), + ]}> + + +
+
+ + {/* 修改手机号弹窗 */} + { setPhoneModalVisible(false); phoneForm.resetFields(); }} + onOk={() => phoneForm.submit()} + > +
+ + } placeholder="请输入新的手机号码" /> + + + + + + + +
+
+ + {/* 修改邮箱弹窗 */} + { setEmailModalVisible(false); emailForm.resetFields(); }} + onOk={() => emailForm.submit()} + > +
+ + } placeholder="请输入新的邮箱地址" /> + + + + + + + +
+
+ + ); +}; + +export default PersonPage; diff --git a/web/src/pages/system/api/index.tsx b/web/src/pages/system/api/index.tsx new file mode 100644 index 0000000..321032f --- /dev/null +++ b/web/src/pages/system/api/index.tsx @@ -0,0 +1,147 @@ +/** + * API管理页面 + * 与 GVA 保持一致的功能 + */ +import { PlusOutlined, DeleteOutlined, EditOutlined, SyncOutlined } from '@ant-design/icons'; +import { PageContainer, ProTable, ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-components'; +import type { ProColumns, ActionType } from '@ant-design/pro-components'; +import { Button, message, Popconfirm, Space, Tag } from 'antd'; +import { useRef, useState, useEffect } from 'react'; +import { getApiList, createApi, updateApi, deleteApi, syncApi, getApiGroups, freshCasbin } from '@/services/system/api'; + +const methodColors: Record = { + GET: 'green', + POST: 'blue', + PUT: 'orange', + DELETE: 'red', + PATCH: 'purple', +}; + +const ApiPage: React.FC = () => { + const actionRef = useRef(); + const [modalVisible, setModalVisible] = useState(false); + const [currentRow, setCurrentRow] = useState(); + const [isEdit, setIsEdit] = useState(false); + const [apiGroups, setApiGroups] = useState([]); + + const fetchApiGroups = async () => { + const res = await getApiGroups(); + if (res.code === 0 && res.data?.groups) { + setApiGroups(res.data.groups); + } + }; + + useEffect(() => { + fetchApiGroups(); + }, []); + + const handleDelete = async (ids: number[]) => { + const res = await deleteApi({ ids }); + if (res.code === 0) { + message.success('删除成功'); + actionRef.current?.reload(); + } + }; + + const handleSync = async () => { + const res = await syncApi(); + if (res.code === 0) { + message.success('同步成功'); + actionRef.current?.reload(); + } + }; + + const handleFreshCasbin = async () => { + const res = await freshCasbin(); + if (res.code === 0) { + message.success('刷新成功'); + } + }; + + const columns: ProColumns[] = [ + { title: 'ID', dataIndex: 'ID', search: false }, + { title: 'API路径', dataIndex: 'path' }, + { title: 'API描述', dataIndex: 'description' }, + { title: 'API分组', dataIndex: 'apiGroup', valueType: 'select', valueEnum: Object.fromEntries(apiGroups.map((g) => [g, g])) }, + { + title: '请求方法', + dataIndex: 'method', + valueType: 'select', + valueEnum: { GET: 'GET', POST: 'POST', PUT: 'PUT', DELETE: 'DELETE', PATCH: 'PATCH' }, + render: (_, record) => {record.method}, + }, + { + title: '操作', + valueType: 'option', + render: (_, record) => ( + + + handleDelete([record.ID!])}> + + + + ), + }, + ]; + + return ( + + + headerTitle="API列表" + actionRef={actionRef} + rowKey="ID" + columns={columns} + toolBarRender={() => [ + , + , + , + ]} + request={async (params) => { + const res = await getApiList({ page: params.current, pageSize: params.pageSize, ...params }); + return { + data: res.data?.list || [], + total: res.data?.total || 0, + success: res.code === 0, + }; + }} + /> + + { + let res; + if (isEdit) { + res = await updateApi({ ...currentRow, ...values }); + } else { + res = await createApi(values); + } + if (res.code === 0) { + message.success(isEdit ? '编辑成功' : '创建成功'); + setModalVisible(false); + actionRef.current?.reload(); + return true; + } + return false; + }} + > + + + ({ label: g, value: g }))} rules={[{ required: true }]} /> + ({ label: m, value: m }))} rules={[{ required: true }]} /> + + + ); +}; + +export default ApiPage; diff --git a/web/src/pages/system/authority/index.tsx b/web/src/pages/system/authority/index.tsx new file mode 100644 index 0000000..e32fc83 --- /dev/null +++ b/web/src/pages/system/authority/index.tsx @@ -0,0 +1,252 @@ +/** + * 角色管理页面 + * 与 GVA 保持一致的功能 + */ +import { PlusOutlined, DeleteOutlined, EditOutlined, CopyOutlined } from '@ant-design/icons'; +import { PageContainer, ProTable, ModalForm, ProFormText, ProFormDigit } from '@ant-design/pro-components'; +import type { ProColumns, ActionType } from '@ant-design/pro-components'; +import { Button, message, Popconfirm, Space, Tree, Card, Row, Col } from 'antd'; +import { useRef, useState, useEffect } from 'react'; +import { + getAuthorityList, + createAuthority, + updateAuthority, + deleteAuthority, + copyAuthority, +} from '@/services/system/authority'; +import { getBaseMenuTree, addMenuAuthority, getMenuAuthority } from '@/services/system/menu'; +import { getAllApis } from '@/services/system/api'; +import { updateCasbin, getPolicyPathByAuthorityId } from '@/services/system/casbin'; + +const AuthorityPage: React.FC = () => { + const actionRef = useRef(); + const [modalVisible, setModalVisible] = useState(false); + const [currentRow, setCurrentRow] = useState(); + const [isEdit, setIsEdit] = useState(false); + const [menuTree, setMenuTree] = useState([]); + const [apiList, setApiList] = useState([]); + const [checkedMenuKeys, setCheckedMenuKeys] = useState([]); + const [checkedApiKeys, setCheckedApiKeys] = useState([]); + const [selectedAuthority, setSelectedAuthority] = useState(); + + // 获取菜单树 + const fetchMenuTree = async () => { + const res = await getBaseMenuTree(); + if (res.code === 0 && res.data?.menus) { + setMenuTree(buildTreeData(res.data.menus)); + } + }; + + // 获取API列表 + const fetchApis = async () => { + const res = await getAllApis({}); + if (res.code === 0 && res.data?.apis) { + setApiList(res.data.apis); + } + }; + + // 构建树形数据 + const buildTreeData = (data: API.Menu[]): any[] => { + return data.map((item) => ({ + key: item.ID, + title: item.meta?.title || item.name, + children: item.children ? buildTreeData(item.children) : undefined, + })); + }; + + useEffect(() => { + fetchMenuTree(); + fetchApis(); + }, []); + + // 选择角色时加载权限 + const handleSelectAuthority = async (record: API.Authority) => { + setSelectedAuthority(record); + // 获取菜单权限 + const menuRes = await getMenuAuthority({ authorityId: record.authorityId! }); + if (menuRes.code === 0 && menuRes.data?.menus) { + const menuIds = extractMenuIds(menuRes.data.menus); + setCheckedMenuKeys(menuIds); + } + // 获取API权限 + const apiRes = await getPolicyPathByAuthorityId({ authorityId: record.authorityId! }); + if (apiRes.code === 0 && apiRes.data?.paths) { + const apiKeys = apiRes.data.paths.map((p) => `${p.path}:${p.method}`); + setCheckedApiKeys(apiKeys); + } + }; + + // 提取菜单ID + const extractMenuIds = (menus: API.Menu[]): number[] => { + const ids: number[] = []; + const extract = (list: API.Menu[]) => { + list.forEach((m) => { + if (m.ID) ids.push(m.ID); + if (m.children) extract(m.children); + }); + }; + extract(menus); + return ids; + }; + + + // 保存菜单权限 + const handleSaveMenuAuth = async () => { + if (!selectedAuthority) return; + const menus = checkedMenuKeys.map((id) => ({ ID: id })); + const res = await addMenuAuthority({ + menus: menus as API.Menu[], + authorityId: selectedAuthority.authorityId!, + }); + if (res.code === 0) { + message.success('菜单权限保存成功'); + } + }; + + // 保存API权限 + const handleSaveApiAuth = async () => { + if (!selectedAuthority) return; + const casbinInfos = checkedApiKeys.map((key) => { + const [path, method] = key.split(':'); + return { path, method }; + }); + const res = await updateCasbin({ + authorityId: selectedAuthority.authorityId!, + casbinInfos, + }); + if (res.code === 0) { + message.success('API权限保存成功'); + } + }; + + // 删除角色 + const handleDelete = async (authorityId: number) => { + const res = await deleteAuthority({ authorityId }); + if (res.code === 0) { + message.success('删除成功'); + actionRef.current?.reload(); + } + }; + + // 拷贝角色 + const handleCopy = async (record: API.Authority) => { + const res = await copyAuthority({ + authority: { ...record, authorityName: `${record.authorityName}_copy` }, + oldAuthorityId: record.authorityId!, + }); + if (res.code === 0) { + message.success('拷贝成功'); + actionRef.current?.reload(); + } + }; + + const columns: ProColumns[] = [ + { title: '角色ID', dataIndex: 'authorityId' }, + { title: '角色名称', dataIndex: 'authorityName' }, + { title: '父角色ID', dataIndex: 'parentId' }, + { + title: '操作', + valueType: 'option', + render: (_, record) => ( + + + + handleDelete(record.authorityId!)}> + + + + + ), + }, + ]; + + + return ( + + + + + headerTitle="角色列表" + actionRef={actionRef} + rowKey="authorityId" + columns={columns} + search={false} + toolBarRender={() => [ + , + ]} + request={async (params) => { + const res = await getAuthorityList({ page: params.current, pageSize: params.pageSize }); + return { + data: res.data?.list || [], + total: res.data?.total || 0, + success: res.code === 0, + }; + }} + /> + + + {selectedAuthority && ( + + 保存}> + setCheckedMenuKeys(keys as number[])} + /> + + 保存}> + ({ + key: `${api.path}:${api.method}`, + title: `${api.description} [${api.method}] ${api.path}`, + }))} + checkedKeys={checkedApiKeys} + onCheck={(keys) => setCheckedApiKeys(keys as string[])} + height={300} + /> + + + )} + + + + { + let res; + if (isEdit) { + res = await updateAuthority({ ...currentRow, ...values }); + } else { + res = await createAuthority(values); + } + if (res.code === 0) { + message.success(isEdit ? '编辑成功' : '创建成功'); + setModalVisible(false); + actionRef.current?.reload(); + return true; + } + return false; + }} + > + + + + + + ); +}; + +export default AuthorityPage; diff --git a/web/src/pages/system/dictionary/index.tsx b/web/src/pages/system/dictionary/index.tsx new file mode 100644 index 0000000..eeed0f1 --- /dev/null +++ b/web/src/pages/system/dictionary/index.tsx @@ -0,0 +1,264 @@ +/** + * 字典管理页面 + * 与 GVA 保持一致的功能 + */ +import { PlusOutlined, DeleteOutlined, EditOutlined, DownloadOutlined, UploadOutlined } from '@ant-design/icons'; +import { PageContainer, ProTable, ModalForm, ProFormText, ProFormSwitch } from '@ant-design/pro-components'; +import type { ProColumns, ActionType } from '@ant-design/pro-components'; +import { Button, message, Popconfirm, Space, Card, Row, Col, Upload, Switch } from 'antd'; +import { useRef, useState } from 'react'; +import { + getSysDictionaryList, + createSysDictionary, + updateSysDictionary, + deleteSysDictionary, + exportSysDictionary, + importSysDictionary, +} from '@/services/system/dictionary'; +import { + getSysDictionaryDetailList, + createSysDictionaryDetail, + updateSysDictionaryDetail, + deleteSysDictionaryDetail, +} from '@/services/system/dictionaryDetail'; + +const DictionaryPage: React.FC = () => { + const actionRef = useRef(); + const detailActionRef = useRef(); + const [modalVisible, setModalVisible] = useState(false); + const [detailModalVisible, setDetailModalVisible] = useState(false); + const [currentRow, setCurrentRow] = useState(); + const [currentDetail, setCurrentDetail] = useState(); + const [isEdit, setIsEdit] = useState(false); + const [isDetailEdit, setIsDetailEdit] = useState(false); + const [selectedDict, setSelectedDict] = useState(); + + const handleDelete = async (id: number) => { + const res = await deleteSysDictionary({ ID: id }); + if (res.code === 0) { + message.success('删除成功'); + actionRef.current?.reload(); + } + }; + + const handleDeleteDetail = async (id: number) => { + const res = await deleteSysDictionaryDetail({ ID: id }); + if (res.code === 0) { + message.success('删除成功'); + detailActionRef.current?.reload(); + } + }; + + const handleExport = async (id: number) => { + const res = await exportSysDictionary({ ID: id }); + if (res.code === 0 && res.data) { + const blob = new Blob([JSON.stringify(res.data, null, 2)], { type: 'application/json' }); + const url = URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = `dictionary_${id}.json`; + a.click(); + message.success('导出成功'); + } + }; + + const handleImport = async (file: File) => { + const reader = new FileReader(); + reader.onload = async (e) => { + try { + const data = JSON.parse(e.target?.result as string); + const res = await importSysDictionary(data); + if (res.code === 0) { + message.success('导入成功'); + actionRef.current?.reload(); + } + } catch { + message.error('文件格式错误'); + } + }; + reader.readAsText(file); + return false; + }; + + const dictColumns: ProColumns[] = [ + { title: 'ID', dataIndex: 'ID', search: false }, + { title: '字典名称', dataIndex: 'name' }, + { title: '字典类型', dataIndex: 'type' }, + { title: '描述', dataIndex: 'desc', search: false }, + { + title: '状态', + dataIndex: 'status', + search: false, + render: (_, record) => , + }, + { + title: '操作', + valueType: 'option', + render: (_, record) => ( + + + + + handleDelete(record.ID!)}> + + + + ), + }, + ]; + + const detailColumns: ProColumns[] = [ + { title: 'ID', dataIndex: 'ID' }, + { title: '标签', dataIndex: 'label' }, + { title: '值', dataIndex: 'value' }, + { title: '扩展', dataIndex: 'extend' }, + { title: '排序', dataIndex: 'sort' }, + { + title: '状态', + dataIndex: 'status', + render: (_, record) => , + }, + { + title: '操作', + valueType: 'option', + render: (_, record) => ( + + + handleDeleteDetail(record.ID!)}> + + + + ), + }, + ]; + + + return ( + + + + + headerTitle="字典列表" + actionRef={actionRef} + rowKey="ID" + columns={dictColumns} + toolBarRender={() => [ + , + + + , + ]} + request={async (params) => { + const res = await getSysDictionaryList({ page: params.current, pageSize: params.pageSize, ...params }); + return { + data: res.data?.list || [], + total: res.data?.total || 0, + success: res.code === 0, + }; + }} + /> + + + {selectedDict && ( + + + actionRef={detailActionRef} + rowKey="ID" + columns={detailColumns} + search={false} + toolBarRender={() => [ + , + ]} + request={async (params) => { + const res = await getSysDictionaryDetailList({ + page: params.current, + pageSize: params.pageSize, + sysDictionaryID: selectedDict.ID, + }); + return { + data: res.data?.list || [], + total: res.data?.total || 0, + success: res.code === 0, + }; + }} + /> + + )} + + + + { + let res; + if (isEdit) { + res = await updateSysDictionary({ ...currentRow, ...values }); + } else { + res = await createSysDictionary(values); + } + if (res.code === 0) { + message.success(isEdit ? '编辑成功' : '创建成功'); + setModalVisible(false); + actionRef.current?.reload(); + return true; + } + return false; + }} + > + + + + + + + { + let res; + if (isDetailEdit) { + res = await updateSysDictionaryDetail({ ...currentDetail, ...values }); + } else { + res = await createSysDictionaryDetail({ ...currentDetail, ...values }); + } + if (res.code === 0) { + message.success(isDetailEdit ? '编辑成功' : '创建成功'); + setDetailModalVisible(false); + detailActionRef.current?.reload(); + return true; + } + return false; + }} + > + + + + + + + + ); +}; + +export default DictionaryPage; diff --git a/web/src/pages/system/menu/index.tsx b/web/src/pages/system/menu/index.tsx new file mode 100644 index 0000000..6f09742 --- /dev/null +++ b/web/src/pages/system/menu/index.tsx @@ -0,0 +1,126 @@ +/** + * 菜单管理页面 + * 与 GVA 保持一致的功能 + */ +import { PlusOutlined, DeleteOutlined, EditOutlined } from '@ant-design/icons'; +import { PageContainer, ProTable, ModalForm, ProFormText, ProFormDigit, ProFormSwitch, ProFormSelect } from '@ant-design/pro-components'; +import type { ProColumns, ActionType } from '@ant-design/pro-components'; +import { Button, message, Popconfirm, Space } from 'antd'; +import { useRef, useState } from 'react'; +import { getMenuList, addBaseMenu, updateBaseMenu, deleteBaseMenu } from '@/services/system/menu'; + +const MenuPage: React.FC = () => { + const actionRef = useRef(); + const [modalVisible, setModalVisible] = useState(false); + const [currentRow, setCurrentRow] = useState(); + const [isEdit, setIsEdit] = useState(false); + + const handleDelete = async (id: number) => { + const res = await deleteBaseMenu({ ID: id }); + if (res.code === 0) { + message.success('删除成功'); + actionRef.current?.reload(); + } + }; + + const columns: ProColumns[] = [ + { title: 'ID', dataIndex: 'ID', search: false }, + { title: '路由名称', dataIndex: 'name' }, + { title: '路由路径', dataIndex: 'path' }, + { title: '组件路径', dataIndex: 'component', search: false }, + { title: '排序', dataIndex: 'sort', search: false }, + { title: '标题', dataIndex: ['meta', 'title'] }, + { title: '图标', dataIndex: ['meta', 'icon'], search: false }, + { + title: '隐藏', + dataIndex: 'hidden', + search: false, + render: (_, record) => (record.hidden ? '是' : '否'), + }, + { + title: '操作', + valueType: 'option', + render: (_, record) => ( + + + + handleDelete(record.ID!)}> + + + + ), + }, + ]; + + return ( + + + headerTitle="菜单列表" + actionRef={actionRef} + rowKey="ID" + columns={columns} + toolBarRender={() => [ + , + ]} + request={async (params) => { + const res = await getMenuList({ page: params.current, pageSize: params.pageSize }); + return { + data: res.data?.list || [], + total: res.data?.total || 0, + success: res.code === 0, + }; + }} + /> + + { + const data = { + ...values, + meta: { title: values.title, icon: values.icon, keepAlive: values.keepAlive }, + }; + let res; + if (isEdit) { + res = await updateBaseMenu({ ...currentRow, ...data }); + } else { + res = await addBaseMenu(data); + } + if (res.code === 0) { + message.success(isEdit ? '编辑成功' : '创建成功'); + setModalVisible(false); + actionRef.current?.reload(); + return true; + } + return false; + }} + > + + + + + + + + + + + + ); +}; + +export default MenuPage; diff --git a/web/src/pages/system/operation/index.tsx b/web/src/pages/system/operation/index.tsx new file mode 100644 index 0000000..a19f030 --- /dev/null +++ b/web/src/pages/system/operation/index.tsx @@ -0,0 +1,198 @@ +/** + * 操作记录页面 + * 与 GVA sysOperationRecord.vue 保持一致的功能 + */ +import { DeleteOutlined, SearchOutlined, ReloadOutlined } from '@ant-design/icons'; +import { PageContainer, ProTable } from '@ant-design/pro-components'; +import type { ProColumns, ActionType } from '@ant-design/pro-components'; +import { Button, message, Popconfirm, Space, Tag, Popover, Typography } from 'antd'; +import { useRef, useState } from 'react'; +import { + getSysOperationRecordList, + deleteSysOperationRecord, + deleteSysOperationRecordByIds, +} from '@/services/system/operationRecord'; +import dayjs from 'dayjs'; + +const { Text } = Typography; + +const OperationRecordPage: React.FC = () => { + const actionRef = useRef(); + const [selectedRowKeys, setSelectedRowKeys] = useState([]); + + // 格式化JSON显示 + const formatBody = (value: string) => { + try { + return JSON.stringify(JSON.parse(value), null, 2); + } catch { + return value; + } + }; + + // 删除单条记录 + const handleDelete = async (id: number) => { + const res = await deleteSysOperationRecord({ ID: id }); + if (res.code === 0) { + message.success('删除成功'); + actionRef.current?.reload(); + } + }; + + // 批量删除 + const handleBatchDelete = async () => { + if (selectedRowKeys.length === 0) { + message.warning('请选择要删除的记录'); + return; + } + const res = await deleteSysOperationRecordByIds({ ids: selectedRowKeys }); + if (res.code === 0) { + message.success('删除成功'); + setSelectedRowKeys([]); + actionRef.current?.reload(); + } + }; + + const columns: ProColumns[] = [ + { + title: '操作人', + dataIndex: ['user', 'userName'], + width: 140, + search: false, + render: (_, record) => ( + {record.user?.userName}({record.user?.nickName}) + ), + }, + { + title: '日期', + dataIndex: 'CreatedAt', + width: 180, + search: false, + render: (_, record) => dayjs(record.CreatedAt).format('YYYY-MM-DD HH:mm:ss'), + }, + { + title: '状态码', + dataIndex: 'status', + width: 100, + render: (_, record) => {record.status}, + }, + { + title: '请求IP', + dataIndex: 'ip', + width: 120, + search: false, + }, + { + title: '请求方法', + dataIndex: 'method', + width: 100, + }, + { + title: '请求路径', + dataIndex: 'path', + width: 240, + ellipsis: true, + }, + { + title: '请求', + dataIndex: 'body', + width: 80, + search: false, + render: (_, record) => ( + record.body ? ( + +
{formatBody(record.body)}
+
+ } + trigger="click" + > + + + ) : + ), + }, + { + title: '响应', + dataIndex: 'resp', + width: 80, + search: false, + render: (_, record) => ( + record.resp ? ( + +
{formatBody(record.resp)}
+ + } + trigger="click" + > + +
+ ) : + ), + }, + { + title: '操作', + valueType: 'option', + width: 100, + render: (_, record) => ( + handleDelete(record.ID!)}> + + + ), + }, + ]; + + return ( + + + headerTitle="操作记录" + actionRef={actionRef} + rowKey="ID" + columns={columns} + rowSelection={{ + selectedRowKeys, + onChange: (keys) => setSelectedRowKeys(keys as number[]), + }} + toolBarRender={() => [ + + + , + ]} + request={async (params) => { + const res = await getSysOperationRecordList({ + page: params.current, + pageSize: params.pageSize, + method: params.method, + path: params.path, + status: params.status ? Number(params.status) : undefined, + }); + return { + data: res.data?.list || [], + total: res.data?.total || 0, + success: res.code === 0, + }; + }} + pagination={{ + defaultPageSize: 10, + showSizeChanger: true, + pageSizeOptions: ['10', '30', '50', '100'], + }} + /> + + ); +}; + +export default OperationRecordPage; diff --git a/web/src/pages/system/user/index.tsx b/web/src/pages/system/user/index.tsx new file mode 100644 index 0000000..c4178e3 --- /dev/null +++ b/web/src/pages/system/user/index.tsx @@ -0,0 +1,285 @@ +/** + * 用户管理页面 + * 与 GVA 保持一致的功能 + */ +import { PlusOutlined, DeleteOutlined, EditOutlined, KeyOutlined } from '@ant-design/icons'; +import { PageContainer, ProTable, ModalForm, ProFormText, ProFormSelect } from '@ant-design/pro-components'; +import type { ProColumns, ActionType } from '@ant-design/pro-components'; +import { Button, message, Popconfirm, Switch, Avatar, Space, Modal, Input, Cascader } from 'antd'; +import { useRef, useState, useEffect } from 'react'; +import { + getUserList, + register, + deleteUser, + setUserInfo, + setUserAuthorities, + resetPassword, +} from '@/services/system/user'; +import { getAuthorityList } from '@/services/system/authority'; + +const UserPage: React.FC = () => { + const actionRef = useRef(); + const [modalVisible, setModalVisible] = useState(false); + const [resetPwdVisible, setResetPwdVisible] = useState(false); + const [currentRow, setCurrentRow] = useState(); + const [isEdit, setIsEdit] = useState(false); + const [authOptions, setAuthOptions] = useState([]); + const [newPassword, setNewPassword] = useState(''); + + // 获取角色选项 + const fetchAuthorities = async () => { + const res = await getAuthorityList({ page: 1, pageSize: 100 }); + if (res.code === 0 && res.data?.list) { + const options = buildAuthOptions(res.data.list); + setAuthOptions(options); + } + }; + + // 构建角色级联选项 + const buildAuthOptions = (data: API.Authority[]): any[] => { + return data.map((item) => ({ + value: item.authorityId, + label: item.authorityName, + children: item.children ? buildAuthOptions(item.children) : undefined, + })); + }; + + useEffect(() => { + fetchAuthorities(); + }, []); + + // 删除用户 + const handleDelete = async (id: number) => { + const res = await deleteUser({ id }); + if (res.code === 0) { + message.success('删除成功'); + actionRef.current?.reload(); + } else { + message.error(res.msg || '删除失败'); + } + }; + + // 切换启用状态 + const handleSwitchEnable = async (record: API.UserInfo) => { + const res = await setUserInfo({ + ...record, + enable: record.enable === 1 ? 2 : 1, + }); + if (res.code === 0) { + message.success(record.enable === 1 ? '禁用成功' : '启用成功'); + actionRef.current?.reload(); + } + }; + + // 修改角色 + const handleChangeAuthority = async (record: API.UserInfo, authorityIds: number[]) => { + const res = await setUserAuthorities({ + uuid: record.uuid!, + authorityIds, + }); + if (res.code === 0) { + message.success('角色设置成功'); + actionRef.current?.reload(); + } + }; + + + // 生成随机密码 + const generatePassword = () => { + const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*'; + let pwd = ''; + for (let i = 0; i < 12; i++) { + pwd += chars.charAt(Math.floor(Math.random() * chars.length)); + } + setNewPassword(pwd); + navigator.clipboard.writeText(pwd).then(() => { + message.success('密码已复制到剪贴板'); + }); + }; + + // 重置密码 + const handleResetPassword = async () => { + if (!newPassword) { + message.warning('请输入或生成密码'); + return; + } + const res = await resetPassword({ id: currentRow!.ID! }); + if (res.code === 0) { + message.success('密码重置成功'); + setResetPwdVisible(false); + setNewPassword(''); + } + }; + + const columns: ProColumns[] = [ + { + title: '头像', + dataIndex: 'headerImg', + search: false, + render: (_, record) => , + }, + { title: 'ID', dataIndex: 'ID', search: false }, + { title: '用户名', dataIndex: 'userName' }, + { title: '昵称', dataIndex: 'nickName' }, + { title: '手机号', dataIndex: 'phone' }, + { title: '邮箱', dataIndex: 'email' }, + { + title: '用户角色', + dataIndex: 'authorityIds', + search: false, + render: (_, record) => ( + a.authorityId)} + onChange={(value) => handleChangeAuthority(record, value as number[])} + multiple + maxTagCount="responsive" + style={{ width: 200 }} + /> + ), + }, + { + title: '启用', + dataIndex: 'enable', + search: false, + render: (_, record) => ( + handleSwitchEnable(record)} + /> + ), + }, + { + title: '操作', + valueType: 'option', + render: (_, record) => ( + + handleDelete(record.ID!)}> + + + + + + ), + }, + ]; + + + return ( + + + headerTitle="用户列表" + actionRef={actionRef} + rowKey="ID" + columns={columns} + toolBarRender={() => [ + , + ]} + request={async (params) => { + const res = await getUserList({ + page: params.current, + pageSize: params.pageSize, + ...params, + }); + return { + data: res.data?.list || [], + total: res.data?.total || 0, + success: res.code === 0, + }; + }} + /> + + { + let res; + if (isEdit) { + res = await setUserInfo({ ...currentRow, ...values }); + } else { + res = await register(values); + } + if (res.code === 0) { + message.success(isEdit ? '编辑成功' : '创建成功'); + setModalVisible(false); + actionRef.current?.reload(); + return true; + } + message.error(res.msg || '操作失败'); + return false; + }} + > + {!isEdit && ( + <> + + + + )} + + + + + + + { + setResetPwdVisible(false); + setNewPassword(''); + }} + onOk={handleResetPassword} + > +

用户: {currentRow?.userName}

+ + setNewPassword(e.target.value)} + placeholder="请输入新密码" + /> + + +
+
+ ); +}; + +export default UserPage; diff --git a/web/src/pages/user/login/index.tsx b/web/src/pages/user/login/index.tsx index 9b33592..5c2ddaa 100644 --- a/web/src/pages/user/login/index.tsx +++ b/web/src/pages/user/login/index.tsx @@ -1,386 +1,127 @@ -import { Footer } from "@/components"; -import { getFakeCaptcha } from "@/services/ant-design-pro/login"; -import { createAdminService } from "@/services/index"; -import { LoginRequest } from "@/services/kratos/admin/v1/index"; -import { - AlipayCircleOutlined, - LockOutlined, - MobileOutlined, - TaobaoCircleOutlined, - UserOutlined, - WeiboCircleOutlined, -} from "@ant-design/icons"; -import { - LoginForm, - ProFormCaptcha, - ProFormCheckbox, - ProFormText, -} from "@ant-design/pro-components"; -import { - FormattedMessage, - Helmet, - SelectLang, - useIntl, - useModel, -} from "@umijs/max"; -import { Alert, App, Tabs } from "antd"; -import { createStyles } from "antd-style"; -import React, { useState } from "react"; -import { flushSync } from "react-dom"; -import Settings from "../../../../config/defaultSettings"; - -const adminService = createAdminService(); - -const useStyles = createStyles(({ token }) => { - return { - action: { - marginLeft: "8px", - color: "rgba(0, 0, 0, 0.2)", - fontSize: "24px", - verticalAlign: "middle", - cursor: "pointer", - transition: "color 0.3s", - "&:hover": { - color: token.colorPrimaryActive, - }, - }, - lang: { - width: 42, - height: 42, - lineHeight: "42px", - position: "fixed", - right: 16, - borderRadius: token.borderRadius, - ":hover": { - backgroundColor: token.colorBgTextHover, - }, - }, - container: { - display: "flex", - flexDirection: "column", - height: "100vh", - overflow: "auto", - backgroundImage: - "url('https://mdn.alipayobjects.com/yuyan_qk0oxh/afts/img/V-_oS6r-i7wAAAAAAAAAAAAAFl94AQBr')", - backgroundSize: "100% 100%", - }, - }; -}); - -const ActionIcons = () => { - const { styles } = useStyles(); - - return ( - <> - - - - - ); -}; - -const Lang = () => { - const { styles } = useStyles(); - - return ( -
- {SelectLang && } -
- ); -}; - -const LoginMessage: React.FC<{ - content: string; -}> = ({ content }) => { - return ( - - ); -}; +/** + * 登录页面 + * 与 GVA 保持一致的功能 + */ +import { LockOutlined, UserOutlined, SafetyCertificateOutlined } from '@ant-design/icons'; +import { LoginForm, ProFormText } from '@ant-design/pro-components'; +import { history, useModel } from '@umijs/max'; +import { message, Image, Spin } from 'antd'; +import { useState, useEffect } from 'react'; +import { login, captcha } from '@/services/system/user'; const Login: React.FC = () => { - const [userLoginState, setUserLoginState] = useState({}); - const [type, setType] = useState("account"); - const { initialState, setInitialState } = useModel("@@initialState"); - const { styles } = useStyles(); - const { message } = App.useApp(); - const intl = useIntl(); + const { setInitialState } = useModel('@@initialState'); + const [captchaInfo, setCaptchaInfo] = useState<{ + captchaId: string; + picPath: string; + openCaptcha: boolean; + }>({ captchaId: '', picPath: '', openCaptcha: false }); + const [loading, setLoading] = useState(false); - const handleSubmit = async (req: LoginRequest) => { + // 获取验证码 + const getCaptcha = async () => { try { - const userInfo = await adminService.Login(req); - const defaultLoginSuccessMessage = intl.formatMessage({ - id: "pages.login.success", - defaultMessage: "登录成功!", - }); - message.success(defaultLoginSuccessMessage); - // set user state - flushSync(() => { - setInitialState((state) => ({ - ...state, - currentUser: userInfo, - })); - }); - const urlParams = new URL(window.location.href).searchParams; - window.location.href = urlParams.get("redirect") || "/"; - console.log(userInfo); + const res = await captcha(); + if (res.code === 0 && res.data) { + setCaptchaInfo({ + captchaId: res.data.captchaId, + picPath: res.data.picPath, + openCaptcha: res.data.openCaptcha, + }); + } } catch (error) { - const defaultLoginFailureMessage = intl.formatMessage({ - id: "pages.login.failure", - defaultMessage: "登录失败,请重试!", - }); - console.log(error); - message.error(defaultLoginFailureMessage); + console.error('获取验证码失败:', error); } }; - const { status, type: loginType } = userLoginState; + + useEffect(() => { + getCaptcha(); + }, []); + + // 提交登录 + const handleSubmit = async (values: API.LoginParams) => { + setLoading(true); + try { + const res = await login({ + ...values, + captchaId: captchaInfo.captchaId, + }); + if (res.code === 0 && res.data) { + message.success('登录成功'); + // 存储token + localStorage.setItem('token', res.data.token); + localStorage.setItem('userInfo', JSON.stringify(res.data.user)); + // 更新全局状态 + await setInitialState((s) => ({ + ...s, + currentUser: res.data?.user, + })); + // 跳转到首页 + const urlParams = new URL(window.location.href).searchParams; + history.push(urlParams.get('redirect') || '/'); + } else { + message.error(res.msg || '登录失败'); + getCaptcha(); + } + } catch (error) { + message.error('登录失败,请重试'); + getCaptcha(); + } + setLoading(false); + }; return ( -
- - - {intl.formatMessage({ - id: "menu.login", - defaultMessage: "登录页", - })} - {Settings.title && ` - ${Settings.title}`} - - - -
+
+ } - title="Ant Design" - subTitle={intl.formatMessage({ - id: "pages.layouts.userLayout.title", - })} - initialValues={{ - autoLogin: true, - }} - actions={[ - , - , - ]} - onFinish={async (values) => { - await handleSubmit(values as LoginRequest); - }} + title="Kratos Admin" + subTitle="基于 Kratos 的后台管理系统" + onFinish={handleSubmit} + initialValues={{ username: 'admin' }} > - }} + placeholder="请输入用户名" + rules={[ + { required: true, message: '请输入用户名' }, + { min: 5, message: '用户名至少5个字符' }, ]} /> - - {status === "error" && loginType === "account" && ( - - )} - {type === "account" && ( - <> + }} + placeholder="请输入密码" + rules={[ + { required: true, message: '请输入密码' }, + { min: 6, message: '密码至少6个字符' }, + ]} + /> + {captchaInfo.openCaptcha && ( +
, - }} - placeholder={intl.formatMessage({ - id: "pages.login.username.placeholder", - defaultMessage: "用户名: admin or user", - })} - rules={[ - { - required: true, - message: ( - - ), - }, - ]} - /> - , - }} - placeholder={intl.formatMessage({ - id: "pages.login.password.placeholder", - defaultMessage: "密码: ant.design", - })} - rules={[ - { - required: true, - message: ( - - ), - }, - ]} - /> - - )} - - {status === "error" && loginType === "mobile" && ( - - )} - {type === "mobile" && ( - <> - , - }} - name="mobile" - placeholder={intl.formatMessage({ - id: "pages.login.phoneNumber.placeholder", - defaultMessage: "手机号", - })} - rules={[ - { - required: true, - message: ( - - ), - }, - { - pattern: /^1\d{10}$/, - message: ( - - ), - }, - ]} - /> - , - }} - captchaProps={{ - size: "large", - }} - placeholder={intl.formatMessage({ - id: "pages.login.captcha.placeholder", - defaultMessage: "请输入验证码", - })} - captchaTextRender={(timing, count) => { - if (timing) { - return `${count} ${intl.formatMessage({ - id: "pages.getCaptchaSecondText", - defaultMessage: "获取验证码", - })}`; - } - return intl.formatMessage({ - id: "pages.login.phoneLogin.getVerificationCode", - defaultMessage: "获取验证码", - }); - }} name="captcha" - rules={[ - { - required: true, - message: ( - - ), - }, - ]} - onGetCaptcha={async (phone) => { - const result = await getFakeCaptcha({ - phone, - }); - if (!result) { - return; - } - message.success("获取验证码成功!验证码为:1234"); - }} + fieldProps={{ size: 'large', prefix: }} + placeholder="请输入验证码" + rules={[{ required: true, message: '请输入验证码' }]} /> - + 验证码 +
)} -
- - - - - - -
-
-
+
); }; diff --git a/web/src/services/system/api.ts b/web/src/services/system/api.ts new file mode 100644 index 0000000..9bc3461 --- /dev/null +++ b/web/src/services/system/api.ts @@ -0,0 +1,106 @@ +/** + * API管理 服务 + * 与 GVA 保持一致的接口定义 + */ +import { request } from '@umijs/max'; + +/** 分页获取API列表 POST /api/getApiList */ +export async function getApiList(data: API.PageParams & { path?: string; description?: string; apiGroup?: string; method?: string }) { + return request('/api/api/getApiList', { + method: 'POST', + data, + }); +} + +/** 创建API POST /api/createApi */ +export async function createApi(data: API.ApiItem) { + return request('/api/api/createApi', { + method: 'POST', + data, + }); +} + +/** 根据ID获取API POST /api/getApiById */ +export async function getApiById(data: { id: number }) { + return request('/api/api/getApiById', { + method: 'POST', + data, + }); +} + +/** 更新API POST /api/updateApi */ +export async function updateApi(data: API.ApiItem) { + return request('/api/api/updateApi', { + method: 'POST', + data, + }); +} + +/** 设置角色API权限 POST /api/setAuthApi */ +export async function setAuthApi(data: { authorityId: number; apis: API.ApiItem[] }) { + return request('/api/api/setAuthApi', { + method: 'POST', + data, + }); +} + +/** 获取所有API POST /api/getAllApis */ +export async function getAllApis(data?: { authorityId?: number }) { + return request('/api/api/getAllApis', { + method: 'POST', + data, + }); +} + +/** 删除API POST /api/deleteApi */ +export async function deleteApi(data: { ids: number[] }) { + return request('/api/api/deleteApi', { + method: 'POST', + data, + }); +} + +/** 批量删除API DELETE /api/deleteApisByIds */ +export async function deleteApisByIds(data: { ids: number[] }) { + return request('/api/api/deleteApisByIds', { + method: 'DELETE', + data, + }); +} + +/** 刷新Casbin缓存 GET /api/freshCasbin */ +export async function freshCasbin() { + return request('/api/api/freshCasbin', { + method: 'GET', + }); +} + +/** 同步API GET /api/syncApi */ +export async function syncApi() { + return request('/api/api/syncApi', { + method: 'GET', + }); +} + +/** 获取API分组 GET /api/getApiGroups */ +export async function getApiGroups() { + return request('/api/api/getApiGroups', { + method: 'GET', + }); +} + +/** 忽略API POST /api/ignoreApi */ +export async function ignoreApi(data: { path: string; method: string }) { + return request('/api/api/ignoreApi', { + method: 'POST', + data, + }); +} + +/** 确认同步API POST /api/enterSyncApi */ +export async function enterSyncApi(data: { newApis: API.ApiItem[]; deleteApis: API.ApiItem[] }) { + return request('/api/api/enterSyncApi', { + method: 'POST', + data, + }); +} diff --git a/web/src/services/system/authority.ts b/web/src/services/system/authority.ts new file mode 100644 index 0000000..013f72c --- /dev/null +++ b/web/src/services/system/authority.ts @@ -0,0 +1,53 @@ +/** + * 角色管理 API 服务 + * 与 GVA 保持一致的接口定义 + */ +import { request } from '@umijs/max'; + +/** 获取角色列表 POST /authority/getAuthorityList */ +export async function getAuthorityList(data: API.PageParams) { + return request('/api/authority/getAuthorityList', { + method: 'POST', + data, + }); +} + +/** 删除角色 POST /authority/deleteAuthority */ +export async function deleteAuthority(data: { authorityId: number }) { + return request('/api/authority/deleteAuthority', { + method: 'POST', + data, + }); +} + +/** 创建角色 POST /authority/createAuthority */ +export async function createAuthority(data: API.Authority) { + return request('/api/authority/createAuthority', { + method: 'POST', + data, + }); +} + +/** 拷贝角色 POST /authority/copyAuthority */ +export async function copyAuthority(data: { authority: API.Authority; oldAuthorityId: number }) { + return request('/api/authority/copyAuthority', { + method: 'POST', + data, + }); +} + +/** 设置角色资源权限 POST /authority/setDataAuthority */ +export async function setDataAuthority(data: { authorityId: number; dataAuthorityId: number[] }) { + return request('/api/authority/setDataAuthority', { + method: 'POST', + data, + }); +} + +/** 修改角色 PUT /authority/updateAuthority */ +export async function updateAuthority(data: API.Authority) { + return request('/api/authority/updateAuthority', { + method: 'PUT', + data, + }); +} diff --git a/web/src/services/system/casbin.ts b/web/src/services/system/casbin.ts new file mode 100644 index 0000000..672247d --- /dev/null +++ b/web/src/services/system/casbin.ts @@ -0,0 +1,21 @@ +/** + * Casbin权限管理 API 服务 + * 与 GVA 保持一致的接口定义 + */ +import { request } from '@umijs/max'; + +/** 更新角色API权限 POST /casbin/updateCasbin */ +export async function updateCasbin(data: { authorityId: number; casbinInfos: API.CasbinInfo[] }) { + return request('/api/casbin/updateCasbin', { + method: 'POST', + data, + }); +} + +/** 获取权限列表 POST /casbin/getPolicyPathByAuthorityId */ +export async function getPolicyPathByAuthorityId(data: { authorityId: number }) { + return request('/api/casbin/getPolicyPathByAuthorityId', { + method: 'POST', + data, + }); +} diff --git a/web/src/services/system/dictionary.ts b/web/src/services/system/dictionary.ts new file mode 100644 index 0000000..65af15c --- /dev/null +++ b/web/src/services/system/dictionary.ts @@ -0,0 +1,61 @@ +/** + * 字典管理 API 服务 + * 与 GVA 保持一致的接口定义 + */ +import { request } from '@umijs/max'; + +/** 创建字典 POST /sysDictionary/createSysDictionary */ +export async function createSysDictionary(data: API.Dictionary) { + return request('/api/sysDictionary/createSysDictionary', { + method: 'POST', + data, + }); +} + +/** 删除字典 DELETE /sysDictionary/deleteSysDictionary */ +export async function deleteSysDictionary(data: { ID: number }) { + return request('/api/sysDictionary/deleteSysDictionary', { + method: 'DELETE', + data, + }); +} + +/** 更新字典 PUT /sysDictionary/updateSysDictionary */ +export async function updateSysDictionary(data: API.Dictionary) { + return request('/api/sysDictionary/updateSysDictionary', { + method: 'PUT', + data, + }); +} + +/** 根据ID查询字典 GET /sysDictionary/findSysDictionary */ +export async function findSysDictionary(params: { ID: number }) { + return request('/api/sysDictionary/findSysDictionary', { + method: 'GET', + params, + }); +} + +/** 分页获取字典列表 GET /sysDictionary/getSysDictionaryList */ +export async function getSysDictionaryList(params: API.PageParams & { name?: string; type?: string; status?: boolean }) { + return request('/api/sysDictionary/getSysDictionaryList', { + method: 'GET', + params, + }); +} + +/** 导出字典JSON GET /sysDictionary/exportSysDictionary */ +export async function exportSysDictionary(params: { ID: number }) { + return request('/api/sysDictionary/exportSysDictionary', { + method: 'GET', + params, + }); +} + +/** 导入字典JSON POST /sysDictionary/importSysDictionary */ +export async function importSysDictionary(data: API.Dictionary) { + return request('/api/sysDictionary/importSysDictionary', { + method: 'POST', + data, + }); +} diff --git a/web/src/services/system/dictionaryDetail.ts b/web/src/services/system/dictionaryDetail.ts new file mode 100644 index 0000000..f5e947d --- /dev/null +++ b/web/src/services/system/dictionaryDetail.ts @@ -0,0 +1,77 @@ +/** + * 字典详情管理 API 服务 + * 与 GVA 保持一致的接口定义 + */ +import { request } from '@umijs/max'; + +/** 创建字典详情 POST /sysDictionaryDetail/createSysDictionaryDetail */ +export async function createSysDictionaryDetail(data: API.DictionaryDetail) { + return request('/api/sysDictionaryDetail/createSysDictionaryDetail', { + method: 'POST', + data, + }); +} + +/** 删除字典详情 DELETE /sysDictionaryDetail/deleteSysDictionaryDetail */ +export async function deleteSysDictionaryDetail(data: { ID: number }) { + return request('/api/sysDictionaryDetail/deleteSysDictionaryDetail', { + method: 'DELETE', + data, + }); +} + +/** 更新字典详情 PUT /sysDictionaryDetail/updateSysDictionaryDetail */ +export async function updateSysDictionaryDetail(data: API.DictionaryDetail) { + return request('/api/sysDictionaryDetail/updateSysDictionaryDetail', { + method: 'PUT', + data, + }); +} + +/** 根据ID查询字典详情 GET /sysDictionaryDetail/findSysDictionaryDetail */ +export async function findSysDictionaryDetail(params: { ID: number }) { + return request('/api/sysDictionaryDetail/findSysDictionaryDetail', { + method: 'GET', + params, + }); +} + +/** 分页获取字典详情列表 GET /sysDictionaryDetail/getSysDictionaryDetailList */ +export async function getSysDictionaryDetailList(params: API.PageParams & { sysDictionaryID?: number }) { + return request('/api/sysDictionaryDetail/getSysDictionaryDetailList', { + method: 'GET', + params, + }); +} + +/** 获取层级字典详情树形结构(根据字典ID) GET /sysDictionaryDetail/getDictionaryTreeList */ +export async function getDictionaryTreeList(params: { sysDictionaryID: number }) { + return request('/api/sysDictionaryDetail/getDictionaryTreeList', { + method: 'GET', + params, + }); +} + +/** 获取层级字典详情树形结构(根据字典类型) GET /sysDictionaryDetail/getDictionaryTreeListByType */ +export async function getDictionaryTreeListByType(params: { dictType: string }) { + return request('/api/sysDictionaryDetail/getDictionaryTreeListByType', { + method: 'GET', + params, + }); +} + +/** 根据父级ID获取字典详情 GET /sysDictionaryDetail/getDictionaryDetailsByParent */ +export async function getDictionaryDetailsByParent(params: { parentID: number; includeChildren?: boolean }) { + return request('/api/sysDictionaryDetail/getDictionaryDetailsByParent', { + method: 'GET', + params, + }); +} + +/** 获取字典详情的完整路径 GET /sysDictionaryDetail/getDictionaryPath */ +export async function getDictionaryPath(params: { ID: number }) { + return request('/api/sysDictionaryDetail/getDictionaryPath', { + method: 'GET', + params, + }); +} diff --git a/web/src/services/system/index.ts b/web/src/services/system/index.ts new file mode 100644 index 0000000..80f3f21 --- /dev/null +++ b/web/src/services/system/index.ts @@ -0,0 +1,11 @@ +/** + * 系统管理 API 服务导出 + */ +export * from './user'; +export * from './authority'; +export * from './menu'; +export * from './api'; +export * from './dictionary'; +export * from './dictionaryDetail'; +export * from './operationRecord'; +export * from './casbin'; diff --git a/web/src/services/system/menu.ts b/web/src/services/system/menu.ts new file mode 100644 index 0000000..aca9b43 --- /dev/null +++ b/web/src/services/system/menu.ts @@ -0,0 +1,75 @@ +/** + * 菜单管理 API 服务 + * 与 GVA 保持一致的接口定义 + */ +import { request } from '@umijs/max'; + +/** 获取动态路由 POST /menu/getMenu */ +export async function asyncMenu() { + return request('/api/menu/getMenu', { + method: 'POST', + }); +} + +/** 获取菜单列表 POST /menu/getMenuList */ +export async function getMenuList(data: API.PageParams) { + return request('/api/menu/getMenuList', { + method: 'POST', + data, + }); +} + +/** 新增菜单 POST /menu/addBaseMenu */ +export async function addBaseMenu(data: API.Menu) { + return request('/api/menu/addBaseMenu', { + method: 'POST', + data, + }); +} + +/** 获取基础路由列表 POST /menu/getBaseMenuTree */ +export async function getBaseMenuTree() { + return request('/api/menu/getBaseMenuTree', { + method: 'POST', + }); +} + +/** 添加角色菜单关联 POST /menu/addMenuAuthority */ +export async function addMenuAuthority(data: { menus: API.Menu[]; authorityId: number }) { + return request('/api/menu/addMenuAuthority', { + method: 'POST', + data, + }); +} + +/** 获取角色菜单关联 POST /menu/getMenuAuthority */ +export async function getMenuAuthority(data: { authorityId: number }) { + return request('/api/menu/getMenuAuthority', { + method: 'POST', + data, + }); +} + +/** 删除菜单 POST /menu/deleteBaseMenu */ +export async function deleteBaseMenu(data: { ID: number }) { + return request('/api/menu/deleteBaseMenu', { + method: 'POST', + data, + }); +} + +/** 修改菜单 POST /menu/updateBaseMenu */ +export async function updateBaseMenu(data: API.Menu) { + return request('/api/menu/updateBaseMenu', { + method: 'POST', + data, + }); +} + +/** 根据ID获取菜单 POST /menu/getBaseMenuById */ +export async function getBaseMenuById(data: { id: number }) { + return request('/api/menu/getBaseMenuById', { + method: 'POST', + data, + }); +} diff --git a/web/src/services/system/operationRecord.ts b/web/src/services/system/operationRecord.ts new file mode 100644 index 0000000..fe2a4e5 --- /dev/null +++ b/web/src/services/system/operationRecord.ts @@ -0,0 +1,34 @@ +/** + * 操作记录管理 API 服务 + * 与 GVA 保持一致的接口定义 + */ +import { request } from '@umijs/max'; + +/** 删除操作记录 DELETE /sysOperationRecord/deleteSysOperationRecord */ +export async function deleteSysOperationRecord(data: { ID: number }) { + return request('/api/sysOperationRecord/deleteSysOperationRecord', { + method: 'DELETE', + data, + }); +} + +/** 批量删除操作记录 DELETE /sysOperationRecord/deleteSysOperationRecordByIds */ +export async function deleteSysOperationRecordByIds(data: { ids: number[] }) { + return request('/api/sysOperationRecord/deleteSysOperationRecordByIds', { + method: 'DELETE', + data, + }); +} + +/** 分页获取操作记录列表 GET /sysOperationRecord/getSysOperationRecordList */ +export async function getSysOperationRecordList(params: API.PageParams & { + path?: string; + method?: string; + status?: number; + ip?: string; +}) { + return request('/api/sysOperationRecord/getSysOperationRecordList', { + method: 'GET', + params, + }); +} diff --git a/web/src/services/system/typings.d.ts b/web/src/services/system/typings.d.ts new file mode 100644 index 0000000..64b52b3 --- /dev/null +++ b/web/src/services/system/typings.d.ts @@ -0,0 +1,400 @@ +/** + * 系统管理 API 类型定义 + * 与 GVA 保持一致 + */ +declare namespace API { + // 基础响应 + type BaseResult = { + code: number; + msg: string; + data?: any; + }; + + // 分页参数 + type PageParams = { + page?: number; + pageSize?: number; + }; + + // 登录参数 + type LoginParams = { + username: string; + password: string; + captcha?: string; + captchaId?: string; + }; + + // 登录结果 + type LoginResult = { + code: number; + msg: string; + data?: { + user: UserInfo; + token: string; + expiresAt: number; + }; + }; + + // 验证码结果 + type CaptchaResult = { + code: number; + msg: string; + data?: { + captchaId: string; + picPath: string; + captchaLength: number; + openCaptcha: boolean; + }; + }; + + // 注册参数 + type RegisterParams = { + username: string; + password: string; + nickName?: string; + headerImg?: string; + authorityId?: number; + authorityIds?: number[]; + }; + + // 修改密码参数 + type ChangePasswordParams = { + password: string; + newPassword: string; + }; + + // 用户信息 + type UserInfo = { + ID?: number; + uuid?: string; + userName?: string; + nickName?: string; + sideMode?: string; + headerImg?: string; + baseColor?: string; + activeColor?: string; + authorityId?: number; + authority?: Authority; + authorities?: Authority[]; + phone?: string; + email?: string; + enable?: number; + }; + + // 用户信息结果 + type UserInfoResult = { + code: number; + msg: string; + data?: { + userInfo: UserInfo; + }; + }; + + // 用户列表结果 + type UserListResult = { + code: number; + msg: string; + data?: { + list: UserInfo[]; + total: number; + page: number; + pageSize: number; + }; + }; + + + // 角色 + type Authority = { + authorityId?: number; + authorityName?: string; + parentId?: number; + dataAuthorityId?: Authority[]; + children?: Authority[]; + menus?: Menu[]; + defaultRouter?: string; + }; + + // 角色结果 + type AuthorityResult = { + code: number; + msg: string; + data?: { + authority: Authority; + }; + }; + + // 角色列表结果 + type AuthorityListResult = { + code: number; + msg: string; + data?: { + list: Authority[]; + total: number; + page: number; + pageSize: number; + }; + }; + + // 菜单 + type Menu = { + ID?: number; + parentId?: number; + path?: string; + name?: string; + hidden?: boolean; + component?: string; + sort?: number; + meta?: MenuMeta; + children?: Menu[]; + parameters?: MenuParameter[]; + menuBtn?: MenuButton[]; + }; + + // 菜单元信息 + type MenuMeta = { + activeName?: string; + keepAlive?: boolean; + defaultMenu?: boolean; + title?: string; + icon?: string; + closeTab?: boolean; + }; + + // 菜单参数 + type MenuParameter = { + ID?: number; + type?: string; + key?: string; + value?: string; + }; + + // 菜单按钮 + type MenuButton = { + ID?: number; + name?: string; + desc?: string; + }; + + // 菜单结果 + type MenuResult = { + code: number; + msg: string; + data?: { + menu?: Menu; + menus?: Menu[]; + }; + }; + + // 菜单列表结果 + type MenuListResult = { + code: number; + msg: string; + data?: { + list: Menu[]; + total: number; + page: number; + pageSize: number; + }; + }; + + // 菜单树结果 + type MenuTreeResult = { + code: number; + msg: string; + data?: { + menus: Menu[]; + }; + }; + + // 菜单权限结果 + type MenuAuthorityResult = { + code: number; + msg: string; + data?: { + menus: Menu[]; + }; + }; + + + // API项 + type ApiItem = { + ID?: number; + path?: string; + description?: string; + apiGroup?: string; + method?: string; + }; + + // API结果 + type ApiResult = { + code: number; + msg: string; + data?: { + api: ApiItem; + }; + }; + + // API列表结果 + type ApiListResult = { + code: number; + msg: string; + data?: { + list: ApiItem[]; + total: number; + page: number; + pageSize: number; + }; + }; + + // 所有API结果 + type AllApisResult = { + code: number; + msg: string; + data?: { + apis: ApiItem[]; + }; + }; + + // API分组结果 + type ApiGroupsResult = { + code: number; + msg: string; + data?: { + groups: string[]; + }; + }; + + // 字典 + type Dictionary = { + ID?: number; + name?: string; + type?: string; + status?: boolean; + desc?: string; + sysDictionaryDetails?: DictionaryDetail[]; + }; + + // 字典结果 + type DictionaryResult = { + code: number; + msg: string; + data?: { + sysDictionary: Dictionary; + }; + }; + + // 字典列表结果 + type DictionaryListResult = { + code: number; + msg: string; + data?: { + list: Dictionary[]; + total: number; + page: number; + pageSize: number; + }; + }; + + // 字典导出结果 + type DictionaryExportResult = { + code: number; + msg: string; + data?: Dictionary; + }; + + // 字典详情 + type DictionaryDetail = { + ID?: number; + sysDictionaryID?: number; + parentID?: number; + label?: string; + value?: string; + extend?: string; + status?: boolean; + sort?: number; + children?: DictionaryDetail[]; + }; + + // 字典详情结果 + type DictionaryDetailResult = { + code: number; + msg: string; + data?: { + sysDictionaryDetail: DictionaryDetail; + }; + }; + + // 字典详情列表结果 + type DictionaryDetailListResult = { + code: number; + msg: string; + data?: { + list: DictionaryDetail[]; + total: number; + page: number; + pageSize: number; + }; + }; + + // 字典树结果 + type DictionaryTreeResult = { + code: number; + msg: string; + data?: { + list: DictionaryDetail[]; + }; + }; + + // 字典路径结果 + type DictionaryPathResult = { + code: number; + msg: string; + data?: { + path: DictionaryDetail[]; + }; + }; + + // 操作记录 + type OperationRecord = { + ID?: number; + ip?: string; + method?: string; + path?: string; + status?: number; + latency?: string; + agent?: string; + error_message?: string; + body?: string; + resp?: string; + user_id?: number; + user?: UserInfo; + CreatedAt?: string; + }; + + // 操作记录列表结果 + type OperationRecordListResult = { + code: number; + msg: string; + data?: { + list: OperationRecord[]; + total: number; + page: number; + pageSize: number; + }; + }; + + // Casbin信息 + type CasbinInfo = { + path: string; + method: string; + }; + + // Casbin策略结果 + type CasbinPolicyResult = { + code: number; + msg: string; + data?: { + paths: CasbinInfo[]; + }; + }; +} diff --git a/web/src/services/system/user.ts b/web/src/services/system/user.ts new file mode 100644 index 0000000..d639436 --- /dev/null +++ b/web/src/services/system/user.ts @@ -0,0 +1,108 @@ +/** + * 用户管理 API 服务 + * 与 GVA 保持一致的接口定义 + */ +import { request } from '@umijs/max'; + +/** 用户登录 POST /base/login */ +export async function login(data: API.LoginParams) { + return request('/api/base/login', { + method: 'POST', + data, + }); +} + +/** 获取验证码 POST /base/captcha */ +export async function captcha() { + return request('/api/base/captcha', { + method: 'POST', + }); +} + +/** 用户注册 POST /user/admin_register */ +export async function register(data: API.RegisterParams) { + return request('/api/user/admin_register', { + method: 'POST', + data, + }); +} + +/** 修改密码 POST /user/changePassword */ +export async function changePassword(data: API.ChangePasswordParams) { + return request('/api/user/changePassword', { + method: 'POST', + data, + }); +} + +/** 分页获取用户列表 POST /user/getUserList */ +export async function getUserList(data: API.PageParams) { + return request('/api/user/getUserList', { + method: 'POST', + data, + }); +} + +/** 设置用户权限 POST /user/setUserAuthority */ +export async function setUserAuthority(data: { uuid: string; authorityId: number }) { + return request('/api/user/setUserAuthority', { + method: 'POST', + data, + }); +} + +/** 删除用户 DELETE /user/deleteUser */ +export async function deleteUser(data: { id: number }) { + return request('/api/user/deleteUser', { + method: 'DELETE', + data, + }); +} + + +/** 设置用户信息 PUT /user/setUserInfo */ +export async function setUserInfo(data: API.UserInfo) { + return request('/api/user/setUserInfo', { + method: 'PUT', + data, + }); +} + +/** 设置自身信息 PUT /user/setSelfInfo */ +export async function setSelfInfo(data: API.UserInfo) { + return request('/api/user/setSelfInfo', { + method: 'PUT', + data, + }); +} + +/** 设置自身界面配置 PUT /user/setSelfSetting */ +export async function setSelfSetting(data: Record) { + return request('/api/user/setSelfSetting', { + method: 'PUT', + data, + }); +} + +/** 设置用户多角色权限 POST /user/setUserAuthorities */ +export async function setUserAuthorities(data: { uuid: string; authorityIds: number[] }) { + return request('/api/user/setUserAuthorities', { + method: 'POST', + data, + }); +} + +/** 获取用户信息 GET /user/getUserInfo */ +export async function getUserInfo() { + return request('/api/user/getUserInfo', { + method: 'GET', + }); +} + +/** 重置密码 POST /user/resetPassword */ +export async function resetPassword(data: { id: number }) { + return request('/api/user/resetPassword', { + method: 'POST', + data, + }); +}