diff --git a/app/file/api/etc/file-api.yaml b/app/file/api/etc/file-api.yaml index 853ada6..1e831d4 100644 --- a/app/file/api/etc/file-api.yaml +++ b/app/file/api/etc/file-api.yaml @@ -1,4 +1,7 @@ Name: file-api + +Log: + Encoding: plain Host: 0.0.0.0 Port: 9002 diff --git a/app/file/rpc/etc/file.yaml b/app/file/rpc/etc/file.yaml index df53b97..c8dde54 100644 --- a/app/file/rpc/etc/file.yaml +++ b/app/file/rpc/etc/file.yaml @@ -1,4 +1,7 @@ Name: file.rpc + +Log: + Encoding: plain ListenOn: 0.0.0.0:9102 Etcd: Hosts: diff --git a/app/gateway/etc/gateway.yaml b/app/gateway/etc/gateway.yaml new file mode 100644 index 0000000..61fb68e --- /dev/null +++ b/app/gateway/etc/gateway.yaml @@ -0,0 +1,36 @@ +Name: gateway +Host: 0.0.0.0 +Port: 8888 + +Log: + Encoding: plain + Mode: console + +# 跨域配置 +Cors: + Enable: true + AllowOrigins: + - "*" + AllowMethods: + - GET + - POST + - PUT + - DELETE + - OPTIONS + AllowHeaders: + - Content-Type + - Authorization + - X-Requested-With + +# 上游服务路由表 +Upstreams: + - Prefix: /api/user + Target: http://127.0.0.1:9001 + - Prefix: /api/file + Target: http://127.0.0.1:9002 + - Prefix: /api/sys + Target: http://127.0.0.1:9003 + - Prefix: /api/plant + Target: http://127.0.0.1:9004 + - Prefix: /api/radio + Target: http://127.0.0.1:9005 diff --git a/app/gateway/gateway.go b/app/gateway/gateway.go new file mode 100644 index 0000000..4636447 --- /dev/null +++ b/app/gateway/gateway.go @@ -0,0 +1,58 @@ +package main + +import ( + "flag" + "fmt" + "net/http" + + "sundynix-micro-go/app/gateway/internal/config" + "sundynix-micro-go/app/gateway/internal/handler" + "sundynix-micro-go/app/gateway/internal/middleware" + + "github.com/zeromicro/go-zero/core/conf" + "github.com/zeromicro/go-zero/core/logx" +) + +var configFile = flag.String("f", "etc/gateway.yaml", "the config file") + +func main() { + flag.Parse() + + var c config.Config + conf.MustLoad(*configFile, &c) + + // 构建反向代理路由器 + proxyRouter := handler.NewProxyRouter(c.Upstreams) + + // 构建请求处理链 + var finalHandler http.Handler = proxyRouter + + // 注入 CORS 中间件 + if c.Cors.Enable { + corsMiddleware := middleware.NewCorsMiddleware(c.Cors.AllowOrigins, c.Cors.AllowMethods, c.Cors.AllowHeaders) + finalHandler = http.HandlerFunc(corsMiddleware.Handle(func(w http.ResponseWriter, r *http.Request) { + proxyRouter.ServeHTTP(w, r) + })) + } + + // 健康检查 + mux := http.NewServeMux() + mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=utf-8") + fmt.Fprintf(w, `{"code":200,"msg":"gateway is healthy","upstreams":%d}`, len(c.Upstreams)) + }) + mux.Handle("/", finalHandler) + + addr := fmt.Sprintf("%s:%d", c.Host, c.Port) + logx.Infof("===== Sundynix Gateway 启动 =====") + logx.Infof("监听地址: %s", addr) + logx.Infof("路由数量: %d", len(c.Upstreams)) + for _, u := range c.Upstreams { + logx.Infof(" %s -> %s", u.Prefix, u.Target) + } + logx.Infof("================================") + + if err := http.ListenAndServe(addr, mux); err != nil { + logx.Errorf("网关启动失败: %v", err) + } +} diff --git a/app/gateway/internal/config/config.go b/app/gateway/internal/config/config.go new file mode 100644 index 0000000..1e1f4a6 --- /dev/null +++ b/app/gateway/internal/config/config.go @@ -0,0 +1,21 @@ +package config + +import "github.com/zeromicro/go-zero/rest" + +type Config struct { + rest.RestConf + + Cors struct { + Enable bool + AllowOrigins []string + AllowMethods []string + AllowHeaders []string + } + + Upstreams []Upstream +} + +type Upstream struct { + Prefix string // URL 前缀,如 /api/user + Target string // 后端地址,如 http://127.0.0.1:9001 +} diff --git a/app/gateway/internal/handler/proxy.go b/app/gateway/internal/handler/proxy.go new file mode 100644 index 0000000..3589442 --- /dev/null +++ b/app/gateway/internal/handler/proxy.go @@ -0,0 +1,95 @@ +package handler + +import ( + "fmt" + "net/http" + "net/http/httputil" + "net/url" + "strings" + "time" + + "sundynix-micro-go/app/gateway/internal/config" + + "github.com/zeromicro/go-zero/core/logx" +) + +// ProxyRouter 反向代理路由器 +type ProxyRouter struct { + routes []*route +} + +type route struct { + prefix string + proxy *httputil.ReverseProxy + target string +} + +// NewProxyRouter 根据配置构建路由表 +func NewProxyRouter(upstreams []config.Upstream) *ProxyRouter { + router := &ProxyRouter{} + + for _, u := range upstreams { + targetURL, err := url.Parse(u.Target) + if err != nil { + logx.Errorf("解析上游地址失败 [%s]: %v", u.Target, err) + continue + } + + target := targetURL // 显式捕获循环变量 + proxy := &httputil.ReverseProxy{ + Rewrite: func(pr *httputil.ProxyRequest) { + pr.SetXForwarded() + pr.Out.URL.Scheme = target.Scheme + pr.Out.URL.Host = target.Host + pr.Out.Host = target.Host + // 路径透传:前端请求 /api/user/info -> 转发到 user-api 的 /api/user/info + // 不剥前缀,后端API的路由本身就包含 /api/user 前缀 + }, + } + + // 自定义 Transport:超时控制 + proxy.Transport = &http.Transport{ + MaxIdleConns: 100, + MaxIdleConnsPerHost: 20, + IdleConnTimeout: 90 * time.Second, + } + + // 错误处理 + prefix := u.Prefix + targetAddr := u.Target + proxy.ErrorHandler = func(w http.ResponseWriter, r *http.Request, err error) { + logx.Errorf("代理请求失败 [%s%s -> %s]: %v", prefix, r.URL.Path, targetAddr, err) + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusBadGateway) + fmt.Fprintf(w, `{"code":502,"msg":"上游服务不可用: %s"}`, prefix) + } + + router.routes = append(router.routes, &route{ + prefix: u.Prefix, + proxy: proxy, + target: u.Target, + }) + + logx.Infof("路由注册: %s -> %s", u.Prefix, u.Target) + } + + return router +} + +// ServeHTTP 根据 URL 前缀匹配路由并转发 +func (pr *ProxyRouter) ServeHTTP(w http.ResponseWriter, r *http.Request) { + path := r.URL.Path + + for _, rt := range pr.routes { + if strings.HasPrefix(path, rt.prefix) { + logx.Infof("[Gateway] %s %s -> %s", r.Method, path, rt.target) + rt.proxy.ServeHTTP(w, r) + return + } + } + + // 没有匹配的路由 + w.Header().Set("Content-Type", "application/json; charset=utf-8") + w.WriteHeader(http.StatusNotFound) + fmt.Fprintf(w, `{"code":404,"msg":"路由未找到: %s"}`, path) +} diff --git a/app/gateway/internal/middleware/cors.go b/app/gateway/internal/middleware/cors.go new file mode 100644 index 0000000..209280a --- /dev/null +++ b/app/gateway/internal/middleware/cors.go @@ -0,0 +1,55 @@ +package middleware + +import ( + "net/http" + "strings" +) + +// CorsMiddleware 跨域中间件 +type CorsMiddleware struct { + allowOrigins []string + allowMethods []string + allowHeaders []string +} + +func NewCorsMiddleware(origins, methods, headers []string) *CorsMiddleware { + return &CorsMiddleware{ + allowOrigins: origins, + allowMethods: methods, + allowHeaders: headers, + } +} + +func (m *CorsMiddleware) Handle(next http.HandlerFunc) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + origin := r.Header.Get("Origin") + if origin == "" { + next(w, r) + return + } + + allowed := false + for _, o := range m.allowOrigins { + if o == "*" || o == origin { + allowed = true + break + } + } + + if allowed { + w.Header().Set("Access-Control-Allow-Origin", origin) + w.Header().Set("Access-Control-Allow-Methods", strings.Join(m.allowMethods, ", ")) + w.Header().Set("Access-Control-Allow-Headers", strings.Join(m.allowHeaders, ", ")) + w.Header().Set("Access-Control-Allow-Credentials", "true") + w.Header().Set("Access-Control-Max-Age", "3600") + } + + // 预检请求直接返回 + if r.Method == http.MethodOptions { + w.WriteHeader(http.StatusNoContent) + return + } + + next(w, r) + } +} diff --git a/app/plant/api/etc/plant-api.yaml b/app/plant/api/etc/plant-api.yaml index ccd366f..f3ccc9e 100644 --- a/app/plant/api/etc/plant-api.yaml +++ b/app/plant/api/etc/plant-api.yaml @@ -1,22 +1,20 @@ Name: plant-api + +Log: + Encoding: plain Host: 0.0.0.0 Port: 9004 Auth: - AccessSecret: 9149f2eb-d517-4a50-a03a-231dbcf0d872 - AccessExpire: 7200 + AccessSecret: sundynix-jwt-secret-2024 + AccessExpire: 604800 -# MySQL -DB: - DataSource: root:root@tcp(192.168.100.127:3307)/sundynix_micro_go?charset=utf8mb4&parseTime=True&loc=Local +PlantRpc: + Etcd: + Hosts: + - 192.168.100.127:2379 + Key: plant.rpc -# Redis -Cache: - - Host: 127.0.0.1:6379 - Pass: sundynix - Type: node - -# RPC 依赖 UserRpc: Etcd: Hosts: @@ -28,17 +26,3 @@ FileRpc: Hosts: - 192.168.100.127:2379 Key: file.rpc - -# 百度植物识别 -BaiduImgClassify: - ApiKey: hpBfjwy8ifv3qswYGYjUCNKN - SecretKey: i5aXZdM4XZVuDroBslL0f3uIuwbAyXFS - -# 微信支付 -WechatPay: - MchId: "1735188493" - MchCertificateSerialNumber: "3725BFCA9CA3AF819AEC5D0CB7D3540BBC67F2CF" - MchApiV3Key: "a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6" - PrivateKeyPath: "/Users/blizzard/privateFolder/cert/apiclient_key.pem" - PublicKeyPath: "/Users/blizzard/privateFolder/cert/pub_key.pem" - NotifyUrl: "https://prod.sundynix.cn/api/wechatpay/notify" diff --git a/app/plant/api/internal/config/config.go b/app/plant/api/internal/config/config.go index 980a294..a40d2b8 100644 --- a/app/plant/api/internal/config/config.go +++ b/app/plant/api/internal/config/config.go @@ -14,26 +14,7 @@ type Config struct { AccessSecret string AccessExpire int64 } - DB struct { - DataSource string - } - Cache []struct { - Host string - Pass string - Type string - } - UserRpc zrpc.RpcClientConf - FileRpc zrpc.RpcClientConf - BaiduImgClassify struct { - ApiKey string - SecretKey string - } - WechatPay struct { - MchId string - MchCertificateSerialNumber string - MchApiV3Key string - PrivateKeyPath string - PublicKeyPath string - NotifyUrl string - } + PlantRpc zrpc.RpcClientConf + UserRpc zrpc.RpcClientConf + FileRpc zrpc.RpcClientConf } diff --git a/app/plant/api/internal/logic/myPlant/addCarePlanLogic.go b/app/plant/api/internal/logic/myPlant/addCarePlanLogic.go index 712308a..00d3cac 100644 --- a/app/plant/api/internal/logic/myPlant/addCarePlanLogic.go +++ b/app/plant/api/internal/logic/myPlant/addCarePlanLogic.go @@ -1,4 +1,3 @@ -// Code scaffolded by goctl. Safe to edit. package myPlant import ( @@ -7,7 +6,7 @@ import ( "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plant" ) type AddCarePlanLogic struct { @@ -22,12 +21,9 @@ func NewAddCarePlanLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddCa func (l *AddCarePlanLogic) AddCarePlan(req *types.CarePlanReq) error { userId := fmt.Sprintf("%v", l.ctx.Value("userId")) - plan := plantModel.SundynixCarePlan{ - UserID: userId, PlantID: req.PlantId, Name: req.Name, - TargetAction: req.TargetAction, Period: req.Period, Icon: req.Icon, - } - if err := l.svcCtx.DB.Create(&plan).Error; err != nil { - return fmt.Errorf("创建养护计划失败") - } - return nil + _, err := l.svcCtx.PlantRpc.AddCarePlan(l.ctx, &plant.AddCarePlanReq{ + UserId: userId, PlantId: req.PlantId, Name: req.Name, Icon: req.Icon, + TargetAction: req.TargetAction, Period: int32(req.Period), + }) + return err } diff --git a/app/plant/api/internal/logic/myPlant/addCareRecordLogic.go b/app/plant/api/internal/logic/myPlant/addCareRecordLogic.go index 2d20a85..6c3d32e 100644 --- a/app/plant/api/internal/logic/myPlant/addCareRecordLogic.go +++ b/app/plant/api/internal/logic/myPlant/addCareRecordLogic.go @@ -1,4 +1,3 @@ -// Code scaffolded by goctl. Safe to edit. package myPlant import ( @@ -7,7 +6,7 @@ import ( "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plant" ) type AddCareRecordLogic struct { @@ -22,12 +21,8 @@ func NewAddCareRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Add func (l *AddCareRecordLogic) AddCareRecord(req *types.CareRecordReq) error { userId := fmt.Sprintf("%v", l.ctx.Value("userId")) - record := plantModel.SundynixCareRecord{ - UserID: userId, PlantID: req.PlantId, PlanID: req.PlanId, - Name: req.Action, Remark: req.Note, - } - if err := l.svcCtx.DB.Create(&record).Error; err != nil { - return fmt.Errorf("创建养护记录失败") - } - return nil + _, err := l.svcCtx.PlantRpc.AddCareRecord(l.ctx, &plant.AddCareRecordReq{ + UserId: userId, PlantId: req.PlantId, PlanId: req.PlanId, Action: req.Action, Note: req.Note, + }) + return err } diff --git a/app/plant/api/internal/logic/myPlant/addGrowthRecordLogic.go b/app/plant/api/internal/logic/myPlant/addGrowthRecordLogic.go index d6743f5..28b8c57 100644 --- a/app/plant/api/internal/logic/myPlant/addGrowthRecordLogic.go +++ b/app/plant/api/internal/logic/myPlant/addGrowthRecordLogic.go @@ -1,4 +1,3 @@ -// Code scaffolded by goctl. Safe to edit. package myPlant import ( @@ -7,7 +6,7 @@ import ( "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plant" ) type AddGrowthRecordLogic struct { @@ -22,11 +21,8 @@ func NewAddGrowthRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *A func (l *AddGrowthRecordLogic) AddGrowthRecord(req *types.GrowthRecordReq) error { userId := fmt.Sprintf("%v", l.ctx.Value("userId")) - record := plantModel.SundynixGrowthRecord{ - PlantID: req.PlantId, UserID: userId, Content: req.Content, - } - if err := l.svcCtx.DB.Create(&record).Error; err != nil { - return fmt.Errorf("创建成长记录失败") - } - return nil + _, err := l.svcCtx.PlantRpc.AddGrowthRecord(l.ctx, &plant.AddGrowthRecordReq{ + UserId: userId, PlantId: req.PlantId, Content: req.Content, ImgIds: req.ImgIds, + }) + return err } diff --git a/app/plant/api/internal/logic/myPlant/createPlantLogic.go b/app/plant/api/internal/logic/myPlant/createPlantLogic.go index 8597f90..7ba5dce 100644 --- a/app/plant/api/internal/logic/myPlant/createPlantLogic.go +++ b/app/plant/api/internal/logic/myPlant/createPlantLogic.go @@ -1,4 +1,3 @@ -// Code scaffolded by goctl. Safe to edit. package myPlant import ( @@ -7,8 +6,7 @@ import ( "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - plantModel "sundynix-micro-go/app/plant/model" - "time" + "sundynix-micro-go/app/plant/rpc/plant" ) type CreatePlantLogic struct { @@ -23,20 +21,10 @@ func NewCreatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Creat func (l *CreatePlantLogic) CreatePlant(req *types.CreatePlantReq) error { userId := fmt.Sprintf("%v", l.ctx.Value("userId")) - plantTime, _ := time.Parse("2006-01-02", req.PlantTime) - plant := plantModel.SundynixMyPlant{ - UserID: userId, Name: req.Name, PlantTime: plantTime, Placement: req.Placement, + _, err := l.svcCtx.PlantRpc.CreatePlant(l.ctx, &plant.CreatePlantReq{ + UserId: userId, Name: req.Name, PlantTime: req.PlantTime, Placement: req.Placement, PotMaterial: req.PotMaterial, PotSize: req.PotSize, Sunlight: req.Sunlight, - PlantingMaterial: req.PlantingMaterial, Status: 1, - } - if err := l.svcCtx.DB.Create(&plant).Error; err != nil { - l.Errorf("创建植物失败: %v", err) - return fmt.Errorf("创建植物失败") - } - if len(req.ImgIds) > 0 { - for _, imgID := range req.ImgIds { - l.svcCtx.DB.Create(&plantModel.SundynixMyPlantOss{MyPlantID: plant.ID, OssID: imgID}) - } - } - return nil + PlantingMaterial: req.PlantingMaterial, ImgIds: req.ImgIds, + }) + return err } diff --git a/app/plant/api/internal/logic/myPlant/deletePlantLogic.go b/app/plant/api/internal/logic/myPlant/deletePlantLogic.go index 62495c1..79cb56e 100644 --- a/app/plant/api/internal/logic/myPlant/deletePlantLogic.go +++ b/app/plant/api/internal/logic/myPlant/deletePlantLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package myPlant import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plant" ) type DeletePlantLogic struct { @@ -21,13 +19,6 @@ func NewDeletePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delet } func (l *DeletePlantLogic) DeletePlant(req *types.IdsReq) error { - if err := l.svcCtx.DB.Where("id IN ?", req.Ids).Delete(&plantModel.SundynixMyPlant{}).Error; err != nil { - return fmt.Errorf("删除植物失败") - } - // 清理关联数据 - l.svcCtx.DB.Where("plant_id IN ?", req.Ids).Delete(&plantModel.SundynixCarePlan{}) - l.svcCtx.DB.Where("plant_id IN ?", req.Ids).Delete(&plantModel.SundynixCareRecord{}) - l.svcCtx.DB.Where("plant_id IN ?", req.Ids).Delete(&plantModel.SundynixCareTask{}) - l.svcCtx.DB.Where("plant_id IN ?", req.Ids).Delete(&plantModel.SundynixGrowthRecord{}) - return nil + _, err := l.svcCtx.PlantRpc.DeletePlant(l.ctx, &plant.IdsReq{Ids: req.Ids}) + return err } diff --git a/app/plant/api/internal/logic/myPlant/getMyPlantListLogic.go b/app/plant/api/internal/logic/myPlant/getMyPlantListLogic.go index e23a8d7..e3dd59a 100644 --- a/app/plant/api/internal/logic/myPlant/getMyPlantListLogic.go +++ b/app/plant/api/internal/logic/myPlant/getMyPlantListLogic.go @@ -1,4 +1,3 @@ -// Code scaffolded by goctl. Safe to edit. package myPlant import ( @@ -7,7 +6,7 @@ import ( "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plant" ) type GetMyPlantListLogic struct { @@ -22,22 +21,11 @@ func NewGetMyPlantListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge func (l *GetMyPlantListLogic) GetMyPlantList(req *types.PlantListReq) (resp interface{}, err error) { userId := fmt.Sprintf("%v", l.ctx.Value("userId")) - var plants []plantModel.SundynixMyPlant - var total int64 - db := l.svcCtx.DB.Model(&plantModel.SundynixMyPlant{}).Where("user_id = ?", userId) - if req.Name != "" { - db = db.Where("name LIKE ?", "%"+req.Name+"%") + result, err := l.svcCtx.PlantRpc.GetPlantList(l.ctx, &plant.PlantListReq{ + UserId: userId, Current: int32(req.Current), PageSize: int32(req.PageSize), Name: req.Name, + }) + if err != nil { + return nil, err } - db.Count(&total) - current, pageSize := req.Current, req.PageSize - if current <= 0 { - current = 1 - } - if pageSize <= 0 { - pageSize = 10 - } - if err := db.Offset((current - 1) * pageSize).Limit(pageSize).Order("created_at DESC").Find(&plants).Error; err != nil { - return nil, fmt.Errorf("查询植物列表失败") - } - return map[string]interface{}{"list": plants, "total": total, "current": current, "size": pageSize}, nil + return map[string]interface{}{"list": result.List, "total": result.Total}, nil } diff --git a/app/plant/api/internal/logic/myPlant/getPlantDetailLogic.go b/app/plant/api/internal/logic/myPlant/getPlantDetailLogic.go index df52ace..cf5ae9e 100644 --- a/app/plant/api/internal/logic/myPlant/getPlantDetailLogic.go +++ b/app/plant/api/internal/logic/myPlant/getPlantDetailLogic.go @@ -1,14 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package myPlant import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" - "gorm.io/gorm" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plant" ) type GetPlantDetailLogic struct { @@ -22,24 +19,9 @@ func NewGetPlantDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } func (l *GetPlantDetailLogic) GetPlantDetail(req *types.IdPathReq) (resp interface{}, err error) { - var plant plantModel.SundynixMyPlant - if err := l.svcCtx.DB.Where("id = ?", req.Id).First(&plant).Error; err != nil { - if err == gorm.ErrRecordNotFound { - return nil, fmt.Errorf("植物不存在") - } - return nil, fmt.Errorf("查询植物失败") + result, err := l.svcCtx.PlantRpc.GetPlantDetail(l.ctx, &plant.IdReq{Id: req.Id}) + if err != nil { + return nil, err } - // 查询关联图片ID - var ossIds []string - l.svcCtx.DB.Model(&plantModel.SundynixMyPlantOss{}).Where("sundynix_my_plant_id = ?", plant.ID).Pluck("sundynix_oss_id", &ossIds) - // 查询养护计划 - var plans []plantModel.SundynixCarePlan - l.svcCtx.DB.Where("plant_id = ?", plant.ID).Find(&plans) - // 查询成长记录 - var records []plantModel.SundynixGrowthRecord - l.svcCtx.DB.Where("plant_id = ?", plant.ID).Order("created_at DESC").Limit(10).Find(&records) - - return map[string]interface{}{ - "plant": plant, "imgIds": ossIds, "carePlans": plans, "growthRecords": records, - }, nil + return result, nil } diff --git a/app/plant/api/internal/logic/myPlant/updatePlantLogic.go b/app/plant/api/internal/logic/myPlant/updatePlantLogic.go index 5bd7461..01d9060 100644 --- a/app/plant/api/internal/logic/myPlant/updatePlantLogic.go +++ b/app/plant/api/internal/logic/myPlant/updatePlantLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package myPlant import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/plant/api/internal/svc" "sundynix-micro-go/app/plant/api/internal/types" - plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plant" ) type UpdatePlantLogic struct { @@ -21,32 +19,10 @@ func NewUpdatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Updat } func (l *UpdatePlantLogic) UpdatePlant(req *types.UpdatePlantReq) error { - updates := map[string]interface{}{} - if req.Name != "" { - updates["name"] = req.Name - } - if req.Status > 0 { - updates["status"] = req.Status - } - if req.Placement != "" { - updates["placement"] = req.Placement - } - if req.PotMaterial != "" { - updates["pot_material"] = req.PotMaterial - } - if req.PotSize != "" { - updates["pot_size"] = req.PotSize - } - if req.Sunlight != "" { - updates["sunlight"] = req.Sunlight - } - if req.PlantingMaterial != "" { - updates["planting_material"] = req.PlantingMaterial - } - if len(updates) > 0 { - if err := l.svcCtx.DB.Model(&plantModel.SundynixMyPlant{}).Where("id = ?", req.Id).Updates(updates).Error; err != nil { - return fmt.Errorf("更新植物失败") - } - } - return nil + _, err := l.svcCtx.PlantRpc.UpdatePlant(l.ctx, &plant.UpdatePlantReq{ + Id: req.Id, Name: req.Name, Status: int32(req.Status), Placement: req.Placement, + PotMaterial: req.PotMaterial, PotSize: req.PotSize, Sunlight: req.Sunlight, + PlantingMaterial: req.PlantingMaterial, ImgIds: req.ImgIds, + }) + return err } diff --git a/app/plant/api/internal/svc/serviceContext.go b/app/plant/api/internal/svc/serviceContext.go index d5a1c0e..e63ca12 100644 --- a/app/plant/api/internal/svc/serviceContext.go +++ b/app/plant/api/internal/svc/serviceContext.go @@ -6,58 +6,24 @@ package svc import ( "sundynix-micro-go/app/file/rpc/fileservice" "sundynix-micro-go/app/plant/api/internal/config" - plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/plantservice" "sundynix-micro-go/app/user/rpc/userservice" - "github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/zrpc" - "gorm.io/driver/mysql" - "gorm.io/gorm" ) type ServiceContext struct { - Config config.Config - DB *gorm.DB - UserRpc userservice.UserService - FileRpc fileservice.FileService + Config config.Config + PlantRpc plantservice.PlantService + UserRpc userservice.UserService + FileRpc fileservice.FileService } func NewServiceContext(c config.Config) *ServiceContext { - db, err := gorm.Open(mysql.Open(c.DB.DataSource), &gorm.Config{}) - if err != nil { - logx.Errorf("连接数据库失败: %v", err) - panic(err) - } - - // 自动迁移 - if err := db.AutoMigrate( - &plantModel.SundynixPlantUserProfile{}, - &plantModel.SundynixMyPlant{}, - &plantModel.SundynixCarePlan{}, - &plantModel.SundynixCareRecord{}, - &plantModel.SundynixCareTask{}, - &plantModel.SundynixGrowthRecord{}, - &plantModel.SundynixWiki{}, - &plantModel.SundynixWikiClass{}, - &plantModel.SundynixPost{}, - &plantModel.SundynixPostComment{}, - &plantModel.SundynixPostLike{}, - &plantModel.SundynixPostTopic{}, - &plantModel.SundynixUserStar{}, - &plantModel.SundynixExchangeItem{}, - &plantModel.SundynixExchangeOrder{}, - &plantModel.SundynixLevelConfig{}, - &plantModel.SundynixBadgeConfig{}, - &plantModel.SundynixUserBadge{}, - &plantModel.SundynixAiChatHistory{}, - ); err != nil { - logx.Errorf("数据库迁移失败: %v", err) - } - return &ServiceContext{ - Config: c, - DB: db, - UserRpc: userservice.NewUserService(zrpc.MustNewClient(c.UserRpc)), - FileRpc: fileservice.NewFileService(zrpc.MustNewClient(c.FileRpc)), + Config: c, + PlantRpc: plantservice.NewPlantService(zrpc.MustNewClient(c.PlantRpc)), + UserRpc: userservice.NewUserService(zrpc.MustNewClient(c.UserRpc)), + FileRpc: fileservice.NewFileService(zrpc.MustNewClient(c.FileRpc)), } } diff --git a/app/plant/rpc/etc/plant.yaml b/app/plant/rpc/etc/plant.yaml index 924b54f..853eea7 100644 --- a/app/plant/rpc/etc/plant.yaml +++ b/app/plant/rpc/etc/plant.yaml @@ -1,6 +1,12 @@ Name: plant.rpc -ListenOn: 0.0.0.0:8080 + +Log: + Encoding: plain +ListenOn: 0.0.0.0:9014 Etcd: Hosts: - - 127.0.0.1:2379 + - 192.168.100.127:2379 Key: plant.rpc + +DB: + DataSource: root:root@tcp(192.168.100.127:3307)/sundynix_micro_go?charset=utf8mb4&parseTime=True&loc=Local diff --git a/app/plant/rpc/internal/config/config.go b/app/plant/rpc/internal/config/config.go index c1f85b9..897b703 100755 --- a/app/plant/rpc/internal/config/config.go +++ b/app/plant/rpc/internal/config/config.go @@ -4,4 +4,7 @@ import "github.com/zeromicro/go-zero/zrpc" type Config struct { zrpc.RpcServerConf + DB struct { + DataSource string + } } diff --git a/app/plant/rpc/internal/logic/addCarePlanLogic.go b/app/plant/rpc/internal/logic/addCarePlanLogic.go index 4f8ffaf..aef9672 100644 --- a/app/plant/rpc/internal/logic/addCarePlanLogic.go +++ b/app/plant/rpc/internal/logic/addCarePlanLogic.go @@ -24,8 +24,8 @@ func NewAddCarePlanLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddCa } // 养护 -func (l *AddCarePlanLogic) AddCarePlan(in *plant.AddCarePlanReq) (*plant.AddCarePlanResp, error) { +func (l *AddCarePlanLogic) AddCarePlan(in *plant.AddCarePlanReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.AddCarePlanResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/addCareRecordLogic.go b/app/plant/rpc/internal/logic/addCareRecordLogic.go index 9a5b054..f4816a9 100644 --- a/app/plant/rpc/internal/logic/addCareRecordLogic.go +++ b/app/plant/rpc/internal/logic/addCareRecordLogic.go @@ -23,8 +23,8 @@ func NewAddCareRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Add } } -func (l *AddCareRecordLogic) AddCareRecord(in *plant.AddCareRecordReq) (*plant.AddCareRecordResp, error) { +func (l *AddCareRecordLogic) AddCareRecord(in *plant.AddCareRecordReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.AddCareRecordResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/addGrowthRecordLogic.go b/app/plant/rpc/internal/logic/addGrowthRecordLogic.go index 87d8ed5..04ba6f9 100644 --- a/app/plant/rpc/internal/logic/addGrowthRecordLogic.go +++ b/app/plant/rpc/internal/logic/addGrowthRecordLogic.go @@ -23,8 +23,8 @@ func NewAddGrowthRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *A } } -func (l *AddGrowthRecordLogic) AddGrowthRecord(in *plant.AddGrowthRecordReq) (*plant.AddGrowthRecordResp, error) { +func (l *AddGrowthRecordLogic) AddGrowthRecord(in *plant.AddGrowthRecordReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.AddGrowthRecordResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/commentPostLogic.go b/app/plant/rpc/internal/logic/commentPostLogic.go index a1aa69e..1d68d6a 100644 --- a/app/plant/rpc/internal/logic/commentPostLogic.go +++ b/app/plant/rpc/internal/logic/commentPostLogic.go @@ -23,8 +23,8 @@ func NewCommentPostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Comme } } -func (l *CommentPostLogic) CommentPost(in *plant.CommentPostReq) (*plant.CommentPostResp, error) { +func (l *CommentPostLogic) CommentPost(in *plant.CommentPostReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.CommentPostResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/createExchangeOrderLogic.go b/app/plant/rpc/internal/logic/createExchangeOrderLogic.go index d3ea6ac..f8215b3 100644 --- a/app/plant/rpc/internal/logic/createExchangeOrderLogic.go +++ b/app/plant/rpc/internal/logic/createExchangeOrderLogic.go @@ -23,8 +23,8 @@ func NewCreateExchangeOrderLogic(ctx context.Context, svcCtx *svc.ServiceContext } } -func (l *CreateExchangeOrderLogic) CreateExchangeOrder(in *plant.CreateExchangeOrderReq) (*plant.CreateExchangeOrderResp, error) { +func (l *CreateExchangeOrderLogic) CreateExchangeOrder(in *plant.CreateExchangeOrderReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.CreateExchangeOrderResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/createPlantLogic.go b/app/plant/rpc/internal/logic/createPlantLogic.go index 031fd80..1ac29c1 100644 --- a/app/plant/rpc/internal/logic/createPlantLogic.go +++ b/app/plant/rpc/internal/logic/createPlantLogic.go @@ -23,9 +23,9 @@ func NewCreatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Creat } } -// 植物 -func (l *CreatePlantLogic) CreatePlant(in *plant.CreatePlantReq) (*plant.CreatePlantResp, error) { +// 我的植物 +func (l *CreatePlantLogic) CreatePlant(in *plant.CreatePlantReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.CreatePlantResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/createPostLogic.go b/app/plant/rpc/internal/logic/createPostLogic.go index 44a1934..50996e6 100644 --- a/app/plant/rpc/internal/logic/createPostLogic.go +++ b/app/plant/rpc/internal/logic/createPostLogic.go @@ -24,8 +24,8 @@ func NewCreatePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create } // 社区 -func (l *CreatePostLogic) CreatePost(in *plant.CreatePostReq) (*plant.CreatePostResp, error) { +func (l *CreatePostLogic) CreatePost(in *plant.CreatePostReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.CreatePostResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/createTopicLogic.go b/app/plant/rpc/internal/logic/createTopicLogic.go index 0c45af1..4726698 100644 --- a/app/plant/rpc/internal/logic/createTopicLogic.go +++ b/app/plant/rpc/internal/logic/createTopicLogic.go @@ -23,8 +23,8 @@ func NewCreateTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Creat } } -func (l *CreateTopicLogic) CreateTopic(in *plant.CreateTopicReq) (*plant.CreateTopicResp, error) { +func (l *CreateTopicLogic) CreateTopic(in *plant.CreateTopicReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.CreateTopicResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/createWikiClassLogic.go b/app/plant/rpc/internal/logic/createWikiClassLogic.go index 3b9e6ba..dbcb0b1 100644 --- a/app/plant/rpc/internal/logic/createWikiClassLogic.go +++ b/app/plant/rpc/internal/logic/createWikiClassLogic.go @@ -23,8 +23,8 @@ func NewCreateWikiClassLogic(ctx context.Context, svcCtx *svc.ServiceContext) *C } } -func (l *CreateWikiClassLogic) CreateWikiClass(in *plant.CreateWikiClassReq) (*plant.CreateWikiClassResp, error) { +func (l *CreateWikiClassLogic) CreateWikiClass(in *plant.CreateWikiClassReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.CreateWikiClassResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/deletePlantLogic.go b/app/plant/rpc/internal/logic/deletePlantLogic.go index 23bafa4..f1d4553 100644 --- a/app/plant/rpc/internal/logic/deletePlantLogic.go +++ b/app/plant/rpc/internal/logic/deletePlantLogic.go @@ -23,8 +23,8 @@ func NewDeletePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delet } } -func (l *DeletePlantLogic) DeletePlant(in *plant.DeletePlantReq) (*plant.DeletePlantResp, error) { +func (l *DeletePlantLogic) DeletePlant(in *plant.IdsReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.DeletePlantResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/deletePostLogic.go b/app/plant/rpc/internal/logic/deletePostLogic.go index f5e3d9c..71ad852 100644 --- a/app/plant/rpc/internal/logic/deletePostLogic.go +++ b/app/plant/rpc/internal/logic/deletePostLogic.go @@ -23,8 +23,8 @@ func NewDeletePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delete } } -func (l *DeletePostLogic) DeletePost(in *plant.DeletePostReq) (*plant.DeletePostResp, error) { +func (l *DeletePostLogic) DeletePost(in *plant.IdsReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.DeletePostResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/deleteTopicLogic.go b/app/plant/rpc/internal/logic/deleteTopicLogic.go index 1b180c7..4b74af7 100644 --- a/app/plant/rpc/internal/logic/deleteTopicLogic.go +++ b/app/plant/rpc/internal/logic/deleteTopicLogic.go @@ -23,8 +23,8 @@ func NewDeleteTopicLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delet } } -func (l *DeleteTopicLogic) DeleteTopic(in *plant.DeleteTopicReq) (*plant.DeleteTopicResp, error) { +func (l *DeleteTopicLogic) DeleteTopic(in *plant.IdsReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.DeleteTopicResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getBadgeConfigListLogic.go b/app/plant/rpc/internal/logic/getBadgeConfigListLogic.go index 3fdeade..f4da87f 100644 --- a/app/plant/rpc/internal/logic/getBadgeConfigListLogic.go +++ b/app/plant/rpc/internal/logic/getBadgeConfigListLogic.go @@ -23,8 +23,8 @@ func NewGetBadgeConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } -func (l *GetBadgeConfigListLogic) GetBadgeConfigList(in *plant.GetBadgeConfigListReq) (*plant.GetBadgeConfigListResp, error) { +func (l *GetBadgeConfigListLogic) GetBadgeConfigList(in *plant.BadgeConfigListReq) (*plant.BadgeConfigListResp, error) { // todo: add your logic here and delete this line - return &plant.GetBadgeConfigListResp{}, nil + return &plant.BadgeConfigListResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getExchangeItemListLogic.go b/app/plant/rpc/internal/logic/getExchangeItemListLogic.go index d481783..ea4d82c 100644 --- a/app/plant/rpc/internal/logic/getExchangeItemListLogic.go +++ b/app/plant/rpc/internal/logic/getExchangeItemListLogic.go @@ -24,8 +24,8 @@ func NewGetExchangeItemListLogic(ctx context.Context, svcCtx *svc.ServiceContext } // 兑换 -func (l *GetExchangeItemListLogic) GetExchangeItemList(in *plant.GetExchangeItemListReq) (*plant.GetExchangeItemListResp, error) { +func (l *GetExchangeItemListLogic) GetExchangeItemList(in *plant.ExchangeItemListReq) (*plant.ExchangeItemListResp, error) { // todo: add your logic here and delete this line - return &plant.GetExchangeItemListResp{}, nil + return &plant.ExchangeItemListResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getLevelConfigListLogic.go b/app/plant/rpc/internal/logic/getLevelConfigListLogic.go index d936c88..7068585 100644 --- a/app/plant/rpc/internal/logic/getLevelConfigListLogic.go +++ b/app/plant/rpc/internal/logic/getLevelConfigListLogic.go @@ -24,8 +24,8 @@ func NewGetLevelConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) } // 配置 -func (l *GetLevelConfigListLogic) GetLevelConfigList(in *plant.GetLevelConfigListReq) (*plant.GetLevelConfigListResp, error) { +func (l *GetLevelConfigListLogic) GetLevelConfigList(in *plant.PageReq) (*plant.LevelConfigListResp, error) { // todo: add your logic here and delete this line - return &plant.GetLevelConfigListResp{}, nil + return &plant.LevelConfigListResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getPlantDetailLogic.go b/app/plant/rpc/internal/logic/getPlantDetailLogic.go index 470609f..f5875e4 100644 --- a/app/plant/rpc/internal/logic/getPlantDetailLogic.go +++ b/app/plant/rpc/internal/logic/getPlantDetailLogic.go @@ -23,8 +23,8 @@ func NewGetPlantDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } } -func (l *GetPlantDetailLogic) GetPlantDetail(in *plant.GetPlantDetailReq) (*plant.GetPlantDetailResp, error) { +func (l *GetPlantDetailLogic) GetPlantDetail(in *plant.IdReq) (*plant.PlantDetailResp, error) { // todo: add your logic here and delete this line - return &plant.GetPlantDetailResp{}, nil + return &plant.PlantDetailResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getPlantListLogic.go b/app/plant/rpc/internal/logic/getPlantListLogic.go index 48c8be2..0d5431f 100644 --- a/app/plant/rpc/internal/logic/getPlantListLogic.go +++ b/app/plant/rpc/internal/logic/getPlantListLogic.go @@ -23,8 +23,8 @@ func NewGetPlantListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetP } } -func (l *GetPlantListLogic) GetPlantList(in *plant.GetPlantListReq) (*plant.GetPlantListResp, error) { +func (l *GetPlantListLogic) GetPlantList(in *plant.PlantListReq) (*plant.PlantListResp, error) { // todo: add your logic here and delete this line - return &plant.GetPlantListResp{}, nil + return &plant.PlantListResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getPostDetailLogic.go b/app/plant/rpc/internal/logic/getPostDetailLogic.go index e48a74e..e821072 100644 --- a/app/plant/rpc/internal/logic/getPostDetailLogic.go +++ b/app/plant/rpc/internal/logic/getPostDetailLogic.go @@ -23,8 +23,8 @@ func NewGetPostDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get } } -func (l *GetPostDetailLogic) GetPostDetail(in *plant.GetPostDetailReq) (*plant.GetPostDetailResp, error) { +func (l *GetPostDetailLogic) GetPostDetail(in *plant.IdReq) (*plant.PostDetailResp, error) { // todo: add your logic here and delete this line - return &plant.GetPostDetailResp{}, nil + return &plant.PostDetailResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getPostListLogic.go b/app/plant/rpc/internal/logic/getPostListLogic.go index c306441..c59d326 100644 --- a/app/plant/rpc/internal/logic/getPostListLogic.go +++ b/app/plant/rpc/internal/logic/getPostListLogic.go @@ -23,8 +23,8 @@ func NewGetPostListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPo } } -func (l *GetPostListLogic) GetPostList(in *plant.GetPostListReq) (*plant.GetPostListResp, error) { +func (l *GetPostListLogic) GetPostList(in *plant.PostListReq) (*plant.PostListResp, error) { // todo: add your logic here and delete this line - return &plant.GetPostListResp{}, nil + return &plant.PostListResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getTopicListLogic.go b/app/plant/rpc/internal/logic/getTopicListLogic.go index 57be021..1ebe813 100644 --- a/app/plant/rpc/internal/logic/getTopicListLogic.go +++ b/app/plant/rpc/internal/logic/getTopicListLogic.go @@ -24,8 +24,8 @@ func NewGetTopicListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetT } // 话题 -func (l *GetTopicListLogic) GetTopicList(in *plant.Empty) (*plant.GetTopicListResp, error) { +func (l *GetTopicListLogic) GetTopicList(in *plant.IdReq) (*plant.TopicListResp, error) { // todo: add your logic here and delete this line - return &plant.GetTopicListResp{}, nil + return &plant.TopicListResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getUserProfileLogic.go b/app/plant/rpc/internal/logic/getUserProfileLogic.go index 2bc4d0a..adcbb44 100644 --- a/app/plant/rpc/internal/logic/getUserProfileLogic.go +++ b/app/plant/rpc/internal/logic/getUserProfileLogic.go @@ -24,8 +24,8 @@ func NewGetUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } // 用户Profile -func (l *GetUserProfileLogic) GetUserProfile(in *plant.GetUserProfileReq) (*plant.GetUserProfileResp, error) { +func (l *GetUserProfileLogic) GetUserProfile(in *plant.GetProfileReq) (*plant.PlantUserProfile, error) { // todo: add your logic here and delete this line - return &plant.GetUserProfileResp{}, nil + return &plant.PlantUserProfile{}, nil } diff --git a/app/plant/rpc/internal/logic/getWikiClassListLogic.go b/app/plant/rpc/internal/logic/getWikiClassListLogic.go index c83f94c..eb05ef9 100644 --- a/app/plant/rpc/internal/logic/getWikiClassListLogic.go +++ b/app/plant/rpc/internal/logic/getWikiClassListLogic.go @@ -23,8 +23,8 @@ func NewGetWikiClassListLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } -func (l *GetWikiClassListLogic) GetWikiClassList(in *plant.Empty) (*plant.GetWikiClassListResp, error) { +func (l *GetWikiClassListLogic) GetWikiClassList(in *plant.IdReq) (*plant.WikiClassListResp, error) { // todo: add your logic here and delete this line - return &plant.GetWikiClassListResp{}, nil + return &plant.WikiClassListResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getWikiDetailLogic.go b/app/plant/rpc/internal/logic/getWikiDetailLogic.go index 17d3ef9..3d94000 100644 --- a/app/plant/rpc/internal/logic/getWikiDetailLogic.go +++ b/app/plant/rpc/internal/logic/getWikiDetailLogic.go @@ -23,8 +23,8 @@ func NewGetWikiDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get } } -func (l *GetWikiDetailLogic) GetWikiDetail(in *plant.GetWikiDetailReq) (*plant.GetWikiDetailResp, error) { +func (l *GetWikiDetailLogic) GetWikiDetail(in *plant.IdReq) (*plant.WikiDetailResp, error) { // todo: add your logic here and delete this line - return &plant.GetWikiDetailResp{}, nil + return &plant.WikiDetailResp{}, nil } diff --git a/app/plant/rpc/internal/logic/getWikiListLogic.go b/app/plant/rpc/internal/logic/getWikiListLogic.go index f80f950..9315054 100644 --- a/app/plant/rpc/internal/logic/getWikiListLogic.go +++ b/app/plant/rpc/internal/logic/getWikiListLogic.go @@ -24,8 +24,8 @@ func NewGetWikiListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetWi } // 百科 -func (l *GetWikiListLogic) GetWikiList(in *plant.GetWikiListReq) (*plant.GetWikiListResp, error) { +func (l *GetWikiListLogic) GetWikiList(in *plant.WikiListReq) (*plant.WikiListResp, error) { // todo: add your logic here and delete this line - return &plant.GetWikiListResp{}, nil + return &plant.WikiListResp{}, nil } diff --git a/app/plant/rpc/internal/logic/incrUserCounterLogic.go b/app/plant/rpc/internal/logic/incrUserCounterLogic.go deleted file mode 100644 index 6be5ac0..0000000 --- a/app/plant/rpc/internal/logic/incrUserCounterLogic.go +++ /dev/null @@ -1,30 +0,0 @@ -package logic - -import ( - "context" - - "sundynix-micro-go/app/plant/rpc/internal/svc" - "sundynix-micro-go/app/plant/rpc/plant" - - "github.com/zeromicro/go-zero/core/logx" -) - -type IncrUserCounterLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewIncrUserCounterLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IncrUserCounterLogic { - return &IncrUserCounterLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -func (l *IncrUserCounterLogic) IncrUserCounter(in *plant.IncrUserCounterReq) (*plant.IncrUserCounterResp, error) { - // todo: add your logic here and delete this line - - return &plant.IncrUserCounterResp{}, nil -} diff --git a/app/plant/rpc/internal/logic/likePostLogic.go b/app/plant/rpc/internal/logic/likePostLogic.go index 3c68632..d088241 100644 --- a/app/plant/rpc/internal/logic/likePostLogic.go +++ b/app/plant/rpc/internal/logic/likePostLogic.go @@ -23,8 +23,8 @@ func NewLikePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LikePost } } -func (l *LikePostLogic) LikePost(in *plant.LikePostReq) (*plant.LikePostResp, error) { +func (l *LikePostLogic) LikePost(in *plant.LikePostReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.LikePostResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/toggleStarLogic.go b/app/plant/rpc/internal/logic/toggleWikiStarLogic.go similarity index 55% rename from app/plant/rpc/internal/logic/toggleStarLogic.go rename to app/plant/rpc/internal/logic/toggleWikiStarLogic.go index fb847d2..53eaf62 100644 --- a/app/plant/rpc/internal/logic/toggleStarLogic.go +++ b/app/plant/rpc/internal/logic/toggleWikiStarLogic.go @@ -9,22 +9,22 @@ import ( "github.com/zeromicro/go-zero/core/logx" ) -type ToggleStarLogic struct { +type ToggleWikiStarLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } -func NewToggleStarLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ToggleStarLogic { - return &ToggleStarLogic{ +func NewToggleWikiStarLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ToggleWikiStarLogic { + return &ToggleWikiStarLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } -func (l *ToggleStarLogic) ToggleStar(in *plant.ToggleStarReq) (*plant.ToggleStarResp, error) { +func (l *ToggleWikiStarLogic) ToggleWikiStar(in *plant.ToggleStarReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.ToggleStarResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/updatePlantLogic.go b/app/plant/rpc/internal/logic/updatePlantLogic.go index c6607d7..1e59a24 100644 --- a/app/plant/rpc/internal/logic/updatePlantLogic.go +++ b/app/plant/rpc/internal/logic/updatePlantLogic.go @@ -23,8 +23,8 @@ func NewUpdatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Updat } } -func (l *UpdatePlantLogic) UpdatePlant(in *plant.UpdatePlantReq) (*plant.UpdatePlantResp, error) { +func (l *UpdatePlantLogic) UpdatePlant(in *plant.UpdatePlantReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.UpdatePlantResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/logic/updateUserProfileLogic.go b/app/plant/rpc/internal/logic/updateUserProfileLogic.go index fad2875..9efd918 100644 --- a/app/plant/rpc/internal/logic/updateUserProfileLogic.go +++ b/app/plant/rpc/internal/logic/updateUserProfileLogic.go @@ -23,8 +23,8 @@ func NewUpdateUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } -func (l *UpdateUserProfileLogic) UpdateUserProfile(in *plant.UpdateUserProfileReq) (*plant.UpdateUserProfileResp, error) { +func (l *UpdateUserProfileLogic) UpdateUserProfile(in *plant.UpdateProfileReq) (*plant.CommonResp, error) { // todo: add your logic here and delete this line - return &plant.UpdateUserProfileResp{}, nil + return &plant.CommonResp{}, nil } diff --git a/app/plant/rpc/internal/server/plantServiceServer.go b/app/plant/rpc/internal/server/plantServiceServer.go index 60093b6..2ea1edf 100644 --- a/app/plant/rpc/internal/server/plantServiceServer.go +++ b/app/plant/rpc/internal/server/plantServiceServer.go @@ -24,154 +24,149 @@ func NewPlantServiceServer(svcCtx *svc.ServiceContext) *PlantServiceServer { } // 用户Profile -func (s *PlantServiceServer) GetUserProfile(ctx context.Context, in *plant.GetUserProfileReq) (*plant.GetUserProfileResp, error) { +func (s *PlantServiceServer) GetUserProfile(ctx context.Context, in *plant.GetProfileReq) (*plant.PlantUserProfile, error) { l := logic.NewGetUserProfileLogic(ctx, s.svcCtx) return l.GetUserProfile(in) } -func (s *PlantServiceServer) UpdateUserProfile(ctx context.Context, in *plant.UpdateUserProfileReq) (*plant.UpdateUserProfileResp, error) { +func (s *PlantServiceServer) UpdateUserProfile(ctx context.Context, in *plant.UpdateProfileReq) (*plant.CommonResp, error) { l := logic.NewUpdateUserProfileLogic(ctx, s.svcCtx) return l.UpdateUserProfile(in) } -func (s *PlantServiceServer) IncrUserCounter(ctx context.Context, in *plant.IncrUserCounterReq) (*plant.IncrUserCounterResp, error) { - l := logic.NewIncrUserCounterLogic(ctx, s.svcCtx) - return l.IncrUserCounter(in) -} - -// 植物 -func (s *PlantServiceServer) CreatePlant(ctx context.Context, in *plant.CreatePlantReq) (*plant.CreatePlantResp, error) { +// 我的植物 +func (s *PlantServiceServer) CreatePlant(ctx context.Context, in *plant.CreatePlantReq) (*plant.CommonResp, error) { l := logic.NewCreatePlantLogic(ctx, s.svcCtx) return l.CreatePlant(in) } -func (s *PlantServiceServer) UpdatePlant(ctx context.Context, in *plant.UpdatePlantReq) (*plant.UpdatePlantResp, error) { +func (s *PlantServiceServer) UpdatePlant(ctx context.Context, in *plant.UpdatePlantReq) (*plant.CommonResp, error) { l := logic.NewUpdatePlantLogic(ctx, s.svcCtx) return l.UpdatePlant(in) } -func (s *PlantServiceServer) DeletePlant(ctx context.Context, in *plant.DeletePlantReq) (*plant.DeletePlantResp, error) { +func (s *PlantServiceServer) DeletePlant(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { l := logic.NewDeletePlantLogic(ctx, s.svcCtx) return l.DeletePlant(in) } -func (s *PlantServiceServer) GetPlantList(ctx context.Context, in *plant.GetPlantListReq) (*plant.GetPlantListResp, error) { +func (s *PlantServiceServer) GetPlantList(ctx context.Context, in *plant.PlantListReq) (*plant.PlantListResp, error) { l := logic.NewGetPlantListLogic(ctx, s.svcCtx) return l.GetPlantList(in) } -func (s *PlantServiceServer) GetPlantDetail(ctx context.Context, in *plant.GetPlantDetailReq) (*plant.GetPlantDetailResp, error) { +func (s *PlantServiceServer) GetPlantDetail(ctx context.Context, in *plant.IdReq) (*plant.PlantDetailResp, error) { l := logic.NewGetPlantDetailLogic(ctx, s.svcCtx) return l.GetPlantDetail(in) } // 养护 -func (s *PlantServiceServer) AddCarePlan(ctx context.Context, in *plant.AddCarePlanReq) (*plant.AddCarePlanResp, error) { +func (s *PlantServiceServer) AddCarePlan(ctx context.Context, in *plant.AddCarePlanReq) (*plant.CommonResp, error) { l := logic.NewAddCarePlanLogic(ctx, s.svcCtx) return l.AddCarePlan(in) } -func (s *PlantServiceServer) AddCareRecord(ctx context.Context, in *plant.AddCareRecordReq) (*plant.AddCareRecordResp, error) { +func (s *PlantServiceServer) AddCareRecord(ctx context.Context, in *plant.AddCareRecordReq) (*plant.CommonResp, error) { l := logic.NewAddCareRecordLogic(ctx, s.svcCtx) return l.AddCareRecord(in) } -func (s *PlantServiceServer) AddGrowthRecord(ctx context.Context, in *plant.AddGrowthRecordReq) (*plant.AddGrowthRecordResp, error) { +func (s *PlantServiceServer) AddGrowthRecord(ctx context.Context, in *plant.AddGrowthRecordReq) (*plant.CommonResp, error) { l := logic.NewAddGrowthRecordLogic(ctx, s.svcCtx) return l.AddGrowthRecord(in) } // 百科 -func (s *PlantServiceServer) GetWikiList(ctx context.Context, in *plant.GetWikiListReq) (*plant.GetWikiListResp, error) { +func (s *PlantServiceServer) GetWikiList(ctx context.Context, in *plant.WikiListReq) (*plant.WikiListResp, error) { l := logic.NewGetWikiListLogic(ctx, s.svcCtx) return l.GetWikiList(in) } -func (s *PlantServiceServer) GetWikiDetail(ctx context.Context, in *plant.GetWikiDetailReq) (*plant.GetWikiDetailResp, error) { +func (s *PlantServiceServer) GetWikiDetail(ctx context.Context, in *plant.IdReq) (*plant.WikiDetailResp, error) { l := logic.NewGetWikiDetailLogic(ctx, s.svcCtx) return l.GetWikiDetail(in) } -func (s *PlantServiceServer) GetWikiClassList(ctx context.Context, in *plant.Empty) (*plant.GetWikiClassListResp, error) { +func (s *PlantServiceServer) GetWikiClassList(ctx context.Context, in *plant.IdReq) (*plant.WikiClassListResp, error) { l := logic.NewGetWikiClassListLogic(ctx, s.svcCtx) return l.GetWikiClassList(in) } -func (s *PlantServiceServer) CreateWikiClass(ctx context.Context, in *plant.CreateWikiClassReq) (*plant.CreateWikiClassResp, error) { +func (s *PlantServiceServer) CreateWikiClass(ctx context.Context, in *plant.CreateWikiClassReq) (*plant.CommonResp, error) { l := logic.NewCreateWikiClassLogic(ctx, s.svcCtx) return l.CreateWikiClass(in) } -func (s *PlantServiceServer) ToggleStar(ctx context.Context, in *plant.ToggleStarReq) (*plant.ToggleStarResp, error) { - l := logic.NewToggleStarLogic(ctx, s.svcCtx) - return l.ToggleStar(in) +func (s *PlantServiceServer) ToggleWikiStar(ctx context.Context, in *plant.ToggleStarReq) (*plant.CommonResp, error) { + l := logic.NewToggleWikiStarLogic(ctx, s.svcCtx) + return l.ToggleWikiStar(in) } // 社区 -func (s *PlantServiceServer) CreatePost(ctx context.Context, in *plant.CreatePostReq) (*plant.CreatePostResp, error) { +func (s *PlantServiceServer) CreatePost(ctx context.Context, in *plant.CreatePostReq) (*plant.CommonResp, error) { l := logic.NewCreatePostLogic(ctx, s.svcCtx) return l.CreatePost(in) } -func (s *PlantServiceServer) GetPostList(ctx context.Context, in *plant.GetPostListReq) (*plant.GetPostListResp, error) { - l := logic.NewGetPostListLogic(ctx, s.svcCtx) - return l.GetPostList(in) -} - -func (s *PlantServiceServer) GetPostDetail(ctx context.Context, in *plant.GetPostDetailReq) (*plant.GetPostDetailResp, error) { - l := logic.NewGetPostDetailLogic(ctx, s.svcCtx) - return l.GetPostDetail(in) -} - -func (s *PlantServiceServer) DeletePost(ctx context.Context, in *plant.DeletePostReq) (*plant.DeletePostResp, error) { +func (s *PlantServiceServer) DeletePost(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { l := logic.NewDeletePostLogic(ctx, s.svcCtx) return l.DeletePost(in) } -func (s *PlantServiceServer) CommentPost(ctx context.Context, in *plant.CommentPostReq) (*plant.CommentPostResp, error) { +func (s *PlantServiceServer) GetPostList(ctx context.Context, in *plant.PostListReq) (*plant.PostListResp, error) { + l := logic.NewGetPostListLogic(ctx, s.svcCtx) + return l.GetPostList(in) +} + +func (s *PlantServiceServer) GetPostDetail(ctx context.Context, in *plant.IdReq) (*plant.PostDetailResp, error) { + l := logic.NewGetPostDetailLogic(ctx, s.svcCtx) + return l.GetPostDetail(in) +} + +func (s *PlantServiceServer) CommentPost(ctx context.Context, in *plant.CommentPostReq) (*plant.CommonResp, error) { l := logic.NewCommentPostLogic(ctx, s.svcCtx) return l.CommentPost(in) } -func (s *PlantServiceServer) LikePost(ctx context.Context, in *plant.LikePostReq) (*plant.LikePostResp, error) { +func (s *PlantServiceServer) LikePost(ctx context.Context, in *plant.LikePostReq) (*plant.CommonResp, error) { l := logic.NewLikePostLogic(ctx, s.svcCtx) return l.LikePost(in) } // 话题 -func (s *PlantServiceServer) GetTopicList(ctx context.Context, in *plant.Empty) (*plant.GetTopicListResp, error) { +func (s *PlantServiceServer) GetTopicList(ctx context.Context, in *plant.IdReq) (*plant.TopicListResp, error) { l := logic.NewGetTopicListLogic(ctx, s.svcCtx) return l.GetTopicList(in) } -func (s *PlantServiceServer) CreateTopic(ctx context.Context, in *plant.CreateTopicReq) (*plant.CreateTopicResp, error) { +func (s *PlantServiceServer) CreateTopic(ctx context.Context, in *plant.CreateTopicReq) (*plant.CommonResp, error) { l := logic.NewCreateTopicLogic(ctx, s.svcCtx) return l.CreateTopic(in) } -func (s *PlantServiceServer) DeleteTopic(ctx context.Context, in *plant.DeleteTopicReq) (*plant.DeleteTopicResp, error) { +func (s *PlantServiceServer) DeleteTopic(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) { l := logic.NewDeleteTopicLogic(ctx, s.svcCtx) return l.DeleteTopic(in) } -// 配置 -func (s *PlantServiceServer) GetLevelConfigList(ctx context.Context, in *plant.GetLevelConfigListReq) (*plant.GetLevelConfigListResp, error) { - l := logic.NewGetLevelConfigListLogic(ctx, s.svcCtx) - return l.GetLevelConfigList(in) -} - -func (s *PlantServiceServer) GetBadgeConfigList(ctx context.Context, in *plant.GetBadgeConfigListReq) (*plant.GetBadgeConfigListResp, error) { - l := logic.NewGetBadgeConfigListLogic(ctx, s.svcCtx) - return l.GetBadgeConfigList(in) -} - // 兑换 -func (s *PlantServiceServer) GetExchangeItemList(ctx context.Context, in *plant.GetExchangeItemListReq) (*plant.GetExchangeItemListResp, error) { +func (s *PlantServiceServer) GetExchangeItemList(ctx context.Context, in *plant.ExchangeItemListReq) (*plant.ExchangeItemListResp, error) { l := logic.NewGetExchangeItemListLogic(ctx, s.svcCtx) return l.GetExchangeItemList(in) } -func (s *PlantServiceServer) CreateExchangeOrder(ctx context.Context, in *plant.CreateExchangeOrderReq) (*plant.CreateExchangeOrderResp, error) { +func (s *PlantServiceServer) CreateExchangeOrder(ctx context.Context, in *plant.CreateExchangeOrderReq) (*plant.CommonResp, error) { l := logic.NewCreateExchangeOrderLogic(ctx, s.svcCtx) return l.CreateExchangeOrder(in) } + +// 配置 +func (s *PlantServiceServer) GetLevelConfigList(ctx context.Context, in *plant.PageReq) (*plant.LevelConfigListResp, error) { + l := logic.NewGetLevelConfigListLogic(ctx, s.svcCtx) + return l.GetLevelConfigList(in) +} + +func (s *PlantServiceServer) GetBadgeConfigList(ctx context.Context, in *plant.BadgeConfigListReq) (*plant.BadgeConfigListResp, error) { + l := logic.NewGetBadgeConfigListLogic(ctx, s.svcCtx) + return l.GetBadgeConfigList(in) +} diff --git a/app/plant/rpc/internal/svc/serviceContext.go b/app/plant/rpc/internal/svc/serviceContext.go index a23857a..d95c586 100644 --- a/app/plant/rpc/internal/svc/serviceContext.go +++ b/app/plant/rpc/internal/svc/serviceContext.go @@ -1,13 +1,49 @@ package svc -import "sundynix-micro-go/app/plant/rpc/internal/config" +import ( + plantModel "sundynix-micro-go/app/plant/model" + "sundynix-micro-go/app/plant/rpc/internal/config" + + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) type ServiceContext struct { Config config.Config + DB *gorm.DB } func NewServiceContext(c config.Config) *ServiceContext { - return &ServiceContext{ - Config: c, + db, err := gorm.Open(mysql.Open(c.DB.DataSource), &gorm.Config{}) + if err != nil { + logx.Errorf("连接数据库失败: %v", err) + panic(err) } + + if err := db.AutoMigrate( + &plantModel.SundynixPlantUserProfile{}, + &plantModel.SundynixMyPlant{}, + &plantModel.SundynixCarePlan{}, + &plantModel.SundynixCareRecord{}, + &plantModel.SundynixCareTask{}, + &plantModel.SundynixGrowthRecord{}, + &plantModel.SundynixWiki{}, + &plantModel.SundynixWikiClass{}, + &plantModel.SundynixPost{}, + &plantModel.SundynixPostComment{}, + &plantModel.SundynixPostLike{}, + &plantModel.SundynixPostTopic{}, + &plantModel.SundynixUserStar{}, + &plantModel.SundynixExchangeItem{}, + &plantModel.SundynixExchangeOrder{}, + &plantModel.SundynixLevelConfig{}, + &plantModel.SundynixBadgeConfig{}, + &plantModel.SundynixUserBadge{}, + &plantModel.SundynixAiChatHistory{}, + ); err != nil { + logx.Errorf("数据库迁移失败: %v", err) + } + + return &ServiceContext{Config: c, DB: db} } diff --git a/app/plant/rpc/pb/plant.proto b/app/plant/rpc/pb/plant.proto index 365d835..827a400 100644 --- a/app/plant/rpc/pb/plant.proto +++ b/app/plant/rpc/pb/plant.proto @@ -4,8 +4,29 @@ package plant; option go_package = "./plant"; +// ========== 通用 ========== + +message CommonResp { + int64 code = 1; + string msg = 2; +} + +message IdReq { + string id = 1; +} + +message IdsReq { + repeated string ids = 1; +} + +message PageReq { + int32 current = 1; + int32 pageSize = 2; +} + // ========== 用户Profile ========== -message UserProfile { + +message PlantUserProfile { string id = 1; string userId = 2; string nickName = 3; @@ -23,22 +44,18 @@ message UserProfile { int64 photoCount = 15; } -message GetUserProfileReq { string userId = 1; } -message GetUserProfileResp { UserProfile profile = 1; } -message UpdateUserProfileReq { +message GetProfileReq { + string userId = 1; +} + +message UpdateProfileReq { string userId = 1; string nickName = 2; string avatarId = 3; } -message UpdateUserProfileResp {} -message IncrUserCounterReq { - string userId = 1; - string field = 2; // care_count, water_count, etc. - int64 delta = 3; -} -message IncrUserCounterResp {} // ========== 我的植物 ========== + message PlantInfo { string id = 1; string userId = 2; @@ -65,7 +82,6 @@ message CreatePlantReq { string plantingMaterial = 8; repeated string imgIds = 9; } -message CreatePlantResp { string id = 1; } message UpdatePlantReq { string id = 1; @@ -76,35 +92,36 @@ message UpdatePlantReq { string potSize = 6; string sunlight = 7; string plantingMaterial = 8; + repeated string imgIds = 9; } -message UpdatePlantResp {} -message DeletePlantReq { repeated string ids = 1; } -message DeletePlantResp {} - -message GetPlantListReq { +message PlantListReq { string userId = 1; int32 current = 2; int32 pageSize = 3; string name = 4; } -message GetPlantListResp { + +message PlantListResp { repeated PlantInfo list = 1; int64 total = 2; } -message GetPlantDetailReq { string id = 1; } -message GetPlantDetailResp { PlantInfo plant = 1; } +message PlantDetailResp { + PlantInfo plant = 1; + repeated CarePlanInfo carePlans = 2; + repeated GrowthRecordInfo growthRecords = 3; +} + +// ========== 养护计划 ========== -// ========== 养护 ========== message CarePlanInfo { string id = 1; - string userId = 2; - string plantId = 3; - string name = 4; - string icon = 5; - string targetAction = 6; - int32 period = 7; + string plantId = 2; + string name = 3; + string icon = 4; + string targetAction = 5; + int32 period = 6; } message AddCarePlanReq { @@ -115,7 +132,8 @@ message AddCarePlanReq { string targetAction = 5; int32 period = 6; } -message AddCarePlanResp { string id = 1; } + +// ========== 养护记录 ========== message AddCareRecordReq { string userId = 1; @@ -124,7 +142,15 @@ message AddCareRecordReq { string action = 4; string note = 5; } -message AddCareRecordResp {} + +// ========== 成长记录 ========== + +message GrowthRecordInfo { + string id = 1; + string plantId = 2; + string content = 3; + int64 createdAt = 4; +} message AddGrowthRecordReq { string userId = 1; @@ -132,9 +158,9 @@ message AddGrowthRecordReq { string content = 3; repeated string imgIds = 4; } -message AddGrowthRecordResp {} // ========== 百科 ========== + message WikiInfo { string id = 1; string name = 2; @@ -143,41 +169,52 @@ message WikiInfo { string genus = 5; int32 difficulty = 6; int32 isHot = 7; - int64 createdAt = 8; + string growthHabit = 8; + string lightIntensity = 9; + string optimalTempPeriod = 10; + int64 createdAt = 11; } -message GetWikiListReq { +message WikiListReq { int32 current = 1; int32 pageSize = 2; string name = 3; string classId = 4; int32 isHot = 5; } -message GetWikiListResp { + +message WikiListResp { repeated WikiInfo list = 1; int64 total = 2; } -message GetWikiDetailReq { string id = 1; } -message GetWikiDetailResp { WikiInfo wiki = 1; } +message WikiDetailResp { + WikiInfo wiki = 1; +} message WikiClassInfo { string id = 1; string name = 2; string ossId = 3; } -message GetWikiClassListResp { repeated WikiClassInfo list = 1; } -message CreateWikiClassReq { string name = 1; string ossId = 2; } -message CreateWikiClassResp { string id = 1; } + +message WikiClassListResp { + repeated WikiClassInfo list = 1; +} + +message CreateWikiClassReq { + string name = 1; + string icon = 2; +} message ToggleStarReq { string userId = 1; string targetId = 2; string type = 3; } -message ToggleStarResp { bool starred = 1; } -// ========== 社区 ========== +// ========== 社区帖子 ========== + message PostInfo { string id = 1; string userId = 2; @@ -199,24 +236,32 @@ message CreatePostReq { repeated string imgIds = 5; string topicId = 6; } -message CreatePostResp { string id = 1; } -message GetPostListReq { +message PostListReq { int32 current = 1; int32 pageSize = 2; string keyword = 3; string topicId = 4; + string userId = 5; } -message GetPostListResp { + +message PostListResp { repeated PostInfo list = 1; int64 total = 2; } -message GetPostDetailReq { string id = 1; } -message GetPostDetailResp { PostInfo post = 1; } +message PostDetailResp { + PostInfo post = 1; + repeated PostCommentInfo comments = 2; +} -message DeletePostReq { repeated string ids = 1; } -message DeletePostResp {} +message PostCommentInfo { + string id = 1; + string userId = 2; + string content = 3; + string parentId = 4; + int64 createdAt = 5; +} message CommentPostReq { string userId = 1; @@ -224,27 +269,58 @@ message CommentPostReq { string content = 3; string parentId = 4; } -message CommentPostResp {} message LikePostReq { string userId = 1; string postId = 2; } -message LikePostResp { bool liked = 1; } // ========== 话题 ========== + message TopicInfo { string id = 1; string name = 2; int32 postCount = 3; } -message GetTopicListResp { repeated TopicInfo list = 1; } -message CreateTopicReq { string name = 1; } -message CreateTopicResp { string id = 1; } -message DeleteTopicReq { repeated string ids = 1; } -message DeleteTopicResp {} + +message TopicListResp { + repeated TopicInfo list = 1; +} + +message CreateTopicReq { + string name = 1; + string icon = 2; + string desc = 3; +} + +// ========== 兑换商城 ========== + +message ExchangeItemInfo { + string id = 1; + string name = 2; + string desc = 3; + string imgId = 4; + int64 cost = 5; + int32 stock = 6; +} + +message ExchangeItemListReq { + int32 current = 1; + int32 pageSize = 2; +} + +message ExchangeItemListResp { + repeated ExchangeItemInfo list = 1; + int64 total = 2; +} + +message CreateExchangeOrderReq { + string userId = 1; + string itemId = 2; +} // ========== 配置 ========== + message LevelConfigInfo { string id = 1; int32 level = 2; @@ -252,8 +328,10 @@ message LevelConfigInfo { int64 minSunlight = 4; string perks = 5; } -message GetLevelConfigListReq { int32 current = 1; int32 pageSize = 2; } -message GetLevelConfigListResp { repeated LevelConfigInfo list = 1; int64 total = 2; } + +message LevelConfigListResp { + repeated LevelConfigInfo list = 1; +} message BadgeConfigInfo { string id = 1; @@ -266,63 +344,62 @@ message BadgeConfigInfo { int64 threshold = 8; int64 rewardSunlight = 9; } -message GetBadgeConfigListReq { int32 current = 1; int32 pageSize = 2; string dimension = 3; } -message GetBadgeConfigListResp { repeated BadgeConfigInfo list = 1; int64 total = 2; } -// ========== 兑换 ========== -message ExchangeItemInfo { - string id = 1; - string name = 2; - string desc = 3; - int64 cost = 4; - int32 stock = 5; +message BadgeConfigListReq { + int32 current = 1; + int32 pageSize = 2; + string dimension = 3; } -message GetExchangeItemListReq { int32 current = 1; int32 pageSize = 2; } -message GetExchangeItemListResp { repeated ExchangeItemInfo list = 1; int64 total = 2; } -message CreateExchangeOrderReq { string userId = 1; string itemId = 2; } -message CreateExchangeOrderResp { string id = 1; } - -// ========== 通用 ========== -message Empty {} +message BadgeConfigListResp { + repeated BadgeConfigInfo list = 1; + int64 total = 2; +} // ========== 服务定义 ========== + service PlantService { // 用户Profile - rpc GetUserProfile(GetUserProfileReq) returns (GetUserProfileResp); - rpc UpdateUserProfile(UpdateUserProfileReq) returns (UpdateUserProfileResp); - rpc IncrUserCounter(IncrUserCounterReq) returns (IncrUserCounterResp); - // 植物 - rpc CreatePlant(CreatePlantReq) returns (CreatePlantResp); - rpc UpdatePlant(UpdatePlantReq) returns (UpdatePlantResp); - rpc DeletePlant(DeletePlantReq) returns (DeletePlantResp); - rpc GetPlantList(GetPlantListReq) returns (GetPlantListResp); - rpc GetPlantDetail(GetPlantDetailReq) returns (GetPlantDetailResp); + rpc GetUserProfile(GetProfileReq) returns (PlantUserProfile); + rpc UpdateUserProfile(UpdateProfileReq) returns (CommonResp); + + // 我的植物 + rpc CreatePlant(CreatePlantReq) returns (CommonResp); + rpc UpdatePlant(UpdatePlantReq) returns (CommonResp); + rpc DeletePlant(IdsReq) returns (CommonResp); + rpc GetPlantList(PlantListReq) returns (PlantListResp); + rpc GetPlantDetail(IdReq) returns (PlantDetailResp); + // 养护 - rpc AddCarePlan(AddCarePlanReq) returns (AddCarePlanResp); - rpc AddCareRecord(AddCareRecordReq) returns (AddCareRecordResp); - rpc AddGrowthRecord(AddGrowthRecordReq) returns (AddGrowthRecordResp); + rpc AddCarePlan(AddCarePlanReq) returns (CommonResp); + rpc AddCareRecord(AddCareRecordReq) returns (CommonResp); + rpc AddGrowthRecord(AddGrowthRecordReq) returns (CommonResp); + // 百科 - rpc GetWikiList(GetWikiListReq) returns (GetWikiListResp); - rpc GetWikiDetail(GetWikiDetailReq) returns (GetWikiDetailResp); - rpc GetWikiClassList(Empty) returns (GetWikiClassListResp); - rpc CreateWikiClass(CreateWikiClassReq) returns (CreateWikiClassResp); - rpc ToggleStar(ToggleStarReq) returns (ToggleStarResp); + rpc GetWikiList(WikiListReq) returns (WikiListResp); + rpc GetWikiDetail(IdReq) returns (WikiDetailResp); + rpc GetWikiClassList(IdReq) returns (WikiClassListResp); + rpc CreateWikiClass(CreateWikiClassReq) returns (CommonResp); + rpc ToggleWikiStar(ToggleStarReq) returns (CommonResp); + // 社区 - rpc CreatePost(CreatePostReq) returns (CreatePostResp); - rpc GetPostList(GetPostListReq) returns (GetPostListResp); - rpc GetPostDetail(GetPostDetailReq) returns (GetPostDetailResp); - rpc DeletePost(DeletePostReq) returns (DeletePostResp); - rpc CommentPost(CommentPostReq) returns (CommentPostResp); - rpc LikePost(LikePostReq) returns (LikePostResp); + rpc CreatePost(CreatePostReq) returns (CommonResp); + rpc DeletePost(IdsReq) returns (CommonResp); + rpc GetPostList(PostListReq) returns (PostListResp); + rpc GetPostDetail(IdReq) returns (PostDetailResp); + rpc CommentPost(CommentPostReq) returns (CommonResp); + rpc LikePost(LikePostReq) returns (CommonResp); + // 话题 - rpc GetTopicList(Empty) returns (GetTopicListResp); - rpc CreateTopic(CreateTopicReq) returns (CreateTopicResp); - rpc DeleteTopic(DeleteTopicReq) returns (DeleteTopicResp); - // 配置 - rpc GetLevelConfigList(GetLevelConfigListReq) returns (GetLevelConfigListResp); - rpc GetBadgeConfigList(GetBadgeConfigListReq) returns (GetBadgeConfigListResp); + rpc GetTopicList(IdReq) returns (TopicListResp); + rpc CreateTopic(CreateTopicReq) returns (CommonResp); + rpc DeleteTopic(IdsReq) returns (CommonResp); + // 兑换 - rpc GetExchangeItemList(GetExchangeItemListReq) returns (GetExchangeItemListResp); - rpc CreateExchangeOrder(CreateExchangeOrderReq) returns (CreateExchangeOrderResp); + rpc GetExchangeItemList(ExchangeItemListReq) returns (ExchangeItemListResp); + rpc CreateExchangeOrder(CreateExchangeOrderReq) returns (CommonResp); + + // 配置 + rpc GetLevelConfigList(PageReq) returns (LevelConfigListResp); + rpc GetBadgeConfigList(BadgeConfigListReq) returns (BadgeConfigListResp); } diff --git a/app/plant/rpc/plant/plant.pb.go b/app/plant/rpc/plant/plant.pb.go index f60e69d..4872fc5 100644 --- a/app/plant/rpc/plant/plant.pb.go +++ b/app/plant/rpc/plant/plant.pb.go @@ -21,8 +21,199 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// ========== 用户Profile ========== -type UserProfile struct { +type CommonResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommonResp) Reset() { + *x = CommonResp{} + mi := &file_pb_plant_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommonResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResp) ProtoMessage() {} + +func (x *CommonResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[0] + 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 CommonResp.ProtoReflect.Descriptor instead. +func (*CommonResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{0} +} + +func (x *CommonResp) GetCode() int64 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *CommonResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type IdReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdReq) Reset() { + *x = IdReq{} + mi := &file_pb_plant_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdReq) ProtoMessage() {} + +func (x *IdReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[1] + 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 IdReq.ProtoReflect.Descriptor instead. +func (*IdReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{1} +} + +func (x *IdReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type IdsReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdsReq) Reset() { + *x = IdsReq{} + mi := &file_pb_plant_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdsReq) ProtoMessage() {} + +func (x *IdsReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_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 IdsReq.ProtoReflect.Descriptor instead. +func (*IdsReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{2} +} + +func (x *IdsReq) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + +type PageReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *PageReq) Reset() { + *x = PageReq{} + mi := &file_pb_plant_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *PageReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PageReq) ProtoMessage() {} + +func (x *PageReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[3] + 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 PageReq.ProtoReflect.Descriptor instead. +func (*PageReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{3} +} + +func (x *PageReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *PageReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type PlantUserProfile struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` @@ -43,21 +234,21 @@ type UserProfile struct { sizeCache protoimpl.SizeCache } -func (x *UserProfile) Reset() { - *x = UserProfile{} - mi := &file_pb_plant_proto_msgTypes[0] +func (x *PlantUserProfile) Reset() { + *x = PlantUserProfile{} + mi := &file_pb_plant_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UserProfile) String() string { +func (x *PlantUserProfile) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UserProfile) ProtoMessage() {} +func (*PlantUserProfile) ProtoMessage() {} -func (x *UserProfile) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[0] +func (x *PlantUserProfile) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -68,138 +259,138 @@ func (x *UserProfile) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UserProfile.ProtoReflect.Descriptor instead. -func (*UserProfile) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{0} +// Deprecated: Use PlantUserProfile.ProtoReflect.Descriptor instead. +func (*PlantUserProfile) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{4} } -func (x *UserProfile) GetId() string { +func (x *PlantUserProfile) GetId() string { if x != nil { return x.Id } return "" } -func (x *UserProfile) GetUserId() string { +func (x *PlantUserProfile) GetUserId() string { if x != nil { return x.UserId } return "" } -func (x *UserProfile) GetNickName() string { +func (x *PlantUserProfile) GetNickName() string { if x != nil { return x.NickName } return "" } -func (x *UserProfile) GetAvatarId() string { +func (x *PlantUserProfile) GetAvatarId() string { if x != nil { return x.AvatarId } return "" } -func (x *UserProfile) GetLevelId() string { +func (x *PlantUserProfile) GetLevelId() string { if x != nil { return x.LevelId } return "" } -func (x *UserProfile) GetCurrentSunlight() int64 { +func (x *PlantUserProfile) GetCurrentSunlight() int64 { if x != nil { return x.CurrentSunlight } return 0 } -func (x *UserProfile) GetTotalSunlight() int64 { +func (x *PlantUserProfile) GetTotalSunlight() int64 { if x != nil { return x.TotalSunlight } return 0 } -func (x *UserProfile) GetPlantCount() int64 { +func (x *PlantUserProfile) GetPlantCount() int64 { if x != nil { return x.PlantCount } return 0 } -func (x *UserProfile) GetCareCount() int64 { +func (x *PlantUserProfile) GetCareCount() int64 { if x != nil { return x.CareCount } return 0 } -func (x *UserProfile) GetPostCount() int64 { +func (x *PlantUserProfile) GetPostCount() int64 { if x != nil { return x.PostCount } return 0 } -func (x *UserProfile) GetWaterCount() int64 { +func (x *PlantUserProfile) GetWaterCount() int64 { if x != nil { return x.WaterCount } return 0 } -func (x *UserProfile) GetFertilizeCount() int64 { +func (x *PlantUserProfile) GetFertilizeCount() int64 { if x != nil { return x.FertilizeCount } return 0 } -func (x *UserProfile) GetRepotCount() int64 { +func (x *PlantUserProfile) GetRepotCount() int64 { if x != nil { return x.RepotCount } return 0 } -func (x *UserProfile) GetPruneCount() int64 { +func (x *PlantUserProfile) GetPruneCount() int64 { if x != nil { return x.PruneCount } return 0 } -func (x *UserProfile) GetPhotoCount() int64 { +func (x *PlantUserProfile) GetPhotoCount() int64 { if x != nil { return x.PhotoCount } return 0 } -type GetUserProfileReq struct { +type GetProfileReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetUserProfileReq) Reset() { - *x = GetUserProfileReq{} - mi := &file_pb_plant_proto_msgTypes[1] +func (x *GetProfileReq) Reset() { + *x = GetProfileReq{} + mi := &file_pb_plant_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetUserProfileReq) String() string { +func (x *GetProfileReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetUserProfileReq) ProtoMessage() {} +func (*GetProfileReq) ProtoMessage() {} -func (x *GetUserProfileReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[1] +func (x *GetProfileReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -210,63 +401,19 @@ func (x *GetUserProfileReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetUserProfileReq.ProtoReflect.Descriptor instead. -func (*GetUserProfileReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{1} +// Deprecated: Use GetProfileReq.ProtoReflect.Descriptor instead. +func (*GetProfileReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{5} } -func (x *GetUserProfileReq) GetUserId() string { +func (x *GetProfileReq) GetUserId() string { if x != nil { return x.UserId } return "" } -type GetUserProfileResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Profile *UserProfile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetUserProfileResp) Reset() { - *x = GetUserProfileResp{} - mi := &file_pb_plant_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetUserProfileResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserProfileResp) ProtoMessage() {} - -func (x *GetUserProfileResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_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 GetUserProfileResp.ProtoReflect.Descriptor instead. -func (*GetUserProfileResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{2} -} - -func (x *GetUserProfileResp) GetProfile() *UserProfile { - if x != nil { - return x.Profile - } - return nil -} - -type UpdateUserProfileReq struct { +type UpdateProfileReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` NickName string `protobuf:"bytes,2,opt,name=nickName,proto3" json:"nickName,omitempty"` @@ -275,21 +422,21 @@ type UpdateUserProfileReq struct { sizeCache protoimpl.SizeCache } -func (x *UpdateUserProfileReq) Reset() { - *x = UpdateUserProfileReq{} - mi := &file_pb_plant_proto_msgTypes[3] +func (x *UpdateProfileReq) Reset() { + *x = UpdateProfileReq{} + mi := &file_pb_plant_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UpdateUserProfileReq) String() string { +func (x *UpdateProfileReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateUserProfileReq) ProtoMessage() {} +func (*UpdateProfileReq) ProtoMessage() {} -func (x *UpdateUserProfileReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[3] +func (x *UpdateProfileReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -300,165 +447,32 @@ func (x *UpdateUserProfileReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateUserProfileReq.ProtoReflect.Descriptor instead. -func (*UpdateUserProfileReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{3} +// Deprecated: Use UpdateProfileReq.ProtoReflect.Descriptor instead. +func (*UpdateProfileReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{6} } -func (x *UpdateUserProfileReq) GetUserId() string { +func (x *UpdateProfileReq) GetUserId() string { if x != nil { return x.UserId } return "" } -func (x *UpdateUserProfileReq) GetNickName() string { +func (x *UpdateProfileReq) GetNickName() string { if x != nil { return x.NickName } return "" } -func (x *UpdateUserProfileReq) GetAvatarId() string { +func (x *UpdateProfileReq) GetAvatarId() string { if x != nil { return x.AvatarId } return "" } -type UpdateUserProfileResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateUserProfileResp) Reset() { - *x = UpdateUserProfileResp{} - mi := &file_pb_plant_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateUserProfileResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserProfileResp) ProtoMessage() {} - -func (x *UpdateUserProfileResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[4] - 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 UpdateUserProfileResp.ProtoReflect.Descriptor instead. -func (*UpdateUserProfileResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{4} -} - -type IncrUserCounterReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - Field string `protobuf:"bytes,2,opt,name=field,proto3" json:"field,omitempty"` // care_count, water_count, etc. - Delta int64 `protobuf:"varint,3,opt,name=delta,proto3" json:"delta,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *IncrUserCounterReq) Reset() { - *x = IncrUserCounterReq{} - mi := &file_pb_plant_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *IncrUserCounterReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IncrUserCounterReq) ProtoMessage() {} - -func (x *IncrUserCounterReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_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 IncrUserCounterReq.ProtoReflect.Descriptor instead. -func (*IncrUserCounterReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{5} -} - -func (x *IncrUserCounterReq) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *IncrUserCounterReq) GetField() string { - if x != nil { - return x.Field - } - return "" -} - -func (x *IncrUserCounterReq) GetDelta() int64 { - if x != nil { - return x.Delta - } - return 0 -} - -type IncrUserCounterResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *IncrUserCounterResp) Reset() { - *x = IncrUserCounterResp{} - mi := &file_pb_plant_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *IncrUserCounterResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*IncrUserCounterResp) ProtoMessage() {} - -func (x *IncrUserCounterResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[6] - 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 IncrUserCounterResp.ProtoReflect.Descriptor instead. -func (*IncrUserCounterResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{6} -} - -// ========== 我的植物 ========== type PlantInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -699,50 +713,6 @@ func (x *CreatePlantReq) GetImgIds() []string { return nil } -type CreatePlantResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePlantResp) Reset() { - *x = CreatePlantResp{} - mi := &file_pb_plant_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePlantResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePlantResp) ProtoMessage() {} - -func (x *CreatePlantResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_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 CreatePlantResp.ProtoReflect.Descriptor instead. -func (*CreatePlantResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{9} -} - -func (x *CreatePlantResp) GetId() string { - if x != nil { - return x.Id - } - return "" -} - type UpdatePlantReq struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -753,13 +723,14 @@ type UpdatePlantReq struct { PotSize string `protobuf:"bytes,6,opt,name=potSize,proto3" json:"potSize,omitempty"` Sunlight string `protobuf:"bytes,7,opt,name=sunlight,proto3" json:"sunlight,omitempty"` PlantingMaterial string `protobuf:"bytes,8,opt,name=plantingMaterial,proto3" json:"plantingMaterial,omitempty"` + ImgIds []string `protobuf:"bytes,9,rep,name=imgIds,proto3" json:"imgIds,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UpdatePlantReq) Reset() { *x = UpdatePlantReq{} - mi := &file_pb_plant_proto_msgTypes[10] + mi := &file_pb_plant_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -771,7 +742,7 @@ func (x *UpdatePlantReq) String() string { func (*UpdatePlantReq) ProtoMessage() {} func (x *UpdatePlantReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[10] + mi := &file_pb_plant_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -784,7 +755,7 @@ func (x *UpdatePlantReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdatePlantReq.ProtoReflect.Descriptor instead. func (*UpdatePlantReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{10} + return file_pb_plant_proto_rawDescGZIP(), []int{9} } func (x *UpdatePlantReq) GetId() string { @@ -843,123 +814,14 @@ func (x *UpdatePlantReq) GetPlantingMaterial() string { return "" } -type UpdatePlantResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdatePlantResp) Reset() { - *x = UpdatePlantResp{} - mi := &file_pb_plant_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdatePlantResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdatePlantResp) ProtoMessage() {} - -func (x *UpdatePlantResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[11] +func (x *UpdatePlantReq) GetImgIds() []string { 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 UpdatePlantResp.ProtoReflect.Descriptor instead. -func (*UpdatePlantResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{11} -} - -type DeletePlantReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeletePlantReq) Reset() { - *x = DeletePlantReq{} - mi := &file_pb_plant_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeletePlantReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeletePlantReq) ProtoMessage() {} - -func (x *DeletePlantReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_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 DeletePlantReq.ProtoReflect.Descriptor instead. -func (*DeletePlantReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{12} -} - -func (x *DeletePlantReq) GetIds() []string { - if x != nil { - return x.Ids + return x.ImgIds } return nil } -type DeletePlantResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeletePlantResp) Reset() { - *x = DeletePlantResp{} - mi := &file_pb_plant_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeletePlantResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeletePlantResp) ProtoMessage() {} - -func (x *DeletePlantResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_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 DeletePlantResp.ProtoReflect.Descriptor instead. -func (*DeletePlantResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{13} -} - -type GetPlantListReq struct { +type PlantListReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` Current int32 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` @@ -969,21 +831,21 @@ type GetPlantListReq struct { sizeCache protoimpl.SizeCache } -func (x *GetPlantListReq) Reset() { - *x = GetPlantListReq{} - mi := &file_pb_plant_proto_msgTypes[14] +func (x *PlantListReq) Reset() { + *x = PlantListReq{} + mi := &file_pb_plant_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetPlantListReq) String() string { +func (x *PlantListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetPlantListReq) ProtoMessage() {} +func (*PlantListReq) ProtoMessage() {} -func (x *GetPlantListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[14] +func (x *PlantListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -994,40 +856,40 @@ func (x *GetPlantListReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetPlantListReq.ProtoReflect.Descriptor instead. -func (*GetPlantListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{14} +// Deprecated: Use PlantListReq.ProtoReflect.Descriptor instead. +func (*PlantListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{10} } -func (x *GetPlantListReq) GetUserId() string { +func (x *PlantListReq) GetUserId() string { if x != nil { return x.UserId } return "" } -func (x *GetPlantListReq) GetCurrent() int32 { +func (x *PlantListReq) GetCurrent() int32 { if x != nil { return x.Current } return 0 } -func (x *GetPlantListReq) GetPageSize() int32 { +func (x *PlantListReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -func (x *GetPlantListReq) GetName() string { +func (x *PlantListReq) GetName() string { if x != nil { return x.Name } return "" } -type GetPlantListResp struct { +type PlantListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*PlantInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -1035,21 +897,21 @@ type GetPlantListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetPlantListResp) Reset() { - *x = GetPlantListResp{} - mi := &file_pb_plant_proto_msgTypes[15] +func (x *PlantListResp) Reset() { + *x = PlantListResp{} + mi := &file_pb_plant_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetPlantListResp) String() string { +func (x *PlantListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetPlantListResp) ProtoMessage() {} +func (*PlantListResp) ProtoMessage() {} -func (x *GetPlantListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[15] +func (x *PlantListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1060,91 +922,49 @@ func (x *GetPlantListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetPlantListResp.ProtoReflect.Descriptor instead. -func (*GetPlantListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{15} +// Deprecated: Use PlantListResp.ProtoReflect.Descriptor instead. +func (*PlantListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{11} } -func (x *GetPlantListResp) GetList() []*PlantInfo { +func (x *PlantListResp) GetList() []*PlantInfo { if x != nil { return x.List } return nil } -func (x *GetPlantListResp) GetTotal() int64 { +func (x *PlantListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -type GetPlantDetailReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPlantDetailReq) Reset() { - *x = GetPlantDetailReq{} - mi := &file_pb_plant_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPlantDetailReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPlantDetailReq) ProtoMessage() {} - -func (x *GetPlantDetailReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_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 GetPlantDetailReq.ProtoReflect.Descriptor instead. -func (*GetPlantDetailReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{16} -} - -func (x *GetPlantDetailReq) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetPlantDetailResp struct { +type PlantDetailResp struct { state protoimpl.MessageState `protogen:"open.v1"` Plant *PlantInfo `protobuf:"bytes,1,opt,name=plant,proto3" json:"plant,omitempty"` + CarePlans []*CarePlanInfo `protobuf:"bytes,2,rep,name=carePlans,proto3" json:"carePlans,omitempty"` + GrowthRecords []*GrowthRecordInfo `protobuf:"bytes,3,rep,name=growthRecords,proto3" json:"growthRecords,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetPlantDetailResp) Reset() { - *x = GetPlantDetailResp{} - mi := &file_pb_plant_proto_msgTypes[17] +func (x *PlantDetailResp) Reset() { + *x = PlantDetailResp{} + mi := &file_pb_plant_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetPlantDetailResp) String() string { +func (x *PlantDetailResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetPlantDetailResp) ProtoMessage() {} +func (*PlantDetailResp) ProtoMessage() {} -func (x *GetPlantDetailResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[17] +func (x *PlantDetailResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1155,35 +975,47 @@ func (x *GetPlantDetailResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetPlantDetailResp.ProtoReflect.Descriptor instead. -func (*GetPlantDetailResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{17} +// Deprecated: Use PlantDetailResp.ProtoReflect.Descriptor instead. +func (*PlantDetailResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{12} } -func (x *GetPlantDetailResp) GetPlant() *PlantInfo { +func (x *PlantDetailResp) GetPlant() *PlantInfo { if x != nil { return x.Plant } return nil } -// ========== 养护 ========== +func (x *PlantDetailResp) GetCarePlans() []*CarePlanInfo { + if x != nil { + return x.CarePlans + } + return nil +} + +func (x *PlantDetailResp) GetGrowthRecords() []*GrowthRecordInfo { + if x != nil { + return x.GrowthRecords + } + return nil +} + type CarePlanInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` - PlantId string `protobuf:"bytes,3,opt,name=plantId,proto3" json:"plantId,omitempty"` - Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` - Icon string `protobuf:"bytes,5,opt,name=icon,proto3" json:"icon,omitempty"` - TargetAction string `protobuf:"bytes,6,opt,name=targetAction,proto3" json:"targetAction,omitempty"` - Period int32 `protobuf:"varint,7,opt,name=period,proto3" json:"period,omitempty"` + PlantId string `protobuf:"bytes,2,opt,name=plantId,proto3" json:"plantId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"` + TargetAction string `protobuf:"bytes,5,opt,name=targetAction,proto3" json:"targetAction,omitempty"` + Period int32 `protobuf:"varint,6,opt,name=period,proto3" json:"period,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *CarePlanInfo) Reset() { *x = CarePlanInfo{} - mi := &file_pb_plant_proto_msgTypes[18] + mi := &file_pb_plant_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1195,7 +1027,7 @@ func (x *CarePlanInfo) String() string { func (*CarePlanInfo) ProtoMessage() {} func (x *CarePlanInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[18] + mi := &file_pb_plant_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1208,7 +1040,7 @@ func (x *CarePlanInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use CarePlanInfo.ProtoReflect.Descriptor instead. func (*CarePlanInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{18} + return file_pb_plant_proto_rawDescGZIP(), []int{13} } func (x *CarePlanInfo) GetId() string { @@ -1218,13 +1050,6 @@ func (x *CarePlanInfo) GetId() string { return "" } -func (x *CarePlanInfo) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - func (x *CarePlanInfo) GetPlantId() string { if x != nil { return x.PlantId @@ -1274,7 +1099,7 @@ type AddCarePlanReq struct { func (x *AddCarePlanReq) Reset() { *x = AddCarePlanReq{} - mi := &file_pb_plant_proto_msgTypes[19] + mi := &file_pb_plant_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1286,7 +1111,7 @@ func (x *AddCarePlanReq) String() string { func (*AddCarePlanReq) ProtoMessage() {} func (x *AddCarePlanReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[19] + mi := &file_pb_plant_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1299,7 +1124,7 @@ func (x *AddCarePlanReq) ProtoReflect() protoreflect.Message { // Deprecated: Use AddCarePlanReq.ProtoReflect.Descriptor instead. func (*AddCarePlanReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{19} + return file_pb_plant_proto_rawDescGZIP(), []int{14} } func (x *AddCarePlanReq) GetUserId() string { @@ -1344,50 +1169,6 @@ func (x *AddCarePlanReq) GetPeriod() int32 { return 0 } -type AddCarePlanResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddCarePlanResp) Reset() { - *x = AddCarePlanResp{} - mi := &file_pb_plant_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddCarePlanResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddCarePlanResp) ProtoMessage() {} - -func (x *AddCarePlanResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[20] - 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 AddCarePlanResp.ProtoReflect.Descriptor instead. -func (*AddCarePlanResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{20} -} - -func (x *AddCarePlanResp) GetId() string { - if x != nil { - return x.Id - } - return "" -} - type AddCareRecordReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -1401,7 +1182,7 @@ type AddCareRecordReq struct { func (x *AddCareRecordReq) Reset() { *x = AddCareRecordReq{} - mi := &file_pb_plant_proto_msgTypes[21] + mi := &file_pb_plant_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1413,7 +1194,7 @@ func (x *AddCareRecordReq) String() string { func (*AddCareRecordReq) ProtoMessage() {} func (x *AddCareRecordReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[21] + mi := &file_pb_plant_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1426,7 +1207,7 @@ func (x *AddCareRecordReq) ProtoReflect() protoreflect.Message { // Deprecated: Use AddCareRecordReq.ProtoReflect.Descriptor instead. func (*AddCareRecordReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{21} + return file_pb_plant_proto_rawDescGZIP(), []int{15} } func (x *AddCareRecordReq) GetUserId() string { @@ -1464,27 +1245,31 @@ func (x *AddCareRecordReq) GetNote() string { return "" } -type AddCareRecordResp struct { +type GrowthRecordInfo struct { state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + PlantId string `protobuf:"bytes,2,opt,name=plantId,proto3" json:"plantId,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + CreatedAt int64 `protobuf:"varint,4,opt,name=createdAt,proto3" json:"createdAt,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *AddCareRecordResp) Reset() { - *x = AddCareRecordResp{} - mi := &file_pb_plant_proto_msgTypes[22] +func (x *GrowthRecordInfo) Reset() { + *x = GrowthRecordInfo{} + mi := &file_pb_plant_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *AddCareRecordResp) String() string { +func (x *GrowthRecordInfo) String() string { return protoimpl.X.MessageStringOf(x) } -func (*AddCareRecordResp) ProtoMessage() {} +func (*GrowthRecordInfo) ProtoMessage() {} -func (x *AddCareRecordResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[22] +func (x *GrowthRecordInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1495,9 +1280,37 @@ func (x *AddCareRecordResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use AddCareRecordResp.ProtoReflect.Descriptor instead. -func (*AddCareRecordResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{22} +// Deprecated: Use GrowthRecordInfo.ProtoReflect.Descriptor instead. +func (*GrowthRecordInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{16} +} + +func (x *GrowthRecordInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *GrowthRecordInfo) GetPlantId() string { + if x != nil { + return x.PlantId + } + return "" +} + +func (x *GrowthRecordInfo) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *GrowthRecordInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 } type AddGrowthRecordReq struct { @@ -1512,7 +1325,7 @@ type AddGrowthRecordReq struct { func (x *AddGrowthRecordReq) Reset() { *x = AddGrowthRecordReq{} - mi := &file_pb_plant_proto_msgTypes[23] + mi := &file_pb_plant_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1524,7 +1337,7 @@ func (x *AddGrowthRecordReq) String() string { func (*AddGrowthRecordReq) ProtoMessage() {} func (x *AddGrowthRecordReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[23] + mi := &file_pb_plant_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1537,7 +1350,7 @@ func (x *AddGrowthRecordReq) ProtoReflect() protoreflect.Message { // Deprecated: Use AddGrowthRecordReq.ProtoReflect.Descriptor instead. func (*AddGrowthRecordReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{23} + return file_pb_plant_proto_rawDescGZIP(), []int{17} } func (x *AddGrowthRecordReq) GetUserId() string { @@ -1568,60 +1381,26 @@ func (x *AddGrowthRecordReq) GetImgIds() []string { return nil } -type AddGrowthRecordResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *AddGrowthRecordResp) Reset() { - *x = AddGrowthRecordResp{} - mi := &file_pb_plant_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *AddGrowthRecordResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddGrowthRecordResp) ProtoMessage() {} - -func (x *AddGrowthRecordResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[24] - 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 AddGrowthRecordResp.ProtoReflect.Descriptor instead. -func (*AddGrowthRecordResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{24} -} - -// ========== 百科 ========== type WikiInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - LatinName string `protobuf:"bytes,3,opt,name=latinName,proto3" json:"latinName,omitempty"` - Aliases string `protobuf:"bytes,4,opt,name=aliases,proto3" json:"aliases,omitempty"` - Genus string `protobuf:"bytes,5,opt,name=genus,proto3" json:"genus,omitempty"` - Difficulty int32 `protobuf:"varint,6,opt,name=difficulty,proto3" json:"difficulty,omitempty"` - IsHot int32 `protobuf:"varint,7,opt,name=isHot,proto3" json:"isHot,omitempty"` - CreatedAt int64 `protobuf:"varint,8,opt,name=createdAt,proto3" json:"createdAt,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + LatinName string `protobuf:"bytes,3,opt,name=latinName,proto3" json:"latinName,omitempty"` + Aliases string `protobuf:"bytes,4,opt,name=aliases,proto3" json:"aliases,omitempty"` + Genus string `protobuf:"bytes,5,opt,name=genus,proto3" json:"genus,omitempty"` + Difficulty int32 `protobuf:"varint,6,opt,name=difficulty,proto3" json:"difficulty,omitempty"` + IsHot int32 `protobuf:"varint,7,opt,name=isHot,proto3" json:"isHot,omitempty"` + GrowthHabit string `protobuf:"bytes,8,opt,name=growthHabit,proto3" json:"growthHabit,omitempty"` + LightIntensity string `protobuf:"bytes,9,opt,name=lightIntensity,proto3" json:"lightIntensity,omitempty"` + OptimalTempPeriod string `protobuf:"bytes,10,opt,name=optimalTempPeriod,proto3" json:"optimalTempPeriod,omitempty"` + CreatedAt int64 `protobuf:"varint,11,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *WikiInfo) Reset() { *x = WikiInfo{} - mi := &file_pb_plant_proto_msgTypes[25] + mi := &file_pb_plant_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1633,7 +1412,7 @@ func (x *WikiInfo) String() string { func (*WikiInfo) ProtoMessage() {} func (x *WikiInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[25] + mi := &file_pb_plant_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1646,7 +1425,7 @@ func (x *WikiInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use WikiInfo.ProtoReflect.Descriptor instead. func (*WikiInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{25} + return file_pb_plant_proto_rawDescGZIP(), []int{18} } func (x *WikiInfo) GetId() string { @@ -1698,6 +1477,27 @@ func (x *WikiInfo) GetIsHot() int32 { return 0 } +func (x *WikiInfo) GetGrowthHabit() string { + if x != nil { + return x.GrowthHabit + } + return "" +} + +func (x *WikiInfo) GetLightIntensity() string { + if x != nil { + return x.LightIntensity + } + return "" +} + +func (x *WikiInfo) GetOptimalTempPeriod() string { + if x != nil { + return x.OptimalTempPeriod + } + return "" +} + func (x *WikiInfo) GetCreatedAt() int64 { if x != nil { return x.CreatedAt @@ -1705,7 +1505,7 @@ func (x *WikiInfo) GetCreatedAt() int64 { return 0 } -type GetWikiListReq struct { +type WikiListReq struct { state protoimpl.MessageState `protogen:"open.v1"` Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` @@ -1716,21 +1516,21 @@ type GetWikiListReq struct { sizeCache protoimpl.SizeCache } -func (x *GetWikiListReq) Reset() { - *x = GetWikiListReq{} - mi := &file_pb_plant_proto_msgTypes[26] +func (x *WikiListReq) Reset() { + *x = WikiListReq{} + mi := &file_pb_plant_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetWikiListReq) String() string { +func (x *WikiListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetWikiListReq) ProtoMessage() {} +func (*WikiListReq) ProtoMessage() {} -func (x *GetWikiListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[26] +func (x *WikiListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1741,47 +1541,47 @@ func (x *GetWikiListReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetWikiListReq.ProtoReflect.Descriptor instead. -func (*GetWikiListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{26} +// Deprecated: Use WikiListReq.ProtoReflect.Descriptor instead. +func (*WikiListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{19} } -func (x *GetWikiListReq) GetCurrent() int32 { +func (x *WikiListReq) GetCurrent() int32 { if x != nil { return x.Current } return 0 } -func (x *GetWikiListReq) GetPageSize() int32 { +func (x *WikiListReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -func (x *GetWikiListReq) GetName() string { +func (x *WikiListReq) GetName() string { if x != nil { return x.Name } return "" } -func (x *GetWikiListReq) GetClassId() string { +func (x *WikiListReq) GetClassId() string { if x != nil { return x.ClassId } return "" } -func (x *GetWikiListReq) GetIsHot() int32 { +func (x *WikiListReq) GetIsHot() int32 { if x != nil { return x.IsHot } return 0 } -type GetWikiListResp struct { +type WikiListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*WikiInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -1789,21 +1589,21 @@ type GetWikiListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetWikiListResp) Reset() { - *x = GetWikiListResp{} - mi := &file_pb_plant_proto_msgTypes[27] +func (x *WikiListResp) Reset() { + *x = WikiListResp{} + mi := &file_pb_plant_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetWikiListResp) String() string { +func (x *WikiListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetWikiListResp) ProtoMessage() {} +func (*WikiListResp) ProtoMessage() {} -func (x *GetWikiListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[27] +func (x *WikiListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1814,91 +1614,47 @@ func (x *GetWikiListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetWikiListResp.ProtoReflect.Descriptor instead. -func (*GetWikiListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{27} +// Deprecated: Use WikiListResp.ProtoReflect.Descriptor instead. +func (*WikiListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{20} } -func (x *GetWikiListResp) GetList() []*WikiInfo { +func (x *WikiListResp) GetList() []*WikiInfo { if x != nil { return x.List } return nil } -func (x *GetWikiListResp) GetTotal() int64 { +func (x *WikiListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -type GetWikiDetailReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetWikiDetailReq) Reset() { - *x = GetWikiDetailReq{} - mi := &file_pb_plant_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetWikiDetailReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetWikiDetailReq) ProtoMessage() {} - -func (x *GetWikiDetailReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[28] - 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 GetWikiDetailReq.ProtoReflect.Descriptor instead. -func (*GetWikiDetailReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{28} -} - -func (x *GetWikiDetailReq) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetWikiDetailResp struct { +type WikiDetailResp struct { state protoimpl.MessageState `protogen:"open.v1"` Wiki *WikiInfo `protobuf:"bytes,1,opt,name=wiki,proto3" json:"wiki,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetWikiDetailResp) Reset() { - *x = GetWikiDetailResp{} - mi := &file_pb_plant_proto_msgTypes[29] +func (x *WikiDetailResp) Reset() { + *x = WikiDetailResp{} + mi := &file_pb_plant_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetWikiDetailResp) String() string { +func (x *WikiDetailResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetWikiDetailResp) ProtoMessage() {} +func (*WikiDetailResp) ProtoMessage() {} -func (x *GetWikiDetailResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[29] +func (x *WikiDetailResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1909,12 +1665,12 @@ func (x *GetWikiDetailResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetWikiDetailResp.ProtoReflect.Descriptor instead. -func (*GetWikiDetailResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{29} +// Deprecated: Use WikiDetailResp.ProtoReflect.Descriptor instead. +func (*WikiDetailResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{21} } -func (x *GetWikiDetailResp) GetWiki() *WikiInfo { +func (x *WikiDetailResp) GetWiki() *WikiInfo { if x != nil { return x.Wiki } @@ -1932,7 +1688,7 @@ type WikiClassInfo struct { func (x *WikiClassInfo) Reset() { *x = WikiClassInfo{} - mi := &file_pb_plant_proto_msgTypes[30] + mi := &file_pb_plant_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1944,7 +1700,7 @@ func (x *WikiClassInfo) String() string { func (*WikiClassInfo) ProtoMessage() {} func (x *WikiClassInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[30] + mi := &file_pb_plant_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1957,7 +1713,7 @@ func (x *WikiClassInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use WikiClassInfo.ProtoReflect.Descriptor instead. func (*WikiClassInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{30} + return file_pb_plant_proto_rawDescGZIP(), []int{22} } func (x *WikiClassInfo) GetId() string { @@ -1981,28 +1737,28 @@ func (x *WikiClassInfo) GetOssId() string { return "" } -type GetWikiClassListResp struct { +type WikiClassListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*WikiClassInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetWikiClassListResp) Reset() { - *x = GetWikiClassListResp{} - mi := &file_pb_plant_proto_msgTypes[31] +func (x *WikiClassListResp) Reset() { + *x = WikiClassListResp{} + mi := &file_pb_plant_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetWikiClassListResp) String() string { +func (x *WikiClassListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetWikiClassListResp) ProtoMessage() {} +func (*WikiClassListResp) ProtoMessage() {} -func (x *GetWikiClassListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[31] +func (x *WikiClassListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2013,12 +1769,12 @@ func (x *GetWikiClassListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetWikiClassListResp.ProtoReflect.Descriptor instead. -func (*GetWikiClassListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{31} +// Deprecated: Use WikiClassListResp.ProtoReflect.Descriptor instead. +func (*WikiClassListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{23} } -func (x *GetWikiClassListResp) GetList() []*WikiClassInfo { +func (x *WikiClassListResp) GetList() []*WikiClassInfo { if x != nil { return x.List } @@ -2028,14 +1784,14 @@ func (x *GetWikiClassListResp) GetList() []*WikiClassInfo { type CreateWikiClassReq struct { state protoimpl.MessageState `protogen:"open.v1"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - OssId string `protobuf:"bytes,2,opt,name=ossId,proto3" json:"ossId,omitempty"` + Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *CreateWikiClassReq) Reset() { *x = CreateWikiClassReq{} - mi := &file_pb_plant_proto_msgTypes[32] + mi := &file_pb_plant_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2047,7 +1803,7 @@ func (x *CreateWikiClassReq) String() string { func (*CreateWikiClassReq) ProtoMessage() {} func (x *CreateWikiClassReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[32] + mi := &file_pb_plant_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2060,7 +1816,7 @@ func (x *CreateWikiClassReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateWikiClassReq.ProtoReflect.Descriptor instead. func (*CreateWikiClassReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{32} + return file_pb_plant_proto_rawDescGZIP(), []int{24} } func (x *CreateWikiClassReq) GetName() string { @@ -2070,53 +1826,9 @@ func (x *CreateWikiClassReq) GetName() string { return "" } -func (x *CreateWikiClassReq) GetOssId() string { +func (x *CreateWikiClassReq) GetIcon() string { if x != nil { - return x.OssId - } - return "" -} - -type CreateWikiClassResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateWikiClassResp) Reset() { - *x = CreateWikiClassResp{} - mi := &file_pb_plant_proto_msgTypes[33] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateWikiClassResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateWikiClassResp) ProtoMessage() {} - -func (x *CreateWikiClassResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[33] - 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 CreateWikiClassResp.ProtoReflect.Descriptor instead. -func (*CreateWikiClassResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{33} -} - -func (x *CreateWikiClassResp) GetId() string { - if x != nil { - return x.Id + return x.Icon } return "" } @@ -2132,7 +1844,7 @@ type ToggleStarReq struct { func (x *ToggleStarReq) Reset() { *x = ToggleStarReq{} - mi := &file_pb_plant_proto_msgTypes[34] + mi := &file_pb_plant_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2144,7 +1856,7 @@ func (x *ToggleStarReq) String() string { func (*ToggleStarReq) ProtoMessage() {} func (x *ToggleStarReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[34] + mi := &file_pb_plant_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2157,7 +1869,7 @@ func (x *ToggleStarReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ToggleStarReq.ProtoReflect.Descriptor instead. func (*ToggleStarReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{34} + return file_pb_plant_proto_rawDescGZIP(), []int{25} } func (x *ToggleStarReq) GetUserId() string { @@ -2181,51 +1893,6 @@ func (x *ToggleStarReq) GetType() string { return "" } -type ToggleStarResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Starred bool `protobuf:"varint,1,opt,name=starred,proto3" json:"starred,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ToggleStarResp) Reset() { - *x = ToggleStarResp{} - mi := &file_pb_plant_proto_msgTypes[35] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ToggleStarResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ToggleStarResp) ProtoMessage() {} - -func (x *ToggleStarResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[35] - 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 ToggleStarResp.ProtoReflect.Descriptor instead. -func (*ToggleStarResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{35} -} - -func (x *ToggleStarResp) GetStarred() bool { - if x != nil { - return x.Starred - } - return false -} - -// ========== 社区 ========== type PostInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -2244,7 +1911,7 @@ type PostInfo struct { func (x *PostInfo) Reset() { *x = PostInfo{} - mi := &file_pb_plant_proto_msgTypes[36] + mi := &file_pb_plant_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2256,7 +1923,7 @@ func (x *PostInfo) String() string { func (*PostInfo) ProtoMessage() {} func (x *PostInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[36] + mi := &file_pb_plant_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2269,7 +1936,7 @@ func (x *PostInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use PostInfo.ProtoReflect.Descriptor instead. func (*PostInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{36} + return file_pb_plant_proto_rawDescGZIP(), []int{26} } func (x *PostInfo) GetId() string { @@ -2356,7 +2023,7 @@ type CreatePostReq struct { func (x *CreatePostReq) Reset() { *x = CreatePostReq{} - mi := &file_pb_plant_proto_msgTypes[37] + mi := &file_pb_plant_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2368,7 +2035,7 @@ func (x *CreatePostReq) String() string { func (*CreatePostReq) ProtoMessage() {} func (x *CreatePostReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[37] + mi := &file_pb_plant_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2381,7 +2048,7 @@ func (x *CreatePostReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePostReq.ProtoReflect.Descriptor instead. func (*CreatePostReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{37} + return file_pb_plant_proto_rawDescGZIP(), []int{27} } func (x *CreatePostReq) GetUserId() string { @@ -2426,75 +2093,32 @@ func (x *CreatePostReq) GetTopicId() string { return "" } -type CreatePostResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreatePostResp) Reset() { - *x = CreatePostResp{} - mi := &file_pb_plant_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreatePostResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreatePostResp) ProtoMessage() {} - -func (x *CreatePostResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[38] - 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 CreatePostResp.ProtoReflect.Descriptor instead. -func (*CreatePostResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{38} -} - -func (x *CreatePostResp) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetPostListReq struct { +type PostListReq struct { state protoimpl.MessageState `protogen:"open.v1"` Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` Keyword string `protobuf:"bytes,3,opt,name=keyword,proto3" json:"keyword,omitempty"` TopicId string `protobuf:"bytes,4,opt,name=topicId,proto3" json:"topicId,omitempty"` + UserId string `protobuf:"bytes,5,opt,name=userId,proto3" json:"userId,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetPostListReq) Reset() { - *x = GetPostListReq{} - mi := &file_pb_plant_proto_msgTypes[39] +func (x *PostListReq) Reset() { + *x = PostListReq{} + mi := &file_pb_plant_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetPostListReq) String() string { +func (x *PostListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetPostListReq) ProtoMessage() {} +func (*PostListReq) ProtoMessage() {} -func (x *GetPostListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[39] +func (x *PostListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2505,40 +2129,47 @@ func (x *GetPostListReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetPostListReq.ProtoReflect.Descriptor instead. -func (*GetPostListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{39} +// Deprecated: Use PostListReq.ProtoReflect.Descriptor instead. +func (*PostListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{28} } -func (x *GetPostListReq) GetCurrent() int32 { +func (x *PostListReq) GetCurrent() int32 { if x != nil { return x.Current } return 0 } -func (x *GetPostListReq) GetPageSize() int32 { +func (x *PostListReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -func (x *GetPostListReq) GetKeyword() string { +func (x *PostListReq) GetKeyword() string { if x != nil { return x.Keyword } return "" } -func (x *GetPostListReq) GetTopicId() string { +func (x *PostListReq) GetTopicId() string { if x != nil { return x.TopicId } return "" } -type GetPostListResp struct { +func (x *PostListReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +type PostListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*PostInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -2546,21 +2177,21 @@ type GetPostListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetPostListResp) Reset() { - *x = GetPostListResp{} - mi := &file_pb_plant_proto_msgTypes[40] +func (x *PostListResp) Reset() { + *x = PostListResp{} + mi := &file_pb_plant_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetPostListResp) String() string { +func (x *PostListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetPostListResp) ProtoMessage() {} +func (*PostListResp) ProtoMessage() {} -func (x *GetPostListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[40] +func (x *PostListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2571,91 +2202,48 @@ func (x *GetPostListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetPostListResp.ProtoReflect.Descriptor instead. -func (*GetPostListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{40} +// Deprecated: Use PostListResp.ProtoReflect.Descriptor instead. +func (*PostListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{29} } -func (x *GetPostListResp) GetList() []*PostInfo { +func (x *PostListResp) GetList() []*PostInfo { if x != nil { return x.List } return nil } -func (x *GetPostListResp) GetTotal() int64 { +func (x *PostListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -type GetPostDetailReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetPostDetailReq) Reset() { - *x = GetPostDetailReq{} - mi := &file_pb_plant_proto_msgTypes[41] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetPostDetailReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetPostDetailReq) ProtoMessage() {} - -func (x *GetPostDetailReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[41] - 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 GetPostDetailReq.ProtoReflect.Descriptor instead. -func (*GetPostDetailReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{41} -} - -func (x *GetPostDetailReq) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetPostDetailResp struct { +type PostDetailResp struct { state protoimpl.MessageState `protogen:"open.v1"` Post *PostInfo `protobuf:"bytes,1,opt,name=post,proto3" json:"post,omitempty"` + Comments []*PostCommentInfo `protobuf:"bytes,2,rep,name=comments,proto3" json:"comments,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetPostDetailResp) Reset() { - *x = GetPostDetailResp{} - mi := &file_pb_plant_proto_msgTypes[42] +func (x *PostDetailResp) Reset() { + *x = PostDetailResp{} + mi := &file_pb_plant_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetPostDetailResp) String() string { +func (x *PostDetailResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetPostDetailResp) ProtoMessage() {} +func (*PostDetailResp) ProtoMessage() {} -func (x *GetPostDetailResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[42] +func (x *PostDetailResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2666,83 +2254,51 @@ func (x *GetPostDetailResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetPostDetailResp.ProtoReflect.Descriptor instead. -func (*GetPostDetailResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{42} +// Deprecated: Use PostDetailResp.ProtoReflect.Descriptor instead. +func (*PostDetailResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{30} } -func (x *GetPostDetailResp) GetPost() *PostInfo { +func (x *PostDetailResp) GetPost() *PostInfo { if x != nil { return x.Post } return nil } -type DeletePostReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeletePostReq) Reset() { - *x = DeletePostReq{} - mi := &file_pb_plant_proto_msgTypes[43] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeletePostReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeletePostReq) ProtoMessage() {} - -func (x *DeletePostReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[43] +func (x *PostDetailResp) GetComments() []*PostCommentInfo { 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 DeletePostReq.ProtoReflect.Descriptor instead. -func (*DeletePostReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{43} -} - -func (x *DeletePostReq) GetIds() []string { - if x != nil { - return x.Ids + return x.Comments } return nil } -type DeletePostResp struct { +type PostCommentInfo struct { state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content,proto3" json:"content,omitempty"` + ParentId string `protobuf:"bytes,4,opt,name=parentId,proto3" json:"parentId,omitempty"` + CreatedAt int64 `protobuf:"varint,5,opt,name=createdAt,proto3" json:"createdAt,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *DeletePostResp) Reset() { - *x = DeletePostResp{} - mi := &file_pb_plant_proto_msgTypes[44] +func (x *PostCommentInfo) Reset() { + *x = PostCommentInfo{} + mi := &file_pb_plant_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *DeletePostResp) String() string { +func (x *PostCommentInfo) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeletePostResp) ProtoMessage() {} +func (*PostCommentInfo) ProtoMessage() {} -func (x *DeletePostResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[44] +func (x *PostCommentInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2753,9 +2309,44 @@ func (x *DeletePostResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeletePostResp.ProtoReflect.Descriptor instead. -func (*DeletePostResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{44} +// Deprecated: Use PostCommentInfo.ProtoReflect.Descriptor instead. +func (*PostCommentInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{31} +} + +func (x *PostCommentInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *PostCommentInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *PostCommentInfo) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *PostCommentInfo) GetParentId() string { + if x != nil { + return x.ParentId + } + return "" +} + +func (x *PostCommentInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 } type CommentPostReq struct { @@ -2770,7 +2361,7 @@ type CommentPostReq struct { func (x *CommentPostReq) Reset() { *x = CommentPostReq{} - mi := &file_pb_plant_proto_msgTypes[45] + mi := &file_pb_plant_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2782,7 +2373,7 @@ func (x *CommentPostReq) String() string { func (*CommentPostReq) ProtoMessage() {} func (x *CommentPostReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[45] + mi := &file_pb_plant_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2795,7 +2386,7 @@ func (x *CommentPostReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentPostReq.ProtoReflect.Descriptor instead. func (*CommentPostReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{45} + return file_pb_plant_proto_rawDescGZIP(), []int{32} } func (x *CommentPostReq) GetUserId() string { @@ -2826,42 +2417,6 @@ func (x *CommentPostReq) GetParentId() string { return "" } -type CommentPostResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CommentPostResp) Reset() { - *x = CommentPostResp{} - mi := &file_pb_plant_proto_msgTypes[46] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CommentPostResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommentPostResp) ProtoMessage() {} - -func (x *CommentPostResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[46] - 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 CommentPostResp.ProtoReflect.Descriptor instead. -func (*CommentPostResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{46} -} - type LikePostReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -2872,7 +2427,7 @@ type LikePostReq struct { func (x *LikePostReq) Reset() { *x = LikePostReq{} - mi := &file_pb_plant_proto_msgTypes[47] + mi := &file_pb_plant_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2884,7 +2439,7 @@ func (x *LikePostReq) String() string { func (*LikePostReq) ProtoMessage() {} func (x *LikePostReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[47] + mi := &file_pb_plant_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2897,7 +2452,7 @@ func (x *LikePostReq) ProtoReflect() protoreflect.Message { // Deprecated: Use LikePostReq.ProtoReflect.Descriptor instead. func (*LikePostReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{47} + return file_pb_plant_proto_rawDescGZIP(), []int{33} } func (x *LikePostReq) GetUserId() string { @@ -2914,51 +2469,6 @@ func (x *LikePostReq) GetPostId() string { return "" } -type LikePostResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Liked bool `protobuf:"varint,1,opt,name=liked,proto3" json:"liked,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LikePostResp) Reset() { - *x = LikePostResp{} - mi := &file_pb_plant_proto_msgTypes[48] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LikePostResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LikePostResp) ProtoMessage() {} - -func (x *LikePostResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[48] - 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 LikePostResp.ProtoReflect.Descriptor instead. -func (*LikePostResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{48} -} - -func (x *LikePostResp) GetLiked() bool { - if x != nil { - return x.Liked - } - return false -} - -// ========== 话题 ========== type TopicInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -2970,7 +2480,7 @@ type TopicInfo struct { func (x *TopicInfo) Reset() { *x = TopicInfo{} - mi := &file_pb_plant_proto_msgTypes[49] + mi := &file_pb_plant_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2982,7 +2492,7 @@ func (x *TopicInfo) String() string { func (*TopicInfo) ProtoMessage() {} func (x *TopicInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[49] + mi := &file_pb_plant_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2995,7 +2505,7 @@ func (x *TopicInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use TopicInfo.ProtoReflect.Descriptor instead. func (*TopicInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{49} + return file_pb_plant_proto_rawDescGZIP(), []int{34} } func (x *TopicInfo) GetId() string { @@ -3019,28 +2529,28 @@ func (x *TopicInfo) GetPostCount() int32 { return 0 } -type GetTopicListResp struct { +type TopicListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*TopicInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetTopicListResp) Reset() { - *x = GetTopicListResp{} - mi := &file_pb_plant_proto_msgTypes[50] +func (x *TopicListResp) Reset() { + *x = TopicListResp{} + mi := &file_pb_plant_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetTopicListResp) String() string { +func (x *TopicListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetTopicListResp) ProtoMessage() {} +func (*TopicListResp) ProtoMessage() {} -func (x *GetTopicListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[50] +func (x *TopicListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3051,12 +2561,12 @@ func (x *GetTopicListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetTopicListResp.ProtoReflect.Descriptor instead. -func (*GetTopicListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{50} +// Deprecated: Use TopicListResp.ProtoReflect.Descriptor instead. +func (*TopicListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{35} } -func (x *GetTopicListResp) GetList() []*TopicInfo { +func (x *TopicListResp) GetList() []*TopicInfo { if x != nil { return x.List } @@ -3066,13 +2576,15 @@ func (x *GetTopicListResp) GetList() []*TopicInfo { type CreateTopicReq struct { state protoimpl.MessageState `protogen:"open.v1"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *CreateTopicReq) Reset() { *x = CreateTopicReq{} - mi := &file_pb_plant_proto_msgTypes[51] + mi := &file_pb_plant_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3084,7 +2596,7 @@ func (x *CreateTopicReq) String() string { func (*CreateTopicReq) ProtoMessage() {} func (x *CreateTopicReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[51] + mi := &file_pb_plant_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3097,7 +2609,7 @@ func (x *CreateTopicReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateTopicReq.ProtoReflect.Descriptor instead. func (*CreateTopicReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{51} + return file_pb_plant_proto_rawDescGZIP(), []int{36} } func (x *CreateTopicReq) GetName() string { @@ -3107,28 +2619,47 @@ func (x *CreateTopicReq) GetName() string { return "" } -type CreateTopicResp struct { +func (x *CreateTopicReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *CreateTopicReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type ExchangeItemInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` + ImgId string `protobuf:"bytes,4,opt,name=imgId,proto3" json:"imgId,omitempty"` + Cost int64 `protobuf:"varint,5,opt,name=cost,proto3" json:"cost,omitempty"` + Stock int32 `protobuf:"varint,6,opt,name=stock,proto3" json:"stock,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *CreateTopicResp) Reset() { - *x = CreateTopicResp{} - mi := &file_pb_plant_proto_msgTypes[52] +func (x *ExchangeItemInfo) Reset() { + *x = ExchangeItemInfo{} + mi := &file_pb_plant_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *CreateTopicResp) String() string { +func (x *ExchangeItemInfo) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateTopicResp) ProtoMessage() {} +func (*ExchangeItemInfo) ProtoMessage() {} -func (x *CreateTopicResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[52] +func (x *ExchangeItemInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3139,40 +2670,76 @@ func (x *CreateTopicResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateTopicResp.ProtoReflect.Descriptor instead. -func (*CreateTopicResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{52} +// Deprecated: Use ExchangeItemInfo.ProtoReflect.Descriptor instead. +func (*ExchangeItemInfo) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{37} } -func (x *CreateTopicResp) GetId() string { +func (x *ExchangeItemInfo) GetId() string { if x != nil { return x.Id } return "" } -type DeleteTopicReq struct { +func (x *ExchangeItemInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ExchangeItemInfo) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +func (x *ExchangeItemInfo) GetImgId() string { + if x != nil { + return x.ImgId + } + return "" +} + +func (x *ExchangeItemInfo) GetCost() int64 { + if x != nil { + return x.Cost + } + return 0 +} + +func (x *ExchangeItemInfo) GetStock() int32 { + if x != nil { + return x.Stock + } + return 0 +} + +type ExchangeItemListReq struct { state protoimpl.MessageState `protogen:"open.v1"` - Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *DeleteTopicReq) Reset() { - *x = DeleteTopicReq{} - mi := &file_pb_plant_proto_msgTypes[53] +func (x *ExchangeItemListReq) Reset() { + *x = ExchangeItemListReq{} + mi := &file_pb_plant_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *DeleteTopicReq) String() string { +func (x *ExchangeItemListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTopicReq) ProtoMessage() {} +func (*ExchangeItemListReq) ProtoMessage() {} -func (x *DeleteTopicReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[53] +func (x *ExchangeItemListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3183,39 +2750,100 @@ func (x *DeleteTopicReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTopicReq.ProtoReflect.Descriptor instead. -func (*DeleteTopicReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{53} +// Deprecated: Use ExchangeItemListReq.ProtoReflect.Descriptor instead. +func (*ExchangeItemListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{38} } -func (x *DeleteTopicReq) GetIds() []string { +func (x *ExchangeItemListReq) GetCurrent() int32 { if x != nil { - return x.Ids + return x.Current + } + return 0 +} + +func (x *ExchangeItemListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +type ExchangeItemListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ExchangeItemInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ExchangeItemListResp) Reset() { + *x = ExchangeItemListResp{} + mi := &file_pb_plant_proto_msgTypes[39] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ExchangeItemListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeItemListResp) ProtoMessage() {} + +func (x *ExchangeItemListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[39] + 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 ExchangeItemListResp.ProtoReflect.Descriptor instead. +func (*ExchangeItemListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{39} +} + +func (x *ExchangeItemListResp) GetList() []*ExchangeItemInfo { + if x != nil { + return x.List } return nil } -type DeleteTopicResp struct { +func (x *ExchangeItemListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type CreateExchangeOrderReq struct { state protoimpl.MessageState `protogen:"open.v1"` + UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + ItemId string `protobuf:"bytes,2,opt,name=itemId,proto3" json:"itemId,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *DeleteTopicResp) Reset() { - *x = DeleteTopicResp{} - mi := &file_pb_plant_proto_msgTypes[54] +func (x *CreateExchangeOrderReq) Reset() { + *x = CreateExchangeOrderReq{} + mi := &file_pb_plant_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *DeleteTopicResp) String() string { +func (x *CreateExchangeOrderReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*DeleteTopicResp) ProtoMessage() {} +func (*CreateExchangeOrderReq) ProtoMessage() {} -func (x *DeleteTopicResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[54] +func (x *CreateExchangeOrderReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3226,12 +2854,25 @@ func (x *DeleteTopicResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use DeleteTopicResp.ProtoReflect.Descriptor instead. -func (*DeleteTopicResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{54} +// Deprecated: Use CreateExchangeOrderReq.ProtoReflect.Descriptor instead. +func (*CreateExchangeOrderReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{40} +} + +func (x *CreateExchangeOrderReq) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *CreateExchangeOrderReq) GetItemId() string { + if x != nil { + return x.ItemId + } + return "" } -// ========== 配置 ========== type LevelConfigInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -3245,7 +2886,7 @@ type LevelConfigInfo struct { func (x *LevelConfigInfo) Reset() { *x = LevelConfigInfo{} - mi := &file_pb_plant_proto_msgTypes[55] + mi := &file_pb_plant_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3257,7 +2898,7 @@ func (x *LevelConfigInfo) String() string { func (*LevelConfigInfo) ProtoMessage() {} func (x *LevelConfigInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[55] + mi := &file_pb_plant_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3270,7 +2911,7 @@ func (x *LevelConfigInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use LevelConfigInfo.ProtoReflect.Descriptor instead. func (*LevelConfigInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{55} + return file_pb_plant_proto_rawDescGZIP(), []int{41} } func (x *LevelConfigInfo) GetId() string { @@ -3308,81 +2949,28 @@ func (x *LevelConfigInfo) GetPerks() string { return "" } -type GetLevelConfigListReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` - PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetLevelConfigListReq) Reset() { - *x = GetLevelConfigListReq{} - mi := &file_pb_plant_proto_msgTypes[56] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetLevelConfigListReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetLevelConfigListReq) ProtoMessage() {} - -func (x *GetLevelConfigListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[56] - 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 GetLevelConfigListReq.ProtoReflect.Descriptor instead. -func (*GetLevelConfigListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{56} -} - -func (x *GetLevelConfigListReq) GetCurrent() int32 { - if x != nil { - return x.Current - } - return 0 -} - -func (x *GetLevelConfigListReq) GetPageSize() int32 { - if x != nil { - return x.PageSize - } - return 0 -} - -type GetLevelConfigListResp struct { +type LevelConfigListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*LevelConfigInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` - Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetLevelConfigListResp) Reset() { - *x = GetLevelConfigListResp{} - mi := &file_pb_plant_proto_msgTypes[57] +func (x *LevelConfigListResp) Reset() { + *x = LevelConfigListResp{} + mi := &file_pb_plant_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetLevelConfigListResp) String() string { +func (x *LevelConfigListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetLevelConfigListResp) ProtoMessage() {} +func (*LevelConfigListResp) ProtoMessage() {} -func (x *GetLevelConfigListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[57] +func (x *LevelConfigListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3393,25 +2981,18 @@ func (x *GetLevelConfigListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetLevelConfigListResp.ProtoReflect.Descriptor instead. -func (*GetLevelConfigListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{57} +// Deprecated: Use LevelConfigListResp.ProtoReflect.Descriptor instead. +func (*LevelConfigListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{42} } -func (x *GetLevelConfigListResp) GetList() []*LevelConfigInfo { +func (x *LevelConfigListResp) GetList() []*LevelConfigInfo { if x != nil { return x.List } return nil } -func (x *GetLevelConfigListResp) GetTotal() int64 { - if x != nil { - return x.Total - } - return 0 -} - type BadgeConfigInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -3429,7 +3010,7 @@ type BadgeConfigInfo struct { func (x *BadgeConfigInfo) Reset() { *x = BadgeConfigInfo{} - mi := &file_pb_plant_proto_msgTypes[58] + mi := &file_pb_plant_proto_msgTypes[43] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3441,7 +3022,7 @@ func (x *BadgeConfigInfo) String() string { func (*BadgeConfigInfo) ProtoMessage() {} func (x *BadgeConfigInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[58] + mi := &file_pb_plant_proto_msgTypes[43] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3454,7 +3035,7 @@ func (x *BadgeConfigInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BadgeConfigInfo.ProtoReflect.Descriptor instead. func (*BadgeConfigInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{58} + return file_pb_plant_proto_rawDescGZIP(), []int{43} } func (x *BadgeConfigInfo) GetId() string { @@ -3520,7 +3101,7 @@ func (x *BadgeConfigInfo) GetRewardSunlight() int64 { return 0 } -type GetBadgeConfigListReq struct { +type BadgeConfigListReq struct { state protoimpl.MessageState `protogen:"open.v1"` Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` @@ -3529,21 +3110,21 @@ type GetBadgeConfigListReq struct { sizeCache protoimpl.SizeCache } -func (x *GetBadgeConfigListReq) Reset() { - *x = GetBadgeConfigListReq{} - mi := &file_pb_plant_proto_msgTypes[59] +func (x *BadgeConfigListReq) Reset() { + *x = BadgeConfigListReq{} + mi := &file_pb_plant_proto_msgTypes[44] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetBadgeConfigListReq) String() string { +func (x *BadgeConfigListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetBadgeConfigListReq) ProtoMessage() {} +func (*BadgeConfigListReq) ProtoMessage() {} -func (x *GetBadgeConfigListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[59] +func (x *BadgeConfigListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[44] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3554,33 +3135,33 @@ func (x *GetBadgeConfigListReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetBadgeConfigListReq.ProtoReflect.Descriptor instead. -func (*GetBadgeConfigListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{59} +// Deprecated: Use BadgeConfigListReq.ProtoReflect.Descriptor instead. +func (*BadgeConfigListReq) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{44} } -func (x *GetBadgeConfigListReq) GetCurrent() int32 { +func (x *BadgeConfigListReq) GetCurrent() int32 { if x != nil { return x.Current } return 0 } -func (x *GetBadgeConfigListReq) GetPageSize() int32 { +func (x *BadgeConfigListReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -func (x *GetBadgeConfigListReq) GetDimension() string { +func (x *BadgeConfigListReq) GetDimension() string { if x != nil { return x.Dimension } return "" } -type GetBadgeConfigListResp struct { +type BadgeConfigListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*BadgeConfigInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -3588,21 +3169,21 @@ type GetBadgeConfigListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetBadgeConfigListResp) Reset() { - *x = GetBadgeConfigListResp{} - mi := &file_pb_plant_proto_msgTypes[60] +func (x *BadgeConfigListResp) Reset() { + *x = BadgeConfigListResp{} + mi := &file_pb_plant_proto_msgTypes[45] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetBadgeConfigListResp) String() string { +func (x *BadgeConfigListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetBadgeConfigListResp) ProtoMessage() {} +func (*BadgeConfigListResp) ProtoMessage() {} -func (x *GetBadgeConfigListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[60] +func (x *BadgeConfigListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_plant_proto_msgTypes[45] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3613,345 +3194,42 @@ func (x *GetBadgeConfigListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetBadgeConfigListResp.ProtoReflect.Descriptor instead. -func (*GetBadgeConfigListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{60} +// Deprecated: Use BadgeConfigListResp.ProtoReflect.Descriptor instead. +func (*BadgeConfigListResp) Descriptor() ([]byte, []int) { + return file_pb_plant_proto_rawDescGZIP(), []int{45} } -func (x *GetBadgeConfigListResp) GetList() []*BadgeConfigInfo { +func (x *BadgeConfigListResp) GetList() []*BadgeConfigInfo { if x != nil { return x.List } return nil } -func (x *GetBadgeConfigListResp) GetTotal() int64 { +func (x *BadgeConfigListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -// ========== 兑换 ========== -type ExchangeItemInfo struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` - Cost int64 `protobuf:"varint,4,opt,name=cost,proto3" json:"cost,omitempty"` - Stock int32 `protobuf:"varint,5,opt,name=stock,proto3" json:"stock,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExchangeItemInfo) Reset() { - *x = ExchangeItemInfo{} - mi := &file_pb_plant_proto_msgTypes[61] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExchangeItemInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExchangeItemInfo) ProtoMessage() {} - -func (x *ExchangeItemInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[61] - 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 ExchangeItemInfo.ProtoReflect.Descriptor instead. -func (*ExchangeItemInfo) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{61} -} - -func (x *ExchangeItemInfo) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *ExchangeItemInfo) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ExchangeItemInfo) GetDesc() string { - if x != nil { - return x.Desc - } - return "" -} - -func (x *ExchangeItemInfo) GetCost() int64 { - if x != nil { - return x.Cost - } - return 0 -} - -func (x *ExchangeItemInfo) GetStock() int32 { - if x != nil { - return x.Stock - } - return 0 -} - -type GetExchangeItemListReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` - PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetExchangeItemListReq) Reset() { - *x = GetExchangeItemListReq{} - mi := &file_pb_plant_proto_msgTypes[62] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetExchangeItemListReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExchangeItemListReq) ProtoMessage() {} - -func (x *GetExchangeItemListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[62] - 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 GetExchangeItemListReq.ProtoReflect.Descriptor instead. -func (*GetExchangeItemListReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{62} -} - -func (x *GetExchangeItemListReq) GetCurrent() int32 { - if x != nil { - return x.Current - } - return 0 -} - -func (x *GetExchangeItemListReq) GetPageSize() int32 { - if x != nil { - return x.PageSize - } - return 0 -} - -type GetExchangeItemListResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - List []*ExchangeItemInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` - Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetExchangeItemListResp) Reset() { - *x = GetExchangeItemListResp{} - mi := &file_pb_plant_proto_msgTypes[63] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetExchangeItemListResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetExchangeItemListResp) ProtoMessage() {} - -func (x *GetExchangeItemListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[63] - 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 GetExchangeItemListResp.ProtoReflect.Descriptor instead. -func (*GetExchangeItemListResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{63} -} - -func (x *GetExchangeItemListResp) GetList() []*ExchangeItemInfo { - if x != nil { - return x.List - } - return nil -} - -func (x *GetExchangeItemListResp) GetTotal() int64 { - if x != nil { - return x.Total - } - return 0 -} - -type CreateExchangeOrderReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - ItemId string `protobuf:"bytes,2,opt,name=itemId,proto3" json:"itemId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateExchangeOrderReq) Reset() { - *x = CreateExchangeOrderReq{} - mi := &file_pb_plant_proto_msgTypes[64] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateExchangeOrderReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateExchangeOrderReq) ProtoMessage() {} - -func (x *CreateExchangeOrderReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[64] - 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 CreateExchangeOrderReq.ProtoReflect.Descriptor instead. -func (*CreateExchangeOrderReq) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{64} -} - -func (x *CreateExchangeOrderReq) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *CreateExchangeOrderReq) GetItemId() string { - if x != nil { - return x.ItemId - } - return "" -} - -type CreateExchangeOrderResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateExchangeOrderResp) Reset() { - *x = CreateExchangeOrderResp{} - mi := &file_pb_plant_proto_msgTypes[65] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateExchangeOrderResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateExchangeOrderResp) ProtoMessage() {} - -func (x *CreateExchangeOrderResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[65] - 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 CreateExchangeOrderResp.ProtoReflect.Descriptor instead. -func (*CreateExchangeOrderResp) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{65} -} - -func (x *CreateExchangeOrderResp) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -// ========== 通用 ========== -type Empty struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *Empty) Reset() { - *x = Empty{} - mi := &file_pb_plant_proto_msgTypes[66] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *Empty) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Empty) ProtoMessage() {} - -func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_pb_plant_proto_msgTypes[66] - 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 Empty.ProtoReflect.Descriptor instead. -func (*Empty) Descriptor() ([]byte, []int) { - return file_pb_plant_proto_rawDescGZIP(), []int{66} -} - var File_pb_plant_proto protoreflect.FileDescriptor const file_pb_plant_proto_rawDesc = "" + "\n" + - "\x0epb/plant.proto\x12\x05plant\"\xdb\x03\n" + - "\vUserProfile\x12\x0e\n" + + "\x0epb/plant.proto\x12\x05plant\"2\n" + + "\n" + + "CommonResp\x12\x12\n" + + "\x04code\x18\x01 \x01(\x03R\x04code\x12\x10\n" + + "\x03msg\x18\x02 \x01(\tR\x03msg\"\x17\n" + + "\x05IdReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\x1a\n" + + "\x06IdsReq\x12\x10\n" + + "\x03ids\x18\x01 \x03(\tR\x03ids\"?\n" + + "\aPageReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"\xe0\x03\n" + + "\x10PlantUserProfile\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x1a\n" + "\bnickName\x18\x03 \x01(\tR\bnickName\x12\x1a\n" + @@ -3977,21 +3255,13 @@ const file_pb_plant_proto_rawDesc = "" + "pruneCount\x12\x1e\n" + "\n" + "photoCount\x18\x0f \x01(\x03R\n" + - "photoCount\"+\n" + - "\x11GetUserProfileReq\x12\x16\n" + - "\x06userId\x18\x01 \x01(\tR\x06userId\"B\n" + - "\x12GetUserProfileResp\x12,\n" + - "\aprofile\x18\x01 \x01(\v2\x12.plant.UserProfileR\aprofile\"f\n" + - "\x14UpdateUserProfileReq\x12\x16\n" + + "photoCount\"'\n" + + "\rGetProfileReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\"b\n" + + "\x10UpdateProfileReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1a\n" + "\bnickName\x18\x02 \x01(\tR\bnickName\x12\x1a\n" + - "\bavatarId\x18\x03 \x01(\tR\bavatarId\"\x17\n" + - "\x15UpdateUserProfileResp\"X\n" + - "\x12IncrUserCounterReq\x12\x16\n" + - "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x14\n" + - "\x05field\x18\x02 \x01(\tR\x05field\x12\x14\n" + - "\x05delta\x18\x03 \x01(\x03R\x05delta\"\x15\n" + - "\x13IncrUserCounterResp\"\xd5\x02\n" + + "\bavatarId\x18\x03 \x01(\tR\bavatarId\"\xd5\x02\n" + "\tPlantInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x12\n" + @@ -4015,9 +3285,7 @@ const file_pb_plant_proto_rawDesc = "" + "\apotSize\x18\x06 \x01(\tR\apotSize\x12\x1a\n" + "\bsunlight\x18\a \x01(\tR\bsunlight\x12*\n" + "\x10plantingMaterial\x18\b \x01(\tR\x10plantingMaterial\x12\x16\n" + - "\x06imgIds\x18\t \x03(\tR\x06imgIds\"!\n" + - "\x0fCreatePlantResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\xee\x01\n" + + "\x06imgIds\x18\t \x03(\tR\x06imgIds\"\x86\x02\n" + "\x0eUpdatePlantReq\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x16\n" + @@ -4026,53 +3294,50 @@ const file_pb_plant_proto_rawDesc = "" + "\vpotMaterial\x18\x05 \x01(\tR\vpotMaterial\x12\x18\n" + "\apotSize\x18\x06 \x01(\tR\apotSize\x12\x1a\n" + "\bsunlight\x18\a \x01(\tR\bsunlight\x12*\n" + - "\x10plantingMaterial\x18\b \x01(\tR\x10plantingMaterial\"\x11\n" + - "\x0fUpdatePlantResp\"\"\n" + - "\x0eDeletePlantReq\x12\x10\n" + - "\x03ids\x18\x01 \x03(\tR\x03ids\"\x11\n" + - "\x0fDeletePlantResp\"s\n" + - "\x0fGetPlantListReq\x12\x16\n" + + "\x10plantingMaterial\x18\b \x01(\tR\x10plantingMaterial\x12\x16\n" + + "\x06imgIds\x18\t \x03(\tR\x06imgIds\"p\n" + + "\fPlantListReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + "\acurrent\x18\x02 \x01(\x05R\acurrent\x12\x1a\n" + "\bpageSize\x18\x03 \x01(\x05R\bpageSize\x12\x12\n" + - "\x04name\x18\x04 \x01(\tR\x04name\"N\n" + - "\x10GetPlantListResp\x12$\n" + + "\x04name\x18\x04 \x01(\tR\x04name\"K\n" + + "\rPlantListResp\x12$\n" + "\x04list\x18\x01 \x03(\v2\x10.plant.PlantInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"#\n" + - "\x11GetPlantDetailReq\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"<\n" + - "\x12GetPlantDetailResp\x12&\n" + - "\x05plant\x18\x01 \x01(\v2\x10.plant.PlantInfoR\x05plant\"\xb4\x01\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xab\x01\n" + + "\x0fPlantDetailResp\x12&\n" + + "\x05plant\x18\x01 \x01(\v2\x10.plant.PlantInfoR\x05plant\x121\n" + + "\tcarePlans\x18\x02 \x03(\v2\x13.plant.CarePlanInfoR\tcarePlans\x12=\n" + + "\rgrowthRecords\x18\x03 \x03(\v2\x17.plant.GrowthRecordInfoR\rgrowthRecords\"\x9c\x01\n" + "\fCarePlanInfo\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + - "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x18\n" + - "\aplantId\x18\x03 \x01(\tR\aplantId\x12\x12\n" + - "\x04name\x18\x04 \x01(\tR\x04name\x12\x12\n" + - "\x04icon\x18\x05 \x01(\tR\x04icon\x12\"\n" + - "\ftargetAction\x18\x06 \x01(\tR\ftargetAction\x12\x16\n" + - "\x06period\x18\a \x01(\x05R\x06period\"\xa6\x01\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x04 \x01(\tR\x04icon\x12\"\n" + + "\ftargetAction\x18\x05 \x01(\tR\ftargetAction\x12\x16\n" + + "\x06period\x18\x06 \x01(\x05R\x06period\"\xa6\x01\n" + "\x0eAddCarePlanReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x12\n" + "\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" + "\x04icon\x18\x04 \x01(\tR\x04icon\x12\"\n" + "\ftargetAction\x18\x05 \x01(\tR\ftargetAction\x12\x16\n" + - "\x06period\x18\x06 \x01(\x05R\x06period\"!\n" + - "\x0fAddCarePlanResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\x88\x01\n" + + "\x06period\x18\x06 \x01(\x05R\x06period\"\x88\x01\n" + "\x10AddCareRecordReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x16\n" + "\x06planId\x18\x03 \x01(\tR\x06planId\x12\x16\n" + "\x06action\x18\x04 \x01(\tR\x06action\x12\x12\n" + - "\x04note\x18\x05 \x01(\tR\x04note\"\x13\n" + - "\x11AddCareRecordResp\"x\n" + + "\x04note\x18\x05 \x01(\tR\x04note\"t\n" + + "\x10GrowthRecordInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x18\n" + + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x18\n" + + "\acontent\x18\x03 \x01(\tR\acontent\x12\x1c\n" + + "\tcreatedAt\x18\x04 \x01(\x03R\tcreatedAt\"x\n" + "\x12AddGrowthRecordReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + "\aplantId\x18\x02 \x01(\tR\aplantId\x12\x18\n" + "\acontent\x18\x03 \x01(\tR\acontent\x12\x16\n" + - "\x06imgIds\x18\x04 \x03(\tR\x06imgIds\"\x15\n" + - "\x13AddGrowthRecordResp\"\xd0\x01\n" + + "\x06imgIds\x18\x04 \x03(\tR\x06imgIds\"\xc8\x02\n" + "\bWikiInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + @@ -4082,38 +3347,36 @@ const file_pb_plant_proto_rawDesc = "" + "\n" + "difficulty\x18\x06 \x01(\x05R\n" + "difficulty\x12\x14\n" + - "\x05isHot\x18\a \x01(\x05R\x05isHot\x12\x1c\n" + - "\tcreatedAt\x18\b \x01(\x03R\tcreatedAt\"\x8a\x01\n" + - "\x0eGetWikiListReq\x12\x18\n" + + "\x05isHot\x18\a \x01(\x05R\x05isHot\x12 \n" + + "\vgrowthHabit\x18\b \x01(\tR\vgrowthHabit\x12&\n" + + "\x0elightIntensity\x18\t \x01(\tR\x0elightIntensity\x12,\n" + + "\x11optimalTempPeriod\x18\n" + + " \x01(\tR\x11optimalTempPeriod\x12\x1c\n" + + "\tcreatedAt\x18\v \x01(\x03R\tcreatedAt\"\x87\x01\n" + + "\vWikiListReq\x12\x18\n" + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x12\n" + "\x04name\x18\x03 \x01(\tR\x04name\x12\x18\n" + "\aclassId\x18\x04 \x01(\tR\aclassId\x12\x14\n" + - "\x05isHot\x18\x05 \x01(\x05R\x05isHot\"L\n" + - "\x0fGetWikiListResp\x12#\n" + + "\x05isHot\x18\x05 \x01(\x05R\x05isHot\"I\n" + + "\fWikiListResp\x12#\n" + "\x04list\x18\x01 \x03(\v2\x0f.plant.WikiInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"\"\n" + - "\x10GetWikiDetailReq\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"8\n" + - "\x11GetWikiDetailResp\x12#\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"5\n" + + "\x0eWikiDetailResp\x12#\n" + "\x04wiki\x18\x01 \x01(\v2\x0f.plant.WikiInfoR\x04wiki\"I\n" + "\rWikiClassInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + - "\x05ossId\x18\x03 \x01(\tR\x05ossId\"@\n" + - "\x14GetWikiClassListResp\x12(\n" + - "\x04list\x18\x01 \x03(\v2\x14.plant.WikiClassInfoR\x04list\">\n" + + "\x05ossId\x18\x03 \x01(\tR\x05ossId\"=\n" + + "\x11WikiClassListResp\x12(\n" + + "\x04list\x18\x01 \x03(\v2\x14.plant.WikiClassInfoR\x04list\"<\n" + "\x12CreateWikiClassReq\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" + - "\x05ossId\x18\x02 \x01(\tR\x05ossId\"%\n" + - "\x13CreateWikiClassResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"W\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x02 \x01(\tR\x04icon\"W\n" + "\rToggleStarReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1a\n" + "\btargetId\x18\x02 \x01(\tR\btargetId\x12\x12\n" + - "\x04type\x18\x03 \x01(\tR\x04type\"*\n" + - "\x0eToggleStarResp\x12\x18\n" + - "\astarred\x18\x01 \x01(\bR\astarred\"\x9a\x02\n" + + "\x04type\x18\x03 \x01(\tR\x04type\"\x9a\x02\n" + "\bPostInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x14\n" + @@ -4132,60 +3395,67 @@ const file_pb_plant_proto_rawDesc = "" + "\acontent\x18\x03 \x01(\tR\acontent\x12\x1a\n" + "\blocation\x18\x04 \x01(\tR\blocation\x12\x16\n" + "\x06imgIds\x18\x05 \x03(\tR\x06imgIds\x12\x18\n" + - "\atopicId\x18\x06 \x01(\tR\atopicId\" \n" + - "\x0eCreatePostResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"z\n" + - "\x0eGetPostListReq\x12\x18\n" + + "\atopicId\x18\x06 \x01(\tR\atopicId\"\x8f\x01\n" + + "\vPostListReq\x12\x18\n" + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x18\n" + "\akeyword\x18\x03 \x01(\tR\akeyword\x12\x18\n" + - "\atopicId\x18\x04 \x01(\tR\atopicId\"L\n" + - "\x0fGetPostListResp\x12#\n" + + "\atopicId\x18\x04 \x01(\tR\atopicId\x12\x16\n" + + "\x06userId\x18\x05 \x01(\tR\x06userId\"I\n" + + "\fPostListResp\x12#\n" + "\x04list\x18\x01 \x03(\v2\x0f.plant.PostInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"\"\n" + - "\x10GetPostDetailReq\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"8\n" + - "\x11GetPostDetailResp\x12#\n" + - "\x04post\x18\x01 \x01(\v2\x0f.plant.PostInfoR\x04post\"!\n" + - "\rDeletePostReq\x12\x10\n" + - "\x03ids\x18\x01 \x03(\tR\x03ids\"\x10\n" + - "\x0eDeletePostResp\"v\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"i\n" + + "\x0ePostDetailResp\x12#\n" + + "\x04post\x18\x01 \x01(\v2\x0f.plant.PostInfoR\x04post\x122\n" + + "\bcomments\x18\x02 \x03(\v2\x16.plant.PostCommentInfoR\bcomments\"\x8d\x01\n" + + "\x0fPostCommentInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x18\n" + + "\acontent\x18\x03 \x01(\tR\acontent\x12\x1a\n" + + "\bparentId\x18\x04 \x01(\tR\bparentId\x12\x1c\n" + + "\tcreatedAt\x18\x05 \x01(\x03R\tcreatedAt\"v\n" + "\x0eCommentPostReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + "\x06postId\x18\x02 \x01(\tR\x06postId\x12\x18\n" + "\acontent\x18\x03 \x01(\tR\acontent\x12\x1a\n" + - "\bparentId\x18\x04 \x01(\tR\bparentId\"\x11\n" + - "\x0fCommentPostResp\"=\n" + + "\bparentId\x18\x04 \x01(\tR\bparentId\"=\n" + "\vLikePostReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + - "\x06postId\x18\x02 \x01(\tR\x06postId\"$\n" + - "\fLikePostResp\x12\x14\n" + - "\x05liked\x18\x01 \x01(\bR\x05liked\"M\n" + + "\x06postId\x18\x02 \x01(\tR\x06postId\"M\n" + "\tTopicInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + - "\tpostCount\x18\x03 \x01(\x05R\tpostCount\"8\n" + - "\x10GetTopicListResp\x12$\n" + - "\x04list\x18\x01 \x03(\v2\x10.plant.TopicInfoR\x04list\"$\n" + + "\tpostCount\x18\x03 \x01(\x05R\tpostCount\"5\n" + + "\rTopicListResp\x12$\n" + + "\x04list\x18\x01 \x03(\v2\x10.plant.TopicInfoR\x04list\"L\n" + "\x0eCreateTopicReq\x12\x12\n" + - "\x04name\x18\x01 \x01(\tR\x04name\"!\n" + - "\x0fCreateTopicResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\"\n" + - "\x0eDeleteTopicReq\x12\x10\n" + - "\x03ids\x18\x01 \x03(\tR\x03ids\"\x11\n" + - "\x0fDeleteTopicResp\"\x85\x01\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04icon\x18\x02 \x01(\tR\x04icon\x12\x12\n" + + "\x04desc\x18\x03 \x01(\tR\x04desc\"\x8a\x01\n" + + "\x10ExchangeItemInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04desc\x18\x03 \x01(\tR\x04desc\x12\x14\n" + + "\x05imgId\x18\x04 \x01(\tR\x05imgId\x12\x12\n" + + "\x04cost\x18\x05 \x01(\x03R\x04cost\x12\x14\n" + + "\x05stock\x18\x06 \x01(\x05R\x05stock\"K\n" + + "\x13ExchangeItemListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"Y\n" + + "\x14ExchangeItemListResp\x12+\n" + + "\x04list\x18\x01 \x03(\v2\x17.plant.ExchangeItemInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"H\n" + + "\x16CreateExchangeOrderReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + + "\x06itemId\x18\x02 \x01(\tR\x06itemId\"\x85\x01\n" + "\x0fLevelConfigInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" + "\x05level\x18\x02 \x01(\x05R\x05level\x12\x14\n" + "\x05title\x18\x03 \x01(\tR\x05title\x12 \n" + "\vminSunlight\x18\x04 \x01(\x03R\vminSunlight\x12\x14\n" + - "\x05perks\x18\x05 \x01(\tR\x05perks\"M\n" + - "\x15GetLevelConfigListReq\x12\x18\n" + - "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + - "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"Z\n" + - "\x16GetLevelConfigListResp\x12*\n" + - "\x04list\x18\x01 \x03(\v2\x16.plant.LevelConfigInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"\x8d\x02\n" + + "\x05perks\x18\x05 \x01(\tR\x05perks\"A\n" + + "\x13LevelConfigListResp\x12*\n" + + "\x04list\x18\x01 \x03(\v2\x16.plant.LevelConfigInfoR\x04list\"\x8d\x02\n" + "\x0fBadgeConfigInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + @@ -4195,65 +3465,45 @@ const file_pb_plant_proto_rawDesc = "" + "\x04tier\x18\x06 \x01(\x05R\x04tier\x12\"\n" + "\ftargetAction\x18\a \x01(\tR\ftargetAction\x12\x1c\n" + "\tthreshold\x18\b \x01(\x03R\tthreshold\x12&\n" + - "\x0erewardSunlight\x18\t \x01(\x03R\x0erewardSunlight\"k\n" + - "\x15GetBadgeConfigListReq\x12\x18\n" + + "\x0erewardSunlight\x18\t \x01(\x03R\x0erewardSunlight\"h\n" + + "\x12BadgeConfigListReq\x12\x18\n" + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x1c\n" + - "\tdimension\x18\x03 \x01(\tR\tdimension\"Z\n" + - "\x16GetBadgeConfigListResp\x12*\n" + + "\tdimension\x18\x03 \x01(\tR\tdimension\"W\n" + + "\x13BadgeConfigListResp\x12*\n" + "\x04list\x18\x01 \x03(\v2\x16.plant.BadgeConfigInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"t\n" + - "\x10ExchangeItemInfo\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + - "\x04desc\x18\x03 \x01(\tR\x04desc\x12\x12\n" + - "\x04cost\x18\x04 \x01(\x03R\x04cost\x12\x14\n" + - "\x05stock\x18\x05 \x01(\x05R\x05stock\"N\n" + - "\x16GetExchangeItemListReq\x12\x18\n" + - "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + - "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"\\\n" + - "\x17GetExchangeItemListResp\x12+\n" + - "\x04list\x18\x01 \x03(\v2\x17.plant.ExchangeItemInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"H\n" + - "\x16CreateExchangeOrderReq\x12\x16\n" + - "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x16\n" + - "\x06itemId\x18\x02 \x01(\tR\x06itemId\")\n" + - "\x17CreateExchangeOrderResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\a\n" + - "\x05Empty2\xb3\x0f\n" + - "\fPlantService\x12E\n" + - "\x0eGetUserProfile\x12\x18.plant.GetUserProfileReq\x1a\x19.plant.GetUserProfileResp\x12N\n" + - "\x11UpdateUserProfile\x12\x1b.plant.UpdateUserProfileReq\x1a\x1c.plant.UpdateUserProfileResp\x12H\n" + - "\x0fIncrUserCounter\x12\x19.plant.IncrUserCounterReq\x1a\x1a.plant.IncrUserCounterResp\x12<\n" + - "\vCreatePlant\x12\x15.plant.CreatePlantReq\x1a\x16.plant.CreatePlantResp\x12<\n" + - "\vUpdatePlant\x12\x15.plant.UpdatePlantReq\x1a\x16.plant.UpdatePlantResp\x12<\n" + - "\vDeletePlant\x12\x15.plant.DeletePlantReq\x1a\x16.plant.DeletePlantResp\x12?\n" + - "\fGetPlantList\x12\x16.plant.GetPlantListReq\x1a\x17.plant.GetPlantListResp\x12E\n" + - "\x0eGetPlantDetail\x12\x18.plant.GetPlantDetailReq\x1a\x19.plant.GetPlantDetailResp\x12<\n" + - "\vAddCarePlan\x12\x15.plant.AddCarePlanReq\x1a\x16.plant.AddCarePlanResp\x12B\n" + - "\rAddCareRecord\x12\x17.plant.AddCareRecordReq\x1a\x18.plant.AddCareRecordResp\x12H\n" + - "\x0fAddGrowthRecord\x12\x19.plant.AddGrowthRecordReq\x1a\x1a.plant.AddGrowthRecordResp\x12<\n" + - "\vGetWikiList\x12\x15.plant.GetWikiListReq\x1a\x16.plant.GetWikiListResp\x12B\n" + - "\rGetWikiDetail\x12\x17.plant.GetWikiDetailReq\x1a\x18.plant.GetWikiDetailResp\x12=\n" + - "\x10GetWikiClassList\x12\f.plant.Empty\x1a\x1b.plant.GetWikiClassListResp\x12H\n" + - "\x0fCreateWikiClass\x12\x19.plant.CreateWikiClassReq\x1a\x1a.plant.CreateWikiClassResp\x129\n" + + "\x05total\x18\x02 \x01(\x03R\x05total2\x8a\r\n" + + "\fPlantService\x12?\n" + + "\x0eGetUserProfile\x12\x14.plant.GetProfileReq\x1a\x17.plant.PlantUserProfile\x12?\n" + + "\x11UpdateUserProfile\x12\x17.plant.UpdateProfileReq\x1a\x11.plant.CommonResp\x127\n" + + "\vCreatePlant\x12\x15.plant.CreatePlantReq\x1a\x11.plant.CommonResp\x127\n" + + "\vUpdatePlant\x12\x15.plant.UpdatePlantReq\x1a\x11.plant.CommonResp\x12/\n" + + "\vDeletePlant\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x129\n" + + "\fGetPlantList\x12\x13.plant.PlantListReq\x1a\x14.plant.PlantListResp\x126\n" + + "\x0eGetPlantDetail\x12\f.plant.IdReq\x1a\x16.plant.PlantDetailResp\x127\n" + + "\vAddCarePlan\x12\x15.plant.AddCarePlanReq\x1a\x11.plant.CommonResp\x12;\n" + + "\rAddCareRecord\x12\x17.plant.AddCareRecordReq\x1a\x11.plant.CommonResp\x12?\n" + + "\x0fAddGrowthRecord\x12\x19.plant.AddGrowthRecordReq\x1a\x11.plant.CommonResp\x126\n" + + "\vGetWikiList\x12\x12.plant.WikiListReq\x1a\x13.plant.WikiListResp\x124\n" + + "\rGetWikiDetail\x12\f.plant.IdReq\x1a\x15.plant.WikiDetailResp\x12:\n" + + "\x10GetWikiClassList\x12\f.plant.IdReq\x1a\x18.plant.WikiClassListResp\x12?\n" + + "\x0fCreateWikiClass\x12\x19.plant.CreateWikiClassReq\x1a\x11.plant.CommonResp\x129\n" + + "\x0eToggleWikiStar\x12\x14.plant.ToggleStarReq\x1a\x11.plant.CommonResp\x125\n" + "\n" + - "ToggleStar\x12\x14.plant.ToggleStarReq\x1a\x15.plant.ToggleStarResp\x129\n" + + "CreatePost\x12\x14.plant.CreatePostReq\x1a\x11.plant.CommonResp\x12.\n" + "\n" + - "CreatePost\x12\x14.plant.CreatePostReq\x1a\x15.plant.CreatePostResp\x12<\n" + - "\vGetPostList\x12\x15.plant.GetPostListReq\x1a\x16.plant.GetPostListResp\x12B\n" + - "\rGetPostDetail\x12\x17.plant.GetPostDetailReq\x1a\x18.plant.GetPostDetailResp\x129\n" + - "\n" + - "DeletePost\x12\x14.plant.DeletePostReq\x1a\x15.plant.DeletePostResp\x12<\n" + - "\vCommentPost\x12\x15.plant.CommentPostReq\x1a\x16.plant.CommentPostResp\x123\n" + - "\bLikePost\x12\x12.plant.LikePostReq\x1a\x13.plant.LikePostResp\x125\n" + - "\fGetTopicList\x12\f.plant.Empty\x1a\x17.plant.GetTopicListResp\x12<\n" + - "\vCreateTopic\x12\x15.plant.CreateTopicReq\x1a\x16.plant.CreateTopicResp\x12<\n" + - "\vDeleteTopic\x12\x15.plant.DeleteTopicReq\x1a\x16.plant.DeleteTopicResp\x12Q\n" + - "\x12GetLevelConfigList\x12\x1c.plant.GetLevelConfigListReq\x1a\x1d.plant.GetLevelConfigListResp\x12Q\n" + - "\x12GetBadgeConfigList\x12\x1c.plant.GetBadgeConfigListReq\x1a\x1d.plant.GetBadgeConfigListResp\x12T\n" + - "\x13GetExchangeItemList\x12\x1d.plant.GetExchangeItemListReq\x1a\x1e.plant.GetExchangeItemListResp\x12T\n" + - "\x13CreateExchangeOrder\x12\x1d.plant.CreateExchangeOrderReq\x1a\x1e.plant.CreateExchangeOrderRespB\tZ\a./plantb\x06proto3" + "DeletePost\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x126\n" + + "\vGetPostList\x12\x12.plant.PostListReq\x1a\x13.plant.PostListResp\x124\n" + + "\rGetPostDetail\x12\f.plant.IdReq\x1a\x15.plant.PostDetailResp\x127\n" + + "\vCommentPost\x12\x15.plant.CommentPostReq\x1a\x11.plant.CommonResp\x121\n" + + "\bLikePost\x12\x12.plant.LikePostReq\x1a\x11.plant.CommonResp\x122\n" + + "\fGetTopicList\x12\f.plant.IdReq\x1a\x14.plant.TopicListResp\x127\n" + + "\vCreateTopic\x12\x15.plant.CreateTopicReq\x1a\x11.plant.CommonResp\x12/\n" + + "\vDeleteTopic\x12\r.plant.IdsReq\x1a\x11.plant.CommonResp\x12N\n" + + "\x13GetExchangeItemList\x12\x1a.plant.ExchangeItemListReq\x1a\x1b.plant.ExchangeItemListResp\x12G\n" + + "\x13CreateExchangeOrder\x12\x1d.plant.CreateExchangeOrderReq\x1a\x11.plant.CommonResp\x12@\n" + + "\x12GetLevelConfigList\x12\x0e.plant.PageReq\x1a\x1a.plant.LevelConfigListResp\x12K\n" + + "\x12GetBadgeConfigList\x12\x19.plant.BadgeConfigListReq\x1a\x1a.plant.BadgeConfigListRespB\tZ\a./plantb\x06proto3" var ( file_pb_plant_proto_rawDescOnce sync.Once @@ -4267,152 +3517,131 @@ func file_pb_plant_proto_rawDescGZIP() []byte { return file_pb_plant_proto_rawDescData } -var file_pb_plant_proto_msgTypes = make([]protoimpl.MessageInfo, 67) +var file_pb_plant_proto_msgTypes = make([]protoimpl.MessageInfo, 46) var file_pb_plant_proto_goTypes = []any{ - (*UserProfile)(nil), // 0: plant.UserProfile - (*GetUserProfileReq)(nil), // 1: plant.GetUserProfileReq - (*GetUserProfileResp)(nil), // 2: plant.GetUserProfileResp - (*UpdateUserProfileReq)(nil), // 3: plant.UpdateUserProfileReq - (*UpdateUserProfileResp)(nil), // 4: plant.UpdateUserProfileResp - (*IncrUserCounterReq)(nil), // 5: plant.IncrUserCounterReq - (*IncrUserCounterResp)(nil), // 6: plant.IncrUserCounterResp - (*PlantInfo)(nil), // 7: plant.PlantInfo - (*CreatePlantReq)(nil), // 8: plant.CreatePlantReq - (*CreatePlantResp)(nil), // 9: plant.CreatePlantResp - (*UpdatePlantReq)(nil), // 10: plant.UpdatePlantReq - (*UpdatePlantResp)(nil), // 11: plant.UpdatePlantResp - (*DeletePlantReq)(nil), // 12: plant.DeletePlantReq - (*DeletePlantResp)(nil), // 13: plant.DeletePlantResp - (*GetPlantListReq)(nil), // 14: plant.GetPlantListReq - (*GetPlantListResp)(nil), // 15: plant.GetPlantListResp - (*GetPlantDetailReq)(nil), // 16: plant.GetPlantDetailReq - (*GetPlantDetailResp)(nil), // 17: plant.GetPlantDetailResp - (*CarePlanInfo)(nil), // 18: plant.CarePlanInfo - (*AddCarePlanReq)(nil), // 19: plant.AddCarePlanReq - (*AddCarePlanResp)(nil), // 20: plant.AddCarePlanResp - (*AddCareRecordReq)(nil), // 21: plant.AddCareRecordReq - (*AddCareRecordResp)(nil), // 22: plant.AddCareRecordResp - (*AddGrowthRecordReq)(nil), // 23: plant.AddGrowthRecordReq - (*AddGrowthRecordResp)(nil), // 24: plant.AddGrowthRecordResp - (*WikiInfo)(nil), // 25: plant.WikiInfo - (*GetWikiListReq)(nil), // 26: plant.GetWikiListReq - (*GetWikiListResp)(nil), // 27: plant.GetWikiListResp - (*GetWikiDetailReq)(nil), // 28: plant.GetWikiDetailReq - (*GetWikiDetailResp)(nil), // 29: plant.GetWikiDetailResp - (*WikiClassInfo)(nil), // 30: plant.WikiClassInfo - (*GetWikiClassListResp)(nil), // 31: plant.GetWikiClassListResp - (*CreateWikiClassReq)(nil), // 32: plant.CreateWikiClassReq - (*CreateWikiClassResp)(nil), // 33: plant.CreateWikiClassResp - (*ToggleStarReq)(nil), // 34: plant.ToggleStarReq - (*ToggleStarResp)(nil), // 35: plant.ToggleStarResp - (*PostInfo)(nil), // 36: plant.PostInfo - (*CreatePostReq)(nil), // 37: plant.CreatePostReq - (*CreatePostResp)(nil), // 38: plant.CreatePostResp - (*GetPostListReq)(nil), // 39: plant.GetPostListReq - (*GetPostListResp)(nil), // 40: plant.GetPostListResp - (*GetPostDetailReq)(nil), // 41: plant.GetPostDetailReq - (*GetPostDetailResp)(nil), // 42: plant.GetPostDetailResp - (*DeletePostReq)(nil), // 43: plant.DeletePostReq - (*DeletePostResp)(nil), // 44: plant.DeletePostResp - (*CommentPostReq)(nil), // 45: plant.CommentPostReq - (*CommentPostResp)(nil), // 46: plant.CommentPostResp - (*LikePostReq)(nil), // 47: plant.LikePostReq - (*LikePostResp)(nil), // 48: plant.LikePostResp - (*TopicInfo)(nil), // 49: plant.TopicInfo - (*GetTopicListResp)(nil), // 50: plant.GetTopicListResp - (*CreateTopicReq)(nil), // 51: plant.CreateTopicReq - (*CreateTopicResp)(nil), // 52: plant.CreateTopicResp - (*DeleteTopicReq)(nil), // 53: plant.DeleteTopicReq - (*DeleteTopicResp)(nil), // 54: plant.DeleteTopicResp - (*LevelConfigInfo)(nil), // 55: plant.LevelConfigInfo - (*GetLevelConfigListReq)(nil), // 56: plant.GetLevelConfigListReq - (*GetLevelConfigListResp)(nil), // 57: plant.GetLevelConfigListResp - (*BadgeConfigInfo)(nil), // 58: plant.BadgeConfigInfo - (*GetBadgeConfigListReq)(nil), // 59: plant.GetBadgeConfigListReq - (*GetBadgeConfigListResp)(nil), // 60: plant.GetBadgeConfigListResp - (*ExchangeItemInfo)(nil), // 61: plant.ExchangeItemInfo - (*GetExchangeItemListReq)(nil), // 62: plant.GetExchangeItemListReq - (*GetExchangeItemListResp)(nil), // 63: plant.GetExchangeItemListResp - (*CreateExchangeOrderReq)(nil), // 64: plant.CreateExchangeOrderReq - (*CreateExchangeOrderResp)(nil), // 65: plant.CreateExchangeOrderResp - (*Empty)(nil), // 66: plant.Empty + (*CommonResp)(nil), // 0: plant.CommonResp + (*IdReq)(nil), // 1: plant.IdReq + (*IdsReq)(nil), // 2: plant.IdsReq + (*PageReq)(nil), // 3: plant.PageReq + (*PlantUserProfile)(nil), // 4: plant.PlantUserProfile + (*GetProfileReq)(nil), // 5: plant.GetProfileReq + (*UpdateProfileReq)(nil), // 6: plant.UpdateProfileReq + (*PlantInfo)(nil), // 7: plant.PlantInfo + (*CreatePlantReq)(nil), // 8: plant.CreatePlantReq + (*UpdatePlantReq)(nil), // 9: plant.UpdatePlantReq + (*PlantListReq)(nil), // 10: plant.PlantListReq + (*PlantListResp)(nil), // 11: plant.PlantListResp + (*PlantDetailResp)(nil), // 12: plant.PlantDetailResp + (*CarePlanInfo)(nil), // 13: plant.CarePlanInfo + (*AddCarePlanReq)(nil), // 14: plant.AddCarePlanReq + (*AddCareRecordReq)(nil), // 15: plant.AddCareRecordReq + (*GrowthRecordInfo)(nil), // 16: plant.GrowthRecordInfo + (*AddGrowthRecordReq)(nil), // 17: plant.AddGrowthRecordReq + (*WikiInfo)(nil), // 18: plant.WikiInfo + (*WikiListReq)(nil), // 19: plant.WikiListReq + (*WikiListResp)(nil), // 20: plant.WikiListResp + (*WikiDetailResp)(nil), // 21: plant.WikiDetailResp + (*WikiClassInfo)(nil), // 22: plant.WikiClassInfo + (*WikiClassListResp)(nil), // 23: plant.WikiClassListResp + (*CreateWikiClassReq)(nil), // 24: plant.CreateWikiClassReq + (*ToggleStarReq)(nil), // 25: plant.ToggleStarReq + (*PostInfo)(nil), // 26: plant.PostInfo + (*CreatePostReq)(nil), // 27: plant.CreatePostReq + (*PostListReq)(nil), // 28: plant.PostListReq + (*PostListResp)(nil), // 29: plant.PostListResp + (*PostDetailResp)(nil), // 30: plant.PostDetailResp + (*PostCommentInfo)(nil), // 31: plant.PostCommentInfo + (*CommentPostReq)(nil), // 32: plant.CommentPostReq + (*LikePostReq)(nil), // 33: plant.LikePostReq + (*TopicInfo)(nil), // 34: plant.TopicInfo + (*TopicListResp)(nil), // 35: plant.TopicListResp + (*CreateTopicReq)(nil), // 36: plant.CreateTopicReq + (*ExchangeItemInfo)(nil), // 37: plant.ExchangeItemInfo + (*ExchangeItemListReq)(nil), // 38: plant.ExchangeItemListReq + (*ExchangeItemListResp)(nil), // 39: plant.ExchangeItemListResp + (*CreateExchangeOrderReq)(nil), // 40: plant.CreateExchangeOrderReq + (*LevelConfigInfo)(nil), // 41: plant.LevelConfigInfo + (*LevelConfigListResp)(nil), // 42: plant.LevelConfigListResp + (*BadgeConfigInfo)(nil), // 43: plant.BadgeConfigInfo + (*BadgeConfigListReq)(nil), // 44: plant.BadgeConfigListReq + (*BadgeConfigListResp)(nil), // 45: plant.BadgeConfigListResp } var file_pb_plant_proto_depIdxs = []int32{ - 0, // 0: plant.GetUserProfileResp.profile:type_name -> plant.UserProfile - 7, // 1: plant.GetPlantListResp.list:type_name -> plant.PlantInfo - 7, // 2: plant.GetPlantDetailResp.plant:type_name -> plant.PlantInfo - 25, // 3: plant.GetWikiListResp.list:type_name -> plant.WikiInfo - 25, // 4: plant.GetWikiDetailResp.wiki:type_name -> plant.WikiInfo - 30, // 5: plant.GetWikiClassListResp.list:type_name -> plant.WikiClassInfo - 36, // 6: plant.GetPostListResp.list:type_name -> plant.PostInfo - 36, // 7: plant.GetPostDetailResp.post:type_name -> plant.PostInfo - 49, // 8: plant.GetTopicListResp.list:type_name -> plant.TopicInfo - 55, // 9: plant.GetLevelConfigListResp.list:type_name -> plant.LevelConfigInfo - 58, // 10: plant.GetBadgeConfigListResp.list:type_name -> plant.BadgeConfigInfo - 61, // 11: plant.GetExchangeItemListResp.list:type_name -> plant.ExchangeItemInfo - 1, // 12: plant.PlantService.GetUserProfile:input_type -> plant.GetUserProfileReq - 3, // 13: plant.PlantService.UpdateUserProfile:input_type -> plant.UpdateUserProfileReq - 5, // 14: plant.PlantService.IncrUserCounter:input_type -> plant.IncrUserCounterReq - 8, // 15: plant.PlantService.CreatePlant:input_type -> plant.CreatePlantReq - 10, // 16: plant.PlantService.UpdatePlant:input_type -> plant.UpdatePlantReq - 12, // 17: plant.PlantService.DeletePlant:input_type -> plant.DeletePlantReq - 14, // 18: plant.PlantService.GetPlantList:input_type -> plant.GetPlantListReq - 16, // 19: plant.PlantService.GetPlantDetail:input_type -> plant.GetPlantDetailReq - 19, // 20: plant.PlantService.AddCarePlan:input_type -> plant.AddCarePlanReq - 21, // 21: plant.PlantService.AddCareRecord:input_type -> plant.AddCareRecordReq - 23, // 22: plant.PlantService.AddGrowthRecord:input_type -> plant.AddGrowthRecordReq - 26, // 23: plant.PlantService.GetWikiList:input_type -> plant.GetWikiListReq - 28, // 24: plant.PlantService.GetWikiDetail:input_type -> plant.GetWikiDetailReq - 66, // 25: plant.PlantService.GetWikiClassList:input_type -> plant.Empty - 32, // 26: plant.PlantService.CreateWikiClass:input_type -> plant.CreateWikiClassReq - 34, // 27: plant.PlantService.ToggleStar:input_type -> plant.ToggleStarReq - 37, // 28: plant.PlantService.CreatePost:input_type -> plant.CreatePostReq - 39, // 29: plant.PlantService.GetPostList:input_type -> plant.GetPostListReq - 41, // 30: plant.PlantService.GetPostDetail:input_type -> plant.GetPostDetailReq - 43, // 31: plant.PlantService.DeletePost:input_type -> plant.DeletePostReq - 45, // 32: plant.PlantService.CommentPost:input_type -> plant.CommentPostReq - 47, // 33: plant.PlantService.LikePost:input_type -> plant.LikePostReq - 66, // 34: plant.PlantService.GetTopicList:input_type -> plant.Empty - 51, // 35: plant.PlantService.CreateTopic:input_type -> plant.CreateTopicReq - 53, // 36: plant.PlantService.DeleteTopic:input_type -> plant.DeleteTopicReq - 56, // 37: plant.PlantService.GetLevelConfigList:input_type -> plant.GetLevelConfigListReq - 59, // 38: plant.PlantService.GetBadgeConfigList:input_type -> plant.GetBadgeConfigListReq - 62, // 39: plant.PlantService.GetExchangeItemList:input_type -> plant.GetExchangeItemListReq - 64, // 40: plant.PlantService.CreateExchangeOrder:input_type -> plant.CreateExchangeOrderReq - 2, // 41: plant.PlantService.GetUserProfile:output_type -> plant.GetUserProfileResp - 4, // 42: plant.PlantService.UpdateUserProfile:output_type -> plant.UpdateUserProfileResp - 6, // 43: plant.PlantService.IncrUserCounter:output_type -> plant.IncrUserCounterResp - 9, // 44: plant.PlantService.CreatePlant:output_type -> plant.CreatePlantResp - 11, // 45: plant.PlantService.UpdatePlant:output_type -> plant.UpdatePlantResp - 13, // 46: plant.PlantService.DeletePlant:output_type -> plant.DeletePlantResp - 15, // 47: plant.PlantService.GetPlantList:output_type -> plant.GetPlantListResp - 17, // 48: plant.PlantService.GetPlantDetail:output_type -> plant.GetPlantDetailResp - 20, // 49: plant.PlantService.AddCarePlan:output_type -> plant.AddCarePlanResp - 22, // 50: plant.PlantService.AddCareRecord:output_type -> plant.AddCareRecordResp - 24, // 51: plant.PlantService.AddGrowthRecord:output_type -> plant.AddGrowthRecordResp - 27, // 52: plant.PlantService.GetWikiList:output_type -> plant.GetWikiListResp - 29, // 53: plant.PlantService.GetWikiDetail:output_type -> plant.GetWikiDetailResp - 31, // 54: plant.PlantService.GetWikiClassList:output_type -> plant.GetWikiClassListResp - 33, // 55: plant.PlantService.CreateWikiClass:output_type -> plant.CreateWikiClassResp - 35, // 56: plant.PlantService.ToggleStar:output_type -> plant.ToggleStarResp - 38, // 57: plant.PlantService.CreatePost:output_type -> plant.CreatePostResp - 40, // 58: plant.PlantService.GetPostList:output_type -> plant.GetPostListResp - 42, // 59: plant.PlantService.GetPostDetail:output_type -> plant.GetPostDetailResp - 44, // 60: plant.PlantService.DeletePost:output_type -> plant.DeletePostResp - 46, // 61: plant.PlantService.CommentPost:output_type -> plant.CommentPostResp - 48, // 62: plant.PlantService.LikePost:output_type -> plant.LikePostResp - 50, // 63: plant.PlantService.GetTopicList:output_type -> plant.GetTopicListResp - 52, // 64: plant.PlantService.CreateTopic:output_type -> plant.CreateTopicResp - 54, // 65: plant.PlantService.DeleteTopic:output_type -> plant.DeleteTopicResp - 57, // 66: plant.PlantService.GetLevelConfigList:output_type -> plant.GetLevelConfigListResp - 60, // 67: plant.PlantService.GetBadgeConfigList:output_type -> plant.GetBadgeConfigListResp - 63, // 68: plant.PlantService.GetExchangeItemList:output_type -> plant.GetExchangeItemListResp - 65, // 69: plant.PlantService.CreateExchangeOrder:output_type -> plant.CreateExchangeOrderResp - 41, // [41:70] is the sub-list for method output_type - 12, // [12:41] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 7, // 0: plant.PlantListResp.list:type_name -> plant.PlantInfo + 7, // 1: plant.PlantDetailResp.plant:type_name -> plant.PlantInfo + 13, // 2: plant.PlantDetailResp.carePlans:type_name -> plant.CarePlanInfo + 16, // 3: plant.PlantDetailResp.growthRecords:type_name -> plant.GrowthRecordInfo + 18, // 4: plant.WikiListResp.list:type_name -> plant.WikiInfo + 18, // 5: plant.WikiDetailResp.wiki:type_name -> plant.WikiInfo + 22, // 6: plant.WikiClassListResp.list:type_name -> plant.WikiClassInfo + 26, // 7: plant.PostListResp.list:type_name -> plant.PostInfo + 26, // 8: plant.PostDetailResp.post:type_name -> plant.PostInfo + 31, // 9: plant.PostDetailResp.comments:type_name -> plant.PostCommentInfo + 34, // 10: plant.TopicListResp.list:type_name -> plant.TopicInfo + 37, // 11: plant.ExchangeItemListResp.list:type_name -> plant.ExchangeItemInfo + 41, // 12: plant.LevelConfigListResp.list:type_name -> plant.LevelConfigInfo + 43, // 13: plant.BadgeConfigListResp.list:type_name -> plant.BadgeConfigInfo + 5, // 14: plant.PlantService.GetUserProfile:input_type -> plant.GetProfileReq + 6, // 15: plant.PlantService.UpdateUserProfile:input_type -> plant.UpdateProfileReq + 8, // 16: plant.PlantService.CreatePlant:input_type -> plant.CreatePlantReq + 9, // 17: plant.PlantService.UpdatePlant:input_type -> plant.UpdatePlantReq + 2, // 18: plant.PlantService.DeletePlant:input_type -> plant.IdsReq + 10, // 19: plant.PlantService.GetPlantList:input_type -> plant.PlantListReq + 1, // 20: plant.PlantService.GetPlantDetail:input_type -> plant.IdReq + 14, // 21: plant.PlantService.AddCarePlan:input_type -> plant.AddCarePlanReq + 15, // 22: plant.PlantService.AddCareRecord:input_type -> plant.AddCareRecordReq + 17, // 23: plant.PlantService.AddGrowthRecord:input_type -> plant.AddGrowthRecordReq + 19, // 24: plant.PlantService.GetWikiList:input_type -> plant.WikiListReq + 1, // 25: plant.PlantService.GetWikiDetail:input_type -> plant.IdReq + 1, // 26: plant.PlantService.GetWikiClassList:input_type -> plant.IdReq + 24, // 27: plant.PlantService.CreateWikiClass:input_type -> plant.CreateWikiClassReq + 25, // 28: plant.PlantService.ToggleWikiStar:input_type -> plant.ToggleStarReq + 27, // 29: plant.PlantService.CreatePost:input_type -> plant.CreatePostReq + 2, // 30: plant.PlantService.DeletePost:input_type -> plant.IdsReq + 28, // 31: plant.PlantService.GetPostList:input_type -> plant.PostListReq + 1, // 32: plant.PlantService.GetPostDetail:input_type -> plant.IdReq + 32, // 33: plant.PlantService.CommentPost:input_type -> plant.CommentPostReq + 33, // 34: plant.PlantService.LikePost:input_type -> plant.LikePostReq + 1, // 35: plant.PlantService.GetTopicList:input_type -> plant.IdReq + 36, // 36: plant.PlantService.CreateTopic:input_type -> plant.CreateTopicReq + 2, // 37: plant.PlantService.DeleteTopic:input_type -> plant.IdsReq + 38, // 38: plant.PlantService.GetExchangeItemList:input_type -> plant.ExchangeItemListReq + 40, // 39: plant.PlantService.CreateExchangeOrder:input_type -> plant.CreateExchangeOrderReq + 3, // 40: plant.PlantService.GetLevelConfigList:input_type -> plant.PageReq + 44, // 41: plant.PlantService.GetBadgeConfigList:input_type -> plant.BadgeConfigListReq + 4, // 42: plant.PlantService.GetUserProfile:output_type -> plant.PlantUserProfile + 0, // 43: plant.PlantService.UpdateUserProfile:output_type -> plant.CommonResp + 0, // 44: plant.PlantService.CreatePlant:output_type -> plant.CommonResp + 0, // 45: plant.PlantService.UpdatePlant:output_type -> plant.CommonResp + 0, // 46: plant.PlantService.DeletePlant:output_type -> plant.CommonResp + 11, // 47: plant.PlantService.GetPlantList:output_type -> plant.PlantListResp + 12, // 48: plant.PlantService.GetPlantDetail:output_type -> plant.PlantDetailResp + 0, // 49: plant.PlantService.AddCarePlan:output_type -> plant.CommonResp + 0, // 50: plant.PlantService.AddCareRecord:output_type -> plant.CommonResp + 0, // 51: plant.PlantService.AddGrowthRecord:output_type -> plant.CommonResp + 20, // 52: plant.PlantService.GetWikiList:output_type -> plant.WikiListResp + 21, // 53: plant.PlantService.GetWikiDetail:output_type -> plant.WikiDetailResp + 23, // 54: plant.PlantService.GetWikiClassList:output_type -> plant.WikiClassListResp + 0, // 55: plant.PlantService.CreateWikiClass:output_type -> plant.CommonResp + 0, // 56: plant.PlantService.ToggleWikiStar:output_type -> plant.CommonResp + 0, // 57: plant.PlantService.CreatePost:output_type -> plant.CommonResp + 0, // 58: plant.PlantService.DeletePost:output_type -> plant.CommonResp + 29, // 59: plant.PlantService.GetPostList:output_type -> plant.PostListResp + 30, // 60: plant.PlantService.GetPostDetail:output_type -> plant.PostDetailResp + 0, // 61: plant.PlantService.CommentPost:output_type -> plant.CommonResp + 0, // 62: plant.PlantService.LikePost:output_type -> plant.CommonResp + 35, // 63: plant.PlantService.GetTopicList:output_type -> plant.TopicListResp + 0, // 64: plant.PlantService.CreateTopic:output_type -> plant.CommonResp + 0, // 65: plant.PlantService.DeleteTopic:output_type -> plant.CommonResp + 39, // 66: plant.PlantService.GetExchangeItemList:output_type -> plant.ExchangeItemListResp + 0, // 67: plant.PlantService.CreateExchangeOrder:output_type -> plant.CommonResp + 42, // 68: plant.PlantService.GetLevelConfigList:output_type -> plant.LevelConfigListResp + 45, // 69: plant.PlantService.GetBadgeConfigList:output_type -> plant.BadgeConfigListResp + 42, // [42:70] is the sub-list for method output_type + 14, // [14:42] is the sub-list for method input_type + 14, // [14:14] is the sub-list for extension type_name + 14, // [14:14] is the sub-list for extension extendee + 0, // [0:14] is the sub-list for field type_name } func init() { file_pb_plant_proto_init() } @@ -4426,7 +3655,7 @@ func file_pb_plant_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_plant_proto_rawDesc), len(file_pb_plant_proto_rawDesc)), NumEnums: 0, - NumMessages: 67, + NumMessages: 46, NumExtensions: 0, NumServices: 1, }, diff --git a/app/plant/rpc/plant/plant_grpc.pb.go b/app/plant/rpc/plant/plant_grpc.pb.go index 8f49c23..339c41a 100644 --- a/app/plant/rpc/plant/plant_grpc.pb.go +++ b/app/plant/rpc/plant/plant_grpc.pb.go @@ -21,7 +21,6 @@ const _ = grpc.SupportPackageIsVersion9 const ( PlantService_GetUserProfile_FullMethodName = "/plant.PlantService/GetUserProfile" PlantService_UpdateUserProfile_FullMethodName = "/plant.PlantService/UpdateUserProfile" - PlantService_IncrUserCounter_FullMethodName = "/plant.PlantService/IncrUserCounter" PlantService_CreatePlant_FullMethodName = "/plant.PlantService/CreatePlant" PlantService_UpdatePlant_FullMethodName = "/plant.PlantService/UpdatePlant" PlantService_DeletePlant_FullMethodName = "/plant.PlantService/DeletePlant" @@ -34,65 +33,62 @@ const ( PlantService_GetWikiDetail_FullMethodName = "/plant.PlantService/GetWikiDetail" PlantService_GetWikiClassList_FullMethodName = "/plant.PlantService/GetWikiClassList" PlantService_CreateWikiClass_FullMethodName = "/plant.PlantService/CreateWikiClass" - PlantService_ToggleStar_FullMethodName = "/plant.PlantService/ToggleStar" + PlantService_ToggleWikiStar_FullMethodName = "/plant.PlantService/ToggleWikiStar" PlantService_CreatePost_FullMethodName = "/plant.PlantService/CreatePost" + PlantService_DeletePost_FullMethodName = "/plant.PlantService/DeletePost" PlantService_GetPostList_FullMethodName = "/plant.PlantService/GetPostList" PlantService_GetPostDetail_FullMethodName = "/plant.PlantService/GetPostDetail" - PlantService_DeletePost_FullMethodName = "/plant.PlantService/DeletePost" PlantService_CommentPost_FullMethodName = "/plant.PlantService/CommentPost" PlantService_LikePost_FullMethodName = "/plant.PlantService/LikePost" PlantService_GetTopicList_FullMethodName = "/plant.PlantService/GetTopicList" PlantService_CreateTopic_FullMethodName = "/plant.PlantService/CreateTopic" PlantService_DeleteTopic_FullMethodName = "/plant.PlantService/DeleteTopic" - PlantService_GetLevelConfigList_FullMethodName = "/plant.PlantService/GetLevelConfigList" - PlantService_GetBadgeConfigList_FullMethodName = "/plant.PlantService/GetBadgeConfigList" PlantService_GetExchangeItemList_FullMethodName = "/plant.PlantService/GetExchangeItemList" PlantService_CreateExchangeOrder_FullMethodName = "/plant.PlantService/CreateExchangeOrder" + PlantService_GetLevelConfigList_FullMethodName = "/plant.PlantService/GetLevelConfigList" + PlantService_GetBadgeConfigList_FullMethodName = "/plant.PlantService/GetBadgeConfigList" ) // PlantServiceClient is the client API for PlantService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// ========== 服务定义 ========== type PlantServiceClient interface { // 用户Profile - GetUserProfile(ctx context.Context, in *GetUserProfileReq, opts ...grpc.CallOption) (*GetUserProfileResp, error) - UpdateUserProfile(ctx context.Context, in *UpdateUserProfileReq, opts ...grpc.CallOption) (*UpdateUserProfileResp, error) - IncrUserCounter(ctx context.Context, in *IncrUserCounterReq, opts ...grpc.CallOption) (*IncrUserCounterResp, error) - // 植物 - CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CreatePlantResp, error) - UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*UpdatePlantResp, error) - DeletePlant(ctx context.Context, in *DeletePlantReq, opts ...grpc.CallOption) (*DeletePlantResp, error) - GetPlantList(ctx context.Context, in *GetPlantListReq, opts ...grpc.CallOption) (*GetPlantListResp, error) - GetPlantDetail(ctx context.Context, in *GetPlantDetailReq, opts ...grpc.CallOption) (*GetPlantDetailResp, error) + GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) + UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) + // 我的植物 + CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) + DeletePlant(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetPlantList(ctx context.Context, in *PlantListReq, opts ...grpc.CallOption) (*PlantListResp, error) + GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) // 养护 - AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*AddCarePlanResp, error) - AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*AddCareRecordResp, error) - AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*AddGrowthRecordResp, error) + AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) + AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) + AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) // 百科 - GetWikiList(ctx context.Context, in *GetWikiListReq, opts ...grpc.CallOption) (*GetWikiListResp, error) - GetWikiDetail(ctx context.Context, in *GetWikiDetailReq, opts ...grpc.CallOption) (*GetWikiDetailResp, error) - GetWikiClassList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetWikiClassListResp, error) - CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CreateWikiClassResp, error) - ToggleStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*ToggleStarResp, error) + GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) + GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) + GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) + CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) + ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) // 社区 - CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CreatePostResp, error) - GetPostList(ctx context.Context, in *GetPostListReq, opts ...grpc.CallOption) (*GetPostListResp, error) - GetPostDetail(ctx context.Context, in *GetPostDetailReq, opts ...grpc.CallOption) (*GetPostDetailResp, error) - DeletePost(ctx context.Context, in *DeletePostReq, opts ...grpc.CallOption) (*DeletePostResp, error) - CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommentPostResp, error) - LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*LikePostResp, error) + CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) + DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetPostList(ctx context.Context, in *PostListReq, opts ...grpc.CallOption) (*PostListResp, error) + GetPostDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PostDetailResp, error) + CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommonResp, error) + LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) // 话题 - GetTopicList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetTopicListResp, error) - CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CreateTopicResp, error) - DeleteTopic(ctx context.Context, in *DeleteTopicReq, opts ...grpc.CallOption) (*DeleteTopicResp, error) - // 配置 - GetLevelConfigList(ctx context.Context, in *GetLevelConfigListReq, opts ...grpc.CallOption) (*GetLevelConfigListResp, error) - GetBadgeConfigList(ctx context.Context, in *GetBadgeConfigListReq, opts ...grpc.CallOption) (*GetBadgeConfigListResp, error) + GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) + CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) // 兑换 - GetExchangeItemList(ctx context.Context, in *GetExchangeItemListReq, opts ...grpc.CallOption) (*GetExchangeItemListResp, error) - CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CreateExchangeOrderResp, error) + GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) + CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) + // 配置 + GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) + GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) } type plantServiceClient struct { @@ -103,9 +99,9 @@ func NewPlantServiceClient(cc grpc.ClientConnInterface) PlantServiceClient { return &plantServiceClient{cc} } -func (c *plantServiceClient) GetUserProfile(ctx context.Context, in *GetUserProfileReq, opts ...grpc.CallOption) (*GetUserProfileResp, error) { +func (c *plantServiceClient) GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetUserProfileResp) + out := new(PlantUserProfile) err := c.cc.Invoke(ctx, PlantService_GetUserProfile_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -113,9 +109,9 @@ func (c *plantServiceClient) GetUserProfile(ctx context.Context, in *GetUserProf return out, nil } -func (c *plantServiceClient) UpdateUserProfile(ctx context.Context, in *UpdateUserProfileReq, opts ...grpc.CallOption) (*UpdateUserProfileResp, error) { +func (c *plantServiceClient) UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateUserProfileResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_UpdateUserProfile_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -123,19 +119,9 @@ func (c *plantServiceClient) UpdateUserProfile(ctx context.Context, in *UpdateUs return out, nil } -func (c *plantServiceClient) IncrUserCounter(ctx context.Context, in *IncrUserCounterReq, opts ...grpc.CallOption) (*IncrUserCounterResp, error) { +func (c *plantServiceClient) CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(IncrUserCounterResp) - err := c.cc.Invoke(ctx, PlantService_IncrUserCounter_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *plantServiceClient) CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CreatePlantResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreatePlantResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_CreatePlant_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -143,9 +129,9 @@ func (c *plantServiceClient) CreatePlant(ctx context.Context, in *CreatePlantReq return out, nil } -func (c *plantServiceClient) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*UpdatePlantResp, error) { +func (c *plantServiceClient) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdatePlantResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_UpdatePlant_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -153,9 +139,9 @@ func (c *plantServiceClient) UpdatePlant(ctx context.Context, in *UpdatePlantReq return out, nil } -func (c *plantServiceClient) DeletePlant(ctx context.Context, in *DeletePlantReq, opts ...grpc.CallOption) (*DeletePlantResp, error) { +func (c *plantServiceClient) DeletePlant(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeletePlantResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_DeletePlant_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -163,9 +149,9 @@ func (c *plantServiceClient) DeletePlant(ctx context.Context, in *DeletePlantReq return out, nil } -func (c *plantServiceClient) GetPlantList(ctx context.Context, in *GetPlantListReq, opts ...grpc.CallOption) (*GetPlantListResp, error) { +func (c *plantServiceClient) GetPlantList(ctx context.Context, in *PlantListReq, opts ...grpc.CallOption) (*PlantListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetPlantListResp) + out := new(PlantListResp) err := c.cc.Invoke(ctx, PlantService_GetPlantList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -173,9 +159,9 @@ func (c *plantServiceClient) GetPlantList(ctx context.Context, in *GetPlantListR return out, nil } -func (c *plantServiceClient) GetPlantDetail(ctx context.Context, in *GetPlantDetailReq, opts ...grpc.CallOption) (*GetPlantDetailResp, error) { +func (c *plantServiceClient) GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetPlantDetailResp) + out := new(PlantDetailResp) err := c.cc.Invoke(ctx, PlantService_GetPlantDetail_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -183,9 +169,9 @@ func (c *plantServiceClient) GetPlantDetail(ctx context.Context, in *GetPlantDet return out, nil } -func (c *plantServiceClient) AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*AddCarePlanResp, error) { +func (c *plantServiceClient) AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AddCarePlanResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_AddCarePlan_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -193,9 +179,9 @@ func (c *plantServiceClient) AddCarePlan(ctx context.Context, in *AddCarePlanReq return out, nil } -func (c *plantServiceClient) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*AddCareRecordResp, error) { +func (c *plantServiceClient) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AddCareRecordResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_AddCareRecord_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -203,9 +189,9 @@ func (c *plantServiceClient) AddCareRecord(ctx context.Context, in *AddCareRecor return out, nil } -func (c *plantServiceClient) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*AddGrowthRecordResp, error) { +func (c *plantServiceClient) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(AddGrowthRecordResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_AddGrowthRecord_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -213,9 +199,9 @@ func (c *plantServiceClient) AddGrowthRecord(ctx context.Context, in *AddGrowthR return out, nil } -func (c *plantServiceClient) GetWikiList(ctx context.Context, in *GetWikiListReq, opts ...grpc.CallOption) (*GetWikiListResp, error) { +func (c *plantServiceClient) GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetWikiListResp) + out := new(WikiListResp) err := c.cc.Invoke(ctx, PlantService_GetWikiList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -223,9 +209,9 @@ func (c *plantServiceClient) GetWikiList(ctx context.Context, in *GetWikiListReq return out, nil } -func (c *plantServiceClient) GetWikiDetail(ctx context.Context, in *GetWikiDetailReq, opts ...grpc.CallOption) (*GetWikiDetailResp, error) { +func (c *plantServiceClient) GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetWikiDetailResp) + out := new(WikiDetailResp) err := c.cc.Invoke(ctx, PlantService_GetWikiDetail_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -233,9 +219,9 @@ func (c *plantServiceClient) GetWikiDetail(ctx context.Context, in *GetWikiDetai return out, nil } -func (c *plantServiceClient) GetWikiClassList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetWikiClassListResp, error) { +func (c *plantServiceClient) GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetWikiClassListResp) + out := new(WikiClassListResp) err := c.cc.Invoke(ctx, PlantService_GetWikiClassList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -243,9 +229,9 @@ func (c *plantServiceClient) GetWikiClassList(ctx context.Context, in *Empty, op return out, nil } -func (c *plantServiceClient) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CreateWikiClassResp, error) { +func (c *plantServiceClient) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateWikiClassResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_CreateWikiClass_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -253,19 +239,19 @@ func (c *plantServiceClient) CreateWikiClass(ctx context.Context, in *CreateWiki return out, nil } -func (c *plantServiceClient) ToggleStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*ToggleStarResp, error) { +func (c *plantServiceClient) ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ToggleStarResp) - err := c.cc.Invoke(ctx, PlantService_ToggleStar_FullMethodName, in, out, cOpts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, PlantService_ToggleWikiStar_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *plantServiceClient) CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CreatePostResp, error) { +func (c *plantServiceClient) CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreatePostResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_CreatePost_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -273,29 +259,9 @@ func (c *plantServiceClient) CreatePost(ctx context.Context, in *CreatePostReq, return out, nil } -func (c *plantServiceClient) GetPostList(ctx context.Context, in *GetPostListReq, opts ...grpc.CallOption) (*GetPostListResp, error) { +func (c *plantServiceClient) DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetPostListResp) - err := c.cc.Invoke(ctx, PlantService_GetPostList_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *plantServiceClient) GetPostDetail(ctx context.Context, in *GetPostDetailReq, opts ...grpc.CallOption) (*GetPostDetailResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetPostDetailResp) - err := c.cc.Invoke(ctx, PlantService_GetPostDetail_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *plantServiceClient) DeletePost(ctx context.Context, in *DeletePostReq, opts ...grpc.CallOption) (*DeletePostResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeletePostResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_DeletePost_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -303,9 +269,29 @@ func (c *plantServiceClient) DeletePost(ctx context.Context, in *DeletePostReq, return out, nil } -func (c *plantServiceClient) CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommentPostResp, error) { +func (c *plantServiceClient) GetPostList(ctx context.Context, in *PostListReq, opts ...grpc.CallOption) (*PostListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CommentPostResp) + out := new(PostListResp) + err := c.cc.Invoke(ctx, PlantService_GetPostList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetPostDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PostDetailResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PostDetailResp) + err := c.cc.Invoke(ctx, PlantService_GetPostDetail_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_CommentPost_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -313,9 +299,9 @@ func (c *plantServiceClient) CommentPost(ctx context.Context, in *CommentPostReq return out, nil } -func (c *plantServiceClient) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*LikePostResp, error) { +func (c *plantServiceClient) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LikePostResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_LikePost_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -323,9 +309,9 @@ func (c *plantServiceClient) LikePost(ctx context.Context, in *LikePostReq, opts return out, nil } -func (c *plantServiceClient) GetTopicList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetTopicListResp, error) { +func (c *plantServiceClient) GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetTopicListResp) + out := new(TopicListResp) err := c.cc.Invoke(ctx, PlantService_GetTopicList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -333,9 +319,9 @@ func (c *plantServiceClient) GetTopicList(ctx context.Context, in *Empty, opts . return out, nil } -func (c *plantServiceClient) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CreateTopicResp, error) { +func (c *plantServiceClient) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateTopicResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_CreateTopic_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -343,9 +329,9 @@ func (c *plantServiceClient) CreateTopic(ctx context.Context, in *CreateTopicReq return out, nil } -func (c *plantServiceClient) DeleteTopic(ctx context.Context, in *DeleteTopicReq, opts ...grpc.CallOption) (*DeleteTopicResp, error) { +func (c *plantServiceClient) DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteTopicResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_DeleteTopic_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -353,29 +339,9 @@ func (c *plantServiceClient) DeleteTopic(ctx context.Context, in *DeleteTopicReq return out, nil } -func (c *plantServiceClient) GetLevelConfigList(ctx context.Context, in *GetLevelConfigListReq, opts ...grpc.CallOption) (*GetLevelConfigListResp, error) { +func (c *plantServiceClient) GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetLevelConfigListResp) - err := c.cc.Invoke(ctx, PlantService_GetLevelConfigList_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *plantServiceClient) GetBadgeConfigList(ctx context.Context, in *GetBadgeConfigListReq, opts ...grpc.CallOption) (*GetBadgeConfigListResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetBadgeConfigListResp) - err := c.cc.Invoke(ctx, PlantService_GetBadgeConfigList_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *plantServiceClient) GetExchangeItemList(ctx context.Context, in *GetExchangeItemListReq, opts ...grpc.CallOption) (*GetExchangeItemListResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetExchangeItemListResp) + out := new(ExchangeItemListResp) err := c.cc.Invoke(ctx, PlantService_GetExchangeItemList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -383,9 +349,9 @@ func (c *plantServiceClient) GetExchangeItemList(ctx context.Context, in *GetExc return out, nil } -func (c *plantServiceClient) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CreateExchangeOrderResp, error) { +func (c *plantServiceClient) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateExchangeOrderResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, PlantService_CreateExchangeOrder_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -393,49 +359,66 @@ func (c *plantServiceClient) CreateExchangeOrder(ctx context.Context, in *Create return out, nil } +func (c *plantServiceClient) GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(LevelConfigListResp) + err := c.cc.Invoke(ctx, PlantService_GetLevelConfigList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *plantServiceClient) GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BadgeConfigListResp) + err := c.cc.Invoke(ctx, PlantService_GetBadgeConfigList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // PlantServiceServer is the server API for PlantService service. // All implementations must embed UnimplementedPlantServiceServer // for forward compatibility. -// -// ========== 服务定义 ========== type PlantServiceServer interface { // 用户Profile - GetUserProfile(context.Context, *GetUserProfileReq) (*GetUserProfileResp, error) - UpdateUserProfile(context.Context, *UpdateUserProfileReq) (*UpdateUserProfileResp, error) - IncrUserCounter(context.Context, *IncrUserCounterReq) (*IncrUserCounterResp, error) - // 植物 - CreatePlant(context.Context, *CreatePlantReq) (*CreatePlantResp, error) - UpdatePlant(context.Context, *UpdatePlantReq) (*UpdatePlantResp, error) - DeletePlant(context.Context, *DeletePlantReq) (*DeletePlantResp, error) - GetPlantList(context.Context, *GetPlantListReq) (*GetPlantListResp, error) - GetPlantDetail(context.Context, *GetPlantDetailReq) (*GetPlantDetailResp, error) + GetUserProfile(context.Context, *GetProfileReq) (*PlantUserProfile, error) + UpdateUserProfile(context.Context, *UpdateProfileReq) (*CommonResp, error) + // 我的植物 + CreatePlant(context.Context, *CreatePlantReq) (*CommonResp, error) + UpdatePlant(context.Context, *UpdatePlantReq) (*CommonResp, error) + DeletePlant(context.Context, *IdsReq) (*CommonResp, error) + GetPlantList(context.Context, *PlantListReq) (*PlantListResp, error) + GetPlantDetail(context.Context, *IdReq) (*PlantDetailResp, error) // 养护 - AddCarePlan(context.Context, *AddCarePlanReq) (*AddCarePlanResp, error) - AddCareRecord(context.Context, *AddCareRecordReq) (*AddCareRecordResp, error) - AddGrowthRecord(context.Context, *AddGrowthRecordReq) (*AddGrowthRecordResp, error) + AddCarePlan(context.Context, *AddCarePlanReq) (*CommonResp, error) + AddCareRecord(context.Context, *AddCareRecordReq) (*CommonResp, error) + AddGrowthRecord(context.Context, *AddGrowthRecordReq) (*CommonResp, error) // 百科 - GetWikiList(context.Context, *GetWikiListReq) (*GetWikiListResp, error) - GetWikiDetail(context.Context, *GetWikiDetailReq) (*GetWikiDetailResp, error) - GetWikiClassList(context.Context, *Empty) (*GetWikiClassListResp, error) - CreateWikiClass(context.Context, *CreateWikiClassReq) (*CreateWikiClassResp, error) - ToggleStar(context.Context, *ToggleStarReq) (*ToggleStarResp, error) + GetWikiList(context.Context, *WikiListReq) (*WikiListResp, error) + GetWikiDetail(context.Context, *IdReq) (*WikiDetailResp, error) + GetWikiClassList(context.Context, *IdReq) (*WikiClassListResp, error) + CreateWikiClass(context.Context, *CreateWikiClassReq) (*CommonResp, error) + ToggleWikiStar(context.Context, *ToggleStarReq) (*CommonResp, error) // 社区 - CreatePost(context.Context, *CreatePostReq) (*CreatePostResp, error) - GetPostList(context.Context, *GetPostListReq) (*GetPostListResp, error) - GetPostDetail(context.Context, *GetPostDetailReq) (*GetPostDetailResp, error) - DeletePost(context.Context, *DeletePostReq) (*DeletePostResp, error) - CommentPost(context.Context, *CommentPostReq) (*CommentPostResp, error) - LikePost(context.Context, *LikePostReq) (*LikePostResp, error) + CreatePost(context.Context, *CreatePostReq) (*CommonResp, error) + DeletePost(context.Context, *IdsReq) (*CommonResp, error) + GetPostList(context.Context, *PostListReq) (*PostListResp, error) + GetPostDetail(context.Context, *IdReq) (*PostDetailResp, error) + CommentPost(context.Context, *CommentPostReq) (*CommonResp, error) + LikePost(context.Context, *LikePostReq) (*CommonResp, error) // 话题 - GetTopicList(context.Context, *Empty) (*GetTopicListResp, error) - CreateTopic(context.Context, *CreateTopicReq) (*CreateTopicResp, error) - DeleteTopic(context.Context, *DeleteTopicReq) (*DeleteTopicResp, error) - // 配置 - GetLevelConfigList(context.Context, *GetLevelConfigListReq) (*GetLevelConfigListResp, error) - GetBadgeConfigList(context.Context, *GetBadgeConfigListReq) (*GetBadgeConfigListResp, error) + GetTopicList(context.Context, *IdReq) (*TopicListResp, error) + CreateTopic(context.Context, *CreateTopicReq) (*CommonResp, error) + DeleteTopic(context.Context, *IdsReq) (*CommonResp, error) // 兑换 - GetExchangeItemList(context.Context, *GetExchangeItemListReq) (*GetExchangeItemListResp, error) - CreateExchangeOrder(context.Context, *CreateExchangeOrderReq) (*CreateExchangeOrderResp, error) + GetExchangeItemList(context.Context, *ExchangeItemListReq) (*ExchangeItemListResp, error) + CreateExchangeOrder(context.Context, *CreateExchangeOrderReq) (*CommonResp, error) + // 配置 + GetLevelConfigList(context.Context, *PageReq) (*LevelConfigListResp, error) + GetBadgeConfigList(context.Context, *BadgeConfigListReq) (*BadgeConfigListResp, error) mustEmbedUnimplementedPlantServiceServer() } @@ -446,93 +429,90 @@ type PlantServiceServer interface { // pointer dereference when methods are called. type UnimplementedPlantServiceServer struct{} -func (UnimplementedPlantServiceServer) GetUserProfile(context.Context, *GetUserProfileReq) (*GetUserProfileResp, error) { +func (UnimplementedPlantServiceServer) GetUserProfile(context.Context, *GetProfileReq) (*PlantUserProfile, error) { return nil, status.Error(codes.Unimplemented, "method GetUserProfile not implemented") } -func (UnimplementedPlantServiceServer) UpdateUserProfile(context.Context, *UpdateUserProfileReq) (*UpdateUserProfileResp, error) { +func (UnimplementedPlantServiceServer) UpdateUserProfile(context.Context, *UpdateProfileReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method UpdateUserProfile not implemented") } -func (UnimplementedPlantServiceServer) IncrUserCounter(context.Context, *IncrUserCounterReq) (*IncrUserCounterResp, error) { - return nil, status.Error(codes.Unimplemented, "method IncrUserCounter not implemented") -} -func (UnimplementedPlantServiceServer) CreatePlant(context.Context, *CreatePlantReq) (*CreatePlantResp, error) { +func (UnimplementedPlantServiceServer) CreatePlant(context.Context, *CreatePlantReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreatePlant not implemented") } -func (UnimplementedPlantServiceServer) UpdatePlant(context.Context, *UpdatePlantReq) (*UpdatePlantResp, error) { +func (UnimplementedPlantServiceServer) UpdatePlant(context.Context, *UpdatePlantReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method UpdatePlant not implemented") } -func (UnimplementedPlantServiceServer) DeletePlant(context.Context, *DeletePlantReq) (*DeletePlantResp, error) { +func (UnimplementedPlantServiceServer) DeletePlant(context.Context, *IdsReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method DeletePlant not implemented") } -func (UnimplementedPlantServiceServer) GetPlantList(context.Context, *GetPlantListReq) (*GetPlantListResp, error) { +func (UnimplementedPlantServiceServer) GetPlantList(context.Context, *PlantListReq) (*PlantListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetPlantList not implemented") } -func (UnimplementedPlantServiceServer) GetPlantDetail(context.Context, *GetPlantDetailReq) (*GetPlantDetailResp, error) { +func (UnimplementedPlantServiceServer) GetPlantDetail(context.Context, *IdReq) (*PlantDetailResp, error) { return nil, status.Error(codes.Unimplemented, "method GetPlantDetail not implemented") } -func (UnimplementedPlantServiceServer) AddCarePlan(context.Context, *AddCarePlanReq) (*AddCarePlanResp, error) { +func (UnimplementedPlantServiceServer) AddCarePlan(context.Context, *AddCarePlanReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method AddCarePlan not implemented") } -func (UnimplementedPlantServiceServer) AddCareRecord(context.Context, *AddCareRecordReq) (*AddCareRecordResp, error) { +func (UnimplementedPlantServiceServer) AddCareRecord(context.Context, *AddCareRecordReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method AddCareRecord not implemented") } -func (UnimplementedPlantServiceServer) AddGrowthRecord(context.Context, *AddGrowthRecordReq) (*AddGrowthRecordResp, error) { +func (UnimplementedPlantServiceServer) AddGrowthRecord(context.Context, *AddGrowthRecordReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method AddGrowthRecord not implemented") } -func (UnimplementedPlantServiceServer) GetWikiList(context.Context, *GetWikiListReq) (*GetWikiListResp, error) { +func (UnimplementedPlantServiceServer) GetWikiList(context.Context, *WikiListReq) (*WikiListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetWikiList not implemented") } -func (UnimplementedPlantServiceServer) GetWikiDetail(context.Context, *GetWikiDetailReq) (*GetWikiDetailResp, error) { +func (UnimplementedPlantServiceServer) GetWikiDetail(context.Context, *IdReq) (*WikiDetailResp, error) { return nil, status.Error(codes.Unimplemented, "method GetWikiDetail not implemented") } -func (UnimplementedPlantServiceServer) GetWikiClassList(context.Context, *Empty) (*GetWikiClassListResp, error) { +func (UnimplementedPlantServiceServer) GetWikiClassList(context.Context, *IdReq) (*WikiClassListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetWikiClassList not implemented") } -func (UnimplementedPlantServiceServer) CreateWikiClass(context.Context, *CreateWikiClassReq) (*CreateWikiClassResp, error) { +func (UnimplementedPlantServiceServer) CreateWikiClass(context.Context, *CreateWikiClassReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateWikiClass not implemented") } -func (UnimplementedPlantServiceServer) ToggleStar(context.Context, *ToggleStarReq) (*ToggleStarResp, error) { - return nil, status.Error(codes.Unimplemented, "method ToggleStar not implemented") +func (UnimplementedPlantServiceServer) ToggleWikiStar(context.Context, *ToggleStarReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method ToggleWikiStar not implemented") } -func (UnimplementedPlantServiceServer) CreatePost(context.Context, *CreatePostReq) (*CreatePostResp, error) { +func (UnimplementedPlantServiceServer) CreatePost(context.Context, *CreatePostReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreatePost not implemented") } -func (UnimplementedPlantServiceServer) GetPostList(context.Context, *GetPostListReq) (*GetPostListResp, error) { - return nil, status.Error(codes.Unimplemented, "method GetPostList not implemented") -} -func (UnimplementedPlantServiceServer) GetPostDetail(context.Context, *GetPostDetailReq) (*GetPostDetailResp, error) { - return nil, status.Error(codes.Unimplemented, "method GetPostDetail not implemented") -} -func (UnimplementedPlantServiceServer) DeletePost(context.Context, *DeletePostReq) (*DeletePostResp, error) { +func (UnimplementedPlantServiceServer) DeletePost(context.Context, *IdsReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method DeletePost not implemented") } -func (UnimplementedPlantServiceServer) CommentPost(context.Context, *CommentPostReq) (*CommentPostResp, error) { +func (UnimplementedPlantServiceServer) GetPostList(context.Context, *PostListReq) (*PostListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetPostList not implemented") +} +func (UnimplementedPlantServiceServer) GetPostDetail(context.Context, *IdReq) (*PostDetailResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetPostDetail not implemented") +} +func (UnimplementedPlantServiceServer) CommentPost(context.Context, *CommentPostReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CommentPost not implemented") } -func (UnimplementedPlantServiceServer) LikePost(context.Context, *LikePostReq) (*LikePostResp, error) { +func (UnimplementedPlantServiceServer) LikePost(context.Context, *LikePostReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method LikePost not implemented") } -func (UnimplementedPlantServiceServer) GetTopicList(context.Context, *Empty) (*GetTopicListResp, error) { +func (UnimplementedPlantServiceServer) GetTopicList(context.Context, *IdReq) (*TopicListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetTopicList not implemented") } -func (UnimplementedPlantServiceServer) CreateTopic(context.Context, *CreateTopicReq) (*CreateTopicResp, error) { +func (UnimplementedPlantServiceServer) CreateTopic(context.Context, *CreateTopicReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateTopic not implemented") } -func (UnimplementedPlantServiceServer) DeleteTopic(context.Context, *DeleteTopicReq) (*DeleteTopicResp, error) { +func (UnimplementedPlantServiceServer) DeleteTopic(context.Context, *IdsReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method DeleteTopic not implemented") } -func (UnimplementedPlantServiceServer) GetLevelConfigList(context.Context, *GetLevelConfigListReq) (*GetLevelConfigListResp, error) { - return nil, status.Error(codes.Unimplemented, "method GetLevelConfigList not implemented") -} -func (UnimplementedPlantServiceServer) GetBadgeConfigList(context.Context, *GetBadgeConfigListReq) (*GetBadgeConfigListResp, error) { - return nil, status.Error(codes.Unimplemented, "method GetBadgeConfigList not implemented") -} -func (UnimplementedPlantServiceServer) GetExchangeItemList(context.Context, *GetExchangeItemListReq) (*GetExchangeItemListResp, error) { +func (UnimplementedPlantServiceServer) GetExchangeItemList(context.Context, *ExchangeItemListReq) (*ExchangeItemListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetExchangeItemList not implemented") } -func (UnimplementedPlantServiceServer) CreateExchangeOrder(context.Context, *CreateExchangeOrderReq) (*CreateExchangeOrderResp, error) { +func (UnimplementedPlantServiceServer) CreateExchangeOrder(context.Context, *CreateExchangeOrderReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateExchangeOrder not implemented") } +func (UnimplementedPlantServiceServer) GetLevelConfigList(context.Context, *PageReq) (*LevelConfigListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetLevelConfigList not implemented") +} +func (UnimplementedPlantServiceServer) GetBadgeConfigList(context.Context, *BadgeConfigListReq) (*BadgeConfigListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetBadgeConfigList not implemented") +} func (UnimplementedPlantServiceServer) mustEmbedUnimplementedPlantServiceServer() {} func (UnimplementedPlantServiceServer) testEmbeddedByValue() {} @@ -555,7 +535,7 @@ func RegisterPlantServiceServer(s grpc.ServiceRegistrar, srv PlantServiceServer) } func _PlantService_GetUserProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserProfileReq) + in := new(GetProfileReq) if err := dec(in); err != nil { return nil, err } @@ -567,13 +547,13 @@ func _PlantService_GetUserProfile_Handler(srv interface{}, ctx context.Context, FullMethod: PlantService_GetUserProfile_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetUserProfile(ctx, req.(*GetUserProfileReq)) + return srv.(PlantServiceServer).GetUserProfile(ctx, req.(*GetProfileReq)) } return interceptor(ctx, in, info, handler) } func _PlantService_UpdateUserProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateUserProfileReq) + in := new(UpdateProfileReq) if err := dec(in); err != nil { return nil, err } @@ -585,25 +565,7 @@ func _PlantService_UpdateUserProfile_Handler(srv interface{}, ctx context.Contex FullMethod: PlantService_UpdateUserProfile_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).UpdateUserProfile(ctx, req.(*UpdateUserProfileReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlantService_IncrUserCounter_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(IncrUserCounterReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlantServiceServer).IncrUserCounter(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlantService_IncrUserCounter_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).IncrUserCounter(ctx, req.(*IncrUserCounterReq)) + return srv.(PlantServiceServer).UpdateUserProfile(ctx, req.(*UpdateProfileReq)) } return interceptor(ctx, in, info, handler) } @@ -645,7 +607,7 @@ func _PlantService_UpdatePlant_Handler(srv interface{}, ctx context.Context, dec } func _PlantService_DeletePlant_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeletePlantReq) + in := new(IdsReq) if err := dec(in); err != nil { return nil, err } @@ -657,13 +619,13 @@ func _PlantService_DeletePlant_Handler(srv interface{}, ctx context.Context, dec FullMethod: PlantService_DeletePlant_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).DeletePlant(ctx, req.(*DeletePlantReq)) + return srv.(PlantServiceServer).DeletePlant(ctx, req.(*IdsReq)) } return interceptor(ctx, in, info, handler) } func _PlantService_GetPlantList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPlantListReq) + in := new(PlantListReq) if err := dec(in); err != nil { return nil, err } @@ -675,13 +637,13 @@ func _PlantService_GetPlantList_Handler(srv interface{}, ctx context.Context, de FullMethod: PlantService_GetPlantList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetPlantList(ctx, req.(*GetPlantListReq)) + return srv.(PlantServiceServer).GetPlantList(ctx, req.(*PlantListReq)) } return interceptor(ctx, in, info, handler) } func _PlantService_GetPlantDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPlantDetailReq) + in := new(IdReq) if err := dec(in); err != nil { return nil, err } @@ -693,7 +655,7 @@ func _PlantService_GetPlantDetail_Handler(srv interface{}, ctx context.Context, FullMethod: PlantService_GetPlantDetail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetPlantDetail(ctx, req.(*GetPlantDetailReq)) + return srv.(PlantServiceServer).GetPlantDetail(ctx, req.(*IdReq)) } return interceptor(ctx, in, info, handler) } @@ -753,7 +715,7 @@ func _PlantService_AddGrowthRecord_Handler(srv interface{}, ctx context.Context, } func _PlantService_GetWikiList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetWikiListReq) + in := new(WikiListReq) if err := dec(in); err != nil { return nil, err } @@ -765,13 +727,13 @@ func _PlantService_GetWikiList_Handler(srv interface{}, ctx context.Context, dec FullMethod: PlantService_GetWikiList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetWikiList(ctx, req.(*GetWikiListReq)) + return srv.(PlantServiceServer).GetWikiList(ctx, req.(*WikiListReq)) } return interceptor(ctx, in, info, handler) } func _PlantService_GetWikiDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetWikiDetailReq) + in := new(IdReq) if err := dec(in); err != nil { return nil, err } @@ -783,13 +745,13 @@ func _PlantService_GetWikiDetail_Handler(srv interface{}, ctx context.Context, d FullMethod: PlantService_GetWikiDetail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetWikiDetail(ctx, req.(*GetWikiDetailReq)) + return srv.(PlantServiceServer).GetWikiDetail(ctx, req.(*IdReq)) } return interceptor(ctx, in, info, handler) } func _PlantService_GetWikiClassList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) + in := new(IdReq) if err := dec(in); err != nil { return nil, err } @@ -801,7 +763,7 @@ func _PlantService_GetWikiClassList_Handler(srv interface{}, ctx context.Context FullMethod: PlantService_GetWikiClassList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetWikiClassList(ctx, req.(*Empty)) + return srv.(PlantServiceServer).GetWikiClassList(ctx, req.(*IdReq)) } return interceptor(ctx, in, info, handler) } @@ -824,20 +786,20 @@ func _PlantService_CreateWikiClass_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } -func _PlantService_ToggleStar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { +func _PlantService_ToggleWikiStar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ToggleStarReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(PlantServiceServer).ToggleStar(ctx, in) + return srv.(PlantServiceServer).ToggleWikiStar(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: PlantService_ToggleStar_FullMethodName, + FullMethod: PlantService_ToggleWikiStar_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).ToggleStar(ctx, req.(*ToggleStarReq)) + return srv.(PlantServiceServer).ToggleWikiStar(ctx, req.(*ToggleStarReq)) } return interceptor(ctx, in, info, handler) } @@ -860,44 +822,8 @@ func _PlantService_CreatePost_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _PlantService_GetPostList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPostListReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlantServiceServer).GetPostList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlantService_GetPostList_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetPostList(ctx, req.(*GetPostListReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlantService_GetPostDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetPostDetailReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlantServiceServer).GetPostDetail(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlantService_GetPostDetail_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetPostDetail(ctx, req.(*GetPostDetailReq)) - } - return interceptor(ctx, in, info, handler) -} - func _PlantService_DeletePost_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeletePostReq) + in := new(IdsReq) if err := dec(in); err != nil { return nil, err } @@ -909,7 +835,43 @@ func _PlantService_DeletePost_Handler(srv interface{}, ctx context.Context, dec FullMethod: PlantService_DeletePost_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).DeletePost(ctx, req.(*DeletePostReq)) + return srv.(PlantServiceServer).DeletePost(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetPostList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PostListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetPostList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetPostList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetPostList(ctx, req.(*PostListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetPostDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetPostDetail(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetPostDetail_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetPostDetail(ctx, req.(*IdReq)) } return interceptor(ctx, in, info, handler) } @@ -951,7 +913,7 @@ func _PlantService_LikePost_Handler(srv interface{}, ctx context.Context, dec fu } func _PlantService_GetTopicList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(Empty) + in := new(IdReq) if err := dec(in); err != nil { return nil, err } @@ -963,7 +925,7 @@ func _PlantService_GetTopicList_Handler(srv interface{}, ctx context.Context, de FullMethod: PlantService_GetTopicList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetTopicList(ctx, req.(*Empty)) + return srv.(PlantServiceServer).GetTopicList(ctx, req.(*IdReq)) } return interceptor(ctx, in, info, handler) } @@ -987,7 +949,7 @@ func _PlantService_CreateTopic_Handler(srv interface{}, ctx context.Context, dec } func _PlantService_DeleteTopic_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteTopicReq) + in := new(IdsReq) if err := dec(in); err != nil { return nil, err } @@ -999,49 +961,13 @@ func _PlantService_DeleteTopic_Handler(srv interface{}, ctx context.Context, dec FullMethod: PlantService_DeleteTopic_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).DeleteTopic(ctx, req.(*DeleteTopicReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlantService_GetLevelConfigList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetLevelConfigListReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlantServiceServer).GetLevelConfigList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlantService_GetLevelConfigList_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetLevelConfigList(ctx, req.(*GetLevelConfigListReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _PlantService_GetBadgeConfigList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBadgeConfigListReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(PlantServiceServer).GetBadgeConfigList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: PlantService_GetBadgeConfigList_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetBadgeConfigList(ctx, req.(*GetBadgeConfigListReq)) + return srv.(PlantServiceServer).DeleteTopic(ctx, req.(*IdsReq)) } return interceptor(ctx, in, info, handler) } func _PlantService_GetExchangeItemList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetExchangeItemListReq) + in := new(ExchangeItemListReq) if err := dec(in); err != nil { return nil, err } @@ -1053,7 +979,7 @@ func _PlantService_GetExchangeItemList_Handler(srv interface{}, ctx context.Cont FullMethod: PlantService_GetExchangeItemList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(PlantServiceServer).GetExchangeItemList(ctx, req.(*GetExchangeItemListReq)) + return srv.(PlantServiceServer).GetExchangeItemList(ctx, req.(*ExchangeItemListReq)) } return interceptor(ctx, in, info, handler) } @@ -1076,6 +1002,42 @@ func _PlantService_CreateExchangeOrder_Handler(srv interface{}, ctx context.Cont return interceptor(ctx, in, info, handler) } +func _PlantService_GetLevelConfigList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PageReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetLevelConfigList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetLevelConfigList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetLevelConfigList(ctx, req.(*PageReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlantService_GetBadgeConfigList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(BadgeConfigListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlantServiceServer).GetBadgeConfigList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: PlantService_GetBadgeConfigList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlantServiceServer).GetBadgeConfigList(ctx, req.(*BadgeConfigListReq)) + } + return interceptor(ctx, in, info, handler) +} + // PlantService_ServiceDesc is the grpc.ServiceDesc for PlantService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -1091,10 +1053,6 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "UpdateUserProfile", Handler: _PlantService_UpdateUserProfile_Handler, }, - { - MethodName: "IncrUserCounter", - Handler: _PlantService_IncrUserCounter_Handler, - }, { MethodName: "CreatePlant", Handler: _PlantService_CreatePlant_Handler, @@ -1144,13 +1102,17 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ Handler: _PlantService_CreateWikiClass_Handler, }, { - MethodName: "ToggleStar", - Handler: _PlantService_ToggleStar_Handler, + MethodName: "ToggleWikiStar", + Handler: _PlantService_ToggleWikiStar_Handler, }, { MethodName: "CreatePost", Handler: _PlantService_CreatePost_Handler, }, + { + MethodName: "DeletePost", + Handler: _PlantService_DeletePost_Handler, + }, { MethodName: "GetPostList", Handler: _PlantService_GetPostList_Handler, @@ -1159,10 +1121,6 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetPostDetail", Handler: _PlantService_GetPostDetail_Handler, }, - { - MethodName: "DeletePost", - Handler: _PlantService_DeletePost_Handler, - }, { MethodName: "CommentPost", Handler: _PlantService_CommentPost_Handler, @@ -1183,14 +1141,6 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "DeleteTopic", Handler: _PlantService_DeleteTopic_Handler, }, - { - MethodName: "GetLevelConfigList", - Handler: _PlantService_GetLevelConfigList_Handler, - }, - { - MethodName: "GetBadgeConfigList", - Handler: _PlantService_GetBadgeConfigList_Handler, - }, { MethodName: "GetExchangeItemList", Handler: _PlantService_GetExchangeItemList_Handler, @@ -1199,6 +1149,14 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{ MethodName: "CreateExchangeOrder", Handler: _PlantService_CreateExchangeOrder_Handler, }, + { + MethodName: "GetLevelConfigList", + Handler: _PlantService_GetLevelConfigList_Handler, + }, + { + MethodName: "GetBadgeConfigList", + Handler: _PlantService_GetBadgeConfigList_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "pb/plant.proto", diff --git a/app/plant/rpc/plantservice/plantService.go b/app/plant/rpc/plantservice/plantService.go index a90bbfb..33cb847 100644 --- a/app/plant/rpc/plantservice/plantService.go +++ b/app/plant/rpc/plantservice/plantService.go @@ -14,112 +14,90 @@ import ( ) type ( - AddCarePlanReq = plant.AddCarePlanReq - AddCarePlanResp = plant.AddCarePlanResp - AddCareRecordReq = plant.AddCareRecordReq - AddCareRecordResp = plant.AddCareRecordResp - AddGrowthRecordReq = plant.AddGrowthRecordReq - AddGrowthRecordResp = plant.AddGrowthRecordResp - BadgeConfigInfo = plant.BadgeConfigInfo - CarePlanInfo = plant.CarePlanInfo - CommentPostReq = plant.CommentPostReq - CommentPostResp = plant.CommentPostResp - CreateExchangeOrderReq = plant.CreateExchangeOrderReq - CreateExchangeOrderResp = plant.CreateExchangeOrderResp - CreatePlantReq = plant.CreatePlantReq - CreatePlantResp = plant.CreatePlantResp - CreatePostReq = plant.CreatePostReq - CreatePostResp = plant.CreatePostResp - CreateTopicReq = plant.CreateTopicReq - CreateTopicResp = plant.CreateTopicResp - CreateWikiClassReq = plant.CreateWikiClassReq - CreateWikiClassResp = plant.CreateWikiClassResp - DeletePlantReq = plant.DeletePlantReq - DeletePlantResp = plant.DeletePlantResp - DeletePostReq = plant.DeletePostReq - DeletePostResp = plant.DeletePostResp - DeleteTopicReq = plant.DeleteTopicReq - DeleteTopicResp = plant.DeleteTopicResp - Empty = plant.Empty - ExchangeItemInfo = plant.ExchangeItemInfo - GetBadgeConfigListReq = plant.GetBadgeConfigListReq - GetBadgeConfigListResp = plant.GetBadgeConfigListResp - GetExchangeItemListReq = plant.GetExchangeItemListReq - GetExchangeItemListResp = plant.GetExchangeItemListResp - GetLevelConfigListReq = plant.GetLevelConfigListReq - GetLevelConfigListResp = plant.GetLevelConfigListResp - GetPlantDetailReq = plant.GetPlantDetailReq - GetPlantDetailResp = plant.GetPlantDetailResp - GetPlantListReq = plant.GetPlantListReq - GetPlantListResp = plant.GetPlantListResp - GetPostDetailReq = plant.GetPostDetailReq - GetPostDetailResp = plant.GetPostDetailResp - GetPostListReq = plant.GetPostListReq - GetPostListResp = plant.GetPostListResp - GetTopicListResp = plant.GetTopicListResp - GetUserProfileReq = plant.GetUserProfileReq - GetUserProfileResp = plant.GetUserProfileResp - GetWikiClassListResp = plant.GetWikiClassListResp - GetWikiDetailReq = plant.GetWikiDetailReq - GetWikiDetailResp = plant.GetWikiDetailResp - GetWikiListReq = plant.GetWikiListReq - GetWikiListResp = plant.GetWikiListResp - IncrUserCounterReq = plant.IncrUserCounterReq - IncrUserCounterResp = plant.IncrUserCounterResp - LevelConfigInfo = plant.LevelConfigInfo - LikePostReq = plant.LikePostReq - LikePostResp = plant.LikePostResp - PlantInfo = plant.PlantInfo - PostInfo = plant.PostInfo - ToggleStarReq = plant.ToggleStarReq - ToggleStarResp = plant.ToggleStarResp - TopicInfo = plant.TopicInfo - UpdatePlantReq = plant.UpdatePlantReq - UpdatePlantResp = plant.UpdatePlantResp - UpdateUserProfileReq = plant.UpdateUserProfileReq - UpdateUserProfileResp = plant.UpdateUserProfileResp - UserProfile = plant.UserProfile - WikiClassInfo = plant.WikiClassInfo - WikiInfo = plant.WikiInfo + AddCarePlanReq = plant.AddCarePlanReq + AddCareRecordReq = plant.AddCareRecordReq + AddGrowthRecordReq = plant.AddGrowthRecordReq + BadgeConfigInfo = plant.BadgeConfigInfo + BadgeConfigListReq = plant.BadgeConfigListReq + BadgeConfigListResp = plant.BadgeConfigListResp + CarePlanInfo = plant.CarePlanInfo + CommentPostReq = plant.CommentPostReq + CommonResp = plant.CommonResp + CreateExchangeOrderReq = plant.CreateExchangeOrderReq + CreatePlantReq = plant.CreatePlantReq + CreatePostReq = plant.CreatePostReq + CreateTopicReq = plant.CreateTopicReq + CreateWikiClassReq = plant.CreateWikiClassReq + ExchangeItemInfo = plant.ExchangeItemInfo + ExchangeItemListReq = plant.ExchangeItemListReq + ExchangeItemListResp = plant.ExchangeItemListResp + GetProfileReq = plant.GetProfileReq + GrowthRecordInfo = plant.GrowthRecordInfo + IdReq = plant.IdReq + IdsReq = plant.IdsReq + LevelConfigInfo = plant.LevelConfigInfo + LevelConfigListResp = plant.LevelConfigListResp + LikePostReq = plant.LikePostReq + PageReq = plant.PageReq + PlantDetailResp = plant.PlantDetailResp + PlantInfo = plant.PlantInfo + PlantListReq = plant.PlantListReq + PlantListResp = plant.PlantListResp + PlantUserProfile = plant.PlantUserProfile + PostCommentInfo = plant.PostCommentInfo + PostDetailResp = plant.PostDetailResp + PostInfo = plant.PostInfo + PostListReq = plant.PostListReq + PostListResp = plant.PostListResp + ToggleStarReq = plant.ToggleStarReq + TopicInfo = plant.TopicInfo + TopicListResp = plant.TopicListResp + UpdatePlantReq = plant.UpdatePlantReq + UpdateProfileReq = plant.UpdateProfileReq + WikiClassInfo = plant.WikiClassInfo + WikiClassListResp = plant.WikiClassListResp + WikiDetailResp = plant.WikiDetailResp + WikiInfo = plant.WikiInfo + WikiListReq = plant.WikiListReq + WikiListResp = plant.WikiListResp PlantService interface { // 用户Profile - GetUserProfile(ctx context.Context, in *GetUserProfileReq, opts ...grpc.CallOption) (*GetUserProfileResp, error) - UpdateUserProfile(ctx context.Context, in *UpdateUserProfileReq, opts ...grpc.CallOption) (*UpdateUserProfileResp, error) - IncrUserCounter(ctx context.Context, in *IncrUserCounterReq, opts ...grpc.CallOption) (*IncrUserCounterResp, error) - // 植物 - CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CreatePlantResp, error) - UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*UpdatePlantResp, error) - DeletePlant(ctx context.Context, in *DeletePlantReq, opts ...grpc.CallOption) (*DeletePlantResp, error) - GetPlantList(ctx context.Context, in *GetPlantListReq, opts ...grpc.CallOption) (*GetPlantListResp, error) - GetPlantDetail(ctx context.Context, in *GetPlantDetailReq, opts ...grpc.CallOption) (*GetPlantDetailResp, error) + GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) + UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) + // 我的植物 + CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) + DeletePlant(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetPlantList(ctx context.Context, in *PlantListReq, opts ...grpc.CallOption) (*PlantListResp, error) + GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) // 养护 - AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*AddCarePlanResp, error) - AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*AddCareRecordResp, error) - AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*AddGrowthRecordResp, error) + AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) + AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) + AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) // 百科 - GetWikiList(ctx context.Context, in *GetWikiListReq, opts ...grpc.CallOption) (*GetWikiListResp, error) - GetWikiDetail(ctx context.Context, in *GetWikiDetailReq, opts ...grpc.CallOption) (*GetWikiDetailResp, error) - GetWikiClassList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetWikiClassListResp, error) - CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CreateWikiClassResp, error) - ToggleStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*ToggleStarResp, error) + GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) + GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) + GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) + CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) + ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) // 社区 - CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CreatePostResp, error) - GetPostList(ctx context.Context, in *GetPostListReq, opts ...grpc.CallOption) (*GetPostListResp, error) - GetPostDetail(ctx context.Context, in *GetPostDetailReq, opts ...grpc.CallOption) (*GetPostDetailResp, error) - DeletePost(ctx context.Context, in *DeletePostReq, opts ...grpc.CallOption) (*DeletePostResp, error) - CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommentPostResp, error) - LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*LikePostResp, error) + CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) + DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetPostList(ctx context.Context, in *PostListReq, opts ...grpc.CallOption) (*PostListResp, error) + GetPostDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PostDetailResp, error) + CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommonResp, error) + LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) // 话题 - GetTopicList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetTopicListResp, error) - CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CreateTopicResp, error) - DeleteTopic(ctx context.Context, in *DeleteTopicReq, opts ...grpc.CallOption) (*DeleteTopicResp, error) - // 配置 - GetLevelConfigList(ctx context.Context, in *GetLevelConfigListReq, opts ...grpc.CallOption) (*GetLevelConfigListResp, error) - GetBadgeConfigList(ctx context.Context, in *GetBadgeConfigListReq, opts ...grpc.CallOption) (*GetBadgeConfigListResp, error) + GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) + CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) // 兑换 - GetExchangeItemList(ctx context.Context, in *GetExchangeItemListReq, opts ...grpc.CallOption) (*GetExchangeItemListResp, error) - CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CreateExchangeOrderResp, error) + GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) + CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) + // 配置 + GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) + GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) } defaultPlantService struct { @@ -134,154 +112,149 @@ func NewPlantService(cli zrpc.Client) PlantService { } // 用户Profile -func (m *defaultPlantService) GetUserProfile(ctx context.Context, in *GetUserProfileReq, opts ...grpc.CallOption) (*GetUserProfileResp, error) { +func (m *defaultPlantService) GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.GetUserProfile(ctx, in, opts...) } -func (m *defaultPlantService) UpdateUserProfile(ctx context.Context, in *UpdateUserProfileReq, opts ...grpc.CallOption) (*UpdateUserProfileResp, error) { +func (m *defaultPlantService) UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.UpdateUserProfile(ctx, in, opts...) } -func (m *defaultPlantService) IncrUserCounter(ctx context.Context, in *IncrUserCounterReq, opts ...grpc.CallOption) (*IncrUserCounterResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.IncrUserCounter(ctx, in, opts...) -} - -// 植物 -func (m *defaultPlantService) CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CreatePlantResp, error) { +// 我的植物 +func (m *defaultPlantService) CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.CreatePlant(ctx, in, opts...) } -func (m *defaultPlantService) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*UpdatePlantResp, error) { +func (m *defaultPlantService) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.UpdatePlant(ctx, in, opts...) } -func (m *defaultPlantService) DeletePlant(ctx context.Context, in *DeletePlantReq, opts ...grpc.CallOption) (*DeletePlantResp, error) { +func (m *defaultPlantService) DeletePlant(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.DeletePlant(ctx, in, opts...) } -func (m *defaultPlantService) GetPlantList(ctx context.Context, in *GetPlantListReq, opts ...grpc.CallOption) (*GetPlantListResp, error) { +func (m *defaultPlantService) GetPlantList(ctx context.Context, in *PlantListReq, opts ...grpc.CallOption) (*PlantListResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.GetPlantList(ctx, in, opts...) } -func (m *defaultPlantService) GetPlantDetail(ctx context.Context, in *GetPlantDetailReq, opts ...grpc.CallOption) (*GetPlantDetailResp, error) { +func (m *defaultPlantService) GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.GetPlantDetail(ctx, in, opts...) } // 养护 -func (m *defaultPlantService) AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*AddCarePlanResp, error) { +func (m *defaultPlantService) AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.AddCarePlan(ctx, in, opts...) } -func (m *defaultPlantService) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*AddCareRecordResp, error) { +func (m *defaultPlantService) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.AddCareRecord(ctx, in, opts...) } -func (m *defaultPlantService) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*AddGrowthRecordResp, error) { +func (m *defaultPlantService) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.AddGrowthRecord(ctx, in, opts...) } // 百科 -func (m *defaultPlantService) GetWikiList(ctx context.Context, in *GetWikiListReq, opts ...grpc.CallOption) (*GetWikiListResp, error) { +func (m *defaultPlantService) GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.GetWikiList(ctx, in, opts...) } -func (m *defaultPlantService) GetWikiDetail(ctx context.Context, in *GetWikiDetailReq, opts ...grpc.CallOption) (*GetWikiDetailResp, error) { +func (m *defaultPlantService) GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.GetWikiDetail(ctx, in, opts...) } -func (m *defaultPlantService) GetWikiClassList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetWikiClassListResp, error) { +func (m *defaultPlantService) GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.GetWikiClassList(ctx, in, opts...) } -func (m *defaultPlantService) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CreateWikiClassResp, error) { +func (m *defaultPlantService) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.CreateWikiClass(ctx, in, opts...) } -func (m *defaultPlantService) ToggleStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*ToggleStarResp, error) { +func (m *defaultPlantService) ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.ToggleStar(ctx, in, opts...) + return client.ToggleWikiStar(ctx, in, opts...) } // 社区 -func (m *defaultPlantService) CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CreatePostResp, error) { +func (m *defaultPlantService) CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.CreatePost(ctx, in, opts...) } -func (m *defaultPlantService) GetPostList(ctx context.Context, in *GetPostListReq, opts ...grpc.CallOption) (*GetPostListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetPostList(ctx, in, opts...) -} - -func (m *defaultPlantService) GetPostDetail(ctx context.Context, in *GetPostDetailReq, opts ...grpc.CallOption) (*GetPostDetailResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetPostDetail(ctx, in, opts...) -} - -func (m *defaultPlantService) DeletePost(ctx context.Context, in *DeletePostReq, opts ...grpc.CallOption) (*DeletePostResp, error) { +func (m *defaultPlantService) DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.DeletePost(ctx, in, opts...) } -func (m *defaultPlantService) CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommentPostResp, error) { +func (m *defaultPlantService) GetPostList(ctx context.Context, in *PostListReq, opts ...grpc.CallOption) (*PostListResp, error) { + client := plant.NewPlantServiceClient(m.cli.Conn()) + return client.GetPostList(ctx, in, opts...) +} + +func (m *defaultPlantService) GetPostDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PostDetailResp, error) { + client := plant.NewPlantServiceClient(m.cli.Conn()) + return client.GetPostDetail(ctx, in, opts...) +} + +func (m *defaultPlantService) CommentPost(ctx context.Context, in *CommentPostReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.CommentPost(ctx, in, opts...) } -func (m *defaultPlantService) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*LikePostResp, error) { +func (m *defaultPlantService) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.LikePost(ctx, in, opts...) } // 话题 -func (m *defaultPlantService) GetTopicList(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*GetTopicListResp, error) { +func (m *defaultPlantService) GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.GetTopicList(ctx, in, opts...) } -func (m *defaultPlantService) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CreateTopicResp, error) { +func (m *defaultPlantService) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.CreateTopic(ctx, in, opts...) } -func (m *defaultPlantService) DeleteTopic(ctx context.Context, in *DeleteTopicReq, opts ...grpc.CallOption) (*DeleteTopicResp, error) { +func (m *defaultPlantService) DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.DeleteTopic(ctx, in, opts...) } -// 配置 -func (m *defaultPlantService) GetLevelConfigList(ctx context.Context, in *GetLevelConfigListReq, opts ...grpc.CallOption) (*GetLevelConfigListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetLevelConfigList(ctx, in, opts...) -} - -func (m *defaultPlantService) GetBadgeConfigList(ctx context.Context, in *GetBadgeConfigListReq, opts ...grpc.CallOption) (*GetBadgeConfigListResp, error) { - client := plant.NewPlantServiceClient(m.cli.Conn()) - return client.GetBadgeConfigList(ctx, in, opts...) -} - // 兑换 -func (m *defaultPlantService) GetExchangeItemList(ctx context.Context, in *GetExchangeItemListReq, opts ...grpc.CallOption) (*GetExchangeItemListResp, error) { +func (m *defaultPlantService) GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.GetExchangeItemList(ctx, in, opts...) } -func (m *defaultPlantService) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CreateExchangeOrderResp, error) { +func (m *defaultPlantService) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) { client := plant.NewPlantServiceClient(m.cli.Conn()) return client.CreateExchangeOrder(ctx, in, opts...) } + +// 配置 +func (m *defaultPlantService) GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) { + client := plant.NewPlantServiceClient(m.cli.Conn()) + return client.GetLevelConfigList(ctx, in, opts...) +} + +func (m *defaultPlantService) GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) { + client := plant.NewPlantServiceClient(m.cli.Conn()) + return client.GetBadgeConfigList(ctx, in, opts...) +} diff --git a/app/radio/api/etc/radio-api.yaml b/app/radio/api/etc/radio-api.yaml index 0e672d4..ba9573c 100644 --- a/app/radio/api/etc/radio-api.yaml +++ b/app/radio/api/etc/radio-api.yaml @@ -1,22 +1,20 @@ Name: radio-api + +Log: + Encoding: plain Host: 0.0.0.0 Port: 9005 Auth: - AccessSecret: 9149f2eb-d517-4a50-a03a-231dbcf0d872 - AccessExpire: 7200 + AccessSecret: sundynix-jwt-secret-2024 + AccessExpire: 604800 -# MySQL -DB: - DataSource: root:root@tcp(192.168.100.127:3307)/sundynix_micro_go?charset=utf8mb4&parseTime=True&loc=Local +RadioRpc: + Etcd: + Hosts: + - 192.168.100.127:2379 + Key: radio.rpc -# Redis -Cache: - - Host: 127.0.0.1:6379 - Pass: sundynix - Type: node - -# RPC 依赖 UserRpc: Etcd: Hosts: @@ -28,18 +26,3 @@ FileRpc: Hosts: - 192.168.100.127:2379 Key: file.rpc - -# TTS 火山引擎 -Tts: - AppId: "9604175735" - ResourceId: "seed-tts-2.0" - AccessKey: "IMSrxDQgXWOwaJnuF-5G7uppRQutwBny" - -# 微信支付 -WechatPay: - MchId: "1735188493" - MchCertificateSerialNumber: "3725BFCA9CA3AF819AEC5D0CB7D3540BBC67F2CF" - MchApiV3Key: "a1B2c3D4e5F6g7H8i9J0k1L2m3N4o5P6" - PrivateKeyPath: "/Users/blizzard/privateFolder/cert/apiclient_key.pem" - PublicKeyPath: "/Users/blizzard/privateFolder/cert/pub_key.pem" - NotifyUrl: "https://radio.sundynix.cn/api/wechatpay/notify" diff --git a/app/radio/api/internal/config/config.go b/app/radio/api/internal/config/config.go index 3e32222..bf43961 100644 --- a/app/radio/api/internal/config/config.go +++ b/app/radio/api/internal/config/config.go @@ -14,27 +14,7 @@ type Config struct { AccessSecret string AccessExpire int64 } - DB struct { - DataSource string - } - Cache []struct { - Host string - Pass string - Type string - } - UserRpc zrpc.RpcClientConf - FileRpc zrpc.RpcClientConf - Tts struct { - AppId string - ResourceId string - AccessKey string - } - WechatPay struct { - MchId string - MchCertificateSerialNumber string - MchApiV3Key string - PrivateKeyPath string - PublicKeyPath string - NotifyUrl string - } + RadioRpc zrpc.RpcClientConf + UserRpc zrpc.RpcClientConf + FileRpc zrpc.RpcClientConf } diff --git a/app/radio/api/internal/svc/serviceContext.go b/app/radio/api/internal/svc/serviceContext.go index 286e75d..5bbbdf9 100644 --- a/app/radio/api/internal/svc/serviceContext.go +++ b/app/radio/api/internal/svc/serviceContext.go @@ -6,53 +6,24 @@ package svc import ( "sundynix-micro-go/app/file/rpc/fileservice" "sundynix-micro-go/app/radio/api/internal/config" - radioModel "sundynix-micro-go/app/radio/model" + "sundynix-micro-go/app/radio/rpc/radioservice" "sundynix-micro-go/app/user/rpc/userservice" - "github.com/zeromicro/go-zero/core/logx" "github.com/zeromicro/go-zero/zrpc" - "gorm.io/driver/mysql" - "gorm.io/gorm" ) type ServiceContext struct { - Config config.Config - DB *gorm.DB - UserRpc userservice.UserService - FileRpc fileservice.FileService + Config config.Config + RadioRpc radioservice.RadioService + UserRpc userservice.UserService + FileRpc fileservice.FileService } func NewServiceContext(c config.Config) *ServiceContext { - db, err := gorm.Open(mysql.Open(c.DB.DataSource), &gorm.Config{}) - if err != nil { - logx.Errorf("连接数据库失败: %v", err) - panic(err) - } - - // 自动迁移 - if err := db.AutoMigrate( - &radioModel.SundynixRadioUserProfile{}, - &radioModel.SundynixRadioCategory{}, - &radioModel.SundynixRadioChannel{}, - &radioModel.SundynixRadioProgram{}, - &radioModel.SundynixRadioVoice{}, - &radioModel.SundynixRadioLike{}, - &radioModel.SundynixRadioFavorite{}, - &radioModel.SundynixRadioComment{}, - &radioModel.SundynixRadioHistory{}, - &radioModel.SundynixRadioSubscription{}, - &radioModel.SundynixRadioSubscriptionOrder{}, - &radioModel.SundynixRadioPayNotify{}, - &radioModel.SundynixRadioVipConfig{}, - &radioModel.SundynixRadioListenLog{}, - ); err != nil { - logx.Errorf("数据库迁移失败: %v", err) - } - return &ServiceContext{ - Config: c, - DB: db, - UserRpc: userservice.NewUserService(zrpc.MustNewClient(c.UserRpc)), - FileRpc: fileservice.NewFileService(zrpc.MustNewClient(c.FileRpc)), + Config: c, + RadioRpc: radioservice.NewRadioService(zrpc.MustNewClient(c.RadioRpc)), + UserRpc: userservice.NewUserService(zrpc.MustNewClient(c.UserRpc)), + FileRpc: fileservice.NewFileService(zrpc.MustNewClient(c.FileRpc)), } } diff --git a/app/radio/rpc/etc/radio.yaml b/app/radio/rpc/etc/radio.yaml index 5f7336f..295c337 100644 --- a/app/radio/rpc/etc/radio.yaml +++ b/app/radio/rpc/etc/radio.yaml @@ -1,6 +1,12 @@ Name: radio.rpc -ListenOn: 0.0.0.0:8080 + +Log: + Encoding: plain +ListenOn: 0.0.0.0:9015 Etcd: Hosts: - - 127.0.0.1:2379 + - 192.168.100.127:2379 Key: radio.rpc + +DB: + DataSource: root:root@tcp(192.168.100.127:3307)/sundynix_micro_go?charset=utf8mb4&parseTime=True&loc=Local diff --git a/app/radio/rpc/internal/config/config.go b/app/radio/rpc/internal/config/config.go index c1f85b9..897b703 100755 --- a/app/radio/rpc/internal/config/config.go +++ b/app/radio/rpc/internal/config/config.go @@ -4,4 +4,7 @@ import "github.com/zeromicro/go-zero/zrpc" type Config struct { zrpc.RpcServerConf + DB struct { + DataSource string + } } diff --git a/app/radio/rpc/internal/logic/commentProgramLogic.go b/app/radio/rpc/internal/logic/commentProgramLogic.go index 7bdd4c3..69a8776 100644 --- a/app/radio/rpc/internal/logic/commentProgramLogic.go +++ b/app/radio/rpc/internal/logic/commentProgramLogic.go @@ -23,8 +23,8 @@ func NewCommentProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Co } } -func (l *CommentProgramLogic) CommentProgram(in *radio.CommentReq) (*radio.CommentResp, error) { +func (l *CommentProgramLogic) CommentProgram(in *radio.CommentReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.CommentResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/createCategoryLogic.go b/app/radio/rpc/internal/logic/createCategoryLogic.go index 6925a7f..8c522a8 100644 --- a/app/radio/rpc/internal/logic/createCategoryLogic.go +++ b/app/radio/rpc/internal/logic/createCategoryLogic.go @@ -24,8 +24,8 @@ func NewCreateCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cr } // 分类 -func (l *CreateCategoryLogic) CreateCategory(in *radio.CreateCategoryReq) (*radio.CreateCategoryResp, error) { +func (l *CreateCategoryLogic) CreateCategory(in *radio.CategoryReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.CreateCategoryResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/createChannelLogic.go b/app/radio/rpc/internal/logic/createChannelLogic.go index 0df0bf2..3a5efc9 100644 --- a/app/radio/rpc/internal/logic/createChannelLogic.go +++ b/app/radio/rpc/internal/logic/createChannelLogic.go @@ -24,8 +24,8 @@ func NewCreateChannelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cre } // 频道 -func (l *CreateChannelLogic) CreateChannel(in *radio.CreateChannelReq) (*radio.CreateChannelResp, error) { +func (l *CreateChannelLogic) CreateChannel(in *radio.CreateChannelReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.CreateChannelResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/createProgramLogic.go b/app/radio/rpc/internal/logic/createProgramLogic.go index ab54222..4644637 100644 --- a/app/radio/rpc/internal/logic/createProgramLogic.go +++ b/app/radio/rpc/internal/logic/createProgramLogic.go @@ -24,8 +24,8 @@ func NewCreateProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Cre } // 节目 -func (l *CreateProgramLogic) CreateProgram(in *radio.CreateProgramReq) (*radio.CreateProgramResp, error) { +func (l *CreateProgramLogic) CreateProgram(in *radio.CreateProgramReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.CreateProgramResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/createVoiceLogic.go b/app/radio/rpc/internal/logic/createVoiceLogic.go index 91a33f7..9dcbfe6 100644 --- a/app/radio/rpc/internal/logic/createVoiceLogic.go +++ b/app/radio/rpc/internal/logic/createVoiceLogic.go @@ -24,8 +24,8 @@ func NewCreateVoiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Creat } // 音色 -func (l *CreateVoiceLogic) CreateVoice(in *radio.CreateVoiceReq) (*radio.CreateVoiceResp, error) { +func (l *CreateVoiceLogic) CreateVoice(in *radio.CreateVoiceReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.CreateVoiceResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/deleteCategoryLogic.go b/app/radio/rpc/internal/logic/deleteCategoryLogic.go index 17f9196..a0ee7ae 100644 --- a/app/radio/rpc/internal/logic/deleteCategoryLogic.go +++ b/app/radio/rpc/internal/logic/deleteCategoryLogic.go @@ -23,8 +23,8 @@ func NewDeleteCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *De } } -func (l *DeleteCategoryLogic) DeleteCategory(in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) { +func (l *DeleteCategoryLogic) DeleteCategory(in *radio.IdsReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.DeleteResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/deleteChannelLogic.go b/app/radio/rpc/internal/logic/deleteChannelLogic.go index 18011e0..cecc8ca 100644 --- a/app/radio/rpc/internal/logic/deleteChannelLogic.go +++ b/app/radio/rpc/internal/logic/deleteChannelLogic.go @@ -23,8 +23,8 @@ func NewDeleteChannelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Del } } -func (l *DeleteChannelLogic) DeleteChannel(in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) { +func (l *DeleteChannelLogic) DeleteChannel(in *radio.IdsReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.DeleteResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/deleteProgramLogic.go b/app/radio/rpc/internal/logic/deleteProgramLogic.go index f078347..8f4e2bd 100644 --- a/app/radio/rpc/internal/logic/deleteProgramLogic.go +++ b/app/radio/rpc/internal/logic/deleteProgramLogic.go @@ -23,8 +23,8 @@ func NewDeleteProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Del } } -func (l *DeleteProgramLogic) DeleteProgram(in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) { +func (l *DeleteProgramLogic) DeleteProgram(in *radio.IdsReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.DeleteResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/deleteVoiceLogic.go b/app/radio/rpc/internal/logic/deleteVoiceLogic.go index f498ad7..07ff6c9 100644 --- a/app/radio/rpc/internal/logic/deleteVoiceLogic.go +++ b/app/radio/rpc/internal/logic/deleteVoiceLogic.go @@ -23,8 +23,8 @@ func NewDeleteVoiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delet } } -func (l *DeleteVoiceLogic) DeleteVoice(in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) { +func (l *DeleteVoiceLogic) DeleteVoice(in *radio.IdsReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.DeleteResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/getAnalyticsOverviewLogic.go b/app/radio/rpc/internal/logic/getAnalyticsOverviewLogic.go new file mode 100644 index 0000000..48b4fa7 --- /dev/null +++ b/app/radio/rpc/internal/logic/getAnalyticsOverviewLogic.go @@ -0,0 +1,31 @@ +package logic + +import ( + "context" + + "sundynix-micro-go/app/radio/rpc/internal/svc" + "sundynix-micro-go/app/radio/rpc/radio" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetAnalyticsOverviewLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetAnalyticsOverviewLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetAnalyticsOverviewLogic { + return &GetAnalyticsOverviewLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// 数据分析 +func (l *GetAnalyticsOverviewLogic) GetAnalyticsOverview(in *radio.AnalyticsReq) (*radio.AnalyticsOverviewResp, error) { + // todo: add your logic here and delete this line + + return &radio.AnalyticsOverviewResp{}, nil +} diff --git a/app/radio/rpc/internal/logic/getCategoryListLogic.go b/app/radio/rpc/internal/logic/getCategoryListLogic.go index da7069a..216abf2 100644 --- a/app/radio/rpc/internal/logic/getCategoryListLogic.go +++ b/app/radio/rpc/internal/logic/getCategoryListLogic.go @@ -23,8 +23,8 @@ func NewGetCategoryListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G } } -func (l *GetCategoryListLogic) GetCategoryList(in *radio.GetCategoryListReq) (*radio.GetCategoryListResp, error) { +func (l *GetCategoryListLogic) GetCategoryList(in *radio.CategoryListReq) (*radio.CategoryListResp, error) { // todo: add your logic here and delete this line - return &radio.GetCategoryListResp{}, nil + return &radio.CategoryListResp{}, nil } diff --git a/app/radio/rpc/internal/logic/getChannelAnalyticsLogic.go b/app/radio/rpc/internal/logic/getChannelAnalyticsLogic.go new file mode 100644 index 0000000..3cdd449 --- /dev/null +++ b/app/radio/rpc/internal/logic/getChannelAnalyticsLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "sundynix-micro-go/app/radio/rpc/internal/svc" + "sundynix-micro-go/app/radio/rpc/radio" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetChannelAnalyticsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetChannelAnalyticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetChannelAnalyticsLogic { + return &GetChannelAnalyticsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *GetChannelAnalyticsLogic) GetChannelAnalytics(in *radio.AnalyticsReq) (*radio.ChannelAnalyticsResp, error) { + // todo: add your logic here and delete this line + + return &radio.ChannelAnalyticsResp{}, nil +} diff --git a/app/radio/rpc/internal/logic/getChannelDetailLogic.go b/app/radio/rpc/internal/logic/getChannelDetailLogic.go index 21bc458..926e054 100644 --- a/app/radio/rpc/internal/logic/getChannelDetailLogic.go +++ b/app/radio/rpc/internal/logic/getChannelDetailLogic.go @@ -23,8 +23,8 @@ func NewGetChannelDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } -func (l *GetChannelDetailLogic) GetChannelDetail(in *radio.GetChannelDetailReq) (*radio.GetChannelDetailResp, error) { +func (l *GetChannelDetailLogic) GetChannelDetail(in *radio.IdReq) (*radio.ChannelInfo, error) { // todo: add your logic here and delete this line - return &radio.GetChannelDetailResp{}, nil + return &radio.ChannelInfo{}, nil } diff --git a/app/radio/rpc/internal/logic/getChannelListLogic.go b/app/radio/rpc/internal/logic/getChannelListLogic.go index 21ab6ce..309bc1d 100644 --- a/app/radio/rpc/internal/logic/getChannelListLogic.go +++ b/app/radio/rpc/internal/logic/getChannelListLogic.go @@ -23,8 +23,8 @@ func NewGetChannelListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } } -func (l *GetChannelListLogic) GetChannelList(in *radio.GetChannelListReq) (*radio.GetChannelListResp, error) { +func (l *GetChannelListLogic) GetChannelList(in *radio.ChannelListReq) (*radio.ChannelListResp, error) { // todo: add your logic here and delete this line - return &radio.GetChannelListResp{}, nil + return &radio.ChannelListResp{}, nil } diff --git a/app/radio/rpc/internal/logic/getFavoriteListLogic.go b/app/radio/rpc/internal/logic/getFavoriteListLogic.go index 75b1a99..b43c117 100644 --- a/app/radio/rpc/internal/logic/getFavoriteListLogic.go +++ b/app/radio/rpc/internal/logic/getFavoriteListLogic.go @@ -23,8 +23,8 @@ func NewGetFavoriteListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *G } } -func (l *GetFavoriteListLogic) GetFavoriteList(in *radio.GetFavoriteListReq) (*radio.GetFavoriteListResp, error) { +func (l *GetFavoriteListLogic) GetFavoriteList(in *radio.InteractionListReq) (*radio.FavoriteListResp, error) { // todo: add your logic here and delete this line - return &radio.GetFavoriteListResp{}, nil + return &radio.FavoriteListResp{}, nil } diff --git a/app/radio/rpc/internal/logic/getHistoryListLogic.go b/app/radio/rpc/internal/logic/getHistoryListLogic.go index e3c06e7..dbdd599 100644 --- a/app/radio/rpc/internal/logic/getHistoryListLogic.go +++ b/app/radio/rpc/internal/logic/getHistoryListLogic.go @@ -23,8 +23,8 @@ func NewGetHistoryListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } } -func (l *GetHistoryListLogic) GetHistoryList(in *radio.GetHistoryListReq) (*radio.GetHistoryListResp, error) { +func (l *GetHistoryListLogic) GetHistoryList(in *radio.InteractionListReq) (*radio.HistoryListResp, error) { // todo: add your logic here and delete this line - return &radio.GetHistoryListResp{}, nil + return &radio.HistoryListResp{}, nil } diff --git a/app/radio/rpc/internal/logic/getMySubscriptionsLogic.go b/app/radio/rpc/internal/logic/getMySubscriptionsLogic.go index 46c41d5..47f34bc 100644 --- a/app/radio/rpc/internal/logic/getMySubscriptionsLogic.go +++ b/app/radio/rpc/internal/logic/getMySubscriptionsLogic.go @@ -23,9 +23,9 @@ func NewGetMySubscriptionsLogic(ctx context.Context, svcCtx *svc.ServiceContext) } } -// 订阅 -func (l *GetMySubscriptionsLogic) GetMySubscriptions(in *radio.GetMySubscriptionsReq) (*radio.GetMySubscriptionsResp, error) { +// 订阅/VIP +func (l *GetMySubscriptionsLogic) GetMySubscriptions(in *radio.SubscriptionListReq) (*radio.SubscriptionListResp, error) { // todo: add your logic here and delete this line - return &radio.GetMySubscriptionsResp{}, nil + return &radio.SubscriptionListResp{}, nil } diff --git a/app/radio/rpc/internal/logic/getMyVipInfoLogic.go b/app/radio/rpc/internal/logic/getMyVipInfoLogic.go index 130e2ba..2aee57b 100644 --- a/app/radio/rpc/internal/logic/getMyVipInfoLogic.go +++ b/app/radio/rpc/internal/logic/getMyVipInfoLogic.go @@ -23,8 +23,8 @@ func NewGetMyVipInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetM } } -func (l *GetMyVipInfoLogic) GetMyVipInfo(in *radio.GetMyVipInfoReq) (*radio.GetMyVipInfoResp, error) { +func (l *GetMyVipInfoLogic) GetMyVipInfo(in *radio.GetProfileReq) (*radio.RadioUserProfile, error) { // todo: add your logic here and delete this line - return &radio.GetMyVipInfoResp{}, nil + return &radio.RadioUserProfile{}, nil } diff --git a/app/radio/rpc/internal/logic/getProgramDetailLogic.go b/app/radio/rpc/internal/logic/getProgramDetailLogic.go index 4ffb92d..8972695 100644 --- a/app/radio/rpc/internal/logic/getProgramDetailLogic.go +++ b/app/radio/rpc/internal/logic/getProgramDetailLogic.go @@ -23,8 +23,8 @@ func NewGetProgramDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } -func (l *GetProgramDetailLogic) GetProgramDetail(in *radio.GetProgramDetailReq) (*radio.GetProgramDetailResp, error) { +func (l *GetProgramDetailLogic) GetProgramDetail(in *radio.IdReq) (*radio.ProgramInfo, error) { // todo: add your logic here and delete this line - return &radio.GetProgramDetailResp{}, nil + return &radio.ProgramInfo{}, nil } diff --git a/app/radio/rpc/internal/logic/getProgramListLogic.go b/app/radio/rpc/internal/logic/getProgramListLogic.go index b675d61..35b529c 100644 --- a/app/radio/rpc/internal/logic/getProgramListLogic.go +++ b/app/radio/rpc/internal/logic/getProgramListLogic.go @@ -23,8 +23,8 @@ func NewGetProgramListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge } } -func (l *GetProgramListLogic) GetProgramList(in *radio.GetProgramListReq) (*radio.GetProgramListResp, error) { +func (l *GetProgramListLogic) GetProgramList(in *radio.ProgramListReq) (*radio.ProgramListResp, error) { // todo: add your logic here and delete this line - return &radio.GetProgramListResp{}, nil + return &radio.ProgramListResp{}, nil } diff --git a/app/radio/rpc/internal/logic/getRadioUserProfileLogic.go b/app/radio/rpc/internal/logic/getRadioUserProfileLogic.go deleted file mode 100644 index 28cf1a2..0000000 --- a/app/radio/rpc/internal/logic/getRadioUserProfileLogic.go +++ /dev/null @@ -1,31 +0,0 @@ -package logic - -import ( - "context" - - "sundynix-micro-go/app/radio/rpc/internal/svc" - "sundynix-micro-go/app/radio/rpc/radio" - - "github.com/zeromicro/go-zero/core/logx" -) - -type GetRadioUserProfileLogic struct { - ctx context.Context - svcCtx *svc.ServiceContext - logx.Logger -} - -func NewGetRadioUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRadioUserProfileLogic { - return &GetRadioUserProfileLogic{ - ctx: ctx, - svcCtx: svcCtx, - Logger: logx.WithContext(ctx), - } -} - -// 用户 -func (l *GetRadioUserProfileLogic) GetRadioUserProfile(in *radio.GetRadioUserProfileReq) (*radio.GetRadioUserProfileResp, error) { - // todo: add your logic here and delete this line - - return &radio.GetRadioUserProfileResp{}, nil -} diff --git a/app/radio/rpc/internal/logic/getUserAnalyticsLogic.go b/app/radio/rpc/internal/logic/getUserAnalyticsLogic.go new file mode 100644 index 0000000..9fec531 --- /dev/null +++ b/app/radio/rpc/internal/logic/getUserAnalyticsLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + + "sundynix-micro-go/app/radio/rpc/internal/svc" + "sundynix-micro-go/app/radio/rpc/radio" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetUserAnalyticsLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetUserAnalyticsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserAnalyticsLogic { + return &GetUserAnalyticsLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +func (l *GetUserAnalyticsLogic) GetUserAnalytics(in *radio.AnalyticsReq) (*radio.UserAnalyticsResp, error) { + // todo: add your logic here and delete this line + + return &radio.UserAnalyticsResp{}, nil +} diff --git a/app/radio/rpc/internal/logic/getUserProfileLogic.go b/app/radio/rpc/internal/logic/getUserProfileLogic.go new file mode 100644 index 0000000..0f19aa9 --- /dev/null +++ b/app/radio/rpc/internal/logic/getUserProfileLogic.go @@ -0,0 +1,31 @@ +package logic + +import ( + "context" + + "sundynix-micro-go/app/radio/rpc/internal/svc" + "sundynix-micro-go/app/radio/rpc/radio" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetUserProfileLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserProfileLogic { + return &GetUserProfileLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// 用户Profile +func (l *GetUserProfileLogic) GetUserProfile(in *radio.GetProfileReq) (*radio.RadioUserProfile, error) { + // todo: add your logic here and delete this line + + return &radio.RadioUserProfile{}, nil +} diff --git a/app/radio/rpc/internal/logic/getVipConfigListLogic.go b/app/radio/rpc/internal/logic/getVipConfigListLogic.go index 4d040dd..1569dd4 100644 --- a/app/radio/rpc/internal/logic/getVipConfigListLogic.go +++ b/app/radio/rpc/internal/logic/getVipConfigListLogic.go @@ -23,9 +23,8 @@ func NewGetVipConfigListLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } } -// VIP -func (l *GetVipConfigListLogic) GetVipConfigList(in *radio.GetVipConfigListReq) (*radio.GetVipConfigListResp, error) { +func (l *GetVipConfigListLogic) GetVipConfigList(in *radio.IdReq) (*radio.VipConfigListResp, error) { // todo: add your logic here and delete this line - return &radio.GetVipConfigListResp{}, nil + return &radio.VipConfigListResp{}, nil } diff --git a/app/radio/rpc/internal/logic/getVoiceListLogic.go b/app/radio/rpc/internal/logic/getVoiceListLogic.go index cfbe032..62bc593 100644 --- a/app/radio/rpc/internal/logic/getVoiceListLogic.go +++ b/app/radio/rpc/internal/logic/getVoiceListLogic.go @@ -23,8 +23,8 @@ func NewGetVoiceListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetV } } -func (l *GetVoiceListLogic) GetVoiceList(in *radio.GetVoiceListReq) (*radio.GetVoiceListResp, error) { +func (l *GetVoiceListLogic) GetVoiceList(in *radio.VoiceListReq) (*radio.VoiceListResp, error) { // todo: add your logic here and delete this line - return &radio.GetVoiceListResp{}, nil + return &radio.VoiceListResp{}, nil } diff --git a/app/radio/rpc/internal/logic/recordHistoryLogic.go b/app/radio/rpc/internal/logic/recordHistoryLogic.go index 657eac1..ab74693 100644 --- a/app/radio/rpc/internal/logic/recordHistoryLogic.go +++ b/app/radio/rpc/internal/logic/recordHistoryLogic.go @@ -23,8 +23,8 @@ func NewRecordHistoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Rec } } -func (l *RecordHistoryLogic) RecordHistory(in *radio.RecordHistoryReq) (*radio.RecordHistoryResp, error) { +func (l *RecordHistoryLogic) RecordHistory(in *radio.RecordHistoryReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.RecordHistoryResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/toggleFavoriteLogic.go b/app/radio/rpc/internal/logic/toggleFavoriteLogic.go index 3de0d28..0434b30 100644 --- a/app/radio/rpc/internal/logic/toggleFavoriteLogic.go +++ b/app/radio/rpc/internal/logic/toggleFavoriteLogic.go @@ -23,8 +23,8 @@ func NewToggleFavoriteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *To } } -func (l *ToggleFavoriteLogic) ToggleFavorite(in *radio.ToggleFavoriteReq) (*radio.ToggleFavoriteResp, error) { +func (l *ToggleFavoriteLogic) ToggleFavorite(in *radio.ToggleFavoriteReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.ToggleFavoriteResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/toggleLikeLogic.go b/app/radio/rpc/internal/logic/toggleLikeLogic.go index ec56cf8..bcd4b48 100644 --- a/app/radio/rpc/internal/logic/toggleLikeLogic.go +++ b/app/radio/rpc/internal/logic/toggleLikeLogic.go @@ -24,8 +24,8 @@ func NewToggleLikeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Toggle } // 互动 -func (l *ToggleLikeLogic) ToggleLike(in *radio.ToggleLikeReq) (*radio.ToggleLikeResp, error) { +func (l *ToggleLikeLogic) ToggleLike(in *radio.ToggleLikeReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.ToggleLikeResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/updateCategoryLogic.go b/app/radio/rpc/internal/logic/updateCategoryLogic.go index 50d7e80..a1582e5 100644 --- a/app/radio/rpc/internal/logic/updateCategoryLogic.go +++ b/app/radio/rpc/internal/logic/updateCategoryLogic.go @@ -23,8 +23,8 @@ func NewUpdateCategoryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Up } } -func (l *UpdateCategoryLogic) UpdateCategory(in *radio.UpdateCategoryReq) (*radio.UpdateCategoryResp, error) { +func (l *UpdateCategoryLogic) UpdateCategory(in *radio.CategoryUpdateReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.UpdateCategoryResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/updateChannelLogic.go b/app/radio/rpc/internal/logic/updateChannelLogic.go index aa54db7..0d44db1 100644 --- a/app/radio/rpc/internal/logic/updateChannelLogic.go +++ b/app/radio/rpc/internal/logic/updateChannelLogic.go @@ -23,8 +23,8 @@ func NewUpdateChannelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Upd } } -func (l *UpdateChannelLogic) UpdateChannel(in *radio.UpdateChannelReq) (*radio.UpdateChannelResp, error) { +func (l *UpdateChannelLogic) UpdateChannel(in *radio.UpdateChannelReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.UpdateChannelResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/updateProgramLogic.go b/app/radio/rpc/internal/logic/updateProgramLogic.go index d52af05..cf976f8 100644 --- a/app/radio/rpc/internal/logic/updateProgramLogic.go +++ b/app/radio/rpc/internal/logic/updateProgramLogic.go @@ -23,8 +23,8 @@ func NewUpdateProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Upd } } -func (l *UpdateProgramLogic) UpdateProgram(in *radio.UpdateProgramReq) (*radio.UpdateProgramResp, error) { +func (l *UpdateProgramLogic) UpdateProgram(in *radio.UpdateProgramReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.UpdateProgramResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/logic/updateVoiceLogic.go b/app/radio/rpc/internal/logic/updateVoiceLogic.go index 35d8d93..43fa7f8 100644 --- a/app/radio/rpc/internal/logic/updateVoiceLogic.go +++ b/app/radio/rpc/internal/logic/updateVoiceLogic.go @@ -23,8 +23,8 @@ func NewUpdateVoiceLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Updat } } -func (l *UpdateVoiceLogic) UpdateVoice(in *radio.UpdateVoiceReq) (*radio.UpdateVoiceResp, error) { +func (l *UpdateVoiceLogic) UpdateVoice(in *radio.UpdateVoiceReq) (*radio.CommonResp, error) { // todo: add your logic here and delete this line - return &radio.UpdateVoiceResp{}, nil + return &radio.CommonResp{}, nil } diff --git a/app/radio/rpc/internal/server/radioServiceServer.go b/app/radio/rpc/internal/server/radioServiceServer.go index 6ebe2b6..4db7632 100644 --- a/app/radio/rpc/internal/server/radioServiceServer.go +++ b/app/radio/rpc/internal/server/radioServiceServer.go @@ -23,139 +23,139 @@ func NewRadioServiceServer(svcCtx *svc.ServiceContext) *RadioServiceServer { } } -// 用户 -func (s *RadioServiceServer) GetRadioUserProfile(ctx context.Context, in *radio.GetRadioUserProfileReq) (*radio.GetRadioUserProfileResp, error) { - l := logic.NewGetRadioUserProfileLogic(ctx, s.svcCtx) - return l.GetRadioUserProfile(in) +// 用户Profile +func (s *RadioServiceServer) GetUserProfile(ctx context.Context, in *radio.GetProfileReq) (*radio.RadioUserProfile, error) { + l := logic.NewGetUserProfileLogic(ctx, s.svcCtx) + return l.GetUserProfile(in) } // 分类 -func (s *RadioServiceServer) CreateCategory(ctx context.Context, in *radio.CreateCategoryReq) (*radio.CreateCategoryResp, error) { +func (s *RadioServiceServer) CreateCategory(ctx context.Context, in *radio.CategoryReq) (*radio.CommonResp, error) { l := logic.NewCreateCategoryLogic(ctx, s.svcCtx) return l.CreateCategory(in) } -func (s *RadioServiceServer) UpdateCategory(ctx context.Context, in *radio.UpdateCategoryReq) (*radio.UpdateCategoryResp, error) { +func (s *RadioServiceServer) UpdateCategory(ctx context.Context, in *radio.CategoryUpdateReq) (*radio.CommonResp, error) { l := logic.NewUpdateCategoryLogic(ctx, s.svcCtx) return l.UpdateCategory(in) } -func (s *RadioServiceServer) DeleteCategory(ctx context.Context, in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) { +func (s *RadioServiceServer) DeleteCategory(ctx context.Context, in *radio.IdsReq) (*radio.CommonResp, error) { l := logic.NewDeleteCategoryLogic(ctx, s.svcCtx) return l.DeleteCategory(in) } -func (s *RadioServiceServer) GetCategoryList(ctx context.Context, in *radio.GetCategoryListReq) (*radio.GetCategoryListResp, error) { +func (s *RadioServiceServer) GetCategoryList(ctx context.Context, in *radio.CategoryListReq) (*radio.CategoryListResp, error) { l := logic.NewGetCategoryListLogic(ctx, s.svcCtx) return l.GetCategoryList(in) } // 频道 -func (s *RadioServiceServer) CreateChannel(ctx context.Context, in *radio.CreateChannelReq) (*radio.CreateChannelResp, error) { +func (s *RadioServiceServer) CreateChannel(ctx context.Context, in *radio.CreateChannelReq) (*radio.CommonResp, error) { l := logic.NewCreateChannelLogic(ctx, s.svcCtx) return l.CreateChannel(in) } -func (s *RadioServiceServer) UpdateChannel(ctx context.Context, in *radio.UpdateChannelReq) (*radio.UpdateChannelResp, error) { +func (s *RadioServiceServer) UpdateChannel(ctx context.Context, in *radio.UpdateChannelReq) (*radio.CommonResp, error) { l := logic.NewUpdateChannelLogic(ctx, s.svcCtx) return l.UpdateChannel(in) } -func (s *RadioServiceServer) DeleteChannel(ctx context.Context, in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) { +func (s *RadioServiceServer) DeleteChannel(ctx context.Context, in *radio.IdsReq) (*radio.CommonResp, error) { l := logic.NewDeleteChannelLogic(ctx, s.svcCtx) return l.DeleteChannel(in) } -func (s *RadioServiceServer) GetChannelList(ctx context.Context, in *radio.GetChannelListReq) (*radio.GetChannelListResp, error) { +func (s *RadioServiceServer) GetChannelList(ctx context.Context, in *radio.ChannelListReq) (*radio.ChannelListResp, error) { l := logic.NewGetChannelListLogic(ctx, s.svcCtx) return l.GetChannelList(in) } -func (s *RadioServiceServer) GetChannelDetail(ctx context.Context, in *radio.GetChannelDetailReq) (*radio.GetChannelDetailResp, error) { +func (s *RadioServiceServer) GetChannelDetail(ctx context.Context, in *radio.IdReq) (*radio.ChannelInfo, error) { l := logic.NewGetChannelDetailLogic(ctx, s.svcCtx) return l.GetChannelDetail(in) } // 节目 -func (s *RadioServiceServer) CreateProgram(ctx context.Context, in *radio.CreateProgramReq) (*radio.CreateProgramResp, error) { +func (s *RadioServiceServer) CreateProgram(ctx context.Context, in *radio.CreateProgramReq) (*radio.CommonResp, error) { l := logic.NewCreateProgramLogic(ctx, s.svcCtx) return l.CreateProgram(in) } -func (s *RadioServiceServer) UpdateProgram(ctx context.Context, in *radio.UpdateProgramReq) (*radio.UpdateProgramResp, error) { +func (s *RadioServiceServer) UpdateProgram(ctx context.Context, in *radio.UpdateProgramReq) (*radio.CommonResp, error) { l := logic.NewUpdateProgramLogic(ctx, s.svcCtx) return l.UpdateProgram(in) } -func (s *RadioServiceServer) DeleteProgram(ctx context.Context, in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) { +func (s *RadioServiceServer) DeleteProgram(ctx context.Context, in *radio.IdsReq) (*radio.CommonResp, error) { l := logic.NewDeleteProgramLogic(ctx, s.svcCtx) return l.DeleteProgram(in) } -func (s *RadioServiceServer) GetProgramList(ctx context.Context, in *radio.GetProgramListReq) (*radio.GetProgramListResp, error) { +func (s *RadioServiceServer) GetProgramList(ctx context.Context, in *radio.ProgramListReq) (*radio.ProgramListResp, error) { l := logic.NewGetProgramListLogic(ctx, s.svcCtx) return l.GetProgramList(in) } -func (s *RadioServiceServer) GetProgramDetail(ctx context.Context, in *radio.GetProgramDetailReq) (*radio.GetProgramDetailResp, error) { +func (s *RadioServiceServer) GetProgramDetail(ctx context.Context, in *radio.IdReq) (*radio.ProgramInfo, error) { l := logic.NewGetProgramDetailLogic(ctx, s.svcCtx) return l.GetProgramDetail(in) } // 音色 -func (s *RadioServiceServer) CreateVoice(ctx context.Context, in *radio.CreateVoiceReq) (*radio.CreateVoiceResp, error) { +func (s *RadioServiceServer) CreateVoice(ctx context.Context, in *radio.CreateVoiceReq) (*radio.CommonResp, error) { l := logic.NewCreateVoiceLogic(ctx, s.svcCtx) return l.CreateVoice(in) } -func (s *RadioServiceServer) UpdateVoice(ctx context.Context, in *radio.UpdateVoiceReq) (*radio.UpdateVoiceResp, error) { +func (s *RadioServiceServer) UpdateVoice(ctx context.Context, in *radio.UpdateVoiceReq) (*radio.CommonResp, error) { l := logic.NewUpdateVoiceLogic(ctx, s.svcCtx) return l.UpdateVoice(in) } -func (s *RadioServiceServer) DeleteVoice(ctx context.Context, in *radio.DeleteByIdsReq) (*radio.DeleteResp, error) { +func (s *RadioServiceServer) DeleteVoice(ctx context.Context, in *radio.IdsReq) (*radio.CommonResp, error) { l := logic.NewDeleteVoiceLogic(ctx, s.svcCtx) return l.DeleteVoice(in) } -func (s *RadioServiceServer) GetVoiceList(ctx context.Context, in *radio.GetVoiceListReq) (*radio.GetVoiceListResp, error) { +func (s *RadioServiceServer) GetVoiceList(ctx context.Context, in *radio.VoiceListReq) (*radio.VoiceListResp, error) { l := logic.NewGetVoiceListLogic(ctx, s.svcCtx) return l.GetVoiceList(in) } // 互动 -func (s *RadioServiceServer) ToggleLike(ctx context.Context, in *radio.ToggleLikeReq) (*radio.ToggleLikeResp, error) { +func (s *RadioServiceServer) ToggleLike(ctx context.Context, in *radio.ToggleLikeReq) (*radio.CommonResp, error) { l := logic.NewToggleLikeLogic(ctx, s.svcCtx) return l.ToggleLike(in) } -func (s *RadioServiceServer) ToggleFavorite(ctx context.Context, in *radio.ToggleFavoriteReq) (*radio.ToggleFavoriteResp, error) { +func (s *RadioServiceServer) ToggleFavorite(ctx context.Context, in *radio.ToggleFavoriteReq) (*radio.CommonResp, error) { l := logic.NewToggleFavoriteLogic(ctx, s.svcCtx) return l.ToggleFavorite(in) } -func (s *RadioServiceServer) CommentProgram(ctx context.Context, in *radio.CommentReq) (*radio.CommentResp, error) { +func (s *RadioServiceServer) CommentProgram(ctx context.Context, in *radio.CommentReq) (*radio.CommonResp, error) { l := logic.NewCommentProgramLogic(ctx, s.svcCtx) return l.CommentProgram(in) } -func (s *RadioServiceServer) RecordHistory(ctx context.Context, in *radio.RecordHistoryReq) (*radio.RecordHistoryResp, error) { +func (s *RadioServiceServer) RecordHistory(ctx context.Context, in *radio.RecordHistoryReq) (*radio.CommonResp, error) { l := logic.NewRecordHistoryLogic(ctx, s.svcCtx) return l.RecordHistory(in) } -func (s *RadioServiceServer) GetHistoryList(ctx context.Context, in *radio.GetHistoryListReq) (*radio.GetHistoryListResp, error) { - l := logic.NewGetHistoryListLogic(ctx, s.svcCtx) - return l.GetHistoryList(in) -} - -func (s *RadioServiceServer) GetFavoriteList(ctx context.Context, in *radio.GetFavoriteListReq) (*radio.GetFavoriteListResp, error) { +func (s *RadioServiceServer) GetFavoriteList(ctx context.Context, in *radio.InteractionListReq) (*radio.FavoriteListResp, error) { l := logic.NewGetFavoriteListLogic(ctx, s.svcCtx) return l.GetFavoriteList(in) } -// 订阅 -func (s *RadioServiceServer) GetMySubscriptions(ctx context.Context, in *radio.GetMySubscriptionsReq) (*radio.GetMySubscriptionsResp, error) { +func (s *RadioServiceServer) GetHistoryList(ctx context.Context, in *radio.InteractionListReq) (*radio.HistoryListResp, error) { + l := logic.NewGetHistoryListLogic(ctx, s.svcCtx) + return l.GetHistoryList(in) +} + +// 订阅/VIP +func (s *RadioServiceServer) GetMySubscriptions(ctx context.Context, in *radio.SubscriptionListReq) (*radio.SubscriptionListResp, error) { l := logic.NewGetMySubscriptionsLogic(ctx, s.svcCtx) return l.GetMySubscriptions(in) } @@ -165,13 +165,28 @@ func (s *RadioServiceServer) CreatePayOrder(ctx context.Context, in *radio.Creat return l.CreatePayOrder(in) } -// VIP -func (s *RadioServiceServer) GetVipConfigList(ctx context.Context, in *radio.GetVipConfigListReq) (*radio.GetVipConfigListResp, error) { +func (s *RadioServiceServer) GetVipConfigList(ctx context.Context, in *radio.IdReq) (*radio.VipConfigListResp, error) { l := logic.NewGetVipConfigListLogic(ctx, s.svcCtx) return l.GetVipConfigList(in) } -func (s *RadioServiceServer) GetMyVipInfo(ctx context.Context, in *radio.GetMyVipInfoReq) (*radio.GetMyVipInfoResp, error) { +func (s *RadioServiceServer) GetMyVipInfo(ctx context.Context, in *radio.GetProfileReq) (*radio.RadioUserProfile, error) { l := logic.NewGetMyVipInfoLogic(ctx, s.svcCtx) return l.GetMyVipInfo(in) } + +// 数据分析 +func (s *RadioServiceServer) GetAnalyticsOverview(ctx context.Context, in *radio.AnalyticsReq) (*radio.AnalyticsOverviewResp, error) { + l := logic.NewGetAnalyticsOverviewLogic(ctx, s.svcCtx) + return l.GetAnalyticsOverview(in) +} + +func (s *RadioServiceServer) GetChannelAnalytics(ctx context.Context, in *radio.AnalyticsReq) (*radio.ChannelAnalyticsResp, error) { + l := logic.NewGetChannelAnalyticsLogic(ctx, s.svcCtx) + return l.GetChannelAnalytics(in) +} + +func (s *RadioServiceServer) GetUserAnalytics(ctx context.Context, in *radio.AnalyticsReq) (*radio.UserAnalyticsResp, error) { + l := logic.NewGetUserAnalyticsLogic(ctx, s.svcCtx) + return l.GetUserAnalytics(in) +} diff --git a/app/radio/rpc/internal/svc/serviceContext.go b/app/radio/rpc/internal/svc/serviceContext.go index 34977ab..fb0f535 100644 --- a/app/radio/rpc/internal/svc/serviceContext.go +++ b/app/radio/rpc/internal/svc/serviceContext.go @@ -1,13 +1,44 @@ package svc -import "sundynix-micro-go/app/radio/rpc/internal/config" +import ( + radioModel "sundynix-micro-go/app/radio/model" + "sundynix-micro-go/app/radio/rpc/internal/config" + + "github.com/zeromicro/go-zero/core/logx" + "gorm.io/driver/mysql" + "gorm.io/gorm" +) type ServiceContext struct { Config config.Config + DB *gorm.DB } func NewServiceContext(c config.Config) *ServiceContext { - return &ServiceContext{ - Config: c, + db, err := gorm.Open(mysql.Open(c.DB.DataSource), &gorm.Config{}) + if err != nil { + logx.Errorf("连接数据库失败: %v", err) + panic(err) } + + if err := db.AutoMigrate( + &radioModel.SundynixRadioUserProfile{}, + &radioModel.SundynixRadioCategory{}, + &radioModel.SundynixRadioChannel{}, + &radioModel.SundynixRadioProgram{}, + &radioModel.SundynixRadioVoice{}, + &radioModel.SundynixRadioLike{}, + &radioModel.SundynixRadioFavorite{}, + &radioModel.SundynixRadioComment{}, + &radioModel.SundynixRadioHistory{}, + &radioModel.SundynixRadioSubscription{}, + &radioModel.SundynixRadioSubscriptionOrder{}, + &radioModel.SundynixRadioPayNotify{}, + &radioModel.SundynixRadioVipConfig{}, + &radioModel.SundynixRadioListenLog{}, + ); err != nil { + logx.Errorf("数据库迁移失败: %v", err) + } + + return &ServiceContext{Config: c, DB: db} } diff --git a/app/radio/rpc/pb/radio.proto b/app/radio/rpc/pb/radio.proto index 10d24a7..dac63e9 100644 --- a/app/radio/rpc/pb/radio.proto +++ b/app/radio/rpc/pb/radio.proto @@ -4,7 +4,23 @@ package radio; option go_package = "./radio"; +// ========== 通用 ========== + +message CommonResp { + int64 code = 1; + string msg = 2; +} + +message IdReq { + string id = 1; +} + +message IdsReq { + repeated string ids = 1; +} + // ========== 用户Profile ========== + message RadioUserProfile { string id = 1; string userId = 2; @@ -14,26 +30,45 @@ message RadioUserProfile { int64 vipExpireAt = 6; int32 vipLevel = 7; } -message GetRadioUserProfileReq { string userId = 1; } -message GetRadioUserProfileResp { RadioUserProfile profile = 1; } + +message GetProfileReq { + string userId = 1; +} // ========== 分类 ========== + message CategoryInfo { string id = 1; string name = 2; string icon = 3; int32 sort = 4; } -message CreateCategoryReq { string name = 1; string icon = 2; int32 sort = 3; } -message CreateCategoryResp { string id = 1; } -message UpdateCategoryReq { string id = 1; string name = 2; string icon = 3; int32 sort = 4; } -message UpdateCategoryResp {} -message DeleteByIdsReq { repeated string ids = 1; } -message DeleteResp {} -message GetCategoryListReq { int32 current = 1; int32 pageSize = 2; } -message GetCategoryListResp { repeated CategoryInfo list = 1; int64 total = 2; } + +message CategoryReq { + string name = 1; + string icon = 2; + int32 sort = 3; +} + +message CategoryUpdateReq { + string id = 1; + string name = 2; + string icon = 3; + int32 sort = 4; +} + +message CategoryListResp { + repeated CategoryInfo list = 1; + int64 total = 2; +} + +message CategoryListReq { + int32 current = 1; + int32 pageSize = 2; +} // ========== 频道 ========== + message ChannelInfo { string id = 1; string categoryId = 2; @@ -48,28 +83,52 @@ message ChannelInfo { string tags = 11; int32 sort = 12; int32 status = 13; - int64 createdAt = 14; } + message CreateChannelReq { - string categoryId = 1; string name = 2; string description = 3; - int32 isFree = 4; int32 isVipOnly = 5; - int32 monthlyPrice = 6; int32 quarterlyPrice = 7; int32 annualPrice = 8; - string cover = 9; string tags = 10; int32 sort = 11; + string categoryId = 1; + string name = 2; + string description = 3; + int32 isFree = 4; + int32 isVipOnly = 5; + int32 monthlyPrice = 6; + int32 quarterlyPrice = 7; + int32 annualPrice = 8; + string cover = 9; + string tags = 10; + int32 sort = 11; } -message CreateChannelResp { string id = 1; } + message UpdateChannelReq { - string id = 1; string name = 2; string description = 3; - int32 isFree = 4; int32 isVipOnly = 5; - int32 monthlyPrice = 6; int32 quarterlyPrice = 7; int32 annualPrice = 8; - string cover = 9; string tags = 10; int32 sort = 11; int32 status = 12; + string id = 1; + string categoryId = 2; + string name = 3; + string description = 4; + int32 isFree = 5; + int32 isVipOnly = 6; + int32 monthlyPrice = 7; + int32 quarterlyPrice = 8; + int32 annualPrice = 9; + string cover = 10; + string tags = 11; + int32 sort = 12; + int32 status = 13; +} + +message ChannelListReq { + int32 current = 1; + int32 pageSize = 2; + string categoryId = 3; + string userId = 4; +} + +message ChannelListResp { + repeated ChannelInfo list = 1; + int64 total = 2; } -message UpdateChannelResp {} -message GetChannelListReq { int32 current = 1; int32 pageSize = 2; string categoryId = 3; string userId = 4; } -message GetChannelListResp { repeated ChannelInfo list = 1; int64 total = 2; } -message GetChannelDetailReq { string id = 1; string userId = 2; } -message GetChannelDetailResp { ChannelInfo channel = 1; } // ========== 节目 ========== + message ProgramInfo { string id = 1; string channelId = 2; @@ -84,113 +143,255 @@ message ProgramInfo { int32 playCount = 11; int32 likeCount = 12; int32 status = 13; - int64 createdAt = 14; } + message CreateProgramReq { - string channelId = 1; string title = 2; string description = 3; - string content = 4; string cover = 5; string tags = 6; + string channelId = 1; + string title = 2; + string description = 3; + string content = 4; + string cover = 5; + string tags = 6; } -message CreateProgramResp { string id = 1; } + message UpdateProgramReq { - string id = 1; string title = 2; string description = 3; - string content = 4; string cover = 5; string audioId = 6; - int32 audioStatus = 7; int32 duration = 8; string tags = 9; int32 status = 10; + string id = 1; + string channelId = 2; + string title = 3; + string description = 4; + string content = 5; + string cover = 6; + string audioId = 7; + int32 audioStatus = 8; + int32 duration = 9; + string tags = 10; + int32 status = 11; +} + +message ProgramListReq { + int32 current = 1; + int32 pageSize = 2; + string channelId = 3; + string userId = 4; +} + +message ProgramListResp { + repeated ProgramInfo list = 1; + int64 total = 2; } -message UpdateProgramResp {} -message GetProgramListReq { int32 current = 1; int32 pageSize = 2; string channelId = 3; string userId = 4; } -message GetProgramListResp { repeated ProgramInfo list = 1; int64 total = 2; } -message GetProgramDetailReq { string id = 1; string userId = 2; } -message GetProgramDetailResp { ProgramInfo program = 1; } // ========== 音色 ========== + message VoiceInfo { - string id = 1; string speakerId = 2; string name = 3; - string description = 4; string gender = 5; string icon = 6; - string audioId = 7; int32 sort = 8; int32 status = 9; - int32 isDefault = 10; int32 useCount = 11; + string id = 1; + string speakerId = 2; + string name = 3; + string description = 4; + string gender = 5; + string icon = 6; + string audioId = 7; + int32 sort = 8; + int32 status = 9; + int32 isDefault = 10; +} + +message CreateVoiceReq { + string speakerId = 1; + string name = 2; + string description = 3; + string gender = 4; + string icon = 5; + string audioId = 6; + int32 sort = 7; + int32 isDefault = 8; +} + +message UpdateVoiceReq { + string id = 1; + string speakerId = 2; + string name = 3; + string description = 4; + string gender = 5; + string icon = 6; + string audioId = 7; + int32 sort = 8; + int32 status = 9; + int32 isDefault = 10; +} + +message VoiceListReq { + int32 current = 1; + int32 pageSize = 2; +} + +message VoiceListResp { + repeated VoiceInfo list = 1; + int64 total = 2; } -message CreateVoiceReq { string speakerId = 1; string name = 2; string description = 3; string gender = 4; string icon = 5; string audioId = 6; int32 sort = 7; int32 isDefault = 8; } -message CreateVoiceResp { string id = 1; } -message UpdateVoiceReq { string id = 1; string name = 2; string description = 3; string icon = 4; string audioId = 5; int32 sort = 6; int32 status = 7; int32 isDefault = 8; } -message UpdateVoiceResp {} -message GetVoiceListReq { int32 current = 1; int32 pageSize = 2; } -message GetVoiceListResp { repeated VoiceInfo list = 1; int64 total = 2; } // ========== 互动 ========== -message ToggleLikeReq { string userId = 1; string programId = 2; } -message ToggleLikeResp { bool liked = 1; } -message ToggleFavoriteReq { string userId = 1; string programId = 2; } -message ToggleFavoriteResp { bool favorited = 1; } -message CommentReq { string userId = 1; string programId = 2; string content = 3; string parentId = 4; } -message CommentResp {} -message RecordHistoryReq { string userId = 1; string programId = 2; int32 duration = 3; } -message RecordHistoryResp {} -message GetHistoryListReq { string userId = 1; int32 current = 2; int32 pageSize = 3; } -message GetHistoryListResp { repeated ProgramInfo list = 1; int64 total = 2; } -message GetFavoriteListReq { string userId = 1; int32 current = 2; int32 pageSize = 3; } -message GetFavoriteListResp { repeated ProgramInfo list = 1; int64 total = 2; } -// ========== 订阅/支付 ========== -message SubscriptionInfo { - string id = 1; string userId = 2; string channelId = 3; - int64 expiredAt = 4; int32 status = 5; +message ToggleLikeReq { + string userId = 1; + string programId = 2; +} + +message ToggleFavoriteReq { + string userId = 1; + string programId = 2; +} + +message CommentReq { + string userId = 1; + string programId = 2; + string content = 3; + string parentId = 4; +} + +message RecordHistoryReq { + string userId = 1; + string programId = 2; + int32 duration = 3; +} + +message InteractionListReq { + string userId = 1; + int32 current = 2; + int32 pageSize = 3; +} + +message FavoriteListResp { + repeated ProgramInfo list = 1; + int64 total = 2; +} + +message HistoryListResp { + repeated ProgramInfo list = 1; + int64 total = 2; +} + +// ========== 订阅/VIP ========== + +message SubscriptionInfo { + string id = 1; + string channelId = 2; + int64 expiredAt = 3; + int32 status = 4; +} + +message SubscriptionListReq { + string userId = 1; +} + +message SubscriptionListResp { + repeated SubscriptionInfo list = 1; +} + +message CreatePayOrderReq { + string userId = 1; + string channelId = 2; + string planType = 3; +} + +message CreatePayOrderResp { + string orderNo = 1; + string prepayId = 2; } -message GetMySubscriptionsReq { string userId = 1; } -message GetMySubscriptionsResp { repeated SubscriptionInfo list = 1; } -message CreatePayOrderReq { string userId = 1; string channelId = 2; string planType = 3; } -message CreatePayOrderResp { string orderNo = 1; string prepayId = 2; } -// ========== VIP ========== message VipConfigInfo { - string id = 1; string name = 2; string planType = 3; - int32 price = 4; int32 originalPrice = 5; int32 duration = 6; + string id = 1; + string name = 2; + string planType = 3; + int32 price = 4; + int32 originalPrice = 5; + int32 duration = 6; string desc = 7; } -message GetVipConfigListReq { int32 current = 1; int32 pageSize = 2; } -message GetVipConfigListResp { repeated VipConfigInfo list = 1; int64 total = 2; } -message GetMyVipInfoReq { string userId = 1; } -message GetMyVipInfoResp { RadioUserProfile profile = 1; } -// ========== 通用 ========== -message Empty {} +message VipConfigListResp { + repeated VipConfigInfo list = 1; +} + +// ========== 数据分析 ========== + +message AnalyticsReq { + string startDate = 1; + string endDate = 2; +} + +message AnalyticsOverviewResp { + int64 totalUsers = 1; + int64 totalPlays = 2; + int64 totalChannels = 3; + int64 totalPrograms = 4; +} + +message ChannelAnalyticsResp { + repeated ChannelAnalyticsItem list = 1; +} + +message ChannelAnalyticsItem { + string channelId = 1; + string channelName = 2; + int64 playCount = 3; + int64 likeCount = 4; + int64 subscriberCount = 5; +} + +message UserAnalyticsResp { + int64 newUsers = 1; + int64 activeUsers = 2; + int64 vipUsers = 3; +} // ========== 服务定义 ========== + service RadioService { - // 用户 - rpc GetRadioUserProfile(GetRadioUserProfileReq) returns (GetRadioUserProfileResp); + // 用户Profile + rpc GetUserProfile(GetProfileReq) returns (RadioUserProfile); + // 分类 - rpc CreateCategory(CreateCategoryReq) returns (CreateCategoryResp); - rpc UpdateCategory(UpdateCategoryReq) returns (UpdateCategoryResp); - rpc DeleteCategory(DeleteByIdsReq) returns (DeleteResp); - rpc GetCategoryList(GetCategoryListReq) returns (GetCategoryListResp); + rpc CreateCategory(CategoryReq) returns (CommonResp); + rpc UpdateCategory(CategoryUpdateReq) returns (CommonResp); + rpc DeleteCategory(IdsReq) returns (CommonResp); + rpc GetCategoryList(CategoryListReq) returns (CategoryListResp); + // 频道 - rpc CreateChannel(CreateChannelReq) returns (CreateChannelResp); - rpc UpdateChannel(UpdateChannelReq) returns (UpdateChannelResp); - rpc DeleteChannel(DeleteByIdsReq) returns (DeleteResp); - rpc GetChannelList(GetChannelListReq) returns (GetChannelListResp); - rpc GetChannelDetail(GetChannelDetailReq) returns (GetChannelDetailResp); + rpc CreateChannel(CreateChannelReq) returns (CommonResp); + rpc UpdateChannel(UpdateChannelReq) returns (CommonResp); + rpc DeleteChannel(IdsReq) returns (CommonResp); + rpc GetChannelList(ChannelListReq) returns (ChannelListResp); + rpc GetChannelDetail(IdReq) returns (ChannelInfo); + // 节目 - rpc CreateProgram(CreateProgramReq) returns (CreateProgramResp); - rpc UpdateProgram(UpdateProgramReq) returns (UpdateProgramResp); - rpc DeleteProgram(DeleteByIdsReq) returns (DeleteResp); - rpc GetProgramList(GetProgramListReq) returns (GetProgramListResp); - rpc GetProgramDetail(GetProgramDetailReq) returns (GetProgramDetailResp); + rpc CreateProgram(CreateProgramReq) returns (CommonResp); + rpc UpdateProgram(UpdateProgramReq) returns (CommonResp); + rpc DeleteProgram(IdsReq) returns (CommonResp); + rpc GetProgramList(ProgramListReq) returns (ProgramListResp); + rpc GetProgramDetail(IdReq) returns (ProgramInfo); + // 音色 - rpc CreateVoice(CreateVoiceReq) returns (CreateVoiceResp); - rpc UpdateVoice(UpdateVoiceReq) returns (UpdateVoiceResp); - rpc DeleteVoice(DeleteByIdsReq) returns (DeleteResp); - rpc GetVoiceList(GetVoiceListReq) returns (GetVoiceListResp); + rpc CreateVoice(CreateVoiceReq) returns (CommonResp); + rpc UpdateVoice(UpdateVoiceReq) returns (CommonResp); + rpc DeleteVoice(IdsReq) returns (CommonResp); + rpc GetVoiceList(VoiceListReq) returns (VoiceListResp); + // 互动 - rpc ToggleLike(ToggleLikeReq) returns (ToggleLikeResp); - rpc ToggleFavorite(ToggleFavoriteReq) returns (ToggleFavoriteResp); - rpc CommentProgram(CommentReq) returns (CommentResp); - rpc RecordHistory(RecordHistoryReq) returns (RecordHistoryResp); - rpc GetHistoryList(GetHistoryListReq) returns (GetHistoryListResp); - rpc GetFavoriteList(GetFavoriteListReq) returns (GetFavoriteListResp); - // 订阅 - rpc GetMySubscriptions(GetMySubscriptionsReq) returns (GetMySubscriptionsResp); + rpc ToggleLike(ToggleLikeReq) returns (CommonResp); + rpc ToggleFavorite(ToggleFavoriteReq) returns (CommonResp); + rpc CommentProgram(CommentReq) returns (CommonResp); + rpc RecordHistory(RecordHistoryReq) returns (CommonResp); + rpc GetFavoriteList(InteractionListReq) returns (FavoriteListResp); + rpc GetHistoryList(InteractionListReq) returns (HistoryListResp); + + // 订阅/VIP + rpc GetMySubscriptions(SubscriptionListReq) returns (SubscriptionListResp); rpc CreatePayOrder(CreatePayOrderReq) returns (CreatePayOrderResp); - // VIP - rpc GetVipConfigList(GetVipConfigListReq) returns (GetVipConfigListResp); - rpc GetMyVipInfo(GetMyVipInfoReq) returns (GetMyVipInfoResp); + rpc GetVipConfigList(IdReq) returns (VipConfigListResp); + rpc GetMyVipInfo(GetProfileReq) returns (RadioUserProfile); + + // 数据分析 + rpc GetAnalyticsOverview(AnalyticsReq) returns (AnalyticsOverviewResp); + rpc GetChannelAnalytics(AnalyticsReq) returns (ChannelAnalyticsResp); + rpc GetUserAnalytics(AnalyticsReq) returns (UserAnalyticsResp); } diff --git a/app/radio/rpc/radio/radio.pb.go b/app/radio/rpc/radio/radio.pb.go index 48fc804..6d58372 100644 --- a/app/radio/rpc/radio/radio.pb.go +++ b/app/radio/rpc/radio/radio.pb.go @@ -21,7 +21,146 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// ========== 用户Profile ========== +type CommonResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CommonResp) Reset() { + *x = CommonResp{} + mi := &file_pb_radio_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CommonResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommonResp) ProtoMessage() {} + +func (x *CommonResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[0] + 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 CommonResp.ProtoReflect.Descriptor instead. +func (*CommonResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{0} +} + +func (x *CommonResp) GetCode() int64 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *CommonResp) GetMsg() string { + if x != nil { + return x.Msg + } + return "" +} + +type IdReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdReq) Reset() { + *x = IdReq{} + mi := &file_pb_radio_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdReq) ProtoMessage() {} + +func (x *IdReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[1] + 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 IdReq.ProtoReflect.Descriptor instead. +func (*IdReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{1} +} + +func (x *IdReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type IdsReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdsReq) Reset() { + *x = IdsReq{} + mi := &file_pb_radio_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdsReq) ProtoMessage() {} + +func (x *IdsReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_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 IdsReq.ProtoReflect.Descriptor instead. +func (*IdsReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{2} +} + +func (x *IdsReq) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + type RadioUserProfile struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -37,7 +176,7 @@ type RadioUserProfile struct { func (x *RadioUserProfile) Reset() { *x = RadioUserProfile{} - mi := &file_pb_radio_proto_msgTypes[0] + mi := &file_pb_radio_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -49,7 +188,7 @@ func (x *RadioUserProfile) String() string { func (*RadioUserProfile) ProtoMessage() {} func (x *RadioUserProfile) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[0] + mi := &file_pb_radio_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -62,7 +201,7 @@ func (x *RadioUserProfile) ProtoReflect() protoreflect.Message { // Deprecated: Use RadioUserProfile.ProtoReflect.Descriptor instead. func (*RadioUserProfile) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{0} + return file_pb_radio_proto_rawDescGZIP(), []int{3} } func (x *RadioUserProfile) GetId() string { @@ -114,28 +253,28 @@ func (x *RadioUserProfile) GetVipLevel() int32 { return 0 } -type GetRadioUserProfileReq struct { +type GetProfileReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetRadioUserProfileReq) Reset() { - *x = GetRadioUserProfileReq{} - mi := &file_pb_radio_proto_msgTypes[1] +func (x *GetProfileReq) Reset() { + *x = GetProfileReq{} + mi := &file_pb_radio_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetRadioUserProfileReq) String() string { +func (x *GetProfileReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetRadioUserProfileReq) ProtoMessage() {} +func (*GetProfileReq) ProtoMessage() {} -func (x *GetRadioUserProfileReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[1] +func (x *GetProfileReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -146,63 +285,18 @@ func (x *GetRadioUserProfileReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetRadioUserProfileReq.ProtoReflect.Descriptor instead. -func (*GetRadioUserProfileReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{1} +// Deprecated: Use GetProfileReq.ProtoReflect.Descriptor instead. +func (*GetProfileReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{4} } -func (x *GetRadioUserProfileReq) GetUserId() string { +func (x *GetProfileReq) GetUserId() string { if x != nil { return x.UserId } return "" } -type GetRadioUserProfileResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Profile *RadioUserProfile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetRadioUserProfileResp) Reset() { - *x = GetRadioUserProfileResp{} - mi := &file_pb_radio_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetRadioUserProfileResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRadioUserProfileResp) ProtoMessage() {} - -func (x *GetRadioUserProfileResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_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 GetRadioUserProfileResp.ProtoReflect.Descriptor instead. -func (*GetRadioUserProfileResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{2} -} - -func (x *GetRadioUserProfileResp) GetProfile() *RadioUserProfile { - if x != nil { - return x.Profile - } - return nil -} - -// ========== 分类 ========== type CategoryInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -215,7 +309,7 @@ type CategoryInfo struct { func (x *CategoryInfo) Reset() { *x = CategoryInfo{} - mi := &file_pb_radio_proto_msgTypes[3] + mi := &file_pb_radio_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -227,7 +321,7 @@ func (x *CategoryInfo) String() string { func (*CategoryInfo) ProtoMessage() {} func (x *CategoryInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[3] + mi := &file_pb_radio_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -240,7 +334,7 @@ func (x *CategoryInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use CategoryInfo.ProtoReflect.Descriptor instead. func (*CategoryInfo) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{3} + return file_pb_radio_proto_rawDescGZIP(), []int{5} } func (x *CategoryInfo) GetId() string { @@ -271,7 +365,7 @@ func (x *CategoryInfo) GetSort() int32 { return 0 } -type CreateCategoryReq struct { +type CategoryReq struct { state protoimpl.MessageState `protogen:"open.v1"` Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Icon string `protobuf:"bytes,2,opt,name=icon,proto3" json:"icon,omitempty"` @@ -280,21 +374,21 @@ type CreateCategoryReq struct { sizeCache protoimpl.SizeCache } -func (x *CreateCategoryReq) Reset() { - *x = CreateCategoryReq{} - mi := &file_pb_radio_proto_msgTypes[4] +func (x *CategoryReq) Reset() { + *x = CategoryReq{} + mi := &file_pb_radio_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *CreateCategoryReq) String() string { +func (x *CategoryReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateCategoryReq) ProtoMessage() {} +func (*CategoryReq) ProtoMessage() {} -func (x *CreateCategoryReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[4] +func (x *CategoryReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -305,77 +399,33 @@ func (x *CreateCategoryReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateCategoryReq.ProtoReflect.Descriptor instead. -func (*CreateCategoryReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{4} +// Deprecated: Use CategoryReq.ProtoReflect.Descriptor instead. +func (*CategoryReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{6} } -func (x *CreateCategoryReq) GetName() string { +func (x *CategoryReq) GetName() string { if x != nil { return x.Name } return "" } -func (x *CreateCategoryReq) GetIcon() string { +func (x *CategoryReq) GetIcon() string { if x != nil { return x.Icon } return "" } -func (x *CreateCategoryReq) GetSort() int32 { +func (x *CategoryReq) GetSort() int32 { if x != nil { return x.Sort } return 0 } -type CreateCategoryResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateCategoryResp) Reset() { - *x = CreateCategoryResp{} - mi := &file_pb_radio_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateCategoryResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateCategoryResp) ProtoMessage() {} - -func (x *CreateCategoryResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_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 CreateCategoryResp.ProtoReflect.Descriptor instead. -func (*CreateCategoryResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateCategoryResp) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type UpdateCategoryReq struct { +type CategoryUpdateReq struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` @@ -385,21 +435,21 @@ type UpdateCategoryReq struct { sizeCache protoimpl.SizeCache } -func (x *UpdateCategoryReq) Reset() { - *x = UpdateCategoryReq{} - mi := &file_pb_radio_proto_msgTypes[6] +func (x *CategoryUpdateReq) Reset() { + *x = CategoryUpdateReq{} + mi := &file_pb_radio_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *UpdateCategoryReq) String() string { +func (x *CategoryUpdateReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*UpdateCategoryReq) ProtoMessage() {} +func (*CategoryUpdateReq) ProtoMessage() {} -func (x *UpdateCategoryReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[6] +func (x *CategoryUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -410,208 +460,40 @@ func (x *UpdateCategoryReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use UpdateCategoryReq.ProtoReflect.Descriptor instead. -func (*UpdateCategoryReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{6} +// Deprecated: Use CategoryUpdateReq.ProtoReflect.Descriptor instead. +func (*CategoryUpdateReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{7} } -func (x *UpdateCategoryReq) GetId() string { +func (x *CategoryUpdateReq) GetId() string { if x != nil { return x.Id } return "" } -func (x *UpdateCategoryReq) GetName() string { +func (x *CategoryUpdateReq) GetName() string { if x != nil { return x.Name } return "" } -func (x *UpdateCategoryReq) GetIcon() string { +func (x *CategoryUpdateReq) GetIcon() string { if x != nil { return x.Icon } return "" } -func (x *UpdateCategoryReq) GetSort() int32 { +func (x *CategoryUpdateReq) GetSort() int32 { if x != nil { return x.Sort } return 0 } -type UpdateCategoryResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateCategoryResp) Reset() { - *x = UpdateCategoryResp{} - mi := &file_pb_radio_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateCategoryResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateCategoryResp) ProtoMessage() {} - -func (x *UpdateCategoryResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_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 UpdateCategoryResp.ProtoReflect.Descriptor instead. -func (*UpdateCategoryResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{7} -} - -type DeleteByIdsReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteByIdsReq) Reset() { - *x = DeleteByIdsReq{} - mi := &file_pb_radio_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteByIdsReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteByIdsReq) ProtoMessage() {} - -func (x *DeleteByIdsReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_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 DeleteByIdsReq.ProtoReflect.Descriptor instead. -func (*DeleteByIdsReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{8} -} - -func (x *DeleteByIdsReq) GetIds() []string { - if x != nil { - return x.Ids - } - return nil -} - -type DeleteResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *DeleteResp) Reset() { - *x = DeleteResp{} - mi := &file_pb_radio_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *DeleteResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteResp) ProtoMessage() {} - -func (x *DeleteResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_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 DeleteResp.ProtoReflect.Descriptor instead. -func (*DeleteResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{9} -} - -type GetCategoryListReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` - PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetCategoryListReq) Reset() { - *x = GetCategoryListReq{} - mi := &file_pb_radio_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetCategoryListReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetCategoryListReq) ProtoMessage() {} - -func (x *GetCategoryListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_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 GetCategoryListReq.ProtoReflect.Descriptor instead. -func (*GetCategoryListReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{10} -} - -func (x *GetCategoryListReq) GetCurrent() int32 { - if x != nil { - return x.Current - } - return 0 -} - -func (x *GetCategoryListReq) GetPageSize() int32 { - if x != nil { - return x.PageSize - } - return 0 -} - -type GetCategoryListResp struct { +type CategoryListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*CategoryInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -619,21 +501,21 @@ type GetCategoryListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetCategoryListResp) Reset() { - *x = GetCategoryListResp{} - mi := &file_pb_radio_proto_msgTypes[11] +func (x *CategoryListResp) Reset() { + *x = CategoryListResp{} + mi := &file_pb_radio_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetCategoryListResp) String() string { +func (x *CategoryListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetCategoryListResp) ProtoMessage() {} +func (*CategoryListResp) ProtoMessage() {} -func (x *GetCategoryListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[11] +func (x *CategoryListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -644,26 +526,77 @@ func (x *GetCategoryListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetCategoryListResp.ProtoReflect.Descriptor instead. -func (*GetCategoryListResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{11} +// Deprecated: Use CategoryListResp.ProtoReflect.Descriptor instead. +func (*CategoryListResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{8} } -func (x *GetCategoryListResp) GetList() []*CategoryInfo { +func (x *CategoryListResp) GetList() []*CategoryInfo { if x != nil { return x.List } return nil } -func (x *GetCategoryListResp) GetTotal() int64 { +func (x *CategoryListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -// ========== 频道 ========== +type CategoryListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *CategoryListReq) Reset() { + *x = CategoryListReq{} + mi := &file_pb_radio_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CategoryListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CategoryListReq) ProtoMessage() {} + +func (x *CategoryListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_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 CategoryListReq.ProtoReflect.Descriptor instead. +func (*CategoryListReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{9} +} + +func (x *CategoryListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *CategoryListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + type ChannelInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -679,14 +612,13 @@ type ChannelInfo struct { Tags string `protobuf:"bytes,11,opt,name=tags,proto3" json:"tags,omitempty"` Sort int32 `protobuf:"varint,12,opt,name=sort,proto3" json:"sort,omitempty"` Status int32 `protobuf:"varint,13,opt,name=status,proto3" json:"status,omitempty"` - CreatedAt int64 `protobuf:"varint,14,opt,name=createdAt,proto3" json:"createdAt,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ChannelInfo) Reset() { *x = ChannelInfo{} - mi := &file_pb_radio_proto_msgTypes[12] + mi := &file_pb_radio_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -698,7 +630,7 @@ func (x *ChannelInfo) String() string { func (*ChannelInfo) ProtoMessage() {} func (x *ChannelInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[12] + mi := &file_pb_radio_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -711,7 +643,7 @@ func (x *ChannelInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ChannelInfo.ProtoReflect.Descriptor instead. func (*ChannelInfo) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{12} + return file_pb_radio_proto_rawDescGZIP(), []int{10} } func (x *ChannelInfo) GetId() string { @@ -805,13 +737,6 @@ func (x *ChannelInfo) GetStatus() int32 { return 0 } -func (x *ChannelInfo) GetCreatedAt() int64 { - if x != nil { - return x.CreatedAt - } - return 0 -} - type CreateChannelReq struct { state protoimpl.MessageState `protogen:"open.v1"` CategoryId string `protobuf:"bytes,1,opt,name=categoryId,proto3" json:"categoryId,omitempty"` @@ -831,7 +756,7 @@ type CreateChannelReq struct { func (x *CreateChannelReq) Reset() { *x = CreateChannelReq{} - mi := &file_pb_radio_proto_msgTypes[13] + mi := &file_pb_radio_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -843,7 +768,7 @@ func (x *CreateChannelReq) String() string { func (*CreateChannelReq) ProtoMessage() {} func (x *CreateChannelReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[13] + mi := &file_pb_radio_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -856,7 +781,7 @@ func (x *CreateChannelReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateChannelReq.ProtoReflect.Descriptor instead. func (*CreateChannelReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{13} + return file_pb_radio_proto_rawDescGZIP(), []int{11} } func (x *CreateChannelReq) GetCategoryId() string { @@ -936,71 +861,28 @@ func (x *CreateChannelReq) GetSort() int32 { return 0 } -type CreateChannelResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateChannelResp) Reset() { - *x = CreateChannelResp{} - mi := &file_pb_radio_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateChannelResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateChannelResp) ProtoMessage() {} - -func (x *CreateChannelResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_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 CreateChannelResp.ProtoReflect.Descriptor instead. -func (*CreateChannelResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{14} -} - -func (x *CreateChannelResp) GetId() string { - if x != nil { - return x.Id - } - return "" -} - type UpdateChannelReq struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - IsFree int32 `protobuf:"varint,4,opt,name=isFree,proto3" json:"isFree,omitempty"` - IsVipOnly int32 `protobuf:"varint,5,opt,name=isVipOnly,proto3" json:"isVipOnly,omitempty"` - MonthlyPrice int32 `protobuf:"varint,6,opt,name=monthlyPrice,proto3" json:"monthlyPrice,omitempty"` - QuarterlyPrice int32 `protobuf:"varint,7,opt,name=quarterlyPrice,proto3" json:"quarterlyPrice,omitempty"` - AnnualPrice int32 `protobuf:"varint,8,opt,name=annualPrice,proto3" json:"annualPrice,omitempty"` - Cover string `protobuf:"bytes,9,opt,name=cover,proto3" json:"cover,omitempty"` - Tags string `protobuf:"bytes,10,opt,name=tags,proto3" json:"tags,omitempty"` - Sort int32 `protobuf:"varint,11,opt,name=sort,proto3" json:"sort,omitempty"` - Status int32 `protobuf:"varint,12,opt,name=status,proto3" json:"status,omitempty"` + CategoryId string `protobuf:"bytes,2,opt,name=categoryId,proto3" json:"categoryId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + IsFree int32 `protobuf:"varint,5,opt,name=isFree,proto3" json:"isFree,omitempty"` + IsVipOnly int32 `protobuf:"varint,6,opt,name=isVipOnly,proto3" json:"isVipOnly,omitempty"` + MonthlyPrice int32 `protobuf:"varint,7,opt,name=monthlyPrice,proto3" json:"monthlyPrice,omitempty"` + QuarterlyPrice int32 `protobuf:"varint,8,opt,name=quarterlyPrice,proto3" json:"quarterlyPrice,omitempty"` + AnnualPrice int32 `protobuf:"varint,9,opt,name=annualPrice,proto3" json:"annualPrice,omitempty"` + Cover string `protobuf:"bytes,10,opt,name=cover,proto3" json:"cover,omitempty"` + Tags string `protobuf:"bytes,11,opt,name=tags,proto3" json:"tags,omitempty"` + Sort int32 `protobuf:"varint,12,opt,name=sort,proto3" json:"sort,omitempty"` + Status int32 `protobuf:"varint,13,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UpdateChannelReq) Reset() { *x = UpdateChannelReq{} - mi := &file_pb_radio_proto_msgTypes[15] + mi := &file_pb_radio_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1012,7 +894,7 @@ func (x *UpdateChannelReq) String() string { func (*UpdateChannelReq) ProtoMessage() {} func (x *UpdateChannelReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[15] + mi := &file_pb_radio_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1025,7 +907,7 @@ func (x *UpdateChannelReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateChannelReq.ProtoReflect.Descriptor instead. func (*UpdateChannelReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{15} + return file_pb_radio_proto_rawDescGZIP(), []int{12} } func (x *UpdateChannelReq) GetId() string { @@ -1035,6 +917,13 @@ func (x *UpdateChannelReq) GetId() string { return "" } +func (x *UpdateChannelReq) GetCategoryId() string { + if x != nil { + return x.CategoryId + } + return "" +} + func (x *UpdateChannelReq) GetName() string { if x != nil { return x.Name @@ -1112,43 +1001,7 @@ func (x *UpdateChannelReq) GetStatus() int32 { return 0 } -type UpdateChannelResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateChannelResp) Reset() { - *x = UpdateChannelResp{} - mi := &file_pb_radio_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateChannelResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateChannelResp) ProtoMessage() {} - -func (x *UpdateChannelResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_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 UpdateChannelResp.ProtoReflect.Descriptor instead. -func (*UpdateChannelResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{16} -} - -type GetChannelListReq struct { +type ChannelListReq struct { state protoimpl.MessageState `protogen:"open.v1"` Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` @@ -1158,21 +1011,21 @@ type GetChannelListReq struct { sizeCache protoimpl.SizeCache } -func (x *GetChannelListReq) Reset() { - *x = GetChannelListReq{} - mi := &file_pb_radio_proto_msgTypes[17] +func (x *ChannelListReq) Reset() { + *x = ChannelListReq{} + mi := &file_pb_radio_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetChannelListReq) String() string { +func (x *ChannelListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetChannelListReq) ProtoMessage() {} +func (*ChannelListReq) ProtoMessage() {} -func (x *GetChannelListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[17] +func (x *ChannelListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1183,40 +1036,40 @@ func (x *GetChannelListReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetChannelListReq.ProtoReflect.Descriptor instead. -func (*GetChannelListReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{17} +// Deprecated: Use ChannelListReq.ProtoReflect.Descriptor instead. +func (*ChannelListReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{13} } -func (x *GetChannelListReq) GetCurrent() int32 { +func (x *ChannelListReq) GetCurrent() int32 { if x != nil { return x.Current } return 0 } -func (x *GetChannelListReq) GetPageSize() int32 { +func (x *ChannelListReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -func (x *GetChannelListReq) GetCategoryId() string { +func (x *ChannelListReq) GetCategoryId() string { if x != nil { return x.CategoryId } return "" } -func (x *GetChannelListReq) GetUserId() string { +func (x *ChannelListReq) GetUserId() string { if x != nil { return x.UserId } return "" } -type GetChannelListResp struct { +type ChannelListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*ChannelInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -1224,21 +1077,21 @@ type GetChannelListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetChannelListResp) Reset() { - *x = GetChannelListResp{} - mi := &file_pb_radio_proto_msgTypes[18] +func (x *ChannelListResp) Reset() { + *x = ChannelListResp{} + mi := &file_pb_radio_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetChannelListResp) String() string { +func (x *ChannelListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetChannelListResp) ProtoMessage() {} +func (*ChannelListResp) ProtoMessage() {} -func (x *GetChannelListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[18] +func (x *ChannelListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[14] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1249,122 +1102,25 @@ func (x *GetChannelListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetChannelListResp.ProtoReflect.Descriptor instead. -func (*GetChannelListResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{18} +// Deprecated: Use ChannelListResp.ProtoReflect.Descriptor instead. +func (*ChannelListResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{14} } -func (x *GetChannelListResp) GetList() []*ChannelInfo { +func (x *ChannelListResp) GetList() []*ChannelInfo { if x != nil { return x.List } return nil } -func (x *GetChannelListResp) GetTotal() int64 { +func (x *ChannelListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -type GetChannelDetailReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetChannelDetailReq) Reset() { - *x = GetChannelDetailReq{} - mi := &file_pb_radio_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetChannelDetailReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetChannelDetailReq) ProtoMessage() {} - -func (x *GetChannelDetailReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_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 GetChannelDetailReq.ProtoReflect.Descriptor instead. -func (*GetChannelDetailReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{19} -} - -func (x *GetChannelDetailReq) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *GetChannelDetailReq) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type GetChannelDetailResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Channel *ChannelInfo `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetChannelDetailResp) Reset() { - *x = GetChannelDetailResp{} - mi := &file_pb_radio_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetChannelDetailResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetChannelDetailResp) ProtoMessage() {} - -func (x *GetChannelDetailResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[20] - 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 GetChannelDetailResp.ProtoReflect.Descriptor instead. -func (*GetChannelDetailResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{20} -} - -func (x *GetChannelDetailResp) GetChannel() *ChannelInfo { - if x != nil { - return x.Channel - } - return nil -} - -// ========== 节目 ========== type ProgramInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -1380,14 +1136,13 @@ type ProgramInfo struct { PlayCount int32 `protobuf:"varint,11,opt,name=playCount,proto3" json:"playCount,omitempty"` LikeCount int32 `protobuf:"varint,12,opt,name=likeCount,proto3" json:"likeCount,omitempty"` Status int32 `protobuf:"varint,13,opt,name=status,proto3" json:"status,omitempty"` - CreatedAt int64 `protobuf:"varint,14,opt,name=createdAt,proto3" json:"createdAt,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *ProgramInfo) Reset() { *x = ProgramInfo{} - mi := &file_pb_radio_proto_msgTypes[21] + mi := &file_pb_radio_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1399,7 +1154,7 @@ func (x *ProgramInfo) String() string { func (*ProgramInfo) ProtoMessage() {} func (x *ProgramInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[21] + mi := &file_pb_radio_proto_msgTypes[15] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1412,7 +1167,7 @@ func (x *ProgramInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ProgramInfo.ProtoReflect.Descriptor instead. func (*ProgramInfo) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{21} + return file_pb_radio_proto_rawDescGZIP(), []int{15} } func (x *ProgramInfo) GetId() string { @@ -1506,13 +1261,6 @@ func (x *ProgramInfo) GetStatus() int32 { return 0 } -func (x *ProgramInfo) GetCreatedAt() int64 { - if x != nil { - return x.CreatedAt - } - return 0 -} - type CreateProgramReq struct { state protoimpl.MessageState `protogen:"open.v1"` ChannelId string `protobuf:"bytes,1,opt,name=channelId,proto3" json:"channelId,omitempty"` @@ -1527,7 +1275,7 @@ type CreateProgramReq struct { func (x *CreateProgramReq) Reset() { *x = CreateProgramReq{} - mi := &file_pb_radio_proto_msgTypes[22] + mi := &file_pb_radio_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1539,7 +1287,7 @@ func (x *CreateProgramReq) String() string { func (*CreateProgramReq) ProtoMessage() {} func (x *CreateProgramReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[22] + mi := &file_pb_radio_proto_msgTypes[16] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1552,7 +1300,7 @@ func (x *CreateProgramReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateProgramReq.ProtoReflect.Descriptor instead. func (*CreateProgramReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{22} + return file_pb_radio_proto_rawDescGZIP(), []int{16} } func (x *CreateProgramReq) GetChannelId() string { @@ -1597,69 +1345,26 @@ func (x *CreateProgramReq) GetTags() string { return "" } -type CreateProgramResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateProgramResp) Reset() { - *x = CreateProgramResp{} - mi := &file_pb_radio_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateProgramResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateProgramResp) ProtoMessage() {} - -func (x *CreateProgramResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[23] - 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 CreateProgramResp.ProtoReflect.Descriptor instead. -func (*CreateProgramResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{23} -} - -func (x *CreateProgramResp) GetId() string { - if x != nil { - return x.Id - } - return "" -} - type UpdateProgramReq struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content,omitempty"` - Cover string `protobuf:"bytes,5,opt,name=cover,proto3" json:"cover,omitempty"` - AudioId string `protobuf:"bytes,6,opt,name=audioId,proto3" json:"audioId,omitempty"` - AudioStatus int32 `protobuf:"varint,7,opt,name=audioStatus,proto3" json:"audioStatus,omitempty"` - Duration int32 `protobuf:"varint,8,opt,name=duration,proto3" json:"duration,omitempty"` - Tags string `protobuf:"bytes,9,opt,name=tags,proto3" json:"tags,omitempty"` - Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status,omitempty"` + ChannelId string `protobuf:"bytes,2,opt,name=channelId,proto3" json:"channelId,omitempty"` + Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` + Cover string `protobuf:"bytes,6,opt,name=cover,proto3" json:"cover,omitempty"` + AudioId string `protobuf:"bytes,7,opt,name=audioId,proto3" json:"audioId,omitempty"` + AudioStatus int32 `protobuf:"varint,8,opt,name=audioStatus,proto3" json:"audioStatus,omitempty"` + Duration int32 `protobuf:"varint,9,opt,name=duration,proto3" json:"duration,omitempty"` + Tags string `protobuf:"bytes,10,opt,name=tags,proto3" json:"tags,omitempty"` + Status int32 `protobuf:"varint,11,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UpdateProgramReq) Reset() { *x = UpdateProgramReq{} - mi := &file_pb_radio_proto_msgTypes[24] + mi := &file_pb_radio_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1671,7 +1376,7 @@ func (x *UpdateProgramReq) String() string { func (*UpdateProgramReq) ProtoMessage() {} func (x *UpdateProgramReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[24] + mi := &file_pb_radio_proto_msgTypes[17] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1684,7 +1389,7 @@ func (x *UpdateProgramReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateProgramReq.ProtoReflect.Descriptor instead. func (*UpdateProgramReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{24} + return file_pb_radio_proto_rawDescGZIP(), []int{17} } func (x *UpdateProgramReq) GetId() string { @@ -1694,6 +1399,13 @@ func (x *UpdateProgramReq) GetId() string { return "" } +func (x *UpdateProgramReq) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + func (x *UpdateProgramReq) GetTitle() string { if x != nil { return x.Title @@ -1757,43 +1469,7 @@ func (x *UpdateProgramReq) GetStatus() int32 { return 0 } -type UpdateProgramResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateProgramResp) Reset() { - *x = UpdateProgramResp{} - mi := &file_pb_radio_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateProgramResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateProgramResp) ProtoMessage() {} - -func (x *UpdateProgramResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[25] - 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 UpdateProgramResp.ProtoReflect.Descriptor instead. -func (*UpdateProgramResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{25} -} - -type GetProgramListReq struct { +type ProgramListReq struct { state protoimpl.MessageState `protogen:"open.v1"` Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` @@ -1803,21 +1479,21 @@ type GetProgramListReq struct { sizeCache protoimpl.SizeCache } -func (x *GetProgramListReq) Reset() { - *x = GetProgramListReq{} - mi := &file_pb_radio_proto_msgTypes[26] +func (x *ProgramListReq) Reset() { + *x = ProgramListReq{} + mi := &file_pb_radio_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetProgramListReq) String() string { +func (x *ProgramListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetProgramListReq) ProtoMessage() {} +func (*ProgramListReq) ProtoMessage() {} -func (x *GetProgramListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[26] +func (x *ProgramListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[18] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1828,40 +1504,40 @@ func (x *GetProgramListReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetProgramListReq.ProtoReflect.Descriptor instead. -func (*GetProgramListReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{26} +// Deprecated: Use ProgramListReq.ProtoReflect.Descriptor instead. +func (*ProgramListReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{18} } -func (x *GetProgramListReq) GetCurrent() int32 { +func (x *ProgramListReq) GetCurrent() int32 { if x != nil { return x.Current } return 0 } -func (x *GetProgramListReq) GetPageSize() int32 { +func (x *ProgramListReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -func (x *GetProgramListReq) GetChannelId() string { +func (x *ProgramListReq) GetChannelId() string { if x != nil { return x.ChannelId } return "" } -func (x *GetProgramListReq) GetUserId() string { +func (x *ProgramListReq) GetUserId() string { if x != nil { return x.UserId } return "" } -type GetProgramListResp struct { +type ProgramListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*ProgramInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -1869,21 +1545,21 @@ type GetProgramListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetProgramListResp) Reset() { - *x = GetProgramListResp{} - mi := &file_pb_radio_proto_msgTypes[27] +func (x *ProgramListResp) Reset() { + *x = ProgramListResp{} + mi := &file_pb_radio_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetProgramListResp) String() string { +func (x *ProgramListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetProgramListResp) ProtoMessage() {} +func (*ProgramListResp) ProtoMessage() {} -func (x *GetProgramListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[27] +func (x *ProgramListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[19] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1894,122 +1570,25 @@ func (x *GetProgramListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetProgramListResp.ProtoReflect.Descriptor instead. -func (*GetProgramListResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{27} +// Deprecated: Use ProgramListResp.ProtoReflect.Descriptor instead. +func (*ProgramListResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{19} } -func (x *GetProgramListResp) GetList() []*ProgramInfo { +func (x *ProgramListResp) GetList() []*ProgramInfo { if x != nil { return x.List } return nil } -func (x *GetProgramListResp) GetTotal() int64 { +func (x *ProgramListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -type GetProgramDetailReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetProgramDetailReq) Reset() { - *x = GetProgramDetailReq{} - mi := &file_pb_radio_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetProgramDetailReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProgramDetailReq) ProtoMessage() {} - -func (x *GetProgramDetailReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[28] - 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 GetProgramDetailReq.ProtoReflect.Descriptor instead. -func (*GetProgramDetailReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{28} -} - -func (x *GetProgramDetailReq) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *GetProgramDetailReq) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -type GetProgramDetailResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Program *ProgramInfo `protobuf:"bytes,1,opt,name=program,proto3" json:"program,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetProgramDetailResp) Reset() { - *x = GetProgramDetailResp{} - mi := &file_pb_radio_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetProgramDetailResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetProgramDetailResp) ProtoMessage() {} - -func (x *GetProgramDetailResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[29] - 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 GetProgramDetailResp.ProtoReflect.Descriptor instead. -func (*GetProgramDetailResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{29} -} - -func (x *GetProgramDetailResp) GetProgram() *ProgramInfo { - if x != nil { - return x.Program - } - return nil -} - -// ========== 音色 ========== type VoiceInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -2022,14 +1601,13 @@ type VoiceInfo struct { Sort int32 `protobuf:"varint,8,opt,name=sort,proto3" json:"sort,omitempty"` Status int32 `protobuf:"varint,9,opt,name=status,proto3" json:"status,omitempty"` IsDefault int32 `protobuf:"varint,10,opt,name=isDefault,proto3" json:"isDefault,omitempty"` - UseCount int32 `protobuf:"varint,11,opt,name=useCount,proto3" json:"useCount,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *VoiceInfo) Reset() { *x = VoiceInfo{} - mi := &file_pb_radio_proto_msgTypes[30] + mi := &file_pb_radio_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2041,7 +1619,7 @@ func (x *VoiceInfo) String() string { func (*VoiceInfo) ProtoMessage() {} func (x *VoiceInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[30] + mi := &file_pb_radio_proto_msgTypes[20] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2054,7 +1632,7 @@ func (x *VoiceInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use VoiceInfo.ProtoReflect.Descriptor instead. func (*VoiceInfo) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{30} + return file_pb_radio_proto_rawDescGZIP(), []int{20} } func (x *VoiceInfo) GetId() string { @@ -2127,13 +1705,6 @@ func (x *VoiceInfo) GetIsDefault() int32 { return 0 } -func (x *VoiceInfo) GetUseCount() int32 { - if x != nil { - return x.UseCount - } - return 0 -} - type CreateVoiceReq struct { state protoimpl.MessageState `protogen:"open.v1"` SpeakerId string `protobuf:"bytes,1,opt,name=speakerId,proto3" json:"speakerId,omitempty"` @@ -2150,7 +1721,7 @@ type CreateVoiceReq struct { func (x *CreateVoiceReq) Reset() { *x = CreateVoiceReq{} - mi := &file_pb_radio_proto_msgTypes[31] + mi := &file_pb_radio_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2162,7 +1733,7 @@ func (x *CreateVoiceReq) String() string { func (*CreateVoiceReq) ProtoMessage() {} func (x *CreateVoiceReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[31] + mi := &file_pb_radio_proto_msgTypes[21] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2175,7 +1746,7 @@ func (x *CreateVoiceReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateVoiceReq.ProtoReflect.Descriptor instead. func (*CreateVoiceReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{31} + return file_pb_radio_proto_rawDescGZIP(), []int{21} } func (x *CreateVoiceReq) GetSpeakerId() string { @@ -2234,67 +1805,25 @@ func (x *CreateVoiceReq) GetIsDefault() int32 { return 0 } -type CreateVoiceResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateVoiceResp) Reset() { - *x = CreateVoiceResp{} - mi := &file_pb_radio_proto_msgTypes[32] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateVoiceResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateVoiceResp) ProtoMessage() {} - -func (x *CreateVoiceResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[32] - 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 CreateVoiceResp.ProtoReflect.Descriptor instead. -func (*CreateVoiceResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{32} -} - -func (x *CreateVoiceResp) GetId() string { - if x != nil { - return x.Id - } - return "" -} - type UpdateVoiceReq struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` - Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon,omitempty"` - AudioId string `protobuf:"bytes,5,opt,name=audioId,proto3" json:"audioId,omitempty"` - Sort int32 `protobuf:"varint,6,opt,name=sort,proto3" json:"sort,omitempty"` - Status int32 `protobuf:"varint,7,opt,name=status,proto3" json:"status,omitempty"` - IsDefault int32 `protobuf:"varint,8,opt,name=isDefault,proto3" json:"isDefault,omitempty"` + SpeakerId string `protobuf:"bytes,2,opt,name=speakerId,proto3" json:"speakerId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"` + Gender string `protobuf:"bytes,5,opt,name=gender,proto3" json:"gender,omitempty"` + Icon string `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"` + AudioId string `protobuf:"bytes,7,opt,name=audioId,proto3" json:"audioId,omitempty"` + Sort int32 `protobuf:"varint,8,opt,name=sort,proto3" json:"sort,omitempty"` + Status int32 `protobuf:"varint,9,opt,name=status,proto3" json:"status,omitempty"` + IsDefault int32 `protobuf:"varint,10,opt,name=isDefault,proto3" json:"isDefault,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *UpdateVoiceReq) Reset() { *x = UpdateVoiceReq{} - mi := &file_pb_radio_proto_msgTypes[33] + mi := &file_pb_radio_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2306,7 +1835,7 @@ func (x *UpdateVoiceReq) String() string { func (*UpdateVoiceReq) ProtoMessage() {} func (x *UpdateVoiceReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[33] + mi := &file_pb_radio_proto_msgTypes[22] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2319,7 +1848,7 @@ func (x *UpdateVoiceReq) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdateVoiceReq.ProtoReflect.Descriptor instead. func (*UpdateVoiceReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{33} + return file_pb_radio_proto_rawDescGZIP(), []int{22} } func (x *UpdateVoiceReq) GetId() string { @@ -2329,6 +1858,13 @@ func (x *UpdateVoiceReq) GetId() string { return "" } +func (x *UpdateVoiceReq) GetSpeakerId() string { + if x != nil { + return x.SpeakerId + } + return "" +} + func (x *UpdateVoiceReq) GetName() string { if x != nil { return x.Name @@ -2343,6 +1879,13 @@ func (x *UpdateVoiceReq) GetDescription() string { return "" } +func (x *UpdateVoiceReq) GetGender() string { + if x != nil { + return x.Gender + } + return "" +} + func (x *UpdateVoiceReq) GetIcon() string { if x != nil { return x.Icon @@ -2378,43 +1921,7 @@ func (x *UpdateVoiceReq) GetIsDefault() int32 { return 0 } -type UpdateVoiceResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *UpdateVoiceResp) Reset() { - *x = UpdateVoiceResp{} - mi := &file_pb_radio_proto_msgTypes[34] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *UpdateVoiceResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateVoiceResp) ProtoMessage() {} - -func (x *UpdateVoiceResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[34] - 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 UpdateVoiceResp.ProtoReflect.Descriptor instead. -func (*UpdateVoiceResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{34} -} - -type GetVoiceListReq struct { +type VoiceListReq struct { state protoimpl.MessageState `protogen:"open.v1"` Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` @@ -2422,21 +1929,21 @@ type GetVoiceListReq struct { sizeCache protoimpl.SizeCache } -func (x *GetVoiceListReq) Reset() { - *x = GetVoiceListReq{} - mi := &file_pb_radio_proto_msgTypes[35] +func (x *VoiceListReq) Reset() { + *x = VoiceListReq{} + mi := &file_pb_radio_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetVoiceListReq) String() string { +func (x *VoiceListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetVoiceListReq) ProtoMessage() {} +func (*VoiceListReq) ProtoMessage() {} -func (x *GetVoiceListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[35] +func (x *VoiceListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[23] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2447,26 +1954,26 @@ func (x *GetVoiceListReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetVoiceListReq.ProtoReflect.Descriptor instead. -func (*GetVoiceListReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{35} +// Deprecated: Use VoiceListReq.ProtoReflect.Descriptor instead. +func (*VoiceListReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{23} } -func (x *GetVoiceListReq) GetCurrent() int32 { +func (x *VoiceListReq) GetCurrent() int32 { if x != nil { return x.Current } return 0 } -func (x *GetVoiceListReq) GetPageSize() int32 { +func (x *VoiceListReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -type GetVoiceListResp struct { +type VoiceListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*VoiceInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -2474,21 +1981,21 @@ type GetVoiceListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetVoiceListResp) Reset() { - *x = GetVoiceListResp{} - mi := &file_pb_radio_proto_msgTypes[36] +func (x *VoiceListResp) Reset() { + *x = VoiceListResp{} + mi := &file_pb_radio_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetVoiceListResp) String() string { +func (x *VoiceListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetVoiceListResp) ProtoMessage() {} +func (*VoiceListResp) ProtoMessage() {} -func (x *GetVoiceListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[36] +func (x *VoiceListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[24] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2499,26 +2006,25 @@ func (x *GetVoiceListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetVoiceListResp.ProtoReflect.Descriptor instead. -func (*GetVoiceListResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{36} +// Deprecated: Use VoiceListResp.ProtoReflect.Descriptor instead. +func (*VoiceListResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{24} } -func (x *GetVoiceListResp) GetList() []*VoiceInfo { +func (x *VoiceListResp) GetList() []*VoiceInfo { if x != nil { return x.List } return nil } -func (x *GetVoiceListResp) GetTotal() int64 { +func (x *VoiceListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -// ========== 互动 ========== type ToggleLikeReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -2529,7 +2035,7 @@ type ToggleLikeReq struct { func (x *ToggleLikeReq) Reset() { *x = ToggleLikeReq{} - mi := &file_pb_radio_proto_msgTypes[37] + mi := &file_pb_radio_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2541,7 +2047,7 @@ func (x *ToggleLikeReq) String() string { func (*ToggleLikeReq) ProtoMessage() {} func (x *ToggleLikeReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[37] + mi := &file_pb_radio_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2554,7 +2060,7 @@ func (x *ToggleLikeReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ToggleLikeReq.ProtoReflect.Descriptor instead. func (*ToggleLikeReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{37} + return file_pb_radio_proto_rawDescGZIP(), []int{25} } func (x *ToggleLikeReq) GetUserId() string { @@ -2571,50 +2077,6 @@ func (x *ToggleLikeReq) GetProgramId() string { return "" } -type ToggleLikeResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Liked bool `protobuf:"varint,1,opt,name=liked,proto3" json:"liked,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ToggleLikeResp) Reset() { - *x = ToggleLikeResp{} - mi := &file_pb_radio_proto_msgTypes[38] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ToggleLikeResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ToggleLikeResp) ProtoMessage() {} - -func (x *ToggleLikeResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[38] - 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 ToggleLikeResp.ProtoReflect.Descriptor instead. -func (*ToggleLikeResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{38} -} - -func (x *ToggleLikeResp) GetLiked() bool { - if x != nil { - return x.Liked - } - return false -} - type ToggleFavoriteReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -2625,7 +2087,7 @@ type ToggleFavoriteReq struct { func (x *ToggleFavoriteReq) Reset() { *x = ToggleFavoriteReq{} - mi := &file_pb_radio_proto_msgTypes[39] + mi := &file_pb_radio_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2637,7 +2099,7 @@ func (x *ToggleFavoriteReq) String() string { func (*ToggleFavoriteReq) ProtoMessage() {} func (x *ToggleFavoriteReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[39] + mi := &file_pb_radio_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2650,7 +2112,7 @@ func (x *ToggleFavoriteReq) ProtoReflect() protoreflect.Message { // Deprecated: Use ToggleFavoriteReq.ProtoReflect.Descriptor instead. func (*ToggleFavoriteReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{39} + return file_pb_radio_proto_rawDescGZIP(), []int{26} } func (x *ToggleFavoriteReq) GetUserId() string { @@ -2667,50 +2129,6 @@ func (x *ToggleFavoriteReq) GetProgramId() string { return "" } -type ToggleFavoriteResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - Favorited bool `protobuf:"varint,1,opt,name=favorited,proto3" json:"favorited,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ToggleFavoriteResp) Reset() { - *x = ToggleFavoriteResp{} - mi := &file_pb_radio_proto_msgTypes[40] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ToggleFavoriteResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ToggleFavoriteResp) ProtoMessage() {} - -func (x *ToggleFavoriteResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[40] - 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 ToggleFavoriteResp.ProtoReflect.Descriptor instead. -func (*ToggleFavoriteResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{40} -} - -func (x *ToggleFavoriteResp) GetFavorited() bool { - if x != nil { - return x.Favorited - } - return false -} - type CommentReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -2723,7 +2141,7 @@ type CommentReq struct { func (x *CommentReq) Reset() { *x = CommentReq{} - mi := &file_pb_radio_proto_msgTypes[41] + mi := &file_pb_radio_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2735,7 +2153,7 @@ func (x *CommentReq) String() string { func (*CommentReq) ProtoMessage() {} func (x *CommentReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[41] + mi := &file_pb_radio_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2748,7 +2166,7 @@ func (x *CommentReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentReq.ProtoReflect.Descriptor instead. func (*CommentReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{41} + return file_pb_radio_proto_rawDescGZIP(), []int{27} } func (x *CommentReq) GetUserId() string { @@ -2779,42 +2197,6 @@ func (x *CommentReq) GetParentId() string { return "" } -type CommentResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CommentResp) Reset() { - *x = CommentResp{} - mi := &file_pb_radio_proto_msgTypes[42] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CommentResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CommentResp) ProtoMessage() {} - -func (x *CommentResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[42] - 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 CommentResp.ProtoReflect.Descriptor instead. -func (*CommentResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{42} -} - type RecordHistoryReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -2826,7 +2208,7 @@ type RecordHistoryReq struct { func (x *RecordHistoryReq) Reset() { *x = RecordHistoryReq{} - mi := &file_pb_radio_proto_msgTypes[43] + mi := &file_pb_radio_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2838,7 +2220,7 @@ func (x *RecordHistoryReq) String() string { func (*RecordHistoryReq) ProtoMessage() {} func (x *RecordHistoryReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[43] + mi := &file_pb_radio_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2851,7 +2233,7 @@ func (x *RecordHistoryReq) ProtoReflect() protoreflect.Message { // Deprecated: Use RecordHistoryReq.ProtoReflect.Descriptor instead. func (*RecordHistoryReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{43} + return file_pb_radio_proto_rawDescGZIP(), []int{28} } func (x *RecordHistoryReq) GetUserId() string { @@ -2875,43 +2257,7 @@ func (x *RecordHistoryReq) GetDuration() int32 { return 0 } -type RecordHistoryResp struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RecordHistoryResp) Reset() { - *x = RecordHistoryResp{} - mi := &file_pb_radio_proto_msgTypes[44] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RecordHistoryResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RecordHistoryResp) ProtoMessage() {} - -func (x *RecordHistoryResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[44] - 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 RecordHistoryResp.ProtoReflect.Descriptor instead. -func (*RecordHistoryResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{44} -} - -type GetHistoryListReq struct { +type InteractionListReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` Current int32 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` @@ -2920,21 +2266,21 @@ type GetHistoryListReq struct { sizeCache protoimpl.SizeCache } -func (x *GetHistoryListReq) Reset() { - *x = GetHistoryListReq{} - mi := &file_pb_radio_proto_msgTypes[45] +func (x *InteractionListReq) Reset() { + *x = InteractionListReq{} + mi := &file_pb_radio_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetHistoryListReq) String() string { +func (x *InteractionListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHistoryListReq) ProtoMessage() {} +func (*InteractionListReq) ProtoMessage() {} -func (x *GetHistoryListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[45] +func (x *InteractionListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2945,33 +2291,33 @@ func (x *GetHistoryListReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHistoryListReq.ProtoReflect.Descriptor instead. -func (*GetHistoryListReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{45} +// Deprecated: Use InteractionListReq.ProtoReflect.Descriptor instead. +func (*InteractionListReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{29} } -func (x *GetHistoryListReq) GetUserId() string { +func (x *InteractionListReq) GetUserId() string { if x != nil { return x.UserId } return "" } -func (x *GetHistoryListReq) GetCurrent() int32 { +func (x *InteractionListReq) GetCurrent() int32 { if x != nil { return x.Current } return 0 } -func (x *GetHistoryListReq) GetPageSize() int32 { +func (x *InteractionListReq) GetPageSize() int32 { if x != nil { return x.PageSize } return 0 } -type GetHistoryListResp struct { +type FavoriteListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*ProgramInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -2979,21 +2325,21 @@ type GetHistoryListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetHistoryListResp) Reset() { - *x = GetHistoryListResp{} - mi := &file_pb_radio_proto_msgTypes[46] +func (x *FavoriteListResp) Reset() { + *x = FavoriteListResp{} + mi := &file_pb_radio_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetHistoryListResp) String() string { +func (x *FavoriteListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetHistoryListResp) ProtoMessage() {} +func (*FavoriteListResp) ProtoMessage() {} -func (x *GetHistoryListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[46] +func (x *FavoriteListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3004,86 +2350,26 @@ func (x *GetHistoryListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetHistoryListResp.ProtoReflect.Descriptor instead. -func (*GetHistoryListResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{46} +// Deprecated: Use FavoriteListResp.ProtoReflect.Descriptor instead. +func (*FavoriteListResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{30} } -func (x *GetHistoryListResp) GetList() []*ProgramInfo { +func (x *FavoriteListResp) GetList() []*ProgramInfo { if x != nil { return x.List } return nil } -func (x *GetHistoryListResp) GetTotal() int64 { +func (x *FavoriteListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -type GetFavoriteListReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` - Current int32 `protobuf:"varint,2,opt,name=current,proto3" json:"current,omitempty"` - PageSize int32 `protobuf:"varint,3,opt,name=pageSize,proto3" json:"pageSize,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetFavoriteListReq) Reset() { - *x = GetFavoriteListReq{} - mi := &file_pb_radio_proto_msgTypes[47] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetFavoriteListReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetFavoriteListReq) ProtoMessage() {} - -func (x *GetFavoriteListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[47] - 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 GetFavoriteListReq.ProtoReflect.Descriptor instead. -func (*GetFavoriteListReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{47} -} - -func (x *GetFavoriteListReq) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *GetFavoriteListReq) GetCurrent() int32 { - if x != nil { - return x.Current - } - return 0 -} - -func (x *GetFavoriteListReq) GetPageSize() int32 { - if x != nil { - return x.PageSize - } - return 0 -} - -type GetFavoriteListResp struct { +type HistoryListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*ProgramInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` @@ -3091,21 +2377,21 @@ type GetFavoriteListResp struct { sizeCache protoimpl.SizeCache } -func (x *GetFavoriteListResp) Reset() { - *x = GetFavoriteListResp{} - mi := &file_pb_radio_proto_msgTypes[48] +func (x *HistoryListResp) Reset() { + *x = HistoryListResp{} + mi := &file_pb_radio_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetFavoriteListResp) String() string { +func (x *HistoryListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetFavoriteListResp) ProtoMessage() {} +func (*HistoryListResp) ProtoMessage() {} -func (x *GetFavoriteListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[48] +func (x *HistoryListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[31] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3116,40 +2402,38 @@ func (x *GetFavoriteListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetFavoriteListResp.ProtoReflect.Descriptor instead. -func (*GetFavoriteListResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{48} +// Deprecated: Use HistoryListResp.ProtoReflect.Descriptor instead. +func (*HistoryListResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{31} } -func (x *GetFavoriteListResp) GetList() []*ProgramInfo { +func (x *HistoryListResp) GetList() []*ProgramInfo { if x != nil { return x.List } return nil } -func (x *GetFavoriteListResp) GetTotal() int64 { +func (x *HistoryListResp) GetTotal() int64 { if x != nil { return x.Total } return 0 } -// ========== 订阅/支付 ========== type SubscriptionInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"` - ChannelId string `protobuf:"bytes,3,opt,name=channelId,proto3" json:"channelId,omitempty"` - ExpiredAt int64 `protobuf:"varint,4,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` - Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + ChannelId string `protobuf:"bytes,2,opt,name=channelId,proto3" json:"channelId,omitempty"` + ExpiredAt int64 `protobuf:"varint,3,opt,name=expiredAt,proto3" json:"expiredAt,omitempty"` + Status int32 `protobuf:"varint,4,opt,name=status,proto3" json:"status,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *SubscriptionInfo) Reset() { *x = SubscriptionInfo{} - mi := &file_pb_radio_proto_msgTypes[49] + mi := &file_pb_radio_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3161,7 +2445,7 @@ func (x *SubscriptionInfo) String() string { func (*SubscriptionInfo) ProtoMessage() {} func (x *SubscriptionInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[49] + mi := &file_pb_radio_proto_msgTypes[32] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3174,7 +2458,7 @@ func (x *SubscriptionInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscriptionInfo.ProtoReflect.Descriptor instead. func (*SubscriptionInfo) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{49} + return file_pb_radio_proto_rawDescGZIP(), []int{32} } func (x *SubscriptionInfo) GetId() string { @@ -3184,13 +2468,6 @@ func (x *SubscriptionInfo) GetId() string { return "" } -func (x *SubscriptionInfo) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - func (x *SubscriptionInfo) GetChannelId() string { if x != nil { return x.ChannelId @@ -3212,28 +2489,28 @@ func (x *SubscriptionInfo) GetStatus() int32 { return 0 } -type GetMySubscriptionsReq struct { +type SubscriptionListReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetMySubscriptionsReq) Reset() { - *x = GetMySubscriptionsReq{} - mi := &file_pb_radio_proto_msgTypes[50] +func (x *SubscriptionListReq) Reset() { + *x = SubscriptionListReq{} + mi := &file_pb_radio_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetMySubscriptionsReq) String() string { +func (x *SubscriptionListReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMySubscriptionsReq) ProtoMessage() {} +func (*SubscriptionListReq) ProtoMessage() {} -func (x *GetMySubscriptionsReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[50] +func (x *SubscriptionListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[33] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3244,40 +2521,40 @@ func (x *GetMySubscriptionsReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMySubscriptionsReq.ProtoReflect.Descriptor instead. -func (*GetMySubscriptionsReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{50} +// Deprecated: Use SubscriptionListReq.ProtoReflect.Descriptor instead. +func (*SubscriptionListReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{33} } -func (x *GetMySubscriptionsReq) GetUserId() string { +func (x *SubscriptionListReq) GetUserId() string { if x != nil { return x.UserId } return "" } -type GetMySubscriptionsResp struct { +type SubscriptionListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*SubscriptionInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetMySubscriptionsResp) Reset() { - *x = GetMySubscriptionsResp{} - mi := &file_pb_radio_proto_msgTypes[51] +func (x *SubscriptionListResp) Reset() { + *x = SubscriptionListResp{} + mi := &file_pb_radio_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetMySubscriptionsResp) String() string { +func (x *SubscriptionListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMySubscriptionsResp) ProtoMessage() {} +func (*SubscriptionListResp) ProtoMessage() {} -func (x *GetMySubscriptionsResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[51] +func (x *SubscriptionListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[34] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3288,12 +2565,12 @@ func (x *GetMySubscriptionsResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMySubscriptionsResp.ProtoReflect.Descriptor instead. -func (*GetMySubscriptionsResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{51} +// Deprecated: Use SubscriptionListResp.ProtoReflect.Descriptor instead. +func (*SubscriptionListResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{34} } -func (x *GetMySubscriptionsResp) GetList() []*SubscriptionInfo { +func (x *SubscriptionListResp) GetList() []*SubscriptionInfo { if x != nil { return x.List } @@ -3311,7 +2588,7 @@ type CreatePayOrderReq struct { func (x *CreatePayOrderReq) Reset() { *x = CreatePayOrderReq{} - mi := &file_pb_radio_proto_msgTypes[52] + mi := &file_pb_radio_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3323,7 +2600,7 @@ func (x *CreatePayOrderReq) String() string { func (*CreatePayOrderReq) ProtoMessage() {} func (x *CreatePayOrderReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[52] + mi := &file_pb_radio_proto_msgTypes[35] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3336,7 +2613,7 @@ func (x *CreatePayOrderReq) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePayOrderReq.ProtoReflect.Descriptor instead. func (*CreatePayOrderReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{52} + return file_pb_radio_proto_rawDescGZIP(), []int{35} } func (x *CreatePayOrderReq) GetUserId() string { @@ -3370,7 +2647,7 @@ type CreatePayOrderResp struct { func (x *CreatePayOrderResp) Reset() { *x = CreatePayOrderResp{} - mi := &file_pb_radio_proto_msgTypes[53] + mi := &file_pb_radio_proto_msgTypes[36] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3382,7 +2659,7 @@ func (x *CreatePayOrderResp) String() string { func (*CreatePayOrderResp) ProtoMessage() {} func (x *CreatePayOrderResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[53] + mi := &file_pb_radio_proto_msgTypes[36] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3395,7 +2672,7 @@ func (x *CreatePayOrderResp) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePayOrderResp.ProtoReflect.Descriptor instead. func (*CreatePayOrderResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{53} + return file_pb_radio_proto_rawDescGZIP(), []int{36} } func (x *CreatePayOrderResp) GetOrderNo() string { @@ -3412,7 +2689,6 @@ func (x *CreatePayOrderResp) GetPrepayId() string { return "" } -// ========== VIP ========== type VipConfigInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -3428,7 +2704,7 @@ type VipConfigInfo struct { func (x *VipConfigInfo) Reset() { *x = VipConfigInfo{} - mi := &file_pb_radio_proto_msgTypes[54] + mi := &file_pb_radio_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3440,7 +2716,7 @@ func (x *VipConfigInfo) String() string { func (*VipConfigInfo) ProtoMessage() {} func (x *VipConfigInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[54] + mi := &file_pb_radio_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3453,7 +2729,7 @@ func (x *VipConfigInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use VipConfigInfo.ProtoReflect.Descriptor instead. func (*VipConfigInfo) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{54} + return file_pb_radio_proto_rawDescGZIP(), []int{37} } func (x *VipConfigInfo) GetId() string { @@ -3505,81 +2781,28 @@ func (x *VipConfigInfo) GetDesc() string { return "" } -type GetVipConfigListReq struct { - state protoimpl.MessageState `protogen:"open.v1"` - Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` - PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetVipConfigListReq) Reset() { - *x = GetVipConfigListReq{} - mi := &file_pb_radio_proto_msgTypes[55] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetVipConfigListReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetVipConfigListReq) ProtoMessage() {} - -func (x *GetVipConfigListReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[55] - 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 GetVipConfigListReq.ProtoReflect.Descriptor instead. -func (*GetVipConfigListReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{55} -} - -func (x *GetVipConfigListReq) GetCurrent() int32 { - if x != nil { - return x.Current - } - return 0 -} - -func (x *GetVipConfigListReq) GetPageSize() int32 { - if x != nil { - return x.PageSize - } - return 0 -} - -type GetVipConfigListResp struct { +type VipConfigListResp struct { state protoimpl.MessageState `protogen:"open.v1"` List []*VipConfigInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` - Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetVipConfigListResp) Reset() { - *x = GetVipConfigListResp{} - mi := &file_pb_radio_proto_msgTypes[56] +func (x *VipConfigListResp) Reset() { + *x = VipConfigListResp{} + mi := &file_pb_radio_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetVipConfigListResp) String() string { +func (x *VipConfigListResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetVipConfigListResp) ProtoMessage() {} +func (*VipConfigListResp) ProtoMessage() {} -func (x *GetVipConfigListResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[56] +func (x *VipConfigListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3590,47 +2813,41 @@ func (x *GetVipConfigListResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetVipConfigListResp.ProtoReflect.Descriptor instead. -func (*GetVipConfigListResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{56} +// Deprecated: Use VipConfigListResp.ProtoReflect.Descriptor instead. +func (*VipConfigListResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{38} } -func (x *GetVipConfigListResp) GetList() []*VipConfigInfo { +func (x *VipConfigListResp) GetList() []*VipConfigInfo { if x != nil { return x.List } return nil } -func (x *GetVipConfigListResp) GetTotal() int64 { - if x != nil { - return x.Total - } - return 0 -} - -type GetMyVipInfoReq struct { +type AnalyticsReq struct { state protoimpl.MessageState `protogen:"open.v1"` - UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` + StartDate string `protobuf:"bytes,1,opt,name=startDate,proto3" json:"startDate,omitempty"` + EndDate string `protobuf:"bytes,2,opt,name=endDate,proto3" json:"endDate,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetMyVipInfoReq) Reset() { - *x = GetMyVipInfoReq{} - mi := &file_pb_radio_proto_msgTypes[57] +func (x *AnalyticsReq) Reset() { + *x = AnalyticsReq{} + mi := &file_pb_radio_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetMyVipInfoReq) String() string { +func (x *AnalyticsReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMyVipInfoReq) ProtoMessage() {} +func (*AnalyticsReq) ProtoMessage() {} -func (x *GetMyVipInfoReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[57] +func (x *AnalyticsReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3641,40 +2858,50 @@ func (x *GetMyVipInfoReq) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMyVipInfoReq.ProtoReflect.Descriptor instead. -func (*GetMyVipInfoReq) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{57} +// Deprecated: Use AnalyticsReq.ProtoReflect.Descriptor instead. +func (*AnalyticsReq) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{39} } -func (x *GetMyVipInfoReq) GetUserId() string { +func (x *AnalyticsReq) GetStartDate() string { if x != nil { - return x.UserId + return x.StartDate } return "" } -type GetMyVipInfoResp struct { +func (x *AnalyticsReq) GetEndDate() string { + if x != nil { + return x.EndDate + } + return "" +} + +type AnalyticsOverviewResp struct { state protoimpl.MessageState `protogen:"open.v1"` - Profile *RadioUserProfile `protobuf:"bytes,1,opt,name=profile,proto3" json:"profile,omitempty"` + TotalUsers int64 `protobuf:"varint,1,opt,name=totalUsers,proto3" json:"totalUsers,omitempty"` + TotalPlays int64 `protobuf:"varint,2,opt,name=totalPlays,proto3" json:"totalPlays,omitempty"` + TotalChannels int64 `protobuf:"varint,3,opt,name=totalChannels,proto3" json:"totalChannels,omitempty"` + TotalPrograms int64 `protobuf:"varint,4,opt,name=totalPrograms,proto3" json:"totalPrograms,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } -func (x *GetMyVipInfoResp) Reset() { - *x = GetMyVipInfoResp{} - mi := &file_pb_radio_proto_msgTypes[58] +func (x *AnalyticsOverviewResp) Reset() { + *x = AnalyticsOverviewResp{} + mi := &file_pb_radio_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *GetMyVipInfoResp) String() string { +func (x *AnalyticsOverviewResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*GetMyVipInfoResp) ProtoMessage() {} +func (*AnalyticsOverviewResp) ProtoMessage() {} -func (x *GetMyVipInfoResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[58] +func (x *AnalyticsOverviewResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3685,40 +2912,109 @@ func (x *GetMyVipInfoResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use GetMyVipInfoResp.ProtoReflect.Descriptor instead. -func (*GetMyVipInfoResp) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{58} +// Deprecated: Use AnalyticsOverviewResp.ProtoReflect.Descriptor instead. +func (*AnalyticsOverviewResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{40} } -func (x *GetMyVipInfoResp) GetProfile() *RadioUserProfile { +func (x *AnalyticsOverviewResp) GetTotalUsers() int64 { if x != nil { - return x.Profile + return x.TotalUsers + } + return 0 +} + +func (x *AnalyticsOverviewResp) GetTotalPlays() int64 { + if x != nil { + return x.TotalPlays + } + return 0 +} + +func (x *AnalyticsOverviewResp) GetTotalChannels() int64 { + if x != nil { + return x.TotalChannels + } + return 0 +} + +func (x *AnalyticsOverviewResp) GetTotalPrograms() int64 { + if x != nil { + return x.TotalPrograms + } + return 0 +} + +type ChannelAnalyticsResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ChannelAnalyticsItem `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ChannelAnalyticsResp) Reset() { + *x = ChannelAnalyticsResp{} + mi := &file_pb_radio_proto_msgTypes[41] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ChannelAnalyticsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ChannelAnalyticsResp) ProtoMessage() {} + +func (x *ChannelAnalyticsResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[41] + 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 ChannelAnalyticsResp.ProtoReflect.Descriptor instead. +func (*ChannelAnalyticsResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{41} +} + +func (x *ChannelAnalyticsResp) GetList() []*ChannelAnalyticsItem { + if x != nil { + return x.List } return nil } -// ========== 通用 ========== -type Empty struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache +type ChannelAnalyticsItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + ChannelId string `protobuf:"bytes,1,opt,name=channelId,proto3" json:"channelId,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + PlayCount int64 `protobuf:"varint,3,opt,name=playCount,proto3" json:"playCount,omitempty"` + LikeCount int64 `protobuf:"varint,4,opt,name=likeCount,proto3" json:"likeCount,omitempty"` + SubscriberCount int64 `protobuf:"varint,5,opt,name=subscriberCount,proto3" json:"subscriberCount,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } -func (x *Empty) Reset() { - *x = Empty{} - mi := &file_pb_radio_proto_msgTypes[59] +func (x *ChannelAnalyticsItem) Reset() { + *x = ChannelAnalyticsItem{} + mi := &file_pb_radio_proto_msgTypes[42] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } -func (x *Empty) String() string { +func (x *ChannelAnalyticsItem) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Empty) ProtoMessage() {} +func (*ChannelAnalyticsItem) ProtoMessage() {} -func (x *Empty) ProtoReflect() protoreflect.Message { - mi := &file_pb_radio_proto_msgTypes[59] +func (x *ChannelAnalyticsItem) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[42] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3729,16 +3025,119 @@ func (x *Empty) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Empty.ProtoReflect.Descriptor instead. -func (*Empty) Descriptor() ([]byte, []int) { - return file_pb_radio_proto_rawDescGZIP(), []int{59} +// Deprecated: Use ChannelAnalyticsItem.ProtoReflect.Descriptor instead. +func (*ChannelAnalyticsItem) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{42} +} + +func (x *ChannelAnalyticsItem) GetChannelId() string { + if x != nil { + return x.ChannelId + } + return "" +} + +func (x *ChannelAnalyticsItem) GetChannelName() string { + if x != nil { + return x.ChannelName + } + return "" +} + +func (x *ChannelAnalyticsItem) GetPlayCount() int64 { + if x != nil { + return x.PlayCount + } + return 0 +} + +func (x *ChannelAnalyticsItem) GetLikeCount() int64 { + if x != nil { + return x.LikeCount + } + return 0 +} + +func (x *ChannelAnalyticsItem) GetSubscriberCount() int64 { + if x != nil { + return x.SubscriberCount + } + return 0 +} + +type UserAnalyticsResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + NewUsers int64 `protobuf:"varint,1,opt,name=newUsers,proto3" json:"newUsers,omitempty"` + ActiveUsers int64 `protobuf:"varint,2,opt,name=activeUsers,proto3" json:"activeUsers,omitempty"` + VipUsers int64 `protobuf:"varint,3,opt,name=vipUsers,proto3" json:"vipUsers,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UserAnalyticsResp) Reset() { + *x = UserAnalyticsResp{} + mi := &file_pb_radio_proto_msgTypes[43] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UserAnalyticsResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserAnalyticsResp) ProtoMessage() {} + +func (x *UserAnalyticsResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_radio_proto_msgTypes[43] + 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 UserAnalyticsResp.ProtoReflect.Descriptor instead. +func (*UserAnalyticsResp) Descriptor() ([]byte, []int) { + return file_pb_radio_proto_rawDescGZIP(), []int{43} +} + +func (x *UserAnalyticsResp) GetNewUsers() int64 { + if x != nil { + return x.NewUsers + } + return 0 +} + +func (x *UserAnalyticsResp) GetActiveUsers() int64 { + if x != nil { + return x.ActiveUsers + } + return 0 +} + +func (x *UserAnalyticsResp) GetVipUsers() int64 { + if x != nil { + return x.VipUsers + } + return 0 } var File_pb_radio_proto protoreflect.FileDescriptor const file_pb_radio_proto_rawDesc = "" + "\n" + - "\x0epb/radio.proto\x12\x05radio\"\xc6\x01\n" + + "\x0epb/radio.proto\x12\x05radio\"2\n" + + "\n" + + "CommonResp\x12\x12\n" + + "\x04code\x18\x01 \x01(\x03R\x04code\x12\x10\n" + + "\x03msg\x18\x02 \x01(\tR\x03msg\"\x17\n" + + "\x05IdReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\x1a\n" + + "\x06IdsReq\x12\x10\n" + + "\x03ids\x18\x01 \x03(\tR\x03ids\"\xc6\x01\n" + "\x10RadioUserProfile\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x1a\n" + @@ -3746,38 +3145,29 @@ const file_pb_radio_proto_rawDesc = "" + "\bavatarId\x18\x04 \x01(\tR\bavatarId\x12\x14\n" + "\x05isVip\x18\x05 \x01(\x05R\x05isVip\x12 \n" + "\vvipExpireAt\x18\x06 \x01(\x03R\vvipExpireAt\x12\x1a\n" + - "\bvipLevel\x18\a \x01(\x05R\bvipLevel\"0\n" + - "\x16GetRadioUserProfileReq\x12\x16\n" + - "\x06userId\x18\x01 \x01(\tR\x06userId\"L\n" + - "\x17GetRadioUserProfileResp\x121\n" + - "\aprofile\x18\x01 \x01(\v2\x17.radio.RadioUserProfileR\aprofile\"Z\n" + + "\bvipLevel\x18\a \x01(\x05R\bvipLevel\"'\n" + + "\rGetProfileReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\"Z\n" + "\fCategoryInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + "\x04icon\x18\x03 \x01(\tR\x04icon\x12\x12\n" + - "\x04sort\x18\x04 \x01(\x05R\x04sort\"O\n" + - "\x11CreateCategoryReq\x12\x12\n" + + "\x04sort\x18\x04 \x01(\x05R\x04sort\"I\n" + + "\vCategoryReq\x12\x12\n" + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + "\x04icon\x18\x02 \x01(\tR\x04icon\x12\x12\n" + - "\x04sort\x18\x03 \x01(\x05R\x04sort\"$\n" + - "\x12CreateCategoryResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"_\n" + - "\x11UpdateCategoryReq\x12\x0e\n" + + "\x04sort\x18\x03 \x01(\x05R\x04sort\"_\n" + + "\x11CategoryUpdateReq\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + "\x04icon\x18\x03 \x01(\tR\x04icon\x12\x12\n" + - "\x04sort\x18\x04 \x01(\x05R\x04sort\"\x14\n" + - "\x12UpdateCategoryResp\"\"\n" + - "\x0eDeleteByIdsReq\x12\x10\n" + - "\x03ids\x18\x01 \x03(\tR\x03ids\"\f\n" + - "\n" + - "DeleteResp\"J\n" + - "\x12GetCategoryListReq\x12\x18\n" + - "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + - "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"T\n" + - "\x13GetCategoryListResp\x12'\n" + + "\x04sort\x18\x04 \x01(\x05R\x04sort\"Q\n" + + "\x10CategoryListResp\x12'\n" + "\x04list\x18\x01 \x03(\v2\x13.radio.CategoryInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"\x8b\x03\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"G\n" + + "\x0fCategoryListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"\xed\x02\n" + "\vChannelInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1e\n" + "\n" + @@ -3794,8 +3184,7 @@ const file_pb_radio_proto_rawDesc = "" + " \x01(\tR\x05cover\x12\x12\n" + "\x04tags\x18\v \x01(\tR\x04tags\x12\x12\n" + "\x04sort\x18\f \x01(\x05R\x04sort\x12\x16\n" + - "\x06status\x18\r \x01(\x05R\x06status\x12\x1c\n" + - "\tcreatedAt\x18\x0e \x01(\x03R\tcreatedAt\"\xca\x02\n" + + "\x06status\x18\r \x01(\x05R\x06status\"\xca\x02\n" + "\x10CreateChannelReq\x12\x1e\n" + "\n" + "categoryId\x18\x01 \x01(\tR\n" + @@ -3810,39 +3199,34 @@ const file_pb_radio_proto_rawDesc = "" + "\x05cover\x18\t \x01(\tR\x05cover\x12\x12\n" + "\x04tags\x18\n" + " \x01(\tR\x04tags\x12\x12\n" + - "\x04sort\x18\v \x01(\x05R\x04sort\"#\n" + - "\x11CreateChannelResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\xd2\x02\n" + + "\x04sort\x18\v \x01(\x05R\x04sort\"\xf2\x02\n" + "\x10UpdateChannelReq\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x16\n" + - "\x06isFree\x18\x04 \x01(\x05R\x06isFree\x12\x1c\n" + - "\tisVipOnly\x18\x05 \x01(\x05R\tisVipOnly\x12\"\n" + - "\fmonthlyPrice\x18\x06 \x01(\x05R\fmonthlyPrice\x12&\n" + - "\x0equarterlyPrice\x18\a \x01(\x05R\x0equarterlyPrice\x12 \n" + - "\vannualPrice\x18\b \x01(\x05R\vannualPrice\x12\x14\n" + - "\x05cover\x18\t \x01(\tR\x05cover\x12\x12\n" + - "\x04tags\x18\n" + - " \x01(\tR\x04tags\x12\x12\n" + - "\x04sort\x18\v \x01(\x05R\x04sort\x12\x16\n" + - "\x06status\x18\f \x01(\x05R\x06status\"\x13\n" + - "\x11UpdateChannelResp\"\x81\x01\n" + - "\x11GetChannelListReq\x12\x18\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1e\n" + + "\n" + + "categoryId\x18\x02 \x01(\tR\n" + + "categoryId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x04 \x01(\tR\vdescription\x12\x16\n" + + "\x06isFree\x18\x05 \x01(\x05R\x06isFree\x12\x1c\n" + + "\tisVipOnly\x18\x06 \x01(\x05R\tisVipOnly\x12\"\n" + + "\fmonthlyPrice\x18\a \x01(\x05R\fmonthlyPrice\x12&\n" + + "\x0equarterlyPrice\x18\b \x01(\x05R\x0equarterlyPrice\x12 \n" + + "\vannualPrice\x18\t \x01(\x05R\vannualPrice\x12\x14\n" + + "\x05cover\x18\n" + + " \x01(\tR\x05cover\x12\x12\n" + + "\x04tags\x18\v \x01(\tR\x04tags\x12\x12\n" + + "\x04sort\x18\f \x01(\x05R\x04sort\x12\x16\n" + + "\x06status\x18\r \x01(\x05R\x06status\"~\n" + + "\x0eChannelListReq\x12\x18\n" + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x1e\n" + "\n" + "categoryId\x18\x03 \x01(\tR\n" + "categoryId\x12\x16\n" + - "\x06userId\x18\x04 \x01(\tR\x06userId\"R\n" + - "\x12GetChannelListResp\x12&\n" + + "\x06userId\x18\x04 \x01(\tR\x06userId\"O\n" + + "\x0fChannelListResp\x12&\n" + "\x04list\x18\x01 \x03(\v2\x12.radio.ChannelInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"=\n" + - "\x13GetChannelDetailReq\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + - "\x06userId\x18\x02 \x01(\tR\x06userId\"D\n" + - "\x14GetChannelDetailResp\x12,\n" + - "\achannel\x18\x01 \x01(\v2\x12.radio.ChannelInfoR\achannel\"\x81\x03\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xe3\x02\n" + "\vProgramInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1c\n" + "\tchannelId\x18\x02 \x01(\tR\tchannelId\x12\x14\n" + @@ -3857,43 +3241,35 @@ const file_pb_radio_proto_rawDesc = "" + " \x01(\tR\x04tags\x12\x1c\n" + "\tplayCount\x18\v \x01(\x05R\tplayCount\x12\x1c\n" + "\tlikeCount\x18\f \x01(\x05R\tlikeCount\x12\x16\n" + - "\x06status\x18\r \x01(\x05R\x06status\x12\x1c\n" + - "\tcreatedAt\x18\x0e \x01(\x03R\tcreatedAt\"\xac\x01\n" + + "\x06status\x18\r \x01(\x05R\x06status\"\xac\x01\n" + "\x10CreateProgramReq\x12\x1c\n" + "\tchannelId\x18\x01 \x01(\tR\tchannelId\x12\x14\n" + "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x18\n" + "\acontent\x18\x04 \x01(\tR\acontent\x12\x14\n" + "\x05cover\x18\x05 \x01(\tR\x05cover\x12\x12\n" + - "\x04tags\x18\x06 \x01(\tR\x04tags\"#\n" + - "\x11CreateProgramResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\x8e\x02\n" + + "\x04tags\x18\x06 \x01(\tR\x04tags\"\xac\x02\n" + "\x10UpdateProgramReq\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x14\n" + - "\x05title\x18\x02 \x01(\tR\x05title\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x18\n" + - "\acontent\x18\x04 \x01(\tR\acontent\x12\x14\n" + - "\x05cover\x18\x05 \x01(\tR\x05cover\x12\x18\n" + - "\aaudioId\x18\x06 \x01(\tR\aaudioId\x12 \n" + - "\vaudioStatus\x18\a \x01(\x05R\vaudioStatus\x12\x1a\n" + - "\bduration\x18\b \x01(\x05R\bduration\x12\x12\n" + - "\x04tags\x18\t \x01(\tR\x04tags\x12\x16\n" + - "\x06status\x18\n" + - " \x01(\x05R\x06status\"\x13\n" + - "\x11UpdateProgramResp\"\x7f\n" + - "\x11GetProgramListReq\x12\x18\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1c\n" + + "\tchannelId\x18\x02 \x01(\tR\tchannelId\x12\x14\n" + + "\x05title\x18\x03 \x01(\tR\x05title\x12 \n" + + "\vdescription\x18\x04 \x01(\tR\vdescription\x12\x18\n" + + "\acontent\x18\x05 \x01(\tR\acontent\x12\x14\n" + + "\x05cover\x18\x06 \x01(\tR\x05cover\x12\x18\n" + + "\aaudioId\x18\a \x01(\tR\aaudioId\x12 \n" + + "\vaudioStatus\x18\b \x01(\x05R\vaudioStatus\x12\x1a\n" + + "\bduration\x18\t \x01(\x05R\bduration\x12\x12\n" + + "\x04tags\x18\n" + + " \x01(\tR\x04tags\x12\x16\n" + + "\x06status\x18\v \x01(\x05R\x06status\"|\n" + + "\x0eProgramListReq\x12\x18\n" + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x1c\n" + "\tchannelId\x18\x03 \x01(\tR\tchannelId\x12\x16\n" + - "\x06userId\x18\x04 \x01(\tR\x06userId\"R\n" + - "\x12GetProgramListResp\x12&\n" + + "\x06userId\x18\x04 \x01(\tR\x06userId\"O\n" + + "\x0fProgramListResp\x12&\n" + "\x04list\x18\x01 \x03(\v2\x12.radio.ProgramInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"=\n" + - "\x13GetProgramDetailReq\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + - "\x06userId\x18\x02 \x01(\tR\x06userId\"D\n" + - "\x14GetProgramDetailResp\x12,\n" + - "\aprogram\x18\x01 \x01(\v2\x12.radio.ProgramInfoR\aprogram\"\x9b\x02\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xff\x01\n" + "\tVoiceInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1c\n" + "\tspeakerId\x18\x02 \x01(\tR\tspeakerId\x12\x12\n" + @@ -3905,8 +3281,7 @@ const file_pb_radio_proto_rawDesc = "" + "\x04sort\x18\b \x01(\x05R\x04sort\x12\x16\n" + "\x06status\x18\t \x01(\x05R\x06status\x12\x1c\n" + "\tisDefault\x18\n" + - " \x01(\x05R\tisDefault\x12\x1a\n" + - "\buseCount\x18\v \x01(\x05R\buseCount\"\xdc\x01\n" + + " \x01(\x05R\tisDefault\"\xdc\x01\n" + "\x0eCreateVoiceReq\x12\x1c\n" + "\tspeakerId\x18\x01 \x01(\tR\tspeakerId\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + @@ -3915,70 +3290,59 @@ const file_pb_radio_proto_rawDesc = "" + "\x04icon\x18\x05 \x01(\tR\x04icon\x12\x18\n" + "\aaudioId\x18\x06 \x01(\tR\aaudioId\x12\x12\n" + "\x04sort\x18\a \x01(\x05R\x04sort\x12\x1c\n" + - "\tisDefault\x18\b \x01(\x05R\tisDefault\"!\n" + - "\x0fCreateVoiceResp\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\"\xce\x01\n" + + "\tisDefault\x18\b \x01(\x05R\tisDefault\"\x84\x02\n" + "\x0eUpdateVoiceReq\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12 \n" + - "\vdescription\x18\x03 \x01(\tR\vdescription\x12\x12\n" + - "\x04icon\x18\x04 \x01(\tR\x04icon\x12\x18\n" + - "\aaudioId\x18\x05 \x01(\tR\aaudioId\x12\x12\n" + - "\x04sort\x18\x06 \x01(\x05R\x04sort\x12\x16\n" + - "\x06status\x18\a \x01(\x05R\x06status\x12\x1c\n" + - "\tisDefault\x18\b \x01(\x05R\tisDefault\"\x11\n" + - "\x0fUpdateVoiceResp\"G\n" + - "\x0fGetVoiceListReq\x12\x18\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1c\n" + + "\tspeakerId\x18\x02 \x01(\tR\tspeakerId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x04 \x01(\tR\vdescription\x12\x16\n" + + "\x06gender\x18\x05 \x01(\tR\x06gender\x12\x12\n" + + "\x04icon\x18\x06 \x01(\tR\x04icon\x12\x18\n" + + "\aaudioId\x18\a \x01(\tR\aaudioId\x12\x12\n" + + "\x04sort\x18\b \x01(\x05R\x04sort\x12\x16\n" + + "\x06status\x18\t \x01(\x05R\x06status\x12\x1c\n" + + "\tisDefault\x18\n" + + " \x01(\x05R\tisDefault\"D\n" + + "\fVoiceListReq\x12\x18\n" + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + - "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"N\n" + - "\x10GetVoiceListResp\x12$\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"K\n" + + "\rVoiceListResp\x12$\n" + "\x04list\x18\x01 \x03(\v2\x10.radio.VoiceInfoR\x04list\x12\x14\n" + "\x05total\x18\x02 \x01(\x03R\x05total\"E\n" + "\rToggleLikeReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1c\n" + - "\tprogramId\x18\x02 \x01(\tR\tprogramId\"&\n" + - "\x0eToggleLikeResp\x12\x14\n" + - "\x05liked\x18\x01 \x01(\bR\x05liked\"I\n" + + "\tprogramId\x18\x02 \x01(\tR\tprogramId\"I\n" + "\x11ToggleFavoriteReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1c\n" + - "\tprogramId\x18\x02 \x01(\tR\tprogramId\"2\n" + - "\x12ToggleFavoriteResp\x12\x1c\n" + - "\tfavorited\x18\x01 \x01(\bR\tfavorited\"x\n" + + "\tprogramId\x18\x02 \x01(\tR\tprogramId\"x\n" + "\n" + "CommentReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1c\n" + "\tprogramId\x18\x02 \x01(\tR\tprogramId\x12\x18\n" + "\acontent\x18\x03 \x01(\tR\acontent\x12\x1a\n" + - "\bparentId\x18\x04 \x01(\tR\bparentId\"\r\n" + - "\vCommentResp\"d\n" + + "\bparentId\x18\x04 \x01(\tR\bparentId\"d\n" + "\x10RecordHistoryReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1c\n" + "\tprogramId\x18\x02 \x01(\tR\tprogramId\x12\x1a\n" + - "\bduration\x18\x03 \x01(\x05R\bduration\"\x13\n" + - "\x11RecordHistoryResp\"a\n" + - "\x11GetHistoryListReq\x12\x16\n" + + "\bduration\x18\x03 \x01(\x05R\bduration\"b\n" + + "\x12InteractionListReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + "\acurrent\x18\x02 \x01(\x05R\acurrent\x12\x1a\n" + - "\bpageSize\x18\x03 \x01(\x05R\bpageSize\"R\n" + - "\x12GetHistoryListResp\x12&\n" + + "\bpageSize\x18\x03 \x01(\x05R\bpageSize\"P\n" + + "\x10FavoriteListResp\x12&\n" + "\x04list\x18\x01 \x03(\v2\x12.radio.ProgramInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"b\n" + - "\x12GetFavoriteListReq\x12\x16\n" + - "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x18\n" + - "\acurrent\x18\x02 \x01(\x05R\acurrent\x12\x1a\n" + - "\bpageSize\x18\x03 \x01(\x05R\bpageSize\"S\n" + - "\x13GetFavoriteListResp\x12&\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"O\n" + + "\x0fHistoryListResp\x12&\n" + "\x04list\x18\x01 \x03(\v2\x12.radio.ProgramInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\"\x8e\x01\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"v\n" + "\x10SubscriptionInfo\x12\x0e\n" + - "\x02id\x18\x01 \x01(\tR\x02id\x12\x16\n" + - "\x06userId\x18\x02 \x01(\tR\x06userId\x12\x1c\n" + - "\tchannelId\x18\x03 \x01(\tR\tchannelId\x12\x1c\n" + - "\texpiredAt\x18\x04 \x01(\x03R\texpiredAt\x12\x16\n" + - "\x06status\x18\x05 \x01(\x05R\x06status\"/\n" + - "\x15GetMySubscriptionsReq\x12\x16\n" + - "\x06userId\x18\x01 \x01(\tR\x06userId\"E\n" + - "\x16GetMySubscriptionsResp\x12+\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1c\n" + + "\tchannelId\x18\x02 \x01(\tR\tchannelId\x12\x1c\n" + + "\texpiredAt\x18\x03 \x01(\x03R\texpiredAt\x12\x16\n" + + "\x06status\x18\x04 \x01(\x05R\x06status\"-\n" + + "\x13SubscriptionListReq\x12\x16\n" + + "\x06userId\x18\x01 \x01(\tR\x06userId\"C\n" + + "\x14SubscriptionListResp\x12+\n" + "\x04list\x18\x01 \x03(\v2\x17.radio.SubscriptionInfoR\x04list\"e\n" + "\x11CreatePayOrderReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\x12\x1c\n" + @@ -3994,49 +3358,67 @@ const file_pb_radio_proto_rawDesc = "" + "\x05price\x18\x04 \x01(\x05R\x05price\x12$\n" + "\roriginalPrice\x18\x05 \x01(\x05R\roriginalPrice\x12\x1a\n" + "\bduration\x18\x06 \x01(\x05R\bduration\x12\x12\n" + - "\x04desc\x18\a \x01(\tR\x04desc\"K\n" + - "\x13GetVipConfigListReq\x12\x18\n" + - "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + - "\bpageSize\x18\x02 \x01(\x05R\bpageSize\"V\n" + - "\x14GetVipConfigListResp\x12(\n" + - "\x04list\x18\x01 \x03(\v2\x14.radio.VipConfigInfoR\x04list\x12\x14\n" + - "\x05total\x18\x02 \x01(\x03R\x05total\")\n" + - "\x0fGetMyVipInfoReq\x12\x16\n" + - "\x06userId\x18\x01 \x01(\tR\x06userId\"E\n" + - "\x10GetMyVipInfoResp\x121\n" + - "\aprofile\x18\x01 \x01(\v2\x17.radio.RadioUserProfileR\aprofile\"\a\n" + - "\x05Empty2\xd4\x0f\n" + - "\fRadioService\x12T\n" + - "\x13GetRadioUserProfile\x12\x1d.radio.GetRadioUserProfileReq\x1a\x1e.radio.GetRadioUserProfileResp\x12E\n" + - "\x0eCreateCategory\x12\x18.radio.CreateCategoryReq\x1a\x19.radio.CreateCategoryResp\x12E\n" + - "\x0eUpdateCategory\x12\x18.radio.UpdateCategoryReq\x1a\x19.radio.UpdateCategoryResp\x12:\n" + - "\x0eDeleteCategory\x12\x15.radio.DeleteByIdsReq\x1a\x11.radio.DeleteResp\x12H\n" + - "\x0fGetCategoryList\x12\x19.radio.GetCategoryListReq\x1a\x1a.radio.GetCategoryListResp\x12B\n" + - "\rCreateChannel\x12\x17.radio.CreateChannelReq\x1a\x18.radio.CreateChannelResp\x12B\n" + - "\rUpdateChannel\x12\x17.radio.UpdateChannelReq\x1a\x18.radio.UpdateChannelResp\x129\n" + - "\rDeleteChannel\x12\x15.radio.DeleteByIdsReq\x1a\x11.radio.DeleteResp\x12E\n" + - "\x0eGetChannelList\x12\x18.radio.GetChannelListReq\x1a\x19.radio.GetChannelListResp\x12K\n" + - "\x10GetChannelDetail\x12\x1a.radio.GetChannelDetailReq\x1a\x1b.radio.GetChannelDetailResp\x12B\n" + - "\rCreateProgram\x12\x17.radio.CreateProgramReq\x1a\x18.radio.CreateProgramResp\x12B\n" + - "\rUpdateProgram\x12\x17.radio.UpdateProgramReq\x1a\x18.radio.UpdateProgramResp\x129\n" + - "\rDeleteProgram\x12\x15.radio.DeleteByIdsReq\x1a\x11.radio.DeleteResp\x12E\n" + - "\x0eGetProgramList\x12\x18.radio.GetProgramListReq\x1a\x19.radio.GetProgramListResp\x12K\n" + - "\x10GetProgramDetail\x12\x1a.radio.GetProgramDetailReq\x1a\x1b.radio.GetProgramDetailResp\x12<\n" + - "\vCreateVoice\x12\x15.radio.CreateVoiceReq\x1a\x16.radio.CreateVoiceResp\x12<\n" + - "\vUpdateVoice\x12\x15.radio.UpdateVoiceReq\x1a\x16.radio.UpdateVoiceResp\x127\n" + - "\vDeleteVoice\x12\x15.radio.DeleteByIdsReq\x1a\x11.radio.DeleteResp\x12?\n" + - "\fGetVoiceList\x12\x16.radio.GetVoiceListReq\x1a\x17.radio.GetVoiceListResp\x129\n" + + "\x04desc\x18\a \x01(\tR\x04desc\"=\n" + + "\x11VipConfigListResp\x12(\n" + + "\x04list\x18\x01 \x03(\v2\x14.radio.VipConfigInfoR\x04list\"F\n" + + "\fAnalyticsReq\x12\x1c\n" + + "\tstartDate\x18\x01 \x01(\tR\tstartDate\x12\x18\n" + + "\aendDate\x18\x02 \x01(\tR\aendDate\"\xa3\x01\n" + + "\x15AnalyticsOverviewResp\x12\x1e\n" + "\n" + - "ToggleLike\x12\x14.radio.ToggleLikeReq\x1a\x15.radio.ToggleLikeResp\x12E\n" + - "\x0eToggleFavorite\x12\x18.radio.ToggleFavoriteReq\x1a\x19.radio.ToggleFavoriteResp\x127\n" + - "\x0eCommentProgram\x12\x11.radio.CommentReq\x1a\x12.radio.CommentResp\x12B\n" + - "\rRecordHistory\x12\x17.radio.RecordHistoryReq\x1a\x18.radio.RecordHistoryResp\x12E\n" + - "\x0eGetHistoryList\x12\x18.radio.GetHistoryListReq\x1a\x19.radio.GetHistoryListResp\x12H\n" + - "\x0fGetFavoriteList\x12\x19.radio.GetFavoriteListReq\x1a\x1a.radio.GetFavoriteListResp\x12Q\n" + - "\x12GetMySubscriptions\x12\x1c.radio.GetMySubscriptionsReq\x1a\x1d.radio.GetMySubscriptionsResp\x12E\n" + - "\x0eCreatePayOrder\x12\x18.radio.CreatePayOrderReq\x1a\x19.radio.CreatePayOrderResp\x12K\n" + - "\x10GetVipConfigList\x12\x1a.radio.GetVipConfigListReq\x1a\x1b.radio.GetVipConfigListResp\x12?\n" + - "\fGetMyVipInfo\x12\x16.radio.GetMyVipInfoReq\x1a\x17.radio.GetMyVipInfoRespB\tZ\a./radiob\x06proto3" + "totalUsers\x18\x01 \x01(\x03R\n" + + "totalUsers\x12\x1e\n" + + "\n" + + "totalPlays\x18\x02 \x01(\x03R\n" + + "totalPlays\x12$\n" + + "\rtotalChannels\x18\x03 \x01(\x03R\rtotalChannels\x12$\n" + + "\rtotalPrograms\x18\x04 \x01(\x03R\rtotalPrograms\"G\n" + + "\x14ChannelAnalyticsResp\x12/\n" + + "\x04list\x18\x01 \x03(\v2\x1b.radio.ChannelAnalyticsItemR\x04list\"\xbc\x01\n" + + "\x14ChannelAnalyticsItem\x12\x1c\n" + + "\tchannelId\x18\x01 \x01(\tR\tchannelId\x12 \n" + + "\vchannelName\x18\x02 \x01(\tR\vchannelName\x12\x1c\n" + + "\tplayCount\x18\x03 \x01(\x03R\tplayCount\x12\x1c\n" + + "\tlikeCount\x18\x04 \x01(\x03R\tlikeCount\x12(\n" + + "\x0fsubscriberCount\x18\x05 \x01(\x03R\x0fsubscriberCount\"m\n" + + "\x11UserAnalyticsResp\x12\x1a\n" + + "\bnewUsers\x18\x01 \x01(\x03R\bnewUsers\x12 \n" + + "\vactiveUsers\x18\x02 \x01(\x03R\vactiveUsers\x12\x1a\n" + + "\bvipUsers\x18\x03 \x01(\x03R\bvipUsers2\xc4\x0f\n" + + "\fRadioService\x12?\n" + + "\x0eGetUserProfile\x12\x14.radio.GetProfileReq\x1a\x17.radio.RadioUserProfile\x127\n" + + "\x0eCreateCategory\x12\x12.radio.CategoryReq\x1a\x11.radio.CommonResp\x12=\n" + + "\x0eUpdateCategory\x12\x18.radio.CategoryUpdateReq\x1a\x11.radio.CommonResp\x122\n" + + "\x0eDeleteCategory\x12\r.radio.IdsReq\x1a\x11.radio.CommonResp\x12B\n" + + "\x0fGetCategoryList\x12\x16.radio.CategoryListReq\x1a\x17.radio.CategoryListResp\x12;\n" + + "\rCreateChannel\x12\x17.radio.CreateChannelReq\x1a\x11.radio.CommonResp\x12;\n" + + "\rUpdateChannel\x12\x17.radio.UpdateChannelReq\x1a\x11.radio.CommonResp\x121\n" + + "\rDeleteChannel\x12\r.radio.IdsReq\x1a\x11.radio.CommonResp\x12?\n" + + "\x0eGetChannelList\x12\x15.radio.ChannelListReq\x1a\x16.radio.ChannelListResp\x124\n" + + "\x10GetChannelDetail\x12\f.radio.IdReq\x1a\x12.radio.ChannelInfo\x12;\n" + + "\rCreateProgram\x12\x17.radio.CreateProgramReq\x1a\x11.radio.CommonResp\x12;\n" + + "\rUpdateProgram\x12\x17.radio.UpdateProgramReq\x1a\x11.radio.CommonResp\x121\n" + + "\rDeleteProgram\x12\r.radio.IdsReq\x1a\x11.radio.CommonResp\x12?\n" + + "\x0eGetProgramList\x12\x15.radio.ProgramListReq\x1a\x16.radio.ProgramListResp\x124\n" + + "\x10GetProgramDetail\x12\f.radio.IdReq\x1a\x12.radio.ProgramInfo\x127\n" + + "\vCreateVoice\x12\x15.radio.CreateVoiceReq\x1a\x11.radio.CommonResp\x127\n" + + "\vUpdateVoice\x12\x15.radio.UpdateVoiceReq\x1a\x11.radio.CommonResp\x12/\n" + + "\vDeleteVoice\x12\r.radio.IdsReq\x1a\x11.radio.CommonResp\x129\n" + + "\fGetVoiceList\x12\x13.radio.VoiceListReq\x1a\x14.radio.VoiceListResp\x125\n" + + "\n" + + "ToggleLike\x12\x14.radio.ToggleLikeReq\x1a\x11.radio.CommonResp\x12=\n" + + "\x0eToggleFavorite\x12\x18.radio.ToggleFavoriteReq\x1a\x11.radio.CommonResp\x126\n" + + "\x0eCommentProgram\x12\x11.radio.CommentReq\x1a\x11.radio.CommonResp\x12;\n" + + "\rRecordHistory\x12\x17.radio.RecordHistoryReq\x1a\x11.radio.CommonResp\x12E\n" + + "\x0fGetFavoriteList\x12\x19.radio.InteractionListReq\x1a\x17.radio.FavoriteListResp\x12C\n" + + "\x0eGetHistoryList\x12\x19.radio.InteractionListReq\x1a\x16.radio.HistoryListResp\x12M\n" + + "\x12GetMySubscriptions\x12\x1a.radio.SubscriptionListReq\x1a\x1b.radio.SubscriptionListResp\x12E\n" + + "\x0eCreatePayOrder\x12\x18.radio.CreatePayOrderReq\x1a\x19.radio.CreatePayOrderResp\x12:\n" + + "\x10GetVipConfigList\x12\f.radio.IdReq\x1a\x18.radio.VipConfigListResp\x12=\n" + + "\fGetMyVipInfo\x12\x14.radio.GetProfileReq\x1a\x17.radio.RadioUserProfile\x12I\n" + + "\x14GetAnalyticsOverview\x12\x13.radio.AnalyticsReq\x1a\x1c.radio.AnalyticsOverviewResp\x12G\n" + + "\x13GetChannelAnalytics\x12\x13.radio.AnalyticsReq\x1a\x1b.radio.ChannelAnalyticsResp\x12A\n" + + "\x10GetUserAnalytics\x12\x13.radio.AnalyticsReq\x1a\x18.radio.UserAnalyticsRespB\tZ\a./radiob\x06proto3" var ( file_pb_radio_proto_rawDescOnce sync.Once @@ -4050,145 +3432,132 @@ func file_pb_radio_proto_rawDescGZIP() []byte { return file_pb_radio_proto_rawDescData } -var file_pb_radio_proto_msgTypes = make([]protoimpl.MessageInfo, 60) +var file_pb_radio_proto_msgTypes = make([]protoimpl.MessageInfo, 44) var file_pb_radio_proto_goTypes = []any{ - (*RadioUserProfile)(nil), // 0: radio.RadioUserProfile - (*GetRadioUserProfileReq)(nil), // 1: radio.GetRadioUserProfileReq - (*GetRadioUserProfileResp)(nil), // 2: radio.GetRadioUserProfileResp - (*CategoryInfo)(nil), // 3: radio.CategoryInfo - (*CreateCategoryReq)(nil), // 4: radio.CreateCategoryReq - (*CreateCategoryResp)(nil), // 5: radio.CreateCategoryResp - (*UpdateCategoryReq)(nil), // 6: radio.UpdateCategoryReq - (*UpdateCategoryResp)(nil), // 7: radio.UpdateCategoryResp - (*DeleteByIdsReq)(nil), // 8: radio.DeleteByIdsReq - (*DeleteResp)(nil), // 9: radio.DeleteResp - (*GetCategoryListReq)(nil), // 10: radio.GetCategoryListReq - (*GetCategoryListResp)(nil), // 11: radio.GetCategoryListResp - (*ChannelInfo)(nil), // 12: radio.ChannelInfo - (*CreateChannelReq)(nil), // 13: radio.CreateChannelReq - (*CreateChannelResp)(nil), // 14: radio.CreateChannelResp - (*UpdateChannelReq)(nil), // 15: radio.UpdateChannelReq - (*UpdateChannelResp)(nil), // 16: radio.UpdateChannelResp - (*GetChannelListReq)(nil), // 17: radio.GetChannelListReq - (*GetChannelListResp)(nil), // 18: radio.GetChannelListResp - (*GetChannelDetailReq)(nil), // 19: radio.GetChannelDetailReq - (*GetChannelDetailResp)(nil), // 20: radio.GetChannelDetailResp - (*ProgramInfo)(nil), // 21: radio.ProgramInfo - (*CreateProgramReq)(nil), // 22: radio.CreateProgramReq - (*CreateProgramResp)(nil), // 23: radio.CreateProgramResp - (*UpdateProgramReq)(nil), // 24: radio.UpdateProgramReq - (*UpdateProgramResp)(nil), // 25: radio.UpdateProgramResp - (*GetProgramListReq)(nil), // 26: radio.GetProgramListReq - (*GetProgramListResp)(nil), // 27: radio.GetProgramListResp - (*GetProgramDetailReq)(nil), // 28: radio.GetProgramDetailReq - (*GetProgramDetailResp)(nil), // 29: radio.GetProgramDetailResp - (*VoiceInfo)(nil), // 30: radio.VoiceInfo - (*CreateVoiceReq)(nil), // 31: radio.CreateVoiceReq - (*CreateVoiceResp)(nil), // 32: radio.CreateVoiceResp - (*UpdateVoiceReq)(nil), // 33: radio.UpdateVoiceReq - (*UpdateVoiceResp)(nil), // 34: radio.UpdateVoiceResp - (*GetVoiceListReq)(nil), // 35: radio.GetVoiceListReq - (*GetVoiceListResp)(nil), // 36: radio.GetVoiceListResp - (*ToggleLikeReq)(nil), // 37: radio.ToggleLikeReq - (*ToggleLikeResp)(nil), // 38: radio.ToggleLikeResp - (*ToggleFavoriteReq)(nil), // 39: radio.ToggleFavoriteReq - (*ToggleFavoriteResp)(nil), // 40: radio.ToggleFavoriteResp - (*CommentReq)(nil), // 41: radio.CommentReq - (*CommentResp)(nil), // 42: radio.CommentResp - (*RecordHistoryReq)(nil), // 43: radio.RecordHistoryReq - (*RecordHistoryResp)(nil), // 44: radio.RecordHistoryResp - (*GetHistoryListReq)(nil), // 45: radio.GetHistoryListReq - (*GetHistoryListResp)(nil), // 46: radio.GetHistoryListResp - (*GetFavoriteListReq)(nil), // 47: radio.GetFavoriteListReq - (*GetFavoriteListResp)(nil), // 48: radio.GetFavoriteListResp - (*SubscriptionInfo)(nil), // 49: radio.SubscriptionInfo - (*GetMySubscriptionsReq)(nil), // 50: radio.GetMySubscriptionsReq - (*GetMySubscriptionsResp)(nil), // 51: radio.GetMySubscriptionsResp - (*CreatePayOrderReq)(nil), // 52: radio.CreatePayOrderReq - (*CreatePayOrderResp)(nil), // 53: radio.CreatePayOrderResp - (*VipConfigInfo)(nil), // 54: radio.VipConfigInfo - (*GetVipConfigListReq)(nil), // 55: radio.GetVipConfigListReq - (*GetVipConfigListResp)(nil), // 56: radio.GetVipConfigListResp - (*GetMyVipInfoReq)(nil), // 57: radio.GetMyVipInfoReq - (*GetMyVipInfoResp)(nil), // 58: radio.GetMyVipInfoResp - (*Empty)(nil), // 59: radio.Empty + (*CommonResp)(nil), // 0: radio.CommonResp + (*IdReq)(nil), // 1: radio.IdReq + (*IdsReq)(nil), // 2: radio.IdsReq + (*RadioUserProfile)(nil), // 3: radio.RadioUserProfile + (*GetProfileReq)(nil), // 4: radio.GetProfileReq + (*CategoryInfo)(nil), // 5: radio.CategoryInfo + (*CategoryReq)(nil), // 6: radio.CategoryReq + (*CategoryUpdateReq)(nil), // 7: radio.CategoryUpdateReq + (*CategoryListResp)(nil), // 8: radio.CategoryListResp + (*CategoryListReq)(nil), // 9: radio.CategoryListReq + (*ChannelInfo)(nil), // 10: radio.ChannelInfo + (*CreateChannelReq)(nil), // 11: radio.CreateChannelReq + (*UpdateChannelReq)(nil), // 12: radio.UpdateChannelReq + (*ChannelListReq)(nil), // 13: radio.ChannelListReq + (*ChannelListResp)(nil), // 14: radio.ChannelListResp + (*ProgramInfo)(nil), // 15: radio.ProgramInfo + (*CreateProgramReq)(nil), // 16: radio.CreateProgramReq + (*UpdateProgramReq)(nil), // 17: radio.UpdateProgramReq + (*ProgramListReq)(nil), // 18: radio.ProgramListReq + (*ProgramListResp)(nil), // 19: radio.ProgramListResp + (*VoiceInfo)(nil), // 20: radio.VoiceInfo + (*CreateVoiceReq)(nil), // 21: radio.CreateVoiceReq + (*UpdateVoiceReq)(nil), // 22: radio.UpdateVoiceReq + (*VoiceListReq)(nil), // 23: radio.VoiceListReq + (*VoiceListResp)(nil), // 24: radio.VoiceListResp + (*ToggleLikeReq)(nil), // 25: radio.ToggleLikeReq + (*ToggleFavoriteReq)(nil), // 26: radio.ToggleFavoriteReq + (*CommentReq)(nil), // 27: radio.CommentReq + (*RecordHistoryReq)(nil), // 28: radio.RecordHistoryReq + (*InteractionListReq)(nil), // 29: radio.InteractionListReq + (*FavoriteListResp)(nil), // 30: radio.FavoriteListResp + (*HistoryListResp)(nil), // 31: radio.HistoryListResp + (*SubscriptionInfo)(nil), // 32: radio.SubscriptionInfo + (*SubscriptionListReq)(nil), // 33: radio.SubscriptionListReq + (*SubscriptionListResp)(nil), // 34: radio.SubscriptionListResp + (*CreatePayOrderReq)(nil), // 35: radio.CreatePayOrderReq + (*CreatePayOrderResp)(nil), // 36: radio.CreatePayOrderResp + (*VipConfigInfo)(nil), // 37: radio.VipConfigInfo + (*VipConfigListResp)(nil), // 38: radio.VipConfigListResp + (*AnalyticsReq)(nil), // 39: radio.AnalyticsReq + (*AnalyticsOverviewResp)(nil), // 40: radio.AnalyticsOverviewResp + (*ChannelAnalyticsResp)(nil), // 41: radio.ChannelAnalyticsResp + (*ChannelAnalyticsItem)(nil), // 42: radio.ChannelAnalyticsItem + (*UserAnalyticsResp)(nil), // 43: radio.UserAnalyticsResp } var file_pb_radio_proto_depIdxs = []int32{ - 0, // 0: radio.GetRadioUserProfileResp.profile:type_name -> radio.RadioUserProfile - 3, // 1: radio.GetCategoryListResp.list:type_name -> radio.CategoryInfo - 12, // 2: radio.GetChannelListResp.list:type_name -> radio.ChannelInfo - 12, // 3: radio.GetChannelDetailResp.channel:type_name -> radio.ChannelInfo - 21, // 4: radio.GetProgramListResp.list:type_name -> radio.ProgramInfo - 21, // 5: radio.GetProgramDetailResp.program:type_name -> radio.ProgramInfo - 30, // 6: radio.GetVoiceListResp.list:type_name -> radio.VoiceInfo - 21, // 7: radio.GetHistoryListResp.list:type_name -> radio.ProgramInfo - 21, // 8: radio.GetFavoriteListResp.list:type_name -> radio.ProgramInfo - 49, // 9: radio.GetMySubscriptionsResp.list:type_name -> radio.SubscriptionInfo - 54, // 10: radio.GetVipConfigListResp.list:type_name -> radio.VipConfigInfo - 0, // 11: radio.GetMyVipInfoResp.profile:type_name -> radio.RadioUserProfile - 1, // 12: radio.RadioService.GetRadioUserProfile:input_type -> radio.GetRadioUserProfileReq - 4, // 13: radio.RadioService.CreateCategory:input_type -> radio.CreateCategoryReq - 6, // 14: radio.RadioService.UpdateCategory:input_type -> radio.UpdateCategoryReq - 8, // 15: radio.RadioService.DeleteCategory:input_type -> radio.DeleteByIdsReq - 10, // 16: radio.RadioService.GetCategoryList:input_type -> radio.GetCategoryListReq - 13, // 17: radio.RadioService.CreateChannel:input_type -> radio.CreateChannelReq - 15, // 18: radio.RadioService.UpdateChannel:input_type -> radio.UpdateChannelReq - 8, // 19: radio.RadioService.DeleteChannel:input_type -> radio.DeleteByIdsReq - 17, // 20: radio.RadioService.GetChannelList:input_type -> radio.GetChannelListReq - 19, // 21: radio.RadioService.GetChannelDetail:input_type -> radio.GetChannelDetailReq - 22, // 22: radio.RadioService.CreateProgram:input_type -> radio.CreateProgramReq - 24, // 23: radio.RadioService.UpdateProgram:input_type -> radio.UpdateProgramReq - 8, // 24: radio.RadioService.DeleteProgram:input_type -> radio.DeleteByIdsReq - 26, // 25: radio.RadioService.GetProgramList:input_type -> radio.GetProgramListReq - 28, // 26: radio.RadioService.GetProgramDetail:input_type -> radio.GetProgramDetailReq - 31, // 27: radio.RadioService.CreateVoice:input_type -> radio.CreateVoiceReq - 33, // 28: radio.RadioService.UpdateVoice:input_type -> radio.UpdateVoiceReq - 8, // 29: radio.RadioService.DeleteVoice:input_type -> radio.DeleteByIdsReq - 35, // 30: radio.RadioService.GetVoiceList:input_type -> radio.GetVoiceListReq - 37, // 31: radio.RadioService.ToggleLike:input_type -> radio.ToggleLikeReq - 39, // 32: radio.RadioService.ToggleFavorite:input_type -> radio.ToggleFavoriteReq - 41, // 33: radio.RadioService.CommentProgram:input_type -> radio.CommentReq - 43, // 34: radio.RadioService.RecordHistory:input_type -> radio.RecordHistoryReq - 45, // 35: radio.RadioService.GetHistoryList:input_type -> radio.GetHistoryListReq - 47, // 36: radio.RadioService.GetFavoriteList:input_type -> radio.GetFavoriteListReq - 50, // 37: radio.RadioService.GetMySubscriptions:input_type -> radio.GetMySubscriptionsReq - 52, // 38: radio.RadioService.CreatePayOrder:input_type -> radio.CreatePayOrderReq - 55, // 39: radio.RadioService.GetVipConfigList:input_type -> radio.GetVipConfigListReq - 57, // 40: radio.RadioService.GetMyVipInfo:input_type -> radio.GetMyVipInfoReq - 2, // 41: radio.RadioService.GetRadioUserProfile:output_type -> radio.GetRadioUserProfileResp - 5, // 42: radio.RadioService.CreateCategory:output_type -> radio.CreateCategoryResp - 7, // 43: radio.RadioService.UpdateCategory:output_type -> radio.UpdateCategoryResp - 9, // 44: radio.RadioService.DeleteCategory:output_type -> radio.DeleteResp - 11, // 45: radio.RadioService.GetCategoryList:output_type -> radio.GetCategoryListResp - 14, // 46: radio.RadioService.CreateChannel:output_type -> radio.CreateChannelResp - 16, // 47: radio.RadioService.UpdateChannel:output_type -> radio.UpdateChannelResp - 9, // 48: radio.RadioService.DeleteChannel:output_type -> radio.DeleteResp - 18, // 49: radio.RadioService.GetChannelList:output_type -> radio.GetChannelListResp - 20, // 50: radio.RadioService.GetChannelDetail:output_type -> radio.GetChannelDetailResp - 23, // 51: radio.RadioService.CreateProgram:output_type -> radio.CreateProgramResp - 25, // 52: radio.RadioService.UpdateProgram:output_type -> radio.UpdateProgramResp - 9, // 53: radio.RadioService.DeleteProgram:output_type -> radio.DeleteResp - 27, // 54: radio.RadioService.GetProgramList:output_type -> radio.GetProgramListResp - 29, // 55: radio.RadioService.GetProgramDetail:output_type -> radio.GetProgramDetailResp - 32, // 56: radio.RadioService.CreateVoice:output_type -> radio.CreateVoiceResp - 34, // 57: radio.RadioService.UpdateVoice:output_type -> radio.UpdateVoiceResp - 9, // 58: radio.RadioService.DeleteVoice:output_type -> radio.DeleteResp - 36, // 59: radio.RadioService.GetVoiceList:output_type -> radio.GetVoiceListResp - 38, // 60: radio.RadioService.ToggleLike:output_type -> radio.ToggleLikeResp - 40, // 61: radio.RadioService.ToggleFavorite:output_type -> radio.ToggleFavoriteResp - 42, // 62: radio.RadioService.CommentProgram:output_type -> radio.CommentResp - 44, // 63: radio.RadioService.RecordHistory:output_type -> radio.RecordHistoryResp - 46, // 64: radio.RadioService.GetHistoryList:output_type -> radio.GetHistoryListResp - 48, // 65: radio.RadioService.GetFavoriteList:output_type -> radio.GetFavoriteListResp - 51, // 66: radio.RadioService.GetMySubscriptions:output_type -> radio.GetMySubscriptionsResp - 53, // 67: radio.RadioService.CreatePayOrder:output_type -> radio.CreatePayOrderResp - 56, // 68: radio.RadioService.GetVipConfigList:output_type -> radio.GetVipConfigListResp - 58, // 69: radio.RadioService.GetMyVipInfo:output_type -> radio.GetMyVipInfoResp - 41, // [41:70] is the sub-list for method output_type - 12, // [12:41] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name + 5, // 0: radio.CategoryListResp.list:type_name -> radio.CategoryInfo + 10, // 1: radio.ChannelListResp.list:type_name -> radio.ChannelInfo + 15, // 2: radio.ProgramListResp.list:type_name -> radio.ProgramInfo + 20, // 3: radio.VoiceListResp.list:type_name -> radio.VoiceInfo + 15, // 4: radio.FavoriteListResp.list:type_name -> radio.ProgramInfo + 15, // 5: radio.HistoryListResp.list:type_name -> radio.ProgramInfo + 32, // 6: radio.SubscriptionListResp.list:type_name -> radio.SubscriptionInfo + 37, // 7: radio.VipConfigListResp.list:type_name -> radio.VipConfigInfo + 42, // 8: radio.ChannelAnalyticsResp.list:type_name -> radio.ChannelAnalyticsItem + 4, // 9: radio.RadioService.GetUserProfile:input_type -> radio.GetProfileReq + 6, // 10: radio.RadioService.CreateCategory:input_type -> radio.CategoryReq + 7, // 11: radio.RadioService.UpdateCategory:input_type -> radio.CategoryUpdateReq + 2, // 12: radio.RadioService.DeleteCategory:input_type -> radio.IdsReq + 9, // 13: radio.RadioService.GetCategoryList:input_type -> radio.CategoryListReq + 11, // 14: radio.RadioService.CreateChannel:input_type -> radio.CreateChannelReq + 12, // 15: radio.RadioService.UpdateChannel:input_type -> radio.UpdateChannelReq + 2, // 16: radio.RadioService.DeleteChannel:input_type -> radio.IdsReq + 13, // 17: radio.RadioService.GetChannelList:input_type -> radio.ChannelListReq + 1, // 18: radio.RadioService.GetChannelDetail:input_type -> radio.IdReq + 16, // 19: radio.RadioService.CreateProgram:input_type -> radio.CreateProgramReq + 17, // 20: radio.RadioService.UpdateProgram:input_type -> radio.UpdateProgramReq + 2, // 21: radio.RadioService.DeleteProgram:input_type -> radio.IdsReq + 18, // 22: radio.RadioService.GetProgramList:input_type -> radio.ProgramListReq + 1, // 23: radio.RadioService.GetProgramDetail:input_type -> radio.IdReq + 21, // 24: radio.RadioService.CreateVoice:input_type -> radio.CreateVoiceReq + 22, // 25: radio.RadioService.UpdateVoice:input_type -> radio.UpdateVoiceReq + 2, // 26: radio.RadioService.DeleteVoice:input_type -> radio.IdsReq + 23, // 27: radio.RadioService.GetVoiceList:input_type -> radio.VoiceListReq + 25, // 28: radio.RadioService.ToggleLike:input_type -> radio.ToggleLikeReq + 26, // 29: radio.RadioService.ToggleFavorite:input_type -> radio.ToggleFavoriteReq + 27, // 30: radio.RadioService.CommentProgram:input_type -> radio.CommentReq + 28, // 31: radio.RadioService.RecordHistory:input_type -> radio.RecordHistoryReq + 29, // 32: radio.RadioService.GetFavoriteList:input_type -> radio.InteractionListReq + 29, // 33: radio.RadioService.GetHistoryList:input_type -> radio.InteractionListReq + 33, // 34: radio.RadioService.GetMySubscriptions:input_type -> radio.SubscriptionListReq + 35, // 35: radio.RadioService.CreatePayOrder:input_type -> radio.CreatePayOrderReq + 1, // 36: radio.RadioService.GetVipConfigList:input_type -> radio.IdReq + 4, // 37: radio.RadioService.GetMyVipInfo:input_type -> radio.GetProfileReq + 39, // 38: radio.RadioService.GetAnalyticsOverview:input_type -> radio.AnalyticsReq + 39, // 39: radio.RadioService.GetChannelAnalytics:input_type -> radio.AnalyticsReq + 39, // 40: radio.RadioService.GetUserAnalytics:input_type -> radio.AnalyticsReq + 3, // 41: radio.RadioService.GetUserProfile:output_type -> radio.RadioUserProfile + 0, // 42: radio.RadioService.CreateCategory:output_type -> radio.CommonResp + 0, // 43: radio.RadioService.UpdateCategory:output_type -> radio.CommonResp + 0, // 44: radio.RadioService.DeleteCategory:output_type -> radio.CommonResp + 8, // 45: radio.RadioService.GetCategoryList:output_type -> radio.CategoryListResp + 0, // 46: radio.RadioService.CreateChannel:output_type -> radio.CommonResp + 0, // 47: radio.RadioService.UpdateChannel:output_type -> radio.CommonResp + 0, // 48: radio.RadioService.DeleteChannel:output_type -> radio.CommonResp + 14, // 49: radio.RadioService.GetChannelList:output_type -> radio.ChannelListResp + 10, // 50: radio.RadioService.GetChannelDetail:output_type -> radio.ChannelInfo + 0, // 51: radio.RadioService.CreateProgram:output_type -> radio.CommonResp + 0, // 52: radio.RadioService.UpdateProgram:output_type -> radio.CommonResp + 0, // 53: radio.RadioService.DeleteProgram:output_type -> radio.CommonResp + 19, // 54: radio.RadioService.GetProgramList:output_type -> radio.ProgramListResp + 15, // 55: radio.RadioService.GetProgramDetail:output_type -> radio.ProgramInfo + 0, // 56: radio.RadioService.CreateVoice:output_type -> radio.CommonResp + 0, // 57: radio.RadioService.UpdateVoice:output_type -> radio.CommonResp + 0, // 58: radio.RadioService.DeleteVoice:output_type -> radio.CommonResp + 24, // 59: radio.RadioService.GetVoiceList:output_type -> radio.VoiceListResp + 0, // 60: radio.RadioService.ToggleLike:output_type -> radio.CommonResp + 0, // 61: radio.RadioService.ToggleFavorite:output_type -> radio.CommonResp + 0, // 62: radio.RadioService.CommentProgram:output_type -> radio.CommonResp + 0, // 63: radio.RadioService.RecordHistory:output_type -> radio.CommonResp + 30, // 64: radio.RadioService.GetFavoriteList:output_type -> radio.FavoriteListResp + 31, // 65: radio.RadioService.GetHistoryList:output_type -> radio.HistoryListResp + 34, // 66: radio.RadioService.GetMySubscriptions:output_type -> radio.SubscriptionListResp + 36, // 67: radio.RadioService.CreatePayOrder:output_type -> radio.CreatePayOrderResp + 38, // 68: radio.RadioService.GetVipConfigList:output_type -> radio.VipConfigListResp + 3, // 69: radio.RadioService.GetMyVipInfo:output_type -> radio.RadioUserProfile + 40, // 70: radio.RadioService.GetAnalyticsOverview:output_type -> radio.AnalyticsOverviewResp + 41, // 71: radio.RadioService.GetChannelAnalytics:output_type -> radio.ChannelAnalyticsResp + 43, // 72: radio.RadioService.GetUserAnalytics:output_type -> radio.UserAnalyticsResp + 41, // [41:73] is the sub-list for method output_type + 9, // [9:41] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_pb_radio_proto_init() } @@ -4202,7 +3571,7 @@ func file_pb_radio_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_radio_proto_rawDesc), len(file_pb_radio_proto_rawDesc)), NumEnums: 0, - NumMessages: 60, + NumMessages: 44, NumExtensions: 0, NumServices: 1, }, diff --git a/app/radio/rpc/radio/radio_grpc.pb.go b/app/radio/rpc/radio/radio_grpc.pb.go index 61c9f36..226ff61 100644 --- a/app/radio/rpc/radio/radio_grpc.pb.go +++ b/app/radio/rpc/radio/radio_grpc.pb.go @@ -19,80 +19,84 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - RadioService_GetRadioUserProfile_FullMethodName = "/radio.RadioService/GetRadioUserProfile" - RadioService_CreateCategory_FullMethodName = "/radio.RadioService/CreateCategory" - RadioService_UpdateCategory_FullMethodName = "/radio.RadioService/UpdateCategory" - RadioService_DeleteCategory_FullMethodName = "/radio.RadioService/DeleteCategory" - RadioService_GetCategoryList_FullMethodName = "/radio.RadioService/GetCategoryList" - RadioService_CreateChannel_FullMethodName = "/radio.RadioService/CreateChannel" - RadioService_UpdateChannel_FullMethodName = "/radio.RadioService/UpdateChannel" - RadioService_DeleteChannel_FullMethodName = "/radio.RadioService/DeleteChannel" - RadioService_GetChannelList_FullMethodName = "/radio.RadioService/GetChannelList" - RadioService_GetChannelDetail_FullMethodName = "/radio.RadioService/GetChannelDetail" - RadioService_CreateProgram_FullMethodName = "/radio.RadioService/CreateProgram" - RadioService_UpdateProgram_FullMethodName = "/radio.RadioService/UpdateProgram" - RadioService_DeleteProgram_FullMethodName = "/radio.RadioService/DeleteProgram" - RadioService_GetProgramList_FullMethodName = "/radio.RadioService/GetProgramList" - RadioService_GetProgramDetail_FullMethodName = "/radio.RadioService/GetProgramDetail" - RadioService_CreateVoice_FullMethodName = "/radio.RadioService/CreateVoice" - RadioService_UpdateVoice_FullMethodName = "/radio.RadioService/UpdateVoice" - RadioService_DeleteVoice_FullMethodName = "/radio.RadioService/DeleteVoice" - RadioService_GetVoiceList_FullMethodName = "/radio.RadioService/GetVoiceList" - RadioService_ToggleLike_FullMethodName = "/radio.RadioService/ToggleLike" - RadioService_ToggleFavorite_FullMethodName = "/radio.RadioService/ToggleFavorite" - RadioService_CommentProgram_FullMethodName = "/radio.RadioService/CommentProgram" - RadioService_RecordHistory_FullMethodName = "/radio.RadioService/RecordHistory" - RadioService_GetHistoryList_FullMethodName = "/radio.RadioService/GetHistoryList" - RadioService_GetFavoriteList_FullMethodName = "/radio.RadioService/GetFavoriteList" - RadioService_GetMySubscriptions_FullMethodName = "/radio.RadioService/GetMySubscriptions" - RadioService_CreatePayOrder_FullMethodName = "/radio.RadioService/CreatePayOrder" - RadioService_GetVipConfigList_FullMethodName = "/radio.RadioService/GetVipConfigList" - RadioService_GetMyVipInfo_FullMethodName = "/radio.RadioService/GetMyVipInfo" + RadioService_GetUserProfile_FullMethodName = "/radio.RadioService/GetUserProfile" + RadioService_CreateCategory_FullMethodName = "/radio.RadioService/CreateCategory" + RadioService_UpdateCategory_FullMethodName = "/radio.RadioService/UpdateCategory" + RadioService_DeleteCategory_FullMethodName = "/radio.RadioService/DeleteCategory" + RadioService_GetCategoryList_FullMethodName = "/radio.RadioService/GetCategoryList" + RadioService_CreateChannel_FullMethodName = "/radio.RadioService/CreateChannel" + RadioService_UpdateChannel_FullMethodName = "/radio.RadioService/UpdateChannel" + RadioService_DeleteChannel_FullMethodName = "/radio.RadioService/DeleteChannel" + RadioService_GetChannelList_FullMethodName = "/radio.RadioService/GetChannelList" + RadioService_GetChannelDetail_FullMethodName = "/radio.RadioService/GetChannelDetail" + RadioService_CreateProgram_FullMethodName = "/radio.RadioService/CreateProgram" + RadioService_UpdateProgram_FullMethodName = "/radio.RadioService/UpdateProgram" + RadioService_DeleteProgram_FullMethodName = "/radio.RadioService/DeleteProgram" + RadioService_GetProgramList_FullMethodName = "/radio.RadioService/GetProgramList" + RadioService_GetProgramDetail_FullMethodName = "/radio.RadioService/GetProgramDetail" + RadioService_CreateVoice_FullMethodName = "/radio.RadioService/CreateVoice" + RadioService_UpdateVoice_FullMethodName = "/radio.RadioService/UpdateVoice" + RadioService_DeleteVoice_FullMethodName = "/radio.RadioService/DeleteVoice" + RadioService_GetVoiceList_FullMethodName = "/radio.RadioService/GetVoiceList" + RadioService_ToggleLike_FullMethodName = "/radio.RadioService/ToggleLike" + RadioService_ToggleFavorite_FullMethodName = "/radio.RadioService/ToggleFavorite" + RadioService_CommentProgram_FullMethodName = "/radio.RadioService/CommentProgram" + RadioService_RecordHistory_FullMethodName = "/radio.RadioService/RecordHistory" + RadioService_GetFavoriteList_FullMethodName = "/radio.RadioService/GetFavoriteList" + RadioService_GetHistoryList_FullMethodName = "/radio.RadioService/GetHistoryList" + RadioService_GetMySubscriptions_FullMethodName = "/radio.RadioService/GetMySubscriptions" + RadioService_CreatePayOrder_FullMethodName = "/radio.RadioService/CreatePayOrder" + RadioService_GetVipConfigList_FullMethodName = "/radio.RadioService/GetVipConfigList" + RadioService_GetMyVipInfo_FullMethodName = "/radio.RadioService/GetMyVipInfo" + RadioService_GetAnalyticsOverview_FullMethodName = "/radio.RadioService/GetAnalyticsOverview" + RadioService_GetChannelAnalytics_FullMethodName = "/radio.RadioService/GetChannelAnalytics" + RadioService_GetUserAnalytics_FullMethodName = "/radio.RadioService/GetUserAnalytics" ) // RadioServiceClient is the client API for RadioService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -// -// ========== 服务定义 ========== type RadioServiceClient interface { - // 用户 - GetRadioUserProfile(ctx context.Context, in *GetRadioUserProfileReq, opts ...grpc.CallOption) (*GetRadioUserProfileResp, error) + // 用户Profile + GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*RadioUserProfile, error) // 分类 - CreateCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*CreateCategoryResp, error) - UpdateCategory(ctx context.Context, in *UpdateCategoryReq, opts ...grpc.CallOption) (*UpdateCategoryResp, error) - DeleteCategory(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) - GetCategoryList(ctx context.Context, in *GetCategoryListReq, opts ...grpc.CallOption) (*GetCategoryListResp, error) + CreateCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateCategory(ctx context.Context, in *CategoryUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteCategory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetCategoryList(ctx context.Context, in *CategoryListReq, opts ...grpc.CallOption) (*CategoryListResp, error) // 频道 - CreateChannel(ctx context.Context, in *CreateChannelReq, opts ...grpc.CallOption) (*CreateChannelResp, error) - UpdateChannel(ctx context.Context, in *UpdateChannelReq, opts ...grpc.CallOption) (*UpdateChannelResp, error) - DeleteChannel(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) - GetChannelList(ctx context.Context, in *GetChannelListReq, opts ...grpc.CallOption) (*GetChannelListResp, error) - GetChannelDetail(ctx context.Context, in *GetChannelDetailReq, opts ...grpc.CallOption) (*GetChannelDetailResp, error) + CreateChannel(ctx context.Context, in *CreateChannelReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateChannel(ctx context.Context, in *UpdateChannelReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteChannel(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetChannelList(ctx context.Context, in *ChannelListReq, opts ...grpc.CallOption) (*ChannelListResp, error) + GetChannelDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ChannelInfo, error) // 节目 - CreateProgram(ctx context.Context, in *CreateProgramReq, opts ...grpc.CallOption) (*CreateProgramResp, error) - UpdateProgram(ctx context.Context, in *UpdateProgramReq, opts ...grpc.CallOption) (*UpdateProgramResp, error) - DeleteProgram(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) - GetProgramList(ctx context.Context, in *GetProgramListReq, opts ...grpc.CallOption) (*GetProgramListResp, error) - GetProgramDetail(ctx context.Context, in *GetProgramDetailReq, opts ...grpc.CallOption) (*GetProgramDetailResp, error) + CreateProgram(ctx context.Context, in *CreateProgramReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateProgram(ctx context.Context, in *UpdateProgramReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteProgram(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetProgramList(ctx context.Context, in *ProgramListReq, opts ...grpc.CallOption) (*ProgramListResp, error) + GetProgramDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ProgramInfo, error) // 音色 - CreateVoice(ctx context.Context, in *CreateVoiceReq, opts ...grpc.CallOption) (*CreateVoiceResp, error) - UpdateVoice(ctx context.Context, in *UpdateVoiceReq, opts ...grpc.CallOption) (*UpdateVoiceResp, error) - DeleteVoice(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) - GetVoiceList(ctx context.Context, in *GetVoiceListReq, opts ...grpc.CallOption) (*GetVoiceListResp, error) + CreateVoice(ctx context.Context, in *CreateVoiceReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateVoice(ctx context.Context, in *UpdateVoiceReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteVoice(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetVoiceList(ctx context.Context, in *VoiceListReq, opts ...grpc.CallOption) (*VoiceListResp, error) // 互动 - ToggleLike(ctx context.Context, in *ToggleLikeReq, opts ...grpc.CallOption) (*ToggleLikeResp, error) - ToggleFavorite(ctx context.Context, in *ToggleFavoriteReq, opts ...grpc.CallOption) (*ToggleFavoriteResp, error) - CommentProgram(ctx context.Context, in *CommentReq, opts ...grpc.CallOption) (*CommentResp, error) - RecordHistory(ctx context.Context, in *RecordHistoryReq, opts ...grpc.CallOption) (*RecordHistoryResp, error) - GetHistoryList(ctx context.Context, in *GetHistoryListReq, opts ...grpc.CallOption) (*GetHistoryListResp, error) - GetFavoriteList(ctx context.Context, in *GetFavoriteListReq, opts ...grpc.CallOption) (*GetFavoriteListResp, error) - // 订阅 - GetMySubscriptions(ctx context.Context, in *GetMySubscriptionsReq, opts ...grpc.CallOption) (*GetMySubscriptionsResp, error) + ToggleLike(ctx context.Context, in *ToggleLikeReq, opts ...grpc.CallOption) (*CommonResp, error) + ToggleFavorite(ctx context.Context, in *ToggleFavoriteReq, opts ...grpc.CallOption) (*CommonResp, error) + CommentProgram(ctx context.Context, in *CommentReq, opts ...grpc.CallOption) (*CommonResp, error) + RecordHistory(ctx context.Context, in *RecordHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) + GetFavoriteList(ctx context.Context, in *InteractionListReq, opts ...grpc.CallOption) (*FavoriteListResp, error) + GetHistoryList(ctx context.Context, in *InteractionListReq, opts ...grpc.CallOption) (*HistoryListResp, error) + // 订阅/VIP + GetMySubscriptions(ctx context.Context, in *SubscriptionListReq, opts ...grpc.CallOption) (*SubscriptionListResp, error) CreatePayOrder(ctx context.Context, in *CreatePayOrderReq, opts ...grpc.CallOption) (*CreatePayOrderResp, error) - // VIP - GetVipConfigList(ctx context.Context, in *GetVipConfigListReq, opts ...grpc.CallOption) (*GetVipConfigListResp, error) - GetMyVipInfo(ctx context.Context, in *GetMyVipInfoReq, opts ...grpc.CallOption) (*GetMyVipInfoResp, error) + GetVipConfigList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*VipConfigListResp, error) + GetMyVipInfo(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*RadioUserProfile, error) + // 数据分析 + GetAnalyticsOverview(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*AnalyticsOverviewResp, error) + GetChannelAnalytics(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*ChannelAnalyticsResp, error) + GetUserAnalytics(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*UserAnalyticsResp, error) } type radioServiceClient struct { @@ -103,19 +107,19 @@ func NewRadioServiceClient(cc grpc.ClientConnInterface) RadioServiceClient { return &radioServiceClient{cc} } -func (c *radioServiceClient) GetRadioUserProfile(ctx context.Context, in *GetRadioUserProfileReq, opts ...grpc.CallOption) (*GetRadioUserProfileResp, error) { +func (c *radioServiceClient) GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*RadioUserProfile, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetRadioUserProfileResp) - err := c.cc.Invoke(ctx, RadioService_GetRadioUserProfile_FullMethodName, in, out, cOpts...) + out := new(RadioUserProfile) + err := c.cc.Invoke(ctx, RadioService_GetUserProfile_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *radioServiceClient) CreateCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*CreateCategoryResp, error) { +func (c *radioServiceClient) CreateCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateCategoryResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_CreateCategory_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -123,9 +127,9 @@ func (c *radioServiceClient) CreateCategory(ctx context.Context, in *CreateCateg return out, nil } -func (c *radioServiceClient) UpdateCategory(ctx context.Context, in *UpdateCategoryReq, opts ...grpc.CallOption) (*UpdateCategoryResp, error) { +func (c *radioServiceClient) UpdateCategory(ctx context.Context, in *CategoryUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateCategoryResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_UpdateCategory_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -133,9 +137,9 @@ func (c *radioServiceClient) UpdateCategory(ctx context.Context, in *UpdateCateg return out, nil } -func (c *radioServiceClient) DeleteCategory(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) { +func (c *radioServiceClient) DeleteCategory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_DeleteCategory_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -143,9 +147,9 @@ func (c *radioServiceClient) DeleteCategory(ctx context.Context, in *DeleteByIds return out, nil } -func (c *radioServiceClient) GetCategoryList(ctx context.Context, in *GetCategoryListReq, opts ...grpc.CallOption) (*GetCategoryListResp, error) { +func (c *radioServiceClient) GetCategoryList(ctx context.Context, in *CategoryListReq, opts ...grpc.CallOption) (*CategoryListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetCategoryListResp) + out := new(CategoryListResp) err := c.cc.Invoke(ctx, RadioService_GetCategoryList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -153,9 +157,9 @@ func (c *radioServiceClient) GetCategoryList(ctx context.Context, in *GetCategor return out, nil } -func (c *radioServiceClient) CreateChannel(ctx context.Context, in *CreateChannelReq, opts ...grpc.CallOption) (*CreateChannelResp, error) { +func (c *radioServiceClient) CreateChannel(ctx context.Context, in *CreateChannelReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateChannelResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_CreateChannel_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -163,9 +167,9 @@ func (c *radioServiceClient) CreateChannel(ctx context.Context, in *CreateChanne return out, nil } -func (c *radioServiceClient) UpdateChannel(ctx context.Context, in *UpdateChannelReq, opts ...grpc.CallOption) (*UpdateChannelResp, error) { +func (c *radioServiceClient) UpdateChannel(ctx context.Context, in *UpdateChannelReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateChannelResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_UpdateChannel_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -173,9 +177,9 @@ func (c *radioServiceClient) UpdateChannel(ctx context.Context, in *UpdateChanne return out, nil } -func (c *radioServiceClient) DeleteChannel(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) { +func (c *radioServiceClient) DeleteChannel(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_DeleteChannel_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -183,9 +187,9 @@ func (c *radioServiceClient) DeleteChannel(ctx context.Context, in *DeleteByIdsR return out, nil } -func (c *radioServiceClient) GetChannelList(ctx context.Context, in *GetChannelListReq, opts ...grpc.CallOption) (*GetChannelListResp, error) { +func (c *radioServiceClient) GetChannelList(ctx context.Context, in *ChannelListReq, opts ...grpc.CallOption) (*ChannelListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetChannelListResp) + out := new(ChannelListResp) err := c.cc.Invoke(ctx, RadioService_GetChannelList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -193,9 +197,9 @@ func (c *radioServiceClient) GetChannelList(ctx context.Context, in *GetChannelL return out, nil } -func (c *radioServiceClient) GetChannelDetail(ctx context.Context, in *GetChannelDetailReq, opts ...grpc.CallOption) (*GetChannelDetailResp, error) { +func (c *radioServiceClient) GetChannelDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ChannelInfo, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetChannelDetailResp) + out := new(ChannelInfo) err := c.cc.Invoke(ctx, RadioService_GetChannelDetail_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -203,9 +207,9 @@ func (c *radioServiceClient) GetChannelDetail(ctx context.Context, in *GetChanne return out, nil } -func (c *radioServiceClient) CreateProgram(ctx context.Context, in *CreateProgramReq, opts ...grpc.CallOption) (*CreateProgramResp, error) { +func (c *radioServiceClient) CreateProgram(ctx context.Context, in *CreateProgramReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateProgramResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_CreateProgram_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -213,9 +217,9 @@ func (c *radioServiceClient) CreateProgram(ctx context.Context, in *CreateProgra return out, nil } -func (c *radioServiceClient) UpdateProgram(ctx context.Context, in *UpdateProgramReq, opts ...grpc.CallOption) (*UpdateProgramResp, error) { +func (c *radioServiceClient) UpdateProgram(ctx context.Context, in *UpdateProgramReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateProgramResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_UpdateProgram_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -223,9 +227,9 @@ func (c *radioServiceClient) UpdateProgram(ctx context.Context, in *UpdateProgra return out, nil } -func (c *radioServiceClient) DeleteProgram(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) { +func (c *radioServiceClient) DeleteProgram(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_DeleteProgram_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -233,9 +237,9 @@ func (c *radioServiceClient) DeleteProgram(ctx context.Context, in *DeleteByIdsR return out, nil } -func (c *radioServiceClient) GetProgramList(ctx context.Context, in *GetProgramListReq, opts ...grpc.CallOption) (*GetProgramListResp, error) { +func (c *radioServiceClient) GetProgramList(ctx context.Context, in *ProgramListReq, opts ...grpc.CallOption) (*ProgramListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetProgramListResp) + out := new(ProgramListResp) err := c.cc.Invoke(ctx, RadioService_GetProgramList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -243,9 +247,9 @@ func (c *radioServiceClient) GetProgramList(ctx context.Context, in *GetProgramL return out, nil } -func (c *radioServiceClient) GetProgramDetail(ctx context.Context, in *GetProgramDetailReq, opts ...grpc.CallOption) (*GetProgramDetailResp, error) { +func (c *radioServiceClient) GetProgramDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ProgramInfo, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetProgramDetailResp) + out := new(ProgramInfo) err := c.cc.Invoke(ctx, RadioService_GetProgramDetail_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -253,9 +257,9 @@ func (c *radioServiceClient) GetProgramDetail(ctx context.Context, in *GetProgra return out, nil } -func (c *radioServiceClient) CreateVoice(ctx context.Context, in *CreateVoiceReq, opts ...grpc.CallOption) (*CreateVoiceResp, error) { +func (c *radioServiceClient) CreateVoice(ctx context.Context, in *CreateVoiceReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateVoiceResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_CreateVoice_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -263,9 +267,9 @@ func (c *radioServiceClient) CreateVoice(ctx context.Context, in *CreateVoiceReq return out, nil } -func (c *radioServiceClient) UpdateVoice(ctx context.Context, in *UpdateVoiceReq, opts ...grpc.CallOption) (*UpdateVoiceResp, error) { +func (c *radioServiceClient) UpdateVoice(ctx context.Context, in *UpdateVoiceReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(UpdateVoiceResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_UpdateVoice_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -273,9 +277,9 @@ func (c *radioServiceClient) UpdateVoice(ctx context.Context, in *UpdateVoiceReq return out, nil } -func (c *radioServiceClient) DeleteVoice(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) { +func (c *radioServiceClient) DeleteVoice(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(DeleteResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_DeleteVoice_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -283,9 +287,9 @@ func (c *radioServiceClient) DeleteVoice(ctx context.Context, in *DeleteByIdsReq return out, nil } -func (c *radioServiceClient) GetVoiceList(ctx context.Context, in *GetVoiceListReq, opts ...grpc.CallOption) (*GetVoiceListResp, error) { +func (c *radioServiceClient) GetVoiceList(ctx context.Context, in *VoiceListReq, opts ...grpc.CallOption) (*VoiceListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetVoiceListResp) + out := new(VoiceListResp) err := c.cc.Invoke(ctx, RadioService_GetVoiceList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -293,9 +297,9 @@ func (c *radioServiceClient) GetVoiceList(ctx context.Context, in *GetVoiceListR return out, nil } -func (c *radioServiceClient) ToggleLike(ctx context.Context, in *ToggleLikeReq, opts ...grpc.CallOption) (*ToggleLikeResp, error) { +func (c *radioServiceClient) ToggleLike(ctx context.Context, in *ToggleLikeReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ToggleLikeResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_ToggleLike_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -303,9 +307,9 @@ func (c *radioServiceClient) ToggleLike(ctx context.Context, in *ToggleLikeReq, return out, nil } -func (c *radioServiceClient) ToggleFavorite(ctx context.Context, in *ToggleFavoriteReq, opts ...grpc.CallOption) (*ToggleFavoriteResp, error) { +func (c *radioServiceClient) ToggleFavorite(ctx context.Context, in *ToggleFavoriteReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ToggleFavoriteResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_ToggleFavorite_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -313,9 +317,9 @@ func (c *radioServiceClient) ToggleFavorite(ctx context.Context, in *ToggleFavor return out, nil } -func (c *radioServiceClient) CommentProgram(ctx context.Context, in *CommentReq, opts ...grpc.CallOption) (*CommentResp, error) { +func (c *radioServiceClient) CommentProgram(ctx context.Context, in *CommentReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CommentResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_CommentProgram_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -323,9 +327,9 @@ func (c *radioServiceClient) CommentProgram(ctx context.Context, in *CommentReq, return out, nil } -func (c *radioServiceClient) RecordHistory(ctx context.Context, in *RecordHistoryReq, opts ...grpc.CallOption) (*RecordHistoryResp, error) { +func (c *radioServiceClient) RecordHistory(ctx context.Context, in *RecordHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RecordHistoryResp) + out := new(CommonResp) err := c.cc.Invoke(ctx, RadioService_RecordHistory_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -333,19 +337,9 @@ func (c *radioServiceClient) RecordHistory(ctx context.Context, in *RecordHistor return out, nil } -func (c *radioServiceClient) GetHistoryList(ctx context.Context, in *GetHistoryListReq, opts ...grpc.CallOption) (*GetHistoryListResp, error) { +func (c *radioServiceClient) GetFavoriteList(ctx context.Context, in *InteractionListReq, opts ...grpc.CallOption) (*FavoriteListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetHistoryListResp) - err := c.cc.Invoke(ctx, RadioService_GetHistoryList_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *radioServiceClient) GetFavoriteList(ctx context.Context, in *GetFavoriteListReq, opts ...grpc.CallOption) (*GetFavoriteListResp, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetFavoriteListResp) + out := new(FavoriteListResp) err := c.cc.Invoke(ctx, RadioService_GetFavoriteList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -353,9 +347,19 @@ func (c *radioServiceClient) GetFavoriteList(ctx context.Context, in *GetFavorit return out, nil } -func (c *radioServiceClient) GetMySubscriptions(ctx context.Context, in *GetMySubscriptionsReq, opts ...grpc.CallOption) (*GetMySubscriptionsResp, error) { +func (c *radioServiceClient) GetHistoryList(ctx context.Context, in *InteractionListReq, opts ...grpc.CallOption) (*HistoryListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetMySubscriptionsResp) + out := new(HistoryListResp) + err := c.cc.Invoke(ctx, RadioService_GetHistoryList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *radioServiceClient) GetMySubscriptions(ctx context.Context, in *SubscriptionListReq, opts ...grpc.CallOption) (*SubscriptionListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SubscriptionListResp) err := c.cc.Invoke(ctx, RadioService_GetMySubscriptions_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -373,9 +377,9 @@ func (c *radioServiceClient) CreatePayOrder(ctx context.Context, in *CreatePayOr return out, nil } -func (c *radioServiceClient) GetVipConfigList(ctx context.Context, in *GetVipConfigListReq, opts ...grpc.CallOption) (*GetVipConfigListResp, error) { +func (c *radioServiceClient) GetVipConfigList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*VipConfigListResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetVipConfigListResp) + out := new(VipConfigListResp) err := c.cc.Invoke(ctx, RadioService_GetVipConfigList_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -383,9 +387,9 @@ func (c *radioServiceClient) GetVipConfigList(ctx context.Context, in *GetVipCon return out, nil } -func (c *radioServiceClient) GetMyVipInfo(ctx context.Context, in *GetMyVipInfoReq, opts ...grpc.CallOption) (*GetMyVipInfoResp, error) { +func (c *radioServiceClient) GetMyVipInfo(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*RadioUserProfile, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetMyVipInfoResp) + out := new(RadioUserProfile) err := c.cc.Invoke(ctx, RadioService_GetMyVipInfo_FullMethodName, in, out, cOpts...) if err != nil { return nil, err @@ -393,49 +397,80 @@ func (c *radioServiceClient) GetMyVipInfo(ctx context.Context, in *GetMyVipInfoR return out, nil } +func (c *radioServiceClient) GetAnalyticsOverview(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*AnalyticsOverviewResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(AnalyticsOverviewResp) + err := c.cc.Invoke(ctx, RadioService_GetAnalyticsOverview_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *radioServiceClient) GetChannelAnalytics(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*ChannelAnalyticsResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ChannelAnalyticsResp) + err := c.cc.Invoke(ctx, RadioService_GetChannelAnalytics_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *radioServiceClient) GetUserAnalytics(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*UserAnalyticsResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UserAnalyticsResp) + err := c.cc.Invoke(ctx, RadioService_GetUserAnalytics_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // RadioServiceServer is the server API for RadioService service. // All implementations must embed UnimplementedRadioServiceServer // for forward compatibility. -// -// ========== 服务定义 ========== type RadioServiceServer interface { - // 用户 - GetRadioUserProfile(context.Context, *GetRadioUserProfileReq) (*GetRadioUserProfileResp, error) + // 用户Profile + GetUserProfile(context.Context, *GetProfileReq) (*RadioUserProfile, error) // 分类 - CreateCategory(context.Context, *CreateCategoryReq) (*CreateCategoryResp, error) - UpdateCategory(context.Context, *UpdateCategoryReq) (*UpdateCategoryResp, error) - DeleteCategory(context.Context, *DeleteByIdsReq) (*DeleteResp, error) - GetCategoryList(context.Context, *GetCategoryListReq) (*GetCategoryListResp, error) + CreateCategory(context.Context, *CategoryReq) (*CommonResp, error) + UpdateCategory(context.Context, *CategoryUpdateReq) (*CommonResp, error) + DeleteCategory(context.Context, *IdsReq) (*CommonResp, error) + GetCategoryList(context.Context, *CategoryListReq) (*CategoryListResp, error) // 频道 - CreateChannel(context.Context, *CreateChannelReq) (*CreateChannelResp, error) - UpdateChannel(context.Context, *UpdateChannelReq) (*UpdateChannelResp, error) - DeleteChannel(context.Context, *DeleteByIdsReq) (*DeleteResp, error) - GetChannelList(context.Context, *GetChannelListReq) (*GetChannelListResp, error) - GetChannelDetail(context.Context, *GetChannelDetailReq) (*GetChannelDetailResp, error) + CreateChannel(context.Context, *CreateChannelReq) (*CommonResp, error) + UpdateChannel(context.Context, *UpdateChannelReq) (*CommonResp, error) + DeleteChannel(context.Context, *IdsReq) (*CommonResp, error) + GetChannelList(context.Context, *ChannelListReq) (*ChannelListResp, error) + GetChannelDetail(context.Context, *IdReq) (*ChannelInfo, error) // 节目 - CreateProgram(context.Context, *CreateProgramReq) (*CreateProgramResp, error) - UpdateProgram(context.Context, *UpdateProgramReq) (*UpdateProgramResp, error) - DeleteProgram(context.Context, *DeleteByIdsReq) (*DeleteResp, error) - GetProgramList(context.Context, *GetProgramListReq) (*GetProgramListResp, error) - GetProgramDetail(context.Context, *GetProgramDetailReq) (*GetProgramDetailResp, error) + CreateProgram(context.Context, *CreateProgramReq) (*CommonResp, error) + UpdateProgram(context.Context, *UpdateProgramReq) (*CommonResp, error) + DeleteProgram(context.Context, *IdsReq) (*CommonResp, error) + GetProgramList(context.Context, *ProgramListReq) (*ProgramListResp, error) + GetProgramDetail(context.Context, *IdReq) (*ProgramInfo, error) // 音色 - CreateVoice(context.Context, *CreateVoiceReq) (*CreateVoiceResp, error) - UpdateVoice(context.Context, *UpdateVoiceReq) (*UpdateVoiceResp, error) - DeleteVoice(context.Context, *DeleteByIdsReq) (*DeleteResp, error) - GetVoiceList(context.Context, *GetVoiceListReq) (*GetVoiceListResp, error) + CreateVoice(context.Context, *CreateVoiceReq) (*CommonResp, error) + UpdateVoice(context.Context, *UpdateVoiceReq) (*CommonResp, error) + DeleteVoice(context.Context, *IdsReq) (*CommonResp, error) + GetVoiceList(context.Context, *VoiceListReq) (*VoiceListResp, error) // 互动 - ToggleLike(context.Context, *ToggleLikeReq) (*ToggleLikeResp, error) - ToggleFavorite(context.Context, *ToggleFavoriteReq) (*ToggleFavoriteResp, error) - CommentProgram(context.Context, *CommentReq) (*CommentResp, error) - RecordHistory(context.Context, *RecordHistoryReq) (*RecordHistoryResp, error) - GetHistoryList(context.Context, *GetHistoryListReq) (*GetHistoryListResp, error) - GetFavoriteList(context.Context, *GetFavoriteListReq) (*GetFavoriteListResp, error) - // 订阅 - GetMySubscriptions(context.Context, *GetMySubscriptionsReq) (*GetMySubscriptionsResp, error) + ToggleLike(context.Context, *ToggleLikeReq) (*CommonResp, error) + ToggleFavorite(context.Context, *ToggleFavoriteReq) (*CommonResp, error) + CommentProgram(context.Context, *CommentReq) (*CommonResp, error) + RecordHistory(context.Context, *RecordHistoryReq) (*CommonResp, error) + GetFavoriteList(context.Context, *InteractionListReq) (*FavoriteListResp, error) + GetHistoryList(context.Context, *InteractionListReq) (*HistoryListResp, error) + // 订阅/VIP + GetMySubscriptions(context.Context, *SubscriptionListReq) (*SubscriptionListResp, error) CreatePayOrder(context.Context, *CreatePayOrderReq) (*CreatePayOrderResp, error) - // VIP - GetVipConfigList(context.Context, *GetVipConfigListReq) (*GetVipConfigListResp, error) - GetMyVipInfo(context.Context, *GetMyVipInfoReq) (*GetMyVipInfoResp, error) + GetVipConfigList(context.Context, *IdReq) (*VipConfigListResp, error) + GetMyVipInfo(context.Context, *GetProfileReq) (*RadioUserProfile, error) + // 数据分析 + GetAnalyticsOverview(context.Context, *AnalyticsReq) (*AnalyticsOverviewResp, error) + GetChannelAnalytics(context.Context, *AnalyticsReq) (*ChannelAnalyticsResp, error) + GetUserAnalytics(context.Context, *AnalyticsReq) (*UserAnalyticsResp, error) mustEmbedUnimplementedRadioServiceServer() } @@ -446,93 +481,102 @@ type RadioServiceServer interface { // pointer dereference when methods are called. type UnimplementedRadioServiceServer struct{} -func (UnimplementedRadioServiceServer) GetRadioUserProfile(context.Context, *GetRadioUserProfileReq) (*GetRadioUserProfileResp, error) { - return nil, status.Error(codes.Unimplemented, "method GetRadioUserProfile not implemented") +func (UnimplementedRadioServiceServer) GetUserProfile(context.Context, *GetProfileReq) (*RadioUserProfile, error) { + return nil, status.Error(codes.Unimplemented, "method GetUserProfile not implemented") } -func (UnimplementedRadioServiceServer) CreateCategory(context.Context, *CreateCategoryReq) (*CreateCategoryResp, error) { +func (UnimplementedRadioServiceServer) CreateCategory(context.Context, *CategoryReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateCategory not implemented") } -func (UnimplementedRadioServiceServer) UpdateCategory(context.Context, *UpdateCategoryReq) (*UpdateCategoryResp, error) { +func (UnimplementedRadioServiceServer) UpdateCategory(context.Context, *CategoryUpdateReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method UpdateCategory not implemented") } -func (UnimplementedRadioServiceServer) DeleteCategory(context.Context, *DeleteByIdsReq) (*DeleteResp, error) { +func (UnimplementedRadioServiceServer) DeleteCategory(context.Context, *IdsReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method DeleteCategory not implemented") } -func (UnimplementedRadioServiceServer) GetCategoryList(context.Context, *GetCategoryListReq) (*GetCategoryListResp, error) { +func (UnimplementedRadioServiceServer) GetCategoryList(context.Context, *CategoryListReq) (*CategoryListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetCategoryList not implemented") } -func (UnimplementedRadioServiceServer) CreateChannel(context.Context, *CreateChannelReq) (*CreateChannelResp, error) { +func (UnimplementedRadioServiceServer) CreateChannel(context.Context, *CreateChannelReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateChannel not implemented") } -func (UnimplementedRadioServiceServer) UpdateChannel(context.Context, *UpdateChannelReq) (*UpdateChannelResp, error) { +func (UnimplementedRadioServiceServer) UpdateChannel(context.Context, *UpdateChannelReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method UpdateChannel not implemented") } -func (UnimplementedRadioServiceServer) DeleteChannel(context.Context, *DeleteByIdsReq) (*DeleteResp, error) { +func (UnimplementedRadioServiceServer) DeleteChannel(context.Context, *IdsReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method DeleteChannel not implemented") } -func (UnimplementedRadioServiceServer) GetChannelList(context.Context, *GetChannelListReq) (*GetChannelListResp, error) { +func (UnimplementedRadioServiceServer) GetChannelList(context.Context, *ChannelListReq) (*ChannelListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetChannelList not implemented") } -func (UnimplementedRadioServiceServer) GetChannelDetail(context.Context, *GetChannelDetailReq) (*GetChannelDetailResp, error) { +func (UnimplementedRadioServiceServer) GetChannelDetail(context.Context, *IdReq) (*ChannelInfo, error) { return nil, status.Error(codes.Unimplemented, "method GetChannelDetail not implemented") } -func (UnimplementedRadioServiceServer) CreateProgram(context.Context, *CreateProgramReq) (*CreateProgramResp, error) { +func (UnimplementedRadioServiceServer) CreateProgram(context.Context, *CreateProgramReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateProgram not implemented") } -func (UnimplementedRadioServiceServer) UpdateProgram(context.Context, *UpdateProgramReq) (*UpdateProgramResp, error) { +func (UnimplementedRadioServiceServer) UpdateProgram(context.Context, *UpdateProgramReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method UpdateProgram not implemented") } -func (UnimplementedRadioServiceServer) DeleteProgram(context.Context, *DeleteByIdsReq) (*DeleteResp, error) { +func (UnimplementedRadioServiceServer) DeleteProgram(context.Context, *IdsReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method DeleteProgram not implemented") } -func (UnimplementedRadioServiceServer) GetProgramList(context.Context, *GetProgramListReq) (*GetProgramListResp, error) { +func (UnimplementedRadioServiceServer) GetProgramList(context.Context, *ProgramListReq) (*ProgramListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetProgramList not implemented") } -func (UnimplementedRadioServiceServer) GetProgramDetail(context.Context, *GetProgramDetailReq) (*GetProgramDetailResp, error) { +func (UnimplementedRadioServiceServer) GetProgramDetail(context.Context, *IdReq) (*ProgramInfo, error) { return nil, status.Error(codes.Unimplemented, "method GetProgramDetail not implemented") } -func (UnimplementedRadioServiceServer) CreateVoice(context.Context, *CreateVoiceReq) (*CreateVoiceResp, error) { +func (UnimplementedRadioServiceServer) CreateVoice(context.Context, *CreateVoiceReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CreateVoice not implemented") } -func (UnimplementedRadioServiceServer) UpdateVoice(context.Context, *UpdateVoiceReq) (*UpdateVoiceResp, error) { +func (UnimplementedRadioServiceServer) UpdateVoice(context.Context, *UpdateVoiceReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method UpdateVoice not implemented") } -func (UnimplementedRadioServiceServer) DeleteVoice(context.Context, *DeleteByIdsReq) (*DeleteResp, error) { +func (UnimplementedRadioServiceServer) DeleteVoice(context.Context, *IdsReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method DeleteVoice not implemented") } -func (UnimplementedRadioServiceServer) GetVoiceList(context.Context, *GetVoiceListReq) (*GetVoiceListResp, error) { +func (UnimplementedRadioServiceServer) GetVoiceList(context.Context, *VoiceListReq) (*VoiceListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetVoiceList not implemented") } -func (UnimplementedRadioServiceServer) ToggleLike(context.Context, *ToggleLikeReq) (*ToggleLikeResp, error) { +func (UnimplementedRadioServiceServer) ToggleLike(context.Context, *ToggleLikeReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method ToggleLike not implemented") } -func (UnimplementedRadioServiceServer) ToggleFavorite(context.Context, *ToggleFavoriteReq) (*ToggleFavoriteResp, error) { +func (UnimplementedRadioServiceServer) ToggleFavorite(context.Context, *ToggleFavoriteReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method ToggleFavorite not implemented") } -func (UnimplementedRadioServiceServer) CommentProgram(context.Context, *CommentReq) (*CommentResp, error) { +func (UnimplementedRadioServiceServer) CommentProgram(context.Context, *CommentReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method CommentProgram not implemented") } -func (UnimplementedRadioServiceServer) RecordHistory(context.Context, *RecordHistoryReq) (*RecordHistoryResp, error) { +func (UnimplementedRadioServiceServer) RecordHistory(context.Context, *RecordHistoryReq) (*CommonResp, error) { return nil, status.Error(codes.Unimplemented, "method RecordHistory not implemented") } -func (UnimplementedRadioServiceServer) GetHistoryList(context.Context, *GetHistoryListReq) (*GetHistoryListResp, error) { - return nil, status.Error(codes.Unimplemented, "method GetHistoryList not implemented") -} -func (UnimplementedRadioServiceServer) GetFavoriteList(context.Context, *GetFavoriteListReq) (*GetFavoriteListResp, error) { +func (UnimplementedRadioServiceServer) GetFavoriteList(context.Context, *InteractionListReq) (*FavoriteListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetFavoriteList not implemented") } -func (UnimplementedRadioServiceServer) GetMySubscriptions(context.Context, *GetMySubscriptionsReq) (*GetMySubscriptionsResp, error) { +func (UnimplementedRadioServiceServer) GetHistoryList(context.Context, *InteractionListReq) (*HistoryListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetHistoryList not implemented") +} +func (UnimplementedRadioServiceServer) GetMySubscriptions(context.Context, *SubscriptionListReq) (*SubscriptionListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetMySubscriptions not implemented") } func (UnimplementedRadioServiceServer) CreatePayOrder(context.Context, *CreatePayOrderReq) (*CreatePayOrderResp, error) { return nil, status.Error(codes.Unimplemented, "method CreatePayOrder not implemented") } -func (UnimplementedRadioServiceServer) GetVipConfigList(context.Context, *GetVipConfigListReq) (*GetVipConfigListResp, error) { +func (UnimplementedRadioServiceServer) GetVipConfigList(context.Context, *IdReq) (*VipConfigListResp, error) { return nil, status.Error(codes.Unimplemented, "method GetVipConfigList not implemented") } -func (UnimplementedRadioServiceServer) GetMyVipInfo(context.Context, *GetMyVipInfoReq) (*GetMyVipInfoResp, error) { +func (UnimplementedRadioServiceServer) GetMyVipInfo(context.Context, *GetProfileReq) (*RadioUserProfile, error) { return nil, status.Error(codes.Unimplemented, "method GetMyVipInfo not implemented") } +func (UnimplementedRadioServiceServer) GetAnalyticsOverview(context.Context, *AnalyticsReq) (*AnalyticsOverviewResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetAnalyticsOverview not implemented") +} +func (UnimplementedRadioServiceServer) GetChannelAnalytics(context.Context, *AnalyticsReq) (*ChannelAnalyticsResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetChannelAnalytics not implemented") +} +func (UnimplementedRadioServiceServer) GetUserAnalytics(context.Context, *AnalyticsReq) (*UserAnalyticsResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetUserAnalytics not implemented") +} func (UnimplementedRadioServiceServer) mustEmbedUnimplementedRadioServiceServer() {} func (UnimplementedRadioServiceServer) testEmbeddedByValue() {} @@ -554,26 +598,26 @@ func RegisterRadioServiceServer(s grpc.ServiceRegistrar, srv RadioServiceServer) s.RegisterService(&RadioService_ServiceDesc, srv) } -func _RadioService_GetRadioUserProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRadioUserProfileReq) +func _RadioService_GetUserProfile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetProfileReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(RadioServiceServer).GetRadioUserProfile(ctx, in) + return srv.(RadioServiceServer).GetUserProfile(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: RadioService_GetRadioUserProfile_FullMethodName, + FullMethod: RadioService_GetUserProfile_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetRadioUserProfile(ctx, req.(*GetRadioUserProfileReq)) + return srv.(RadioServiceServer).GetUserProfile(ctx, req.(*GetProfileReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_CreateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateCategoryReq) + in := new(CategoryReq) if err := dec(in); err != nil { return nil, err } @@ -585,13 +629,13 @@ func _RadioService_CreateCategory_Handler(srv interface{}, ctx context.Context, FullMethod: RadioService_CreateCategory_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).CreateCategory(ctx, req.(*CreateCategoryReq)) + return srv.(RadioServiceServer).CreateCategory(ctx, req.(*CategoryReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_UpdateCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateCategoryReq) + in := new(CategoryUpdateReq) if err := dec(in); err != nil { return nil, err } @@ -603,13 +647,13 @@ func _RadioService_UpdateCategory_Handler(srv interface{}, ctx context.Context, FullMethod: RadioService_UpdateCategory_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).UpdateCategory(ctx, req.(*UpdateCategoryReq)) + return srv.(RadioServiceServer).UpdateCategory(ctx, req.(*CategoryUpdateReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_DeleteCategory_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteByIdsReq) + in := new(IdsReq) if err := dec(in); err != nil { return nil, err } @@ -621,13 +665,13 @@ func _RadioService_DeleteCategory_Handler(srv interface{}, ctx context.Context, FullMethod: RadioService_DeleteCategory_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).DeleteCategory(ctx, req.(*DeleteByIdsReq)) + return srv.(RadioServiceServer).DeleteCategory(ctx, req.(*IdsReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_GetCategoryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetCategoryListReq) + in := new(CategoryListReq) if err := dec(in); err != nil { return nil, err } @@ -639,7 +683,7 @@ func _RadioService_GetCategoryList_Handler(srv interface{}, ctx context.Context, FullMethod: RadioService_GetCategoryList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetCategoryList(ctx, req.(*GetCategoryListReq)) + return srv.(RadioServiceServer).GetCategoryList(ctx, req.(*CategoryListReq)) } return interceptor(ctx, in, info, handler) } @@ -681,7 +725,7 @@ func _RadioService_UpdateChannel_Handler(srv interface{}, ctx context.Context, d } func _RadioService_DeleteChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteByIdsReq) + in := new(IdsReq) if err := dec(in); err != nil { return nil, err } @@ -693,13 +737,13 @@ func _RadioService_DeleteChannel_Handler(srv interface{}, ctx context.Context, d FullMethod: RadioService_DeleteChannel_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).DeleteChannel(ctx, req.(*DeleteByIdsReq)) + return srv.(RadioServiceServer).DeleteChannel(ctx, req.(*IdsReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_GetChannelList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetChannelListReq) + in := new(ChannelListReq) if err := dec(in); err != nil { return nil, err } @@ -711,13 +755,13 @@ func _RadioService_GetChannelList_Handler(srv interface{}, ctx context.Context, FullMethod: RadioService_GetChannelList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetChannelList(ctx, req.(*GetChannelListReq)) + return srv.(RadioServiceServer).GetChannelList(ctx, req.(*ChannelListReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_GetChannelDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetChannelDetailReq) + in := new(IdReq) if err := dec(in); err != nil { return nil, err } @@ -729,7 +773,7 @@ func _RadioService_GetChannelDetail_Handler(srv interface{}, ctx context.Context FullMethod: RadioService_GetChannelDetail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetChannelDetail(ctx, req.(*GetChannelDetailReq)) + return srv.(RadioServiceServer).GetChannelDetail(ctx, req.(*IdReq)) } return interceptor(ctx, in, info, handler) } @@ -771,7 +815,7 @@ func _RadioService_UpdateProgram_Handler(srv interface{}, ctx context.Context, d } func _RadioService_DeleteProgram_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteByIdsReq) + in := new(IdsReq) if err := dec(in); err != nil { return nil, err } @@ -783,13 +827,13 @@ func _RadioService_DeleteProgram_Handler(srv interface{}, ctx context.Context, d FullMethod: RadioService_DeleteProgram_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).DeleteProgram(ctx, req.(*DeleteByIdsReq)) + return srv.(RadioServiceServer).DeleteProgram(ctx, req.(*IdsReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_GetProgramList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetProgramListReq) + in := new(ProgramListReq) if err := dec(in); err != nil { return nil, err } @@ -801,13 +845,13 @@ func _RadioService_GetProgramList_Handler(srv interface{}, ctx context.Context, FullMethod: RadioService_GetProgramList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetProgramList(ctx, req.(*GetProgramListReq)) + return srv.(RadioServiceServer).GetProgramList(ctx, req.(*ProgramListReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_GetProgramDetail_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetProgramDetailReq) + in := new(IdReq) if err := dec(in); err != nil { return nil, err } @@ -819,7 +863,7 @@ func _RadioService_GetProgramDetail_Handler(srv interface{}, ctx context.Context FullMethod: RadioService_GetProgramDetail_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetProgramDetail(ctx, req.(*GetProgramDetailReq)) + return srv.(RadioServiceServer).GetProgramDetail(ctx, req.(*IdReq)) } return interceptor(ctx, in, info, handler) } @@ -861,7 +905,7 @@ func _RadioService_UpdateVoice_Handler(srv interface{}, ctx context.Context, dec } func _RadioService_DeleteVoice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteByIdsReq) + in := new(IdsReq) if err := dec(in); err != nil { return nil, err } @@ -873,13 +917,13 @@ func _RadioService_DeleteVoice_Handler(srv interface{}, ctx context.Context, dec FullMethod: RadioService_DeleteVoice_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).DeleteVoice(ctx, req.(*DeleteByIdsReq)) + return srv.(RadioServiceServer).DeleteVoice(ctx, req.(*IdsReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_GetVoiceList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetVoiceListReq) + in := new(VoiceListReq) if err := dec(in); err != nil { return nil, err } @@ -891,7 +935,7 @@ func _RadioService_GetVoiceList_Handler(srv interface{}, ctx context.Context, de FullMethod: RadioService_GetVoiceList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetVoiceList(ctx, req.(*GetVoiceListReq)) + return srv.(RadioServiceServer).GetVoiceList(ctx, req.(*VoiceListReq)) } return interceptor(ctx, in, info, handler) } @@ -968,26 +1012,8 @@ func _RadioService_RecordHistory_Handler(srv interface{}, ctx context.Context, d return interceptor(ctx, in, info, handler) } -func _RadioService_GetHistoryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetHistoryListReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RadioServiceServer).GetHistoryList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RadioService_GetHistoryList_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetHistoryList(ctx, req.(*GetHistoryListReq)) - } - return interceptor(ctx, in, info, handler) -} - func _RadioService_GetFavoriteList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetFavoriteListReq) + in := new(InteractionListReq) if err := dec(in); err != nil { return nil, err } @@ -999,13 +1025,31 @@ func _RadioService_GetFavoriteList_Handler(srv interface{}, ctx context.Context, FullMethod: RadioService_GetFavoriteList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetFavoriteList(ctx, req.(*GetFavoriteListReq)) + return srv.(RadioServiceServer).GetFavoriteList(ctx, req.(*InteractionListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _RadioService_GetHistoryList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InteractionListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RadioServiceServer).GetHistoryList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RadioService_GetHistoryList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RadioServiceServer).GetHistoryList(ctx, req.(*InteractionListReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_GetMySubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMySubscriptionsReq) + in := new(SubscriptionListReq) if err := dec(in); err != nil { return nil, err } @@ -1017,7 +1061,7 @@ func _RadioService_GetMySubscriptions_Handler(srv interface{}, ctx context.Conte FullMethod: RadioService_GetMySubscriptions_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetMySubscriptions(ctx, req.(*GetMySubscriptionsReq)) + return srv.(RadioServiceServer).GetMySubscriptions(ctx, req.(*SubscriptionListReq)) } return interceptor(ctx, in, info, handler) } @@ -1041,7 +1085,7 @@ func _RadioService_CreatePayOrder_Handler(srv interface{}, ctx context.Context, } func _RadioService_GetVipConfigList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetVipConfigListReq) + in := new(IdReq) if err := dec(in); err != nil { return nil, err } @@ -1053,13 +1097,13 @@ func _RadioService_GetVipConfigList_Handler(srv interface{}, ctx context.Context FullMethod: RadioService_GetVipConfigList_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetVipConfigList(ctx, req.(*GetVipConfigListReq)) + return srv.(RadioServiceServer).GetVipConfigList(ctx, req.(*IdReq)) } return interceptor(ctx, in, info, handler) } func _RadioService_GetMyVipInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMyVipInfoReq) + in := new(GetProfileReq) if err := dec(in); err != nil { return nil, err } @@ -1071,7 +1115,61 @@ func _RadioService_GetMyVipInfo_Handler(srv interface{}, ctx context.Context, de FullMethod: RadioService_GetMyVipInfo_FullMethodName, } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RadioServiceServer).GetMyVipInfo(ctx, req.(*GetMyVipInfoReq)) + return srv.(RadioServiceServer).GetMyVipInfo(ctx, req.(*GetProfileReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _RadioService_GetAnalyticsOverview_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyticsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RadioServiceServer).GetAnalyticsOverview(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RadioService_GetAnalyticsOverview_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RadioServiceServer).GetAnalyticsOverview(ctx, req.(*AnalyticsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _RadioService_GetChannelAnalytics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyticsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RadioServiceServer).GetChannelAnalytics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RadioService_GetChannelAnalytics_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RadioServiceServer).GetChannelAnalytics(ctx, req.(*AnalyticsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _RadioService_GetUserAnalytics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AnalyticsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RadioServiceServer).GetUserAnalytics(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RadioService_GetUserAnalytics_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RadioServiceServer).GetUserAnalytics(ctx, req.(*AnalyticsReq)) } return interceptor(ctx, in, info, handler) } @@ -1084,8 +1182,8 @@ var RadioService_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*RadioServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetRadioUserProfile", - Handler: _RadioService_GetRadioUserProfile_Handler, + MethodName: "GetUserProfile", + Handler: _RadioService_GetUserProfile_Handler, }, { MethodName: "CreateCategory", @@ -1175,14 +1273,14 @@ var RadioService_ServiceDesc = grpc.ServiceDesc{ MethodName: "RecordHistory", Handler: _RadioService_RecordHistory_Handler, }, - { - MethodName: "GetHistoryList", - Handler: _RadioService_GetHistoryList_Handler, - }, { MethodName: "GetFavoriteList", Handler: _RadioService_GetFavoriteList_Handler, }, + { + MethodName: "GetHistoryList", + Handler: _RadioService_GetHistoryList_Handler, + }, { MethodName: "GetMySubscriptions", Handler: _RadioService_GetMySubscriptions_Handler, @@ -1199,6 +1297,18 @@ var RadioService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetMyVipInfo", Handler: _RadioService_GetMyVipInfo_Handler, }, + { + MethodName: "GetAnalyticsOverview", + Handler: _RadioService_GetAnalyticsOverview_Handler, + }, + { + MethodName: "GetChannelAnalytics", + Handler: _RadioService_GetChannelAnalytics_Handler, + }, + { + MethodName: "GetUserAnalytics", + Handler: _RadioService_GetUserAnalytics_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "pb/radio.proto", diff --git a/app/radio/rpc/radioservice/radioService.go b/app/radio/rpc/radioservice/radioService.go index 41535c7..291f5ba 100644 --- a/app/radio/rpc/radioservice/radioService.go +++ b/app/radio/rpc/radioservice/radioService.go @@ -14,105 +14,92 @@ import ( ) type ( - CategoryInfo = radio.CategoryInfo - ChannelInfo = radio.ChannelInfo - CommentReq = radio.CommentReq - CommentResp = radio.CommentResp - CreateCategoryReq = radio.CreateCategoryReq - CreateCategoryResp = radio.CreateCategoryResp - CreateChannelReq = radio.CreateChannelReq - CreateChannelResp = radio.CreateChannelResp - CreatePayOrderReq = radio.CreatePayOrderReq - CreatePayOrderResp = radio.CreatePayOrderResp - CreateProgramReq = radio.CreateProgramReq - CreateProgramResp = radio.CreateProgramResp - CreateVoiceReq = radio.CreateVoiceReq - CreateVoiceResp = radio.CreateVoiceResp - DeleteByIdsReq = radio.DeleteByIdsReq - DeleteResp = radio.DeleteResp - Empty = radio.Empty - GetCategoryListReq = radio.GetCategoryListReq - GetCategoryListResp = radio.GetCategoryListResp - GetChannelDetailReq = radio.GetChannelDetailReq - GetChannelDetailResp = radio.GetChannelDetailResp - GetChannelListReq = radio.GetChannelListReq - GetChannelListResp = radio.GetChannelListResp - GetFavoriteListReq = radio.GetFavoriteListReq - GetFavoriteListResp = radio.GetFavoriteListResp - GetHistoryListReq = radio.GetHistoryListReq - GetHistoryListResp = radio.GetHistoryListResp - GetMySubscriptionsReq = radio.GetMySubscriptionsReq - GetMySubscriptionsResp = radio.GetMySubscriptionsResp - GetMyVipInfoReq = radio.GetMyVipInfoReq - GetMyVipInfoResp = radio.GetMyVipInfoResp - GetProgramDetailReq = radio.GetProgramDetailReq - GetProgramDetailResp = radio.GetProgramDetailResp - GetProgramListReq = radio.GetProgramListReq - GetProgramListResp = radio.GetProgramListResp - GetRadioUserProfileReq = radio.GetRadioUserProfileReq - GetRadioUserProfileResp = radio.GetRadioUserProfileResp - GetVipConfigListReq = radio.GetVipConfigListReq - GetVipConfigListResp = radio.GetVipConfigListResp - GetVoiceListReq = radio.GetVoiceListReq - GetVoiceListResp = radio.GetVoiceListResp - ProgramInfo = radio.ProgramInfo - RadioUserProfile = radio.RadioUserProfile - RecordHistoryReq = radio.RecordHistoryReq - RecordHistoryResp = radio.RecordHistoryResp - SubscriptionInfo = radio.SubscriptionInfo - ToggleFavoriteReq = radio.ToggleFavoriteReq - ToggleFavoriteResp = radio.ToggleFavoriteResp - ToggleLikeReq = radio.ToggleLikeReq - ToggleLikeResp = radio.ToggleLikeResp - UpdateCategoryReq = radio.UpdateCategoryReq - UpdateCategoryResp = radio.UpdateCategoryResp - UpdateChannelReq = radio.UpdateChannelReq - UpdateChannelResp = radio.UpdateChannelResp - UpdateProgramReq = radio.UpdateProgramReq - UpdateProgramResp = radio.UpdateProgramResp - UpdateVoiceReq = radio.UpdateVoiceReq - UpdateVoiceResp = radio.UpdateVoiceResp - VipConfigInfo = radio.VipConfigInfo - VoiceInfo = radio.VoiceInfo + AnalyticsOverviewResp = radio.AnalyticsOverviewResp + AnalyticsReq = radio.AnalyticsReq + CategoryInfo = radio.CategoryInfo + CategoryListReq = radio.CategoryListReq + CategoryListResp = radio.CategoryListResp + CategoryReq = radio.CategoryReq + CategoryUpdateReq = radio.CategoryUpdateReq + ChannelAnalyticsItem = radio.ChannelAnalyticsItem + ChannelAnalyticsResp = radio.ChannelAnalyticsResp + ChannelInfo = radio.ChannelInfo + ChannelListReq = radio.ChannelListReq + ChannelListResp = radio.ChannelListResp + CommentReq = radio.CommentReq + CommonResp = radio.CommonResp + CreateChannelReq = radio.CreateChannelReq + CreatePayOrderReq = radio.CreatePayOrderReq + CreatePayOrderResp = radio.CreatePayOrderResp + CreateProgramReq = radio.CreateProgramReq + CreateVoiceReq = radio.CreateVoiceReq + FavoriteListResp = radio.FavoriteListResp + GetProfileReq = radio.GetProfileReq + HistoryListResp = radio.HistoryListResp + IdReq = radio.IdReq + IdsReq = radio.IdsReq + InteractionListReq = radio.InteractionListReq + ProgramInfo = radio.ProgramInfo + ProgramListReq = radio.ProgramListReq + ProgramListResp = radio.ProgramListResp + RadioUserProfile = radio.RadioUserProfile + RecordHistoryReq = radio.RecordHistoryReq + SubscriptionInfo = radio.SubscriptionInfo + SubscriptionListReq = radio.SubscriptionListReq + SubscriptionListResp = radio.SubscriptionListResp + ToggleFavoriteReq = radio.ToggleFavoriteReq + ToggleLikeReq = radio.ToggleLikeReq + UpdateChannelReq = radio.UpdateChannelReq + UpdateProgramReq = radio.UpdateProgramReq + UpdateVoiceReq = radio.UpdateVoiceReq + UserAnalyticsResp = radio.UserAnalyticsResp + VipConfigInfo = radio.VipConfigInfo + VipConfigListResp = radio.VipConfigListResp + VoiceInfo = radio.VoiceInfo + VoiceListReq = radio.VoiceListReq + VoiceListResp = radio.VoiceListResp RadioService interface { - // 用户 - GetRadioUserProfile(ctx context.Context, in *GetRadioUserProfileReq, opts ...grpc.CallOption) (*GetRadioUserProfileResp, error) + // 用户Profile + GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*RadioUserProfile, error) // 分类 - CreateCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*CreateCategoryResp, error) - UpdateCategory(ctx context.Context, in *UpdateCategoryReq, opts ...grpc.CallOption) (*UpdateCategoryResp, error) - DeleteCategory(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) - GetCategoryList(ctx context.Context, in *GetCategoryListReq, opts ...grpc.CallOption) (*GetCategoryListResp, error) + CreateCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateCategory(ctx context.Context, in *CategoryUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteCategory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetCategoryList(ctx context.Context, in *CategoryListReq, opts ...grpc.CallOption) (*CategoryListResp, error) // 频道 - CreateChannel(ctx context.Context, in *CreateChannelReq, opts ...grpc.CallOption) (*CreateChannelResp, error) - UpdateChannel(ctx context.Context, in *UpdateChannelReq, opts ...grpc.CallOption) (*UpdateChannelResp, error) - DeleteChannel(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) - GetChannelList(ctx context.Context, in *GetChannelListReq, opts ...grpc.CallOption) (*GetChannelListResp, error) - GetChannelDetail(ctx context.Context, in *GetChannelDetailReq, opts ...grpc.CallOption) (*GetChannelDetailResp, error) + CreateChannel(ctx context.Context, in *CreateChannelReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateChannel(ctx context.Context, in *UpdateChannelReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteChannel(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetChannelList(ctx context.Context, in *ChannelListReq, opts ...grpc.CallOption) (*ChannelListResp, error) + GetChannelDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ChannelInfo, error) // 节目 - CreateProgram(ctx context.Context, in *CreateProgramReq, opts ...grpc.CallOption) (*CreateProgramResp, error) - UpdateProgram(ctx context.Context, in *UpdateProgramReq, opts ...grpc.CallOption) (*UpdateProgramResp, error) - DeleteProgram(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) - GetProgramList(ctx context.Context, in *GetProgramListReq, opts ...grpc.CallOption) (*GetProgramListResp, error) - GetProgramDetail(ctx context.Context, in *GetProgramDetailReq, opts ...grpc.CallOption) (*GetProgramDetailResp, error) + CreateProgram(ctx context.Context, in *CreateProgramReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateProgram(ctx context.Context, in *UpdateProgramReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteProgram(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetProgramList(ctx context.Context, in *ProgramListReq, opts ...grpc.CallOption) (*ProgramListResp, error) + GetProgramDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ProgramInfo, error) // 音色 - CreateVoice(ctx context.Context, in *CreateVoiceReq, opts ...grpc.CallOption) (*CreateVoiceResp, error) - UpdateVoice(ctx context.Context, in *UpdateVoiceReq, opts ...grpc.CallOption) (*UpdateVoiceResp, error) - DeleteVoice(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) - GetVoiceList(ctx context.Context, in *GetVoiceListReq, opts ...grpc.CallOption) (*GetVoiceListResp, error) + CreateVoice(ctx context.Context, in *CreateVoiceReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateVoice(ctx context.Context, in *UpdateVoiceReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteVoice(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetVoiceList(ctx context.Context, in *VoiceListReq, opts ...grpc.CallOption) (*VoiceListResp, error) // 互动 - ToggleLike(ctx context.Context, in *ToggleLikeReq, opts ...grpc.CallOption) (*ToggleLikeResp, error) - ToggleFavorite(ctx context.Context, in *ToggleFavoriteReq, opts ...grpc.CallOption) (*ToggleFavoriteResp, error) - CommentProgram(ctx context.Context, in *CommentReq, opts ...grpc.CallOption) (*CommentResp, error) - RecordHistory(ctx context.Context, in *RecordHistoryReq, opts ...grpc.CallOption) (*RecordHistoryResp, error) - GetHistoryList(ctx context.Context, in *GetHistoryListReq, opts ...grpc.CallOption) (*GetHistoryListResp, error) - GetFavoriteList(ctx context.Context, in *GetFavoriteListReq, opts ...grpc.CallOption) (*GetFavoriteListResp, error) - // 订阅 - GetMySubscriptions(ctx context.Context, in *GetMySubscriptionsReq, opts ...grpc.CallOption) (*GetMySubscriptionsResp, error) + ToggleLike(ctx context.Context, in *ToggleLikeReq, opts ...grpc.CallOption) (*CommonResp, error) + ToggleFavorite(ctx context.Context, in *ToggleFavoriteReq, opts ...grpc.CallOption) (*CommonResp, error) + CommentProgram(ctx context.Context, in *CommentReq, opts ...grpc.CallOption) (*CommonResp, error) + RecordHistory(ctx context.Context, in *RecordHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) + GetFavoriteList(ctx context.Context, in *InteractionListReq, opts ...grpc.CallOption) (*FavoriteListResp, error) + GetHistoryList(ctx context.Context, in *InteractionListReq, opts ...grpc.CallOption) (*HistoryListResp, error) + // 订阅/VIP + GetMySubscriptions(ctx context.Context, in *SubscriptionListReq, opts ...grpc.CallOption) (*SubscriptionListResp, error) CreatePayOrder(ctx context.Context, in *CreatePayOrderReq, opts ...grpc.CallOption) (*CreatePayOrderResp, error) - // VIP - GetVipConfigList(ctx context.Context, in *GetVipConfigListReq, opts ...grpc.CallOption) (*GetVipConfigListResp, error) - GetMyVipInfo(ctx context.Context, in *GetMyVipInfoReq, opts ...grpc.CallOption) (*GetMyVipInfoResp, error) + GetVipConfigList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*VipConfigListResp, error) + GetMyVipInfo(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*RadioUserProfile, error) + // 数据分析 + GetAnalyticsOverview(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*AnalyticsOverviewResp, error) + GetChannelAnalytics(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*ChannelAnalyticsResp, error) + GetUserAnalytics(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*UserAnalyticsResp, error) } defaultRadioService struct { @@ -126,139 +113,139 @@ func NewRadioService(cli zrpc.Client) RadioService { } } -// 用户 -func (m *defaultRadioService) GetRadioUserProfile(ctx context.Context, in *GetRadioUserProfileReq, opts ...grpc.CallOption) (*GetRadioUserProfileResp, error) { +// 用户Profile +func (m *defaultRadioService) GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*RadioUserProfile, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) - return client.GetRadioUserProfile(ctx, in, opts...) + return client.GetUserProfile(ctx, in, opts...) } // 分类 -func (m *defaultRadioService) CreateCategory(ctx context.Context, in *CreateCategoryReq, opts ...grpc.CallOption) (*CreateCategoryResp, error) { +func (m *defaultRadioService) CreateCategory(ctx context.Context, in *CategoryReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.CreateCategory(ctx, in, opts...) } -func (m *defaultRadioService) UpdateCategory(ctx context.Context, in *UpdateCategoryReq, opts ...grpc.CallOption) (*UpdateCategoryResp, error) { +func (m *defaultRadioService) UpdateCategory(ctx context.Context, in *CategoryUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.UpdateCategory(ctx, in, opts...) } -func (m *defaultRadioService) DeleteCategory(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) { +func (m *defaultRadioService) DeleteCategory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.DeleteCategory(ctx, in, opts...) } -func (m *defaultRadioService) GetCategoryList(ctx context.Context, in *GetCategoryListReq, opts ...grpc.CallOption) (*GetCategoryListResp, error) { +func (m *defaultRadioService) GetCategoryList(ctx context.Context, in *CategoryListReq, opts ...grpc.CallOption) (*CategoryListResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetCategoryList(ctx, in, opts...) } // 频道 -func (m *defaultRadioService) CreateChannel(ctx context.Context, in *CreateChannelReq, opts ...grpc.CallOption) (*CreateChannelResp, error) { +func (m *defaultRadioService) CreateChannel(ctx context.Context, in *CreateChannelReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.CreateChannel(ctx, in, opts...) } -func (m *defaultRadioService) UpdateChannel(ctx context.Context, in *UpdateChannelReq, opts ...grpc.CallOption) (*UpdateChannelResp, error) { +func (m *defaultRadioService) UpdateChannel(ctx context.Context, in *UpdateChannelReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.UpdateChannel(ctx, in, opts...) } -func (m *defaultRadioService) DeleteChannel(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) { +func (m *defaultRadioService) DeleteChannel(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.DeleteChannel(ctx, in, opts...) } -func (m *defaultRadioService) GetChannelList(ctx context.Context, in *GetChannelListReq, opts ...grpc.CallOption) (*GetChannelListResp, error) { +func (m *defaultRadioService) GetChannelList(ctx context.Context, in *ChannelListReq, opts ...grpc.CallOption) (*ChannelListResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetChannelList(ctx, in, opts...) } -func (m *defaultRadioService) GetChannelDetail(ctx context.Context, in *GetChannelDetailReq, opts ...grpc.CallOption) (*GetChannelDetailResp, error) { +func (m *defaultRadioService) GetChannelDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ChannelInfo, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetChannelDetail(ctx, in, opts...) } // 节目 -func (m *defaultRadioService) CreateProgram(ctx context.Context, in *CreateProgramReq, opts ...grpc.CallOption) (*CreateProgramResp, error) { +func (m *defaultRadioService) CreateProgram(ctx context.Context, in *CreateProgramReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.CreateProgram(ctx, in, opts...) } -func (m *defaultRadioService) UpdateProgram(ctx context.Context, in *UpdateProgramReq, opts ...grpc.CallOption) (*UpdateProgramResp, error) { +func (m *defaultRadioService) UpdateProgram(ctx context.Context, in *UpdateProgramReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.UpdateProgram(ctx, in, opts...) } -func (m *defaultRadioService) DeleteProgram(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) { +func (m *defaultRadioService) DeleteProgram(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.DeleteProgram(ctx, in, opts...) } -func (m *defaultRadioService) GetProgramList(ctx context.Context, in *GetProgramListReq, opts ...grpc.CallOption) (*GetProgramListResp, error) { +func (m *defaultRadioService) GetProgramList(ctx context.Context, in *ProgramListReq, opts ...grpc.CallOption) (*ProgramListResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetProgramList(ctx, in, opts...) } -func (m *defaultRadioService) GetProgramDetail(ctx context.Context, in *GetProgramDetailReq, opts ...grpc.CallOption) (*GetProgramDetailResp, error) { +func (m *defaultRadioService) GetProgramDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ProgramInfo, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetProgramDetail(ctx, in, opts...) } // 音色 -func (m *defaultRadioService) CreateVoice(ctx context.Context, in *CreateVoiceReq, opts ...grpc.CallOption) (*CreateVoiceResp, error) { +func (m *defaultRadioService) CreateVoice(ctx context.Context, in *CreateVoiceReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.CreateVoice(ctx, in, opts...) } -func (m *defaultRadioService) UpdateVoice(ctx context.Context, in *UpdateVoiceReq, opts ...grpc.CallOption) (*UpdateVoiceResp, error) { +func (m *defaultRadioService) UpdateVoice(ctx context.Context, in *UpdateVoiceReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.UpdateVoice(ctx, in, opts...) } -func (m *defaultRadioService) DeleteVoice(ctx context.Context, in *DeleteByIdsReq, opts ...grpc.CallOption) (*DeleteResp, error) { +func (m *defaultRadioService) DeleteVoice(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.DeleteVoice(ctx, in, opts...) } -func (m *defaultRadioService) GetVoiceList(ctx context.Context, in *GetVoiceListReq, opts ...grpc.CallOption) (*GetVoiceListResp, error) { +func (m *defaultRadioService) GetVoiceList(ctx context.Context, in *VoiceListReq, opts ...grpc.CallOption) (*VoiceListResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetVoiceList(ctx, in, opts...) } // 互动 -func (m *defaultRadioService) ToggleLike(ctx context.Context, in *ToggleLikeReq, opts ...grpc.CallOption) (*ToggleLikeResp, error) { +func (m *defaultRadioService) ToggleLike(ctx context.Context, in *ToggleLikeReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.ToggleLike(ctx, in, opts...) } -func (m *defaultRadioService) ToggleFavorite(ctx context.Context, in *ToggleFavoriteReq, opts ...grpc.CallOption) (*ToggleFavoriteResp, error) { +func (m *defaultRadioService) ToggleFavorite(ctx context.Context, in *ToggleFavoriteReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.ToggleFavorite(ctx, in, opts...) } -func (m *defaultRadioService) CommentProgram(ctx context.Context, in *CommentReq, opts ...grpc.CallOption) (*CommentResp, error) { +func (m *defaultRadioService) CommentProgram(ctx context.Context, in *CommentReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.CommentProgram(ctx, in, opts...) } -func (m *defaultRadioService) RecordHistory(ctx context.Context, in *RecordHistoryReq, opts ...grpc.CallOption) (*RecordHistoryResp, error) { +func (m *defaultRadioService) RecordHistory(ctx context.Context, in *RecordHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.RecordHistory(ctx, in, opts...) } -func (m *defaultRadioService) GetHistoryList(ctx context.Context, in *GetHistoryListReq, opts ...grpc.CallOption) (*GetHistoryListResp, error) { - client := radio.NewRadioServiceClient(m.cli.Conn()) - return client.GetHistoryList(ctx, in, opts...) -} - -func (m *defaultRadioService) GetFavoriteList(ctx context.Context, in *GetFavoriteListReq, opts ...grpc.CallOption) (*GetFavoriteListResp, error) { +func (m *defaultRadioService) GetFavoriteList(ctx context.Context, in *InteractionListReq, opts ...grpc.CallOption) (*FavoriteListResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetFavoriteList(ctx, in, opts...) } -// 订阅 -func (m *defaultRadioService) GetMySubscriptions(ctx context.Context, in *GetMySubscriptionsReq, opts ...grpc.CallOption) (*GetMySubscriptionsResp, error) { +func (m *defaultRadioService) GetHistoryList(ctx context.Context, in *InteractionListReq, opts ...grpc.CallOption) (*HistoryListResp, error) { + client := radio.NewRadioServiceClient(m.cli.Conn()) + return client.GetHistoryList(ctx, in, opts...) +} + +// 订阅/VIP +func (m *defaultRadioService) GetMySubscriptions(ctx context.Context, in *SubscriptionListReq, opts ...grpc.CallOption) (*SubscriptionListResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetMySubscriptions(ctx, in, opts...) } @@ -268,13 +255,28 @@ func (m *defaultRadioService) CreatePayOrder(ctx context.Context, in *CreatePayO return client.CreatePayOrder(ctx, in, opts...) } -// VIP -func (m *defaultRadioService) GetVipConfigList(ctx context.Context, in *GetVipConfigListReq, opts ...grpc.CallOption) (*GetVipConfigListResp, error) { +func (m *defaultRadioService) GetVipConfigList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*VipConfigListResp, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetVipConfigList(ctx, in, opts...) } -func (m *defaultRadioService) GetMyVipInfo(ctx context.Context, in *GetMyVipInfoReq, opts ...grpc.CallOption) (*GetMyVipInfoResp, error) { +func (m *defaultRadioService) GetMyVipInfo(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*RadioUserProfile, error) { client := radio.NewRadioServiceClient(m.cli.Conn()) return client.GetMyVipInfo(ctx, in, opts...) } + +// 数据分析 +func (m *defaultRadioService) GetAnalyticsOverview(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*AnalyticsOverviewResp, error) { + client := radio.NewRadioServiceClient(m.cli.Conn()) + return client.GetAnalyticsOverview(ctx, in, opts...) +} + +func (m *defaultRadioService) GetChannelAnalytics(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*ChannelAnalyticsResp, error) { + client := radio.NewRadioServiceClient(m.cli.Conn()) + return client.GetChannelAnalytics(ctx, in, opts...) +} + +func (m *defaultRadioService) GetUserAnalytics(ctx context.Context, in *AnalyticsReq, opts ...grpc.CallOption) (*UserAnalyticsResp, error) { + client := radio.NewRadioServiceClient(m.cli.Conn()) + return client.GetUserAnalytics(ctx, in, opts...) +} diff --git a/app/system/api/etc/system-api.yaml b/app/system/api/etc/system-api.yaml index 081150a..96caf63 100644 --- a/app/system/api/etc/system-api.yaml +++ b/app/system/api/etc/system-api.yaml @@ -1,15 +1,14 @@ Name: system-api + +Log: + Encoding: plain Host: 0.0.0.0 Port: 9003 Auth: - AccessSecret: 9149f2eb-d517-4a50-a03a-231dbcf0d872 - AccessExpire: 7200 + AccessSecret: sundynix-jwt-secret-2024 + AccessExpire: 604800 -DB: - DataSource: root:root@tcp(192.168.100.127:3307)/sundynix_micro_go?charset=utf8mb4&parseTime=True&loc=Local - -# system-rpc 服务配置 SystemRpc: Etcd: Hosts: diff --git a/app/system/api/internal/config/config.go b/app/system/api/internal/config/config.go index f6f84c4..3ecfadc 100644 --- a/app/system/api/internal/config/config.go +++ b/app/system/api/internal/config/config.go @@ -15,7 +15,4 @@ type Config struct { AccessExpire int64 } SystemRpc zrpc.RpcClientConf - DB struct { - DataSource string - } } diff --git a/app/system/api/internal/logic/client/createClientLogic.go b/app/system/api/internal/logic/client/createClientLogic.go index 9155694..09b52af 100644 --- a/app/system/api/internal/logic/client/createClientLogic.go +++ b/app/system/api/internal/logic/client/createClientLogic.go @@ -1,17 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. -// goctl 1.10.1 - package client import ( "context" - "fmt" - + "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" - - "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/system/rpc/system" ) type CreateClientLogic struct { @@ -21,24 +15,13 @@ type CreateClientLogic struct { } func NewCreateClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateClientLogic { - return &CreateClientLogic{ - Logger: logx.WithContext(ctx), - ctx: ctx, - svcCtx: svcCtx, - } + return &CreateClientLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } func (l *CreateClientLogic) CreateClient(req *types.ClientReq) error { - client := sysModel.SundynixClient{ - ClientID: req.ClientId, - Name: req.Name, - GrantType: req.GrantType, - AdditionalInfo: req.AdditionalInfo, - ActiveTimeout: req.ActiveTimeout, - } - if err := l.svcCtx.DB.Create(&client).Error; err != nil { - l.Errorf("创建客户端失败: %v", err) - return fmt.Errorf("创建客户端失败") - } - return nil + _, err := l.svcCtx.SystemRpc.CreateClient(l.ctx, &system.ClientReq{ + ClientId: req.ClientId, Name: req.Name, GrantType: req.GrantType, + AdditionalInfo: req.AdditionalInfo, ActiveTimeout: req.ActiveTimeout, + }) + return err } diff --git a/app/system/api/internal/logic/client/deleteClientLogic.go b/app/system/api/internal/logic/client/deleteClientLogic.go index 8dcd245..4a1ec6d 100644 --- a/app/system/api/internal/logic/client/deleteClientLogic.go +++ b/app/system/api/internal/logic/client/deleteClientLogic.go @@ -1,17 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. -// goctl 1.10.1 - package client import ( "context" - "fmt" - + "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" - - "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/system/rpc/system" ) type DeleteClientLogic struct { @@ -21,17 +15,10 @@ type DeleteClientLogic struct { } func NewDeleteClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteClientLogic { - return &DeleteClientLogic{ - Logger: logx.WithContext(ctx), - ctx: ctx, - svcCtx: svcCtx, - } + return &DeleteClientLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } func (l *DeleteClientLogic) DeleteClient(req *types.IdsReq) error { - if err := l.svcCtx.DB.Where("id IN ?", req.Ids).Delete(&sysModel.SundynixClient{}).Error; err != nil { - l.Errorf("删除客户端失败: %v", err) - return fmt.Errorf("删除客户端失败") - } - return nil + _, err := l.svcCtx.SystemRpc.DeleteClient(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err } diff --git a/app/system/api/internal/logic/client/getClientListLogic.go b/app/system/api/internal/logic/client/getClientListLogic.go index bdf0feb..7876232 100644 --- a/app/system/api/internal/logic/client/getClientListLogic.go +++ b/app/system/api/internal/logic/client/getClientListLogic.go @@ -1,17 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. -// goctl 1.10.1 - package client import ( "context" - "fmt" - + "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" - - "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/system/rpc/system" ) type GetClientListLogic struct { @@ -21,46 +15,15 @@ type GetClientListLogic struct { } func NewGetClientListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetClientListLogic { - return &GetClientListLogic{ - Logger: logx.WithContext(ctx), - ctx: ctx, - svcCtx: svcCtx, - } + return &GetClientListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } -func (l *GetClientListLogic) GetClientList(req *types.ClientListReq) (resp interface{}, err error) { - var clients []sysModel.SundynixClient - var total int64 - - db := l.svcCtx.DB.Model(&sysModel.SundynixClient{}) - if req.Name != "" { - db = db.Where("name LIKE ?", "%"+req.Name+"%") +func (l *GetClientListLogic) GetClientList(req *types.ClientListReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetClientList(l.ctx, &system.ClientListReq{ + Current: int32(req.Current), PageSize: int32(req.PageSize), Name: req.Name, + }) + if err != nil { + return nil, err } - - if err := db.Count(&total).Error; err != nil { - l.Errorf("查询客户端总数失败: %v", err) - return nil, fmt.Errorf("查询失败") - } - - current := req.Current - pageSize := req.PageSize - if current <= 0 { - current = 1 - } - if pageSize <= 0 { - pageSize = 10 - } - - offset := (current - 1) * pageSize - if err := db.Offset(offset).Limit(pageSize).Find(&clients).Error; err != nil { - l.Errorf("查询客户端列表失败: %v", err) - return nil, fmt.Errorf("查询失败") - } - - return map[string]interface{}{ - "list": clients, - "total": total, - "current": current, - "size": pageSize, - }, nil + return map[string]interface{}{"list": resp.List, "total": resp.Total, "current": req.Current, "size": req.PageSize}, nil } diff --git a/app/system/api/internal/logic/client/updateClientLogic.go b/app/system/api/internal/logic/client/updateClientLogic.go index 5159531..a462fa4 100644 --- a/app/system/api/internal/logic/client/updateClientLogic.go +++ b/app/system/api/internal/logic/client/updateClientLogic.go @@ -1,17 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. -// goctl 1.10.1 - package client import ( "context" - "fmt" - + "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" - - "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/system/rpc/system" ) type UpdateClientLogic struct { @@ -21,34 +15,13 @@ type UpdateClientLogic struct { } func NewUpdateClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateClientLogic { - return &UpdateClientLogic{ - Logger: logx.WithContext(ctx), - ctx: ctx, - svcCtx: svcCtx, - } + return &UpdateClientLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } func (l *UpdateClientLogic) UpdateClient(req *types.ClientUpdateReq) error { - updates := map[string]interface{}{} - if req.ClientId != "" { - updates["client_id"] = req.ClientId - } - if req.Name != "" { - updates["name"] = req.Name - } - if req.GrantType != "" { - updates["grant_type"] = req.GrantType - } - if req.AdditionalInfo != "" { - updates["additional_info"] = req.AdditionalInfo - } - if req.ActiveTimeout > 0 { - updates["active_timeout"] = req.ActiveTimeout - } - - if err := l.svcCtx.DB.Model(&sysModel.SundynixClient{}).Where("id = ?", req.Id).Updates(updates).Error; err != nil { - l.Errorf("更新客户端失败: %v", err) - return fmt.Errorf("更新客户端失败") - } - return nil + _, err := l.svcCtx.SystemRpc.UpdateClient(l.ctx, &system.ClientUpdateReq{ + Id: req.Id, ClientId: req.ClientId, Name: req.Name, GrantType: req.GrantType, + AdditionalInfo: req.AdditionalInfo, ActiveTimeout: req.ActiveTimeout, + }) + return err } diff --git a/app/system/api/internal/logic/dict/createDictLogic.go b/app/system/api/internal/logic/dict/createDictLogic.go index 5307ec4..a3cb419 100644 --- a/app/system/api/internal/logic/dict/createDictLogic.go +++ b/app/system/api/internal/logic/dict/createDictLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package dict import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type CreateDictLogic struct { @@ -21,9 +19,8 @@ func NewCreateDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create } func (l *CreateDictLogic) CreateDict(req *types.DictReq) error { - dict := sysModel.SundynixDict{Type: req.Type, Label: req.Label, Value: req.Value, Sort: req.Sort, Desc: req.Desc} - if err := l.svcCtx.DB.Create(&dict).Error; err != nil { - return fmt.Errorf("创建字典失败") - } - return nil + _, err := l.svcCtx.SystemRpc.CreateDict(l.ctx, &system.DictReq{ + Type: req.Type, Label: req.Label, Value: req.Value, Sort: int32(req.Sort), Desc: req.Desc, + }) + return err } diff --git a/app/system/api/internal/logic/dict/deleteDictLogic.go b/app/system/api/internal/logic/dict/deleteDictLogic.go index 675908b..377a19a 100644 --- a/app/system/api/internal/logic/dict/deleteDictLogic.go +++ b/app/system/api/internal/logic/dict/deleteDictLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package dict import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type DeleteDictLogic struct { @@ -21,8 +19,6 @@ func NewDeleteDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delete } func (l *DeleteDictLogic) DeleteDict(req *types.IdsReq) error { - if err := l.svcCtx.DB.Where("id IN ?", req.Ids).Delete(&sysModel.SundynixDict{}).Error; err != nil { - return fmt.Errorf("删除字典失败") - } - return nil + _, err := l.svcCtx.SystemRpc.DeleteDict(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err } diff --git a/app/system/api/internal/logic/dict/getDictListLogic.go b/app/system/api/internal/logic/dict/getDictListLogic.go index b13074c..eb3888e 100644 --- a/app/system/api/internal/logic/dict/getDictListLogic.go +++ b/app/system/api/internal/logic/dict/getDictListLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package dict import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type GetDictListLogic struct { @@ -20,23 +18,12 @@ func NewGetDictListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDi return &GetDictListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } -func (l *GetDictListLogic) GetDictList(req *types.DictListReq) (resp interface{}, err error) { - var dicts []sysModel.SundynixDict - var total int64 - db := l.svcCtx.DB.Model(&sysModel.SundynixDict{}) - if req.Type != "" { - db = db.Where("type = ?", req.Type) +func (l *GetDictListLogic) GetDictList(req *types.DictListReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetDictList(l.ctx, &system.DictListReq{ + Current: int32(req.Current), PageSize: int32(req.PageSize), Type: req.Type, + }) + if err != nil { + return nil, err } - db.Count(&total) - current, pageSize := req.Current, req.PageSize - if current <= 0 { - current = 1 - } - if pageSize <= 0 { - pageSize = 10 - } - if err := db.Offset((current - 1) * pageSize).Limit(pageSize).Order("sort").Find(&dicts).Error; err != nil { - return nil, fmt.Errorf("查询字典列表失败") - } - return map[string]interface{}{"list": dicts, "total": total, "current": current, "size": pageSize}, nil + return map[string]interface{}{"list": resp.List, "total": resp.Total}, nil } diff --git a/app/system/api/internal/logic/dict/updateDictLogic.go b/app/system/api/internal/logic/dict/updateDictLogic.go index 6eb20e6..7eca66a 100644 --- a/app/system/api/internal/logic/dict/updateDictLogic.go +++ b/app/system/api/internal/logic/dict/updateDictLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package dict import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type UpdateDictLogic struct { @@ -21,26 +19,8 @@ func NewUpdateDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Update } func (l *UpdateDictLogic) UpdateDict(req *types.DictUpdateReq) error { - updates := map[string]interface{}{} - if req.Type != "" { - updates["type"] = req.Type - } - if req.Label != "" { - updates["label"] = req.Label - } - if req.Value != "" { - updates["value"] = req.Value - } - if req.Sort > 0 { - updates["sort"] = req.Sort - } - if req.Desc != "" { - updates["desc"] = req.Desc - } - if len(updates) > 0 { - if err := l.svcCtx.DB.Model(&sysModel.SundynixDict{}).Where("id = ?", req.Id).Updates(updates).Error; err != nil { - return fmt.Errorf("更新字典失败") - } - } - return nil + _, err := l.svcCtx.SystemRpc.UpdateDict(l.ctx, &system.DictUpdateReq{ + Id: req.Id, Type: req.Type, Label: req.Label, Value: req.Value, Sort: int32(req.Sort), Desc: req.Desc, + }) + return err } diff --git a/app/system/api/internal/logic/menu/createMenuLogic.go b/app/system/api/internal/logic/menu/createMenuLogic.go index d2be937..757f9f5 100644 --- a/app/system/api/internal/logic/menu/createMenuLogic.go +++ b/app/system/api/internal/logic/menu/createMenuLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package menu import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type CreateMenuLogic struct { @@ -21,16 +19,10 @@ func NewCreateMenuLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create } func (l *CreateMenuLogic) CreateMenu(req *types.MenuReq) error { - menu := sysModel.SundynixMenu{ - ParentID: req.ParentId, Category: req.Category, Name: req.Name, Title: req.Title, + _, err := l.svcCtx.SystemRpc.CreateMenu(l.ctx, &system.MenuReq{ + ParentId: req.ParentId, Category: int32(req.Category), Name: req.Name, Title: req.Title, Code: req.Code, Path: req.Path, Permission: req.Permission, Locale: req.Locale, - Icon: req.Icon, Sort: req.Sort, - } - if menu.ParentID == "" { - menu.ParentID = "0" - } - if err := l.svcCtx.DB.Create(&menu).Error; err != nil { - return fmt.Errorf("创建菜单失败") - } - return nil + Icon: req.Icon, Sort: int32(req.Sort), + }) + return err } diff --git a/app/system/api/internal/logic/menu/deleteMenuLogic.go b/app/system/api/internal/logic/menu/deleteMenuLogic.go index 309caa4..2c5e972 100644 --- a/app/system/api/internal/logic/menu/deleteMenuLogic.go +++ b/app/system/api/internal/logic/menu/deleteMenuLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package menu import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type DeleteMenuLogic struct { @@ -21,8 +19,6 @@ func NewDeleteMenuLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delete } func (l *DeleteMenuLogic) DeleteMenu(req *types.IdsReq) error { - if err := l.svcCtx.DB.Where("id IN ?", req.Ids).Delete(&sysModel.SundynixMenu{}).Error; err != nil { - return fmt.Errorf("删除菜单失败") - } - return nil + _, err := l.svcCtx.SystemRpc.DeleteMenu(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err } diff --git a/app/system/api/internal/logic/menu/getMenuByRoleLogic.go b/app/system/api/internal/logic/menu/getMenuByRoleLogic.go index d4cd0e8..cee24e8 100644 --- a/app/system/api/internal/logic/menu/getMenuByRoleLogic.go +++ b/app/system/api/internal/logic/menu/getMenuByRoleLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package menu import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type GetMenuByRoleLogic struct { @@ -20,10 +18,10 @@ func NewGetMenuByRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Get return &GetMenuByRoleLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } -func (l *GetMenuByRoleLogic) GetMenuByRole(req *types.IdReq) (resp interface{}, err error) { - var role sysModel.SundynixRole - if err := l.svcCtx.DB.Preload("Menus").Where("id = ?", req.Id).First(&role).Error; err != nil { - return nil, fmt.Errorf("查询角色菜单失败") +func (l *GetMenuByRoleLogic) GetMenuByRole(req *types.IdReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetMenusByRoleId(l.ctx, &system.GetMenusByRoleIdReq{RoleId: req.Id}) + if err != nil { + return nil, err } - return role.Menus, nil + return resp.Menus, nil } diff --git a/app/system/api/internal/logic/menu/getMenuListLogic.go b/app/system/api/internal/logic/menu/getMenuListLogic.go index c8ca0e2..d661a0e 100644 --- a/app/system/api/internal/logic/menu/getMenuListLogic.go +++ b/app/system/api/internal/logic/menu/getMenuListLogic.go @@ -1,12 +1,10 @@ -// Code scaffolded by goctl. Safe to edit. package menu import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type GetMenuListLogic struct { @@ -19,26 +17,10 @@ func NewGetMenuListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMe return &GetMenuListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } -func (l *GetMenuListLogic) GetMenuList() (resp interface{}, err error) { - var menus []sysModel.SundynixMenu - if err := l.svcCtx.DB.Order("sort").Find(&menus).Error; err != nil { - return nil, fmt.Errorf("查询菜单列表失败") +func (l *GetMenuListLogic) GetMenuList() (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetMenuList(l.ctx, &system.IdReq{}) + if err != nil { + return nil, err } - // 构建树形结构 - menuMap := make(map[string]*sysModel.SundynixMenu) - for i := range menus { - menus[i].Children = []*sysModel.SundynixMenu{} - menuMap[menus[i].ID] = &menus[i] - } - var tree []*sysModel.SundynixMenu - for _, m := range menuMap { - if m.ParentID == "0" || m.ParentID == "" { - tree = append(tree, m) - } else if parent, ok := menuMap[m.ParentID]; ok { - parent.Children = append(parent.Children, m) - } else { - tree = append(tree, m) - } - } - return tree, nil + return resp.Menus, nil } diff --git a/app/system/api/internal/logic/menu/updateMenuLogic.go b/app/system/api/internal/logic/menu/updateMenuLogic.go index 0a1d3bd..75f56da 100644 --- a/app/system/api/internal/logic/menu/updateMenuLogic.go +++ b/app/system/api/internal/logic/menu/updateMenuLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package menu import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type UpdateMenuLogic struct { @@ -21,41 +19,10 @@ func NewUpdateMenuLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Update } func (l *UpdateMenuLogic) UpdateMenu(req *types.MenuUpdateReq) error { - updates := map[string]interface{}{} - if req.ParentId != "" { - updates["parent_id"] = req.ParentId - } - if req.Name != "" { - updates["name"] = req.Name - } - if req.Title != "" { - updates["title"] = req.Title - } - if req.Code != "" { - updates["code"] = req.Code - } - if req.Path != "" { - updates["path"] = req.Path - } - if req.Permission != "" { - updates["permission"] = req.Permission - } - if req.Locale != "" { - updates["locale"] = req.Locale - } - if req.Icon != "" { - updates["icon"] = req.Icon - } - if req.Sort > 0 { - updates["sort"] = req.Sort - } - if req.Category > 0 { - updates["category"] = req.Category - } - if len(updates) > 0 { - if err := l.svcCtx.DB.Model(&sysModel.SundynixMenu{}).Where("id = ?", req.Id).Updates(updates).Error; err != nil { - return fmt.Errorf("更新菜单失败") - } - } - return nil + _, err := l.svcCtx.SystemRpc.UpdateMenu(l.ctx, &system.MenuUpdateReq{ + Id: req.Id, ParentId: req.ParentId, Category: int32(req.Category), Name: req.Name, Title: req.Title, + Code: req.Code, Path: req.Path, Permission: req.Permission, Locale: req.Locale, + Icon: req.Icon, Sort: int32(req.Sort), + }) + return err } diff --git a/app/system/api/internal/logic/operationRecord/deleteOperationRecordLogic.go b/app/system/api/internal/logic/operationRecord/deleteOperationRecordLogic.go index 0cb1b09..e0cc2cc 100644 --- a/app/system/api/internal/logic/operationRecord/deleteOperationRecordLogic.go +++ b/app/system/api/internal/logic/operationRecord/deleteOperationRecordLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package operationRecord import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type DeleteOperationRecordLogic struct { @@ -21,8 +19,6 @@ func NewDeleteOperationRecordLogic(ctx context.Context, svcCtx *svc.ServiceConte } func (l *DeleteOperationRecordLogic) DeleteOperationRecord(req *types.IdsReq) error { - if err := l.svcCtx.DB.Where("id IN ?", req.Ids).Delete(&sysModel.SundynixOperationRecord{}).Error; err != nil { - return fmt.Errorf("删除操作日志失败") - } - return nil + _, err := l.svcCtx.SystemRpc.DeleteOperationRecord(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err } diff --git a/app/system/api/internal/logic/operationRecord/getOperationRecordListLogic.go b/app/system/api/internal/logic/operationRecord/getOperationRecordListLogic.go index 305a809..50dab03 100644 --- a/app/system/api/internal/logic/operationRecord/getOperationRecordListLogic.go +++ b/app/system/api/internal/logic/operationRecord/getOperationRecordListLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package operationRecord import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type GetOperationRecordListLogic struct { @@ -20,29 +18,13 @@ func NewGetOperationRecordListLogic(ctx context.Context, svcCtx *svc.ServiceCont return &GetOperationRecordListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } -func (l *GetOperationRecordListLogic) GetOperationRecordList(req *types.OperationRecordListReq) (resp interface{}, err error) { - var records []sysModel.SundynixOperationRecord - var total int64 - db := l.svcCtx.DB.Model(&sysModel.SundynixOperationRecord{}) - if req.Method != "" { - db = db.Where("method = ?", req.Method) +func (l *GetOperationRecordListLogic) GetOperationRecordList(req *types.OperationRecordListReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetOperationRecordList(l.ctx, &system.OperationRecordListReq{ + Current: int32(req.Current), PageSize: int32(req.PageSize), + Method: req.Method, Path: req.Path, Status: int32(req.Status), + }) + if err != nil { + return nil, err } - if req.Path != "" { - db = db.Where("path LIKE ?", "%"+req.Path+"%") - } - if req.Status > 0 { - db = db.Where("status = ?", req.Status) - } - db.Count(&total) - current, pageSize := req.Current, req.PageSize - if current <= 0 { - current = 1 - } - if pageSize <= 0 { - pageSize = 10 - } - if err := db.Offset((current - 1) * pageSize).Limit(pageSize).Order("created_at DESC").Find(&records).Error; err != nil { - return nil, fmt.Errorf("查询操作日志失败") - } - return map[string]interface{}{"list": records, "total": total, "current": current, "size": pageSize}, nil + return map[string]interface{}{"list": resp.List, "total": resp.Total}, nil } diff --git a/app/system/api/internal/logic/role/createRoleLogic.go b/app/system/api/internal/logic/role/createRoleLogic.go index 32335e4..018dc84 100644 --- a/app/system/api/internal/logic/role/createRoleLogic.go +++ b/app/system/api/internal/logic/role/createRoleLogic.go @@ -1,17 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. -// goctl 1.10.1 - package role import ( "context" - "fmt" - + "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" - - "github.com/zeromicro/go-zero/core/logx" + "sundynix-micro-go/app/system/rpc/system" ) type CreateRoleLogic struct { @@ -25,15 +19,8 @@ func NewCreateRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create } func (l *CreateRoleLogic) CreateRole(req *types.RoleReq) error { - role := sysModel.SundynixRole{Name: req.Name, Code: req.Code, Sort: req.Sort} - if err := l.svcCtx.DB.Create(&role).Error; err != nil { - return fmt.Errorf("创建角色失败") - } - // 关联菜单 - if len(req.MenuIds) > 0 { - for _, menuID := range req.MenuIds { - l.svcCtx.DB.Create(&sysModel.SundynixRoleMenu{RoleID: role.ID, MenuID: menuID}) - } - } - return nil + _, err := l.svcCtx.SystemRpc.CreateRole(l.ctx, &system.RoleReq{ + Name: req.Name, Code: req.Code, Sort: int32(req.Sort), MenuIds: req.MenuIds, + }) + return err } diff --git a/app/system/api/internal/logic/role/deleteRoleLogic.go b/app/system/api/internal/logic/role/deleteRoleLogic.go index 6f765e9..f960af0 100644 --- a/app/system/api/internal/logic/role/deleteRoleLogic.go +++ b/app/system/api/internal/logic/role/deleteRoleLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package role import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type DeleteRoleLogic struct { @@ -21,10 +19,6 @@ func NewDeleteRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Delete } func (l *DeleteRoleLogic) DeleteRole(req *types.IdsReq) error { - if err := l.svcCtx.DB.Where("id IN ?", req.Ids).Delete(&sysModel.SundynixRole{}).Error; err != nil { - return fmt.Errorf("删除角色失败") - } - // 清理角色菜单关联 - l.svcCtx.DB.Where("role_id IN ?", req.Ids).Delete(&sysModel.SundynixRoleMenu{}) - return nil + _, err := l.svcCtx.SystemRpc.DeleteRole(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err } diff --git a/app/system/api/internal/logic/role/getRoleListLogic.go b/app/system/api/internal/logic/role/getRoleListLogic.go index 2a834b0..bda8966 100644 --- a/app/system/api/internal/logic/role/getRoleListLogic.go +++ b/app/system/api/internal/logic/role/getRoleListLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package role import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type GetRoleListLogic struct { @@ -20,23 +18,12 @@ func NewGetRoleListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRo return &GetRoleListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} } -func (l *GetRoleListLogic) GetRoleList(req *types.RoleListReq) (resp interface{}, err error) { - var roles []sysModel.SundynixRole - var total int64 - db := l.svcCtx.DB.Model(&sysModel.SundynixRole{}) - if req.Name != "" { - db = db.Where("name LIKE ?", "%"+req.Name+"%") +func (l *GetRoleListLogic) GetRoleList(req *types.RoleListReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetRoleList(l.ctx, &system.RoleListReq{ + Current: int32(req.Current), PageSize: int32(req.PageSize), Name: req.Name, + }) + if err != nil { + return nil, err } - db.Count(&total) - current, pageSize := req.Current, req.PageSize - if current <= 0 { - current = 1 - } - if pageSize <= 0 { - pageSize = 10 - } - if err := db.Preload("Menus").Offset((current - 1) * pageSize).Limit(pageSize).Order("sort").Find(&roles).Error; err != nil { - return nil, fmt.Errorf("查询角色列表失败") - } - return map[string]interface{}{"list": roles, "total": total, "current": current, "size": pageSize}, nil + return map[string]interface{}{"list": resp.List, "total": resp.Total}, nil } diff --git a/app/system/api/internal/logic/role/updateRoleLogic.go b/app/system/api/internal/logic/role/updateRoleLogic.go index 210ec13..8b4732d 100644 --- a/app/system/api/internal/logic/role/updateRoleLogic.go +++ b/app/system/api/internal/logic/role/updateRoleLogic.go @@ -1,13 +1,11 @@ -// Code scaffolded by goctl. Safe to edit. package role import ( "context" - "fmt" "github.com/zeromicro/go-zero/core/logx" "sundynix-micro-go/app/system/api/internal/svc" "sundynix-micro-go/app/system/api/internal/types" - sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/system" ) type UpdateRoleLogic struct { @@ -21,27 +19,8 @@ func NewUpdateRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Update } func (l *UpdateRoleLogic) UpdateRole(req *types.RoleUpdateReq) error { - updates := map[string]interface{}{} - if req.Name != "" { - updates["name"] = req.Name - } - if req.Code != "" { - updates["code"] = req.Code - } - if req.Sort > 0 { - updates["sort"] = req.Sort - } - if len(updates) > 0 { - if err := l.svcCtx.DB.Model(&sysModel.SundynixRole{}).Where("id = ?", req.Id).Updates(updates).Error; err != nil { - return fmt.Errorf("更新角色失败") - } - } - // 更新菜单关联 - if len(req.MenuIds) > 0 { - l.svcCtx.DB.Where("role_id = ?", req.Id).Delete(&sysModel.SundynixRoleMenu{}) - for _, menuID := range req.MenuIds { - l.svcCtx.DB.Create(&sysModel.SundynixRoleMenu{RoleID: req.Id, MenuID: menuID}) - } - } - return nil + _, err := l.svcCtx.SystemRpc.UpdateRole(l.ctx, &system.RoleUpdateReq{ + Id: req.Id, Name: req.Name, Code: req.Code, Sort: int32(req.Sort), MenuIds: req.MenuIds, + }) + return err } diff --git a/app/system/api/internal/svc/serviceContext.go b/app/system/api/internal/svc/serviceContext.go index 6cc2d5d..5ba295a 100644 --- a/app/system/api/internal/svc/serviceContext.go +++ b/app/system/api/internal/svc/serviceContext.go @@ -5,26 +5,19 @@ package svc import ( "sundynix-micro-go/app/system/api/internal/config" + "sundynix-micro-go/app/system/rpc/systemservice" - "github.com/zeromicro/go-zero/core/logx" - "gorm.io/driver/mysql" - "gorm.io/gorm" + "github.com/zeromicro/go-zero/zrpc" ) type ServiceContext struct { - Config config.Config - DB *gorm.DB + Config config.Config + SystemRpc systemservice.SystemService } func NewServiceContext(c config.Config) *ServiceContext { - db, err := gorm.Open(mysql.Open(c.DB.DataSource), &gorm.Config{}) - if err != nil { - logx.Errorf("连接数据库失败: %v", err) - panic(err) - } - return &ServiceContext{ - Config: c, - DB: db, + Config: c, + SystemRpc: systemservice.NewSystemService(zrpc.MustNewClient(c.SystemRpc)), } } diff --git a/app/system/rpc/etc/system.yaml b/app/system/rpc/etc/system.yaml index 61d78e0..e76f2dc 100644 --- a/app/system/rpc/etc/system.yaml +++ b/app/system/rpc/etc/system.yaml @@ -1,4 +1,7 @@ Name: system.rpc + +Log: + Encoding: plain ListenOn: 0.0.0.0:9103 Etcd: Hosts: diff --git a/app/system/rpc/internal/logic/createClientLogic.go b/app/system/rpc/internal/logic/createClientLogic.go new file mode 100644 index 0000000..a7c6cb4 --- /dev/null +++ b/app/system/rpc/internal/logic/createClientLogic.go @@ -0,0 +1,33 @@ +package logic + +import ( + "context" + "fmt" + + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateClientLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCreateClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateClientLogic { + return &CreateClientLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *CreateClientLogic) CreateClient(in *system.ClientReq) (*system.CommonResp, error) { + client := sysModel.SundynixClient{ + ClientID: in.ClientId, Name: in.Name, GrantType: in.GrantType, + AdditionalInfo: in.AdditionalInfo, ActiveTimeout: in.ActiveTimeout, + } + if err := l.svcCtx.DB.Create(&client).Error; err != nil { + return nil, fmt.Errorf("创建客户端失败: %v", err) + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/createDictLogic.go b/app/system/rpc/internal/logic/createDictLogic.go new file mode 100644 index 0000000..fe3a9bd --- /dev/null +++ b/app/system/rpc/internal/logic/createDictLogic.go @@ -0,0 +1,28 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type CreateDictLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCreateDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateDictLogic { + return &CreateDictLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *CreateDictLogic) CreateDict(in *system.DictReq) (*system.CommonResp, error) { + dict := sysModel.SundynixDict{Type: in.Type, Label: in.Label, Value: in.Value, Sort: int(in.Sort), Desc: in.Desc} + if err := l.svcCtx.DB.Create(&dict).Error; err != nil { + return nil, fmt.Errorf("创建字典失败") + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/createMenuLogic.go b/app/system/rpc/internal/logic/createMenuLogic.go new file mode 100644 index 0000000..4606bac --- /dev/null +++ b/app/system/rpc/internal/logic/createMenuLogic.go @@ -0,0 +1,32 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type CreateMenuLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCreateMenuLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateMenuLogic { + return &CreateMenuLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *CreateMenuLogic) CreateMenu(in *system.MenuReq) (*system.CommonResp, error) { + menu := sysModel.SundynixMenu{ + ParentID: in.ParentId, Category: int(in.Category), Name: in.Name, Title: in.Title, + Code: in.Code, Path: in.Path, Permission: in.Permission, Locale: in.Locale, + Icon: in.Icon, Sort: int(in.Sort), + } + if err := l.svcCtx.DB.Create(&menu).Error; err != nil { + return nil, fmt.Errorf("创建菜单失败") + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/createRoleLogic.go b/app/system/rpc/internal/logic/createRoleLogic.go new file mode 100644 index 0000000..b7214e7 --- /dev/null +++ b/app/system/rpc/internal/logic/createRoleLogic.go @@ -0,0 +1,34 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type CreateRoleLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCreateRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateRoleLogic { + return &CreateRoleLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *CreateRoleLogic) CreateRole(in *system.RoleReq) (*system.CommonResp, error) { + role := sysModel.SundynixRole{Name: in.Name, Code: in.Code, Sort: int(in.Sort)} + if err := l.svcCtx.DB.Create(&role).Error; err != nil { + return nil, fmt.Errorf("创建角色失败") + } + // 关联菜单 + if len(in.MenuIds) > 0 { + for _, mid := range in.MenuIds { + l.svcCtx.DB.Create(&sysModel.SundynixRoleMenu{RoleID: role.ID, MenuID: mid}) + } + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/deleteClientLogic.go b/app/system/rpc/internal/logic/deleteClientLogic.go new file mode 100644 index 0000000..3eaf5da --- /dev/null +++ b/app/system/rpc/internal/logic/deleteClientLogic.go @@ -0,0 +1,27 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type DeleteClientLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteClientLogic { + return &DeleteClientLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteClientLogic) DeleteClient(in *system.IdsReq) (*system.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&sysModel.SundynixClient{}).Error; err != nil { + return nil, fmt.Errorf("删除客户端失败") + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/deleteDictLogic.go b/app/system/rpc/internal/logic/deleteDictLogic.go new file mode 100644 index 0000000..018eac7 --- /dev/null +++ b/app/system/rpc/internal/logic/deleteDictLogic.go @@ -0,0 +1,27 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type DeleteDictLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteDictLogic { + return &DeleteDictLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteDictLogic) DeleteDict(in *system.IdsReq) (*system.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&sysModel.SundynixDict{}).Error; err != nil { + return nil, fmt.Errorf("删除字典失败") + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/deleteMenuLogic.go b/app/system/rpc/internal/logic/deleteMenuLogic.go new file mode 100644 index 0000000..81b9abe --- /dev/null +++ b/app/system/rpc/internal/logic/deleteMenuLogic.go @@ -0,0 +1,28 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type DeleteMenuLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteMenuLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteMenuLogic { + return &DeleteMenuLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteMenuLogic) DeleteMenu(in *system.IdsReq) (*system.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&sysModel.SundynixMenu{}).Error; err != nil { + return nil, fmt.Errorf("删除菜单失败") + } + l.svcCtx.DB.Where("menu_id IN ?", in.Ids).Delete(&sysModel.SundynixRoleMenu{}) + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/deleteOperationRecordLogic.go b/app/system/rpc/internal/logic/deleteOperationRecordLogic.go new file mode 100644 index 0000000..dc8b62a --- /dev/null +++ b/app/system/rpc/internal/logic/deleteOperationRecordLogic.go @@ -0,0 +1,27 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type DeleteOperationRecordLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteOperationRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteOperationRecordLogic { + return &DeleteOperationRecordLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteOperationRecordLogic) DeleteOperationRecord(in *system.IdsReq) (*system.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&sysModel.SundynixOperationRecord{}).Error; err != nil { + return nil, fmt.Errorf("删除操作日志失败") + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/deleteRoleLogic.go b/app/system/rpc/internal/logic/deleteRoleLogic.go new file mode 100644 index 0000000..4a39b0b --- /dev/null +++ b/app/system/rpc/internal/logic/deleteRoleLogic.go @@ -0,0 +1,28 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type DeleteRoleLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewDeleteRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteRoleLogic { + return &DeleteRoleLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *DeleteRoleLogic) DeleteRole(in *system.IdsReq) (*system.CommonResp, error) { + if err := l.svcCtx.DB.Where("id IN ?", in.Ids).Delete(&sysModel.SundynixRole{}).Error; err != nil { + return nil, fmt.Errorf("删除角色失败") + } + l.svcCtx.DB.Where("role_id IN ?", in.Ids).Delete(&sysModel.SundynixRoleMenu{}) + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/getClientListLogic.go b/app/system/rpc/internal/logic/getClientListLogic.go new file mode 100644 index 0000000..64b6dd2 --- /dev/null +++ b/app/system/rpc/internal/logic/getClientListLogic.go @@ -0,0 +1,48 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type GetClientListLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetClientListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetClientListLogic { + return &GetClientListLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetClientListLogic) GetClientList(in *system.ClientListReq) (*system.ClientListResp, error) { + var list []sysModel.SundynixClient + var total int64 + db := l.svcCtx.DB.Model(&sysModel.SundynixClient{}) + if in.Name != "" { + db = db.Where("name LIKE ?", "%"+in.Name+"%") + } + db.Count(&total) + current, pageSize := int(in.Current), int(in.PageSize) + if current <= 0 { + current = 1 + } + if pageSize <= 0 { + pageSize = 10 + } + if err := db.Offset((current - 1) * pageSize).Limit(pageSize).Order("created_at DESC").Find(&list).Error; err != nil { + return nil, fmt.Errorf("查询客户端列表失败") + } + var items []*system.ClientInfo + for _, c := range list { + items = append(items, &system.ClientInfo{ + Id: c.ID, ClientId: c.ClientID, Name: c.Name, GrantType: c.GrantType, + AdditionalInfo: c.AdditionalInfo, ActiveTimeout: int64(c.ActiveTimeout), + }) + } + return &system.ClientListResp{List: items, Total: total}, nil +} diff --git a/app/system/rpc/internal/logic/getDictListLogic.go b/app/system/rpc/internal/logic/getDictListLogic.go new file mode 100644 index 0000000..99d7459 --- /dev/null +++ b/app/system/rpc/internal/logic/getDictListLogic.go @@ -0,0 +1,45 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type GetDictListLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetDictListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDictListLogic { + return &GetDictListLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetDictListLogic) GetDictList(in *system.DictListReq) (*system.DictListResp, error) { + var list []sysModel.SundynixDict + var total int64 + db := l.svcCtx.DB.Model(&sysModel.SundynixDict{}) + if in.Type != "" { + db = db.Where("type = ?", in.Type) + } + db.Count(&total) + current, pageSize := int(in.Current), int(in.PageSize) + if current <= 0 { + current = 1 + } + if pageSize <= 0 { + pageSize = 10 + } + if err := db.Offset((current - 1) * pageSize).Limit(pageSize).Order("sort ASC").Find(&list).Error; err != nil { + return nil, fmt.Errorf("查询字典列表失败") + } + var items []*system.DictInfo + for _, d := range list { + items = append(items, &system.DictInfo{Id: d.ID, Type: d.Type, Label: d.Label, Value: d.Value, Sort: int32(d.Sort), Desc: d.Desc}) + } + return &system.DictListResp{List: items, Total: total}, nil +} diff --git a/app/system/rpc/internal/logic/getMenuListLogic.go b/app/system/rpc/internal/logic/getMenuListLogic.go new file mode 100644 index 0000000..11897c7 --- /dev/null +++ b/app/system/rpc/internal/logic/getMenuListLogic.go @@ -0,0 +1,45 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type GetMenuListLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetMenuListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMenuListLogic { + return &GetMenuListLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetMenuListLogic) GetMenuList(in *system.IdReq) (*system.MenuListResp, error) { + var menus []sysModel.SundynixMenu + if err := l.svcCtx.DB.Order("sort ASC").Find(&menus).Error; err != nil { + return nil, fmt.Errorf("查询菜单列表失败") + } + tree := buildMenuTree(menus, "") + return &system.MenuListResp{Menus: tree}, nil +} + +func buildMenuTree(menus []sysModel.SundynixMenu, parentID string) []*system.MenuInfo { + var result []*system.MenuInfo + for _, m := range menus { + if m.ParentID == parentID { + info := &system.MenuInfo{ + Id: m.ID, ParentId: m.ParentID, Category: int32(m.Category), Name: m.Name, + Title: m.Title, Code: m.Code, Path: m.Path, Permission: m.Permission, + Locale: m.Locale, Icon: m.Icon, Sort: int32(m.Sort), + Children: buildMenuTree(menus, m.ID), + } + result = append(result, info) + } + } + return result +} diff --git a/app/system/rpc/internal/logic/getOperationRecordListLogic.go b/app/system/rpc/internal/logic/getOperationRecordListLogic.go new file mode 100644 index 0000000..669036b --- /dev/null +++ b/app/system/rpc/internal/logic/getOperationRecordListLogic.go @@ -0,0 +1,56 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type GetOperationRecordListLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetOperationRecordListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetOperationRecordListLogic { + return &GetOperationRecordListLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetOperationRecordListLogic) GetOperationRecordList(in *system.OperationRecordListReq) (*system.OperationRecordListResp, error) { + var list []sysModel.SundynixOperationRecord + var total int64 + db := l.svcCtx.DB.Model(&sysModel.SundynixOperationRecord{}) + if in.Method != "" { + db = db.Where("method = ?", in.Method) + } + if in.Path != "" { + db = db.Where("path LIKE ?", "%"+in.Path+"%") + } + if in.Status > 0 { + db = db.Where("status = ?", in.Status) + } + db.Count(&total) + current, pageSize := int(in.Current), int(in.PageSize) + if current <= 0 { + current = 1 + } + if pageSize <= 0 { + pageSize = 10 + } + if err := db.Offset((current - 1) * pageSize).Limit(pageSize).Order("created_at DESC").Find(&list).Error; err != nil { + return nil, fmt.Errorf("查询操作日志失败") + } + var items []*system.OperationRecordInfo + for _, r := range list { + items = append(items, &system.OperationRecordInfo{ + Id: r.ID, Ip: r.IP, Method: r.Method, Path: r.Path, + Status: int32(r.Status), Agent: r.Agent, ErrorMessage: r.ErrorMessage, + Body: r.Body, Resp: r.Resp, UserId: r.UserID, + CreatedAt: r.CreatedAt.Unix(), + }) + } + return &system.OperationRecordListResp{List: items, Total: total}, nil +} diff --git a/app/system/rpc/internal/logic/getRoleListLogic.go b/app/system/rpc/internal/logic/getRoleListLogic.go new file mode 100644 index 0000000..4f81e22 --- /dev/null +++ b/app/system/rpc/internal/logic/getRoleListLogic.go @@ -0,0 +1,45 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type GetRoleListLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetRoleListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRoleListLogic { + return &GetRoleListLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *GetRoleListLogic) GetRoleList(in *system.RoleListReq) (*system.RoleListResp, error) { + var list []sysModel.SundynixRole + var total int64 + db := l.svcCtx.DB.Model(&sysModel.SundynixRole{}) + if in.Name != "" { + db = db.Where("name LIKE ?", "%"+in.Name+"%") + } + db.Count(&total) + current, pageSize := int(in.Current), int(in.PageSize) + if current <= 0 { + current = 1 + } + if pageSize <= 0 { + pageSize = 10 + } + if err := db.Offset((current - 1) * pageSize).Limit(pageSize).Order("sort ASC").Find(&list).Error; err != nil { + return nil, fmt.Errorf("查询角色列表失败") + } + var items []*system.RoleInfo + for _, r := range list { + items = append(items, &system.RoleInfo{Id: r.ID, Name: r.Name, Code: r.Code, Sort: int32(r.Sort)}) + } + return &system.RoleListResp{List: items, Total: total}, nil +} diff --git a/app/system/rpc/internal/logic/updateClientLogic.go b/app/system/rpc/internal/logic/updateClientLogic.go new file mode 100644 index 0000000..821e41b --- /dev/null +++ b/app/system/rpc/internal/logic/updateClientLogic.go @@ -0,0 +1,30 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type UpdateClientLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateClientLogic { + return &UpdateClientLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateClientLogic) UpdateClient(in *system.ClientUpdateReq) (*system.CommonResp, error) { + if err := l.svcCtx.DB.Model(&sysModel.SundynixClient{}).Where("id = ?", in.Id).Updates(map[string]interface{}{ + "client_id": in.ClientId, "name": in.Name, "grant_type": in.GrantType, + "additional_info": in.AdditionalInfo, "active_timeout": in.ActiveTimeout, + }).Error; err != nil { + return nil, fmt.Errorf("更新客户端失败") + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/updateDictLogic.go b/app/system/rpc/internal/logic/updateDictLogic.go new file mode 100644 index 0000000..36c604c --- /dev/null +++ b/app/system/rpc/internal/logic/updateDictLogic.go @@ -0,0 +1,29 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type UpdateDictLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateDictLogic { + return &UpdateDictLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateDictLogic) UpdateDict(in *system.DictUpdateReq) (*system.CommonResp, error) { + if err := l.svcCtx.DB.Model(&sysModel.SundynixDict{}).Where("id = ?", in.Id).Updates(map[string]interface{}{ + "type": in.Type, "label": in.Label, "value": in.Value, "sort": in.Sort, "desc": in.Desc, + }).Error; err != nil { + return nil, fmt.Errorf("更新字典失败") + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/updateMenuLogic.go b/app/system/rpc/internal/logic/updateMenuLogic.go new file mode 100644 index 0000000..b6a92ba --- /dev/null +++ b/app/system/rpc/internal/logic/updateMenuLogic.go @@ -0,0 +1,31 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type UpdateMenuLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateMenuLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateMenuLogic { + return &UpdateMenuLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateMenuLogic) UpdateMenu(in *system.MenuUpdateReq) (*system.CommonResp, error) { + if err := l.svcCtx.DB.Model(&sysModel.SundynixMenu{}).Where("id = ?", in.Id).Updates(map[string]interface{}{ + "parent_id": in.ParentId, "category": in.Category, "name": in.Name, "title": in.Title, + "code": in.Code, "path": in.Path, "permission": in.Permission, "locale": in.Locale, + "icon": in.Icon, "sort": in.Sort, + }).Error; err != nil { + return nil, fmt.Errorf("更新菜单失败") + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/logic/updateRoleLogic.go b/app/system/rpc/internal/logic/updateRoleLogic.go new file mode 100644 index 0000000..671db7c --- /dev/null +++ b/app/system/rpc/internal/logic/updateRoleLogic.go @@ -0,0 +1,34 @@ +package logic + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/logx" + sysModel "sundynix-micro-go/app/system/model" + "sundynix-micro-go/app/system/rpc/internal/svc" + "sundynix-micro-go/app/system/rpc/system" +) + +type UpdateRoleLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateRoleLogic { + return &UpdateRoleLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)} +} + +func (l *UpdateRoleLogic) UpdateRole(in *system.RoleUpdateReq) (*system.CommonResp, error) { + if err := l.svcCtx.DB.Model(&sysModel.SundynixRole{}).Where("id = ?", in.Id).Updates(map[string]interface{}{ + "name": in.Name, "code": in.Code, "sort": in.Sort, + }).Error; err != nil { + return nil, fmt.Errorf("更新角色失败") + } + // 更新菜单关联 + l.svcCtx.DB.Where("role_id = ?", in.Id).Delete(&sysModel.SundynixRoleMenu{}) + for _, mid := range in.MenuIds { + l.svcCtx.DB.Create(&sysModel.SundynixRoleMenu{RoleID: in.Id, MenuID: mid}) + } + return &system.CommonResp{Code: 200, Msg: "success"}, nil +} diff --git a/app/system/rpc/internal/server/systemServiceServer.go b/app/system/rpc/internal/server/systemServiceServer.go index d183580..0664e8e 100644 --- a/app/system/rpc/internal/server/systemServiceServer.go +++ b/app/system/rpc/internal/server/systemServiceServer.go @@ -23,20 +23,112 @@ func NewSystemServiceServer(svcCtx *svc.ServiceContext) *SystemServiceServer { } } -// 获取用户角色列表 +// --- 角色 --- func (s *SystemServiceServer) GetRolesByUserId(ctx context.Context, in *system.GetRolesByUserIdReq) (*system.GetRolesByUserIdResp, error) { l := logic.NewGetRolesByUserIdLogic(ctx, s.svcCtx) return l.GetRolesByUserId(in) } -// 获取角色菜单列表 +func (s *SystemServiceServer) CreateRole(ctx context.Context, in *system.RoleReq) (*system.CommonResp, error) { + l := logic.NewCreateRoleLogic(ctx, s.svcCtx) + return l.CreateRole(in) +} + +func (s *SystemServiceServer) UpdateRole(ctx context.Context, in *system.RoleUpdateReq) (*system.CommonResp, error) { + l := logic.NewUpdateRoleLogic(ctx, s.svcCtx) + return l.UpdateRole(in) +} + +func (s *SystemServiceServer) DeleteRole(ctx context.Context, in *system.IdsReq) (*system.CommonResp, error) { + l := logic.NewDeleteRoleLogic(ctx, s.svcCtx) + return l.DeleteRole(in) +} + +func (s *SystemServiceServer) GetRoleList(ctx context.Context, in *system.RoleListReq) (*system.RoleListResp, error) { + l := logic.NewGetRoleListLogic(ctx, s.svcCtx) + return l.GetRoleList(in) +} + +// --- 菜单 --- func (s *SystemServiceServer) GetMenusByRoleId(ctx context.Context, in *system.GetMenusByRoleIdReq) (*system.GetMenusByRoleIdResp, error) { l := logic.NewGetMenusByRoleIdLogic(ctx, s.svcCtx) return l.GetMenusByRoleId(in) } -// 获取客户端信息 +func (s *SystemServiceServer) CreateMenu(ctx context.Context, in *system.MenuReq) (*system.CommonResp, error) { + l := logic.NewCreateMenuLogic(ctx, s.svcCtx) + return l.CreateMenu(in) +} + +func (s *SystemServiceServer) UpdateMenu(ctx context.Context, in *system.MenuUpdateReq) (*system.CommonResp, error) { + l := logic.NewUpdateMenuLogic(ctx, s.svcCtx) + return l.UpdateMenu(in) +} + +func (s *SystemServiceServer) DeleteMenu(ctx context.Context, in *system.IdsReq) (*system.CommonResp, error) { + l := logic.NewDeleteMenuLogic(ctx, s.svcCtx) + return l.DeleteMenu(in) +} + +func (s *SystemServiceServer) GetMenuList(ctx context.Context, in *system.IdReq) (*system.MenuListResp, error) { + l := logic.NewGetMenuListLogic(ctx, s.svcCtx) + return l.GetMenuList(in) +} + +// --- 客户端 --- func (s *SystemServiceServer) GetClientById(ctx context.Context, in *system.GetClientByIdReq) (*system.GetClientByIdResp, error) { l := logic.NewGetClientByIdLogic(ctx, s.svcCtx) return l.GetClientById(in) } + +func (s *SystemServiceServer) CreateClient(ctx context.Context, in *system.ClientReq) (*system.CommonResp, error) { + l := logic.NewCreateClientLogic(ctx, s.svcCtx) + return l.CreateClient(in) +} + +func (s *SystemServiceServer) UpdateClient(ctx context.Context, in *system.ClientUpdateReq) (*system.CommonResp, error) { + l := logic.NewUpdateClientLogic(ctx, s.svcCtx) + return l.UpdateClient(in) +} + +func (s *SystemServiceServer) DeleteClient(ctx context.Context, in *system.IdsReq) (*system.CommonResp, error) { + l := logic.NewDeleteClientLogic(ctx, s.svcCtx) + return l.DeleteClient(in) +} + +func (s *SystemServiceServer) GetClientList(ctx context.Context, in *system.ClientListReq) (*system.ClientListResp, error) { + l := logic.NewGetClientListLogic(ctx, s.svcCtx) + return l.GetClientList(in) +} + +// --- 字典 --- +func (s *SystemServiceServer) CreateDict(ctx context.Context, in *system.DictReq) (*system.CommonResp, error) { + l := logic.NewCreateDictLogic(ctx, s.svcCtx) + return l.CreateDict(in) +} + +func (s *SystemServiceServer) UpdateDict(ctx context.Context, in *system.DictUpdateReq) (*system.CommonResp, error) { + l := logic.NewUpdateDictLogic(ctx, s.svcCtx) + return l.UpdateDict(in) +} + +func (s *SystemServiceServer) DeleteDict(ctx context.Context, in *system.IdsReq) (*system.CommonResp, error) { + l := logic.NewDeleteDictLogic(ctx, s.svcCtx) + return l.DeleteDict(in) +} + +func (s *SystemServiceServer) GetDictList(ctx context.Context, in *system.DictListReq) (*system.DictListResp, error) { + l := logic.NewGetDictListLogic(ctx, s.svcCtx) + return l.GetDictList(in) +} + +// --- 操作日志 --- +func (s *SystemServiceServer) DeleteOperationRecord(ctx context.Context, in *system.IdsReq) (*system.CommonResp, error) { + l := logic.NewDeleteOperationRecordLogic(ctx, s.svcCtx) + return l.DeleteOperationRecord(in) +} + +func (s *SystemServiceServer) GetOperationRecordList(ctx context.Context, in *system.OperationRecordListReq) (*system.OperationRecordListResp, error) { + l := logic.NewGetOperationRecordListLogic(ctx, s.svcCtx) + return l.GetOperationRecordList(in) +} diff --git a/app/system/rpc/pb/system.proto b/app/system/rpc/pb/system.proto index 18c9c06..93950b7 100644 --- a/app/system/rpc/pb/system.proto +++ b/app/system/rpc/pb/system.proto @@ -4,23 +4,58 @@ package system; option go_package = "./system"; -// ---------- 通用消息 ---------- +// ========== 通用消息 ========== message CommonResp { int64 code = 1; string msg = 2; } -// ---------- 角色信息 ---------- +message IdReq { + string id = 1; +} + +message IdsReq { + repeated string ids = 1; +} + +// ========== 角色 ========== message RoleInfo { string id = 1; string name = 2; string code = 3; int32 sort = 4; + repeated string menuIds = 5; } -// ---------- 菜单信息 ---------- +message RoleReq { + string name = 1; + string code = 2; + int32 sort = 3; + repeated string menuIds = 4; +} + +message RoleUpdateReq { + string id = 1; + string name = 2; + string code = 3; + int32 sort = 4; + repeated string menuIds = 5; +} + +message RoleListReq { + int32 current = 1; + int32 pageSize = 2; + string name = 3; +} + +message RoleListResp { + repeated RoleInfo list = 1; + int64 total = 2; +} + +// ========== 菜单 ========== message MenuInfo { string id = 1; @@ -37,7 +72,38 @@ message MenuInfo { repeated MenuInfo children = 12; } -// ---------- 客户端信息 ---------- +message MenuReq { + string parentId = 1; + int32 category = 2; + string name = 3; + string title = 4; + string code = 5; + string path = 6; + string permission = 7; + string locale = 8; + string icon = 9; + int32 sort = 10; +} + +message MenuUpdateReq { + string id = 1; + string parentId = 2; + int32 category = 3; + string name = 4; + string title = 5; + string code = 6; + string path = 7; + string permission = 8; + string locale = 9; + string icon = 10; + int32 sort = 11; +} + +message MenuListResp { + repeated MenuInfo menus = 1; +} + +// ========== 客户端 ========== message ClientInfo { string id = 1; @@ -48,7 +114,103 @@ message ClientInfo { int64 activeTimeout = 6; } -// ---------- 请求/响应 ---------- +message ClientReq { + string clientId = 1; + string name = 2; + string grantType = 3; + string additionalInfo = 4; + int64 activeTimeout = 5; +} + +message ClientUpdateReq { + string id = 1; + string clientId = 2; + string name = 3; + string grantType = 4; + string additionalInfo = 5; + int64 activeTimeout = 6; +} + +message ClientListReq { + int32 current = 1; + int32 pageSize = 2; + string name = 3; +} + +message ClientListResp { + repeated ClientInfo list = 1; + int64 total = 2; +} + +// ========== 字典 ========== + +message DictInfo { + string id = 1; + string type = 2; + string label = 3; + string value = 4; + int32 sort = 5; + string desc = 6; +} + +message DictReq { + string type = 1; + string label = 2; + string value = 3; + int32 sort = 4; + string desc = 5; +} + +message DictUpdateReq { + string id = 1; + string type = 2; + string label = 3; + string value = 4; + int32 sort = 5; + string desc = 6; +} + +message DictListReq { + int32 current = 1; + int32 pageSize = 2; + string type = 3; +} + +message DictListResp { + repeated DictInfo list = 1; + int64 total = 2; +} + +// ========== 操作日志 ========== + +message OperationRecordInfo { + string id = 1; + string ip = 2; + string method = 3; + string path = 4; + int32 status = 5; + string agent = 6; + string errorMessage = 7; + string body = 8; + string resp = 9; + string userId = 10; + int64 createdAt = 11; +} + +message OperationRecordListReq { + int32 current = 1; + int32 pageSize = 2; + string method = 3; + string path = 4; + int32 status = 5; +} + +message OperationRecordListResp { + repeated OperationRecordInfo list = 1; + int64 total = 2; +} + +// ========== 请求/响应(原有) ========== message GetRolesByUserIdReq { string userId = 1; @@ -74,13 +236,37 @@ message GetClientByIdResp { ClientInfo client = 1; } -// ---------- 服务定义 ---------- +// ========== 服务定义 ========== service SystemService { - // 获取用户角色列表 + // --- 角色 --- rpc GetRolesByUserId(GetRolesByUserIdReq) returns (GetRolesByUserIdResp); - // 获取角色菜单列表 + rpc CreateRole(RoleReq) returns (CommonResp); + rpc UpdateRole(RoleUpdateReq) returns (CommonResp); + rpc DeleteRole(IdsReq) returns (CommonResp); + rpc GetRoleList(RoleListReq) returns (RoleListResp); + + // --- 菜单 --- rpc GetMenusByRoleId(GetMenusByRoleIdReq) returns (GetMenusByRoleIdResp); - // 获取客户端信息 + rpc CreateMenu(MenuReq) returns (CommonResp); + rpc UpdateMenu(MenuUpdateReq) returns (CommonResp); + rpc DeleteMenu(IdsReq) returns (CommonResp); + rpc GetMenuList(IdReq) returns (MenuListResp); // 传空id返回全部树 + + // --- 客户端 --- rpc GetClientById(GetClientByIdReq) returns (GetClientByIdResp); + rpc CreateClient(ClientReq) returns (CommonResp); + rpc UpdateClient(ClientUpdateReq) returns (CommonResp); + rpc DeleteClient(IdsReq) returns (CommonResp); + rpc GetClientList(ClientListReq) returns (ClientListResp); + + // --- 字典 --- + rpc CreateDict(DictReq) returns (CommonResp); + rpc UpdateDict(DictUpdateReq) returns (CommonResp); + rpc DeleteDict(IdsReq) returns (CommonResp); + rpc GetDictList(DictListReq) returns (DictListResp); + + // --- 操作日志 --- + rpc DeleteOperationRecord(IdsReq) returns (CommonResp); + rpc GetOperationRecordList(OperationRecordListReq) returns (OperationRecordListResp); } diff --git a/app/system/rpc/system/system.pb.go b/app/system/rpc/system/system.pb.go index 5edb908..e88b66e 100644 --- a/app/system/rpc/system/system.pb.go +++ b/app/system/rpc/system/system.pb.go @@ -73,19 +73,108 @@ func (x *CommonResp) GetMsg() string { return "" } +type IdReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdReq) Reset() { + *x = IdReq{} + mi := &file_pb_system_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdReq) ProtoMessage() {} + +func (x *IdReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_proto_msgTypes[1] + 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 IdReq.ProtoReflect.Descriptor instead. +func (*IdReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{1} +} + +func (x *IdReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type IdsReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Ids []string `protobuf:"bytes,1,rep,name=ids,proto3" json:"ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *IdsReq) Reset() { + *x = IdsReq{} + mi := &file_pb_system_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *IdsReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*IdsReq) ProtoMessage() {} + +func (x *IdsReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 IdsReq.ProtoReflect.Descriptor instead. +func (*IdsReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{2} +} + +func (x *IdsReq) GetIds() []string { + if x != nil { + return x.Ids + } + return nil +} + type RoleInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` + MenuIds []string `protobuf:"bytes,5,rep,name=menuIds,proto3" json:"menuIds,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } func (x *RoleInfo) Reset() { *x = RoleInfo{} - mi := &file_pb_system_proto_msgTypes[1] + mi := &file_pb_system_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -97,7 +186,7 @@ func (x *RoleInfo) String() string { func (*RoleInfo) ProtoMessage() {} func (x *RoleInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_system_proto_msgTypes[1] + mi := &file_pb_system_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -110,7 +199,7 @@ func (x *RoleInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use RoleInfo.ProtoReflect.Descriptor instead. func (*RoleInfo) Descriptor() ([]byte, []int) { - return file_pb_system_proto_rawDescGZIP(), []int{1} + return file_pb_system_proto_rawDescGZIP(), []int{3} } func (x *RoleInfo) GetId() string { @@ -141,6 +230,269 @@ func (x *RoleInfo) GetSort() int32 { return 0 } +func (x *RoleInfo) GetMenuIds() []string { + if x != nil { + return x.MenuIds + } + return nil +} + +type RoleReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` + Sort int32 `protobuf:"varint,3,opt,name=sort,proto3" json:"sort,omitempty"` + MenuIds []string `protobuf:"bytes,4,rep,name=menuIds,proto3" json:"menuIds,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoleReq) Reset() { + *x = RoleReq{} + mi := &file_pb_system_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoleReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleReq) ProtoMessage() {} + +func (x *RoleReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_proto_msgTypes[4] + 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 RoleReq.ProtoReflect.Descriptor instead. +func (*RoleReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{4} +} + +func (x *RoleReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RoleReq) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *RoleReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *RoleReq) GetMenuIds() []string { + if x != nil { + return x.MenuIds + } + return nil +} + +type RoleUpdateReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` + Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` + MenuIds []string `protobuf:"bytes,5,rep,name=menuIds,proto3" json:"menuIds,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoleUpdateReq) Reset() { + *x = RoleUpdateReq{} + mi := &file_pb_system_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoleUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleUpdateReq) ProtoMessage() {} + +func (x *RoleUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 RoleUpdateReq.ProtoReflect.Descriptor instead. +func (*RoleUpdateReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{5} +} + +func (x *RoleUpdateReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *RoleUpdateReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *RoleUpdateReq) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *RoleUpdateReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *RoleUpdateReq) GetMenuIds() []string { + if x != nil { + return x.MenuIds + } + return nil +} + +type RoleListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoleListReq) Reset() { + *x = RoleListReq{} + mi := &file_pb_system_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoleListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleListReq) ProtoMessage() {} + +func (x *RoleListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_proto_msgTypes[6] + 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 RoleListReq.ProtoReflect.Descriptor instead. +func (*RoleListReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{6} +} + +func (x *RoleListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *RoleListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *RoleListReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type RoleListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*RoleInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RoleListResp) Reset() { + *x = RoleListResp{} + mi := &file_pb_system_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RoleListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RoleListResp) ProtoMessage() {} + +func (x *RoleListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 RoleListResp.ProtoReflect.Descriptor instead. +func (*RoleListResp) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{7} +} + +func (x *RoleListResp) GetList() []*RoleInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *RoleListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + type MenuInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -161,7 +513,7 @@ type MenuInfo struct { func (x *MenuInfo) Reset() { *x = MenuInfo{} - mi := &file_pb_system_proto_msgTypes[2] + mi := &file_pb_system_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -173,7 +525,7 @@ func (x *MenuInfo) String() string { func (*MenuInfo) ProtoMessage() {} func (x *MenuInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_system_proto_msgTypes[2] + mi := &file_pb_system_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -186,7 +538,7 @@ func (x *MenuInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use MenuInfo.ProtoReflect.Descriptor instead. func (*MenuInfo) Descriptor() ([]byte, []int) { - return file_pb_system_proto_rawDescGZIP(), []int{2} + return file_pb_system_proto_rawDescGZIP(), []int{8} } func (x *MenuInfo) GetId() string { @@ -273,6 +625,290 @@ func (x *MenuInfo) GetChildren() []*MenuInfo { return nil } +type MenuReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + ParentId string `protobuf:"bytes,1,opt,name=parentId,proto3" json:"parentId,omitempty"` + Category int32 `protobuf:"varint,2,opt,name=category,proto3" json:"category,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + Code string `protobuf:"bytes,5,opt,name=code,proto3" json:"code,omitempty"` + Path string `protobuf:"bytes,6,opt,name=path,proto3" json:"path,omitempty"` + Permission string `protobuf:"bytes,7,opt,name=permission,proto3" json:"permission,omitempty"` + Locale string `protobuf:"bytes,8,opt,name=locale,proto3" json:"locale,omitempty"` + Icon string `protobuf:"bytes,9,opt,name=icon,proto3" json:"icon,omitempty"` + Sort int32 `protobuf:"varint,10,opt,name=sort,proto3" json:"sort,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MenuReq) Reset() { + *x = MenuReq{} + mi := &file_pb_system_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MenuReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MenuReq) ProtoMessage() {} + +func (x *MenuReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 MenuReq.ProtoReflect.Descriptor instead. +func (*MenuReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{9} +} + +func (x *MenuReq) GetParentId() string { + if x != nil { + return x.ParentId + } + return "" +} + +func (x *MenuReq) GetCategory() int32 { + if x != nil { + return x.Category + } + return 0 +} + +func (x *MenuReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MenuReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *MenuReq) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *MenuReq) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *MenuReq) GetPermission() string { + if x != nil { + return x.Permission + } + return "" +} + +func (x *MenuReq) GetLocale() string { + if x != nil { + return x.Locale + } + return "" +} + +func (x *MenuReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *MenuReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +type MenuUpdateReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ParentId string `protobuf:"bytes,2,opt,name=parentId,proto3" json:"parentId,omitempty"` + Category int32 `protobuf:"varint,3,opt,name=category,proto3" json:"category,omitempty"` + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` + Code string `protobuf:"bytes,6,opt,name=code,proto3" json:"code,omitempty"` + Path string `protobuf:"bytes,7,opt,name=path,proto3" json:"path,omitempty"` + Permission string `protobuf:"bytes,8,opt,name=permission,proto3" json:"permission,omitempty"` + Locale string `protobuf:"bytes,9,opt,name=locale,proto3" json:"locale,omitempty"` + Icon string `protobuf:"bytes,10,opt,name=icon,proto3" json:"icon,omitempty"` + Sort int32 `protobuf:"varint,11,opt,name=sort,proto3" json:"sort,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MenuUpdateReq) Reset() { + *x = MenuUpdateReq{} + mi := &file_pb_system_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MenuUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MenuUpdateReq) ProtoMessage() {} + +func (x *MenuUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 MenuUpdateReq.ProtoReflect.Descriptor instead. +func (*MenuUpdateReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{10} +} + +func (x *MenuUpdateReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *MenuUpdateReq) GetParentId() string { + if x != nil { + return x.ParentId + } + return "" +} + +func (x *MenuUpdateReq) GetCategory() int32 { + if x != nil { + return x.Category + } + return 0 +} + +func (x *MenuUpdateReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *MenuUpdateReq) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *MenuUpdateReq) GetCode() string { + if x != nil { + return x.Code + } + return "" +} + +func (x *MenuUpdateReq) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *MenuUpdateReq) GetPermission() string { + if x != nil { + return x.Permission + } + return "" +} + +func (x *MenuUpdateReq) GetLocale() string { + if x != nil { + return x.Locale + } + return "" +} + +func (x *MenuUpdateReq) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + +func (x *MenuUpdateReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +type MenuListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + Menus []*MenuInfo `protobuf:"bytes,1,rep,name=menus,proto3" json:"menus,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MenuListResp) Reset() { + *x = MenuListResp{} + mi := &file_pb_system_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MenuListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MenuListResp) ProtoMessage() {} + +func (x *MenuListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 MenuListResp.ProtoReflect.Descriptor instead. +func (*MenuListResp) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{11} +} + +func (x *MenuListResp) GetMenus() []*MenuInfo { + if x != nil { + return x.Menus + } + return nil +} + type ClientInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -287,7 +923,7 @@ type ClientInfo struct { func (x *ClientInfo) Reset() { *x = ClientInfo{} - mi := &file_pb_system_proto_msgTypes[3] + mi := &file_pb_system_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -299,7 +935,7 @@ func (x *ClientInfo) String() string { func (*ClientInfo) ProtoMessage() {} func (x *ClientInfo) ProtoReflect() protoreflect.Message { - mi := &file_pb_system_proto_msgTypes[3] + mi := &file_pb_system_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -312,7 +948,7 @@ func (x *ClientInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientInfo.ProtoReflect.Descriptor instead. func (*ClientInfo) Descriptor() ([]byte, []int) { - return file_pb_system_proto_rawDescGZIP(), []int{3} + return file_pb_system_proto_rawDescGZIP(), []int{12} } func (x *ClientInfo) GetId() string { @@ -357,6 +993,886 @@ func (x *ClientInfo) GetActiveTimeout() int64 { return 0 } +type ClientReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + ClientId string `protobuf:"bytes,1,opt,name=clientId,proto3" json:"clientId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + GrantType string `protobuf:"bytes,3,opt,name=grantType,proto3" json:"grantType,omitempty"` + AdditionalInfo string `protobuf:"bytes,4,opt,name=additionalInfo,proto3" json:"additionalInfo,omitempty"` + ActiveTimeout int64 `protobuf:"varint,5,opt,name=activeTimeout,proto3" json:"activeTimeout,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientReq) Reset() { + *x = ClientReq{} + mi := &file_pb_system_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientReq) ProtoMessage() {} + +func (x *ClientReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 ClientReq.ProtoReflect.Descriptor instead. +func (*ClientReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{13} +} + +func (x *ClientReq) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *ClientReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClientReq) GetGrantType() string { + if x != nil { + return x.GrantType + } + return "" +} + +func (x *ClientReq) GetAdditionalInfo() string { + if x != nil { + return x.AdditionalInfo + } + return "" +} + +func (x *ClientReq) GetActiveTimeout() int64 { + if x != nil { + return x.ActiveTimeout + } + return 0 +} + +type ClientUpdateReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + ClientId string `protobuf:"bytes,2,opt,name=clientId,proto3" json:"clientId,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + GrantType string `protobuf:"bytes,4,opt,name=grantType,proto3" json:"grantType,omitempty"` + AdditionalInfo string `protobuf:"bytes,5,opt,name=additionalInfo,proto3" json:"additionalInfo,omitempty"` + ActiveTimeout int64 `protobuf:"varint,6,opt,name=activeTimeout,proto3" json:"activeTimeout,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientUpdateReq) Reset() { + *x = ClientUpdateReq{} + mi := &file_pb_system_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientUpdateReq) ProtoMessage() {} + +func (x *ClientUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 ClientUpdateReq.ProtoReflect.Descriptor instead. +func (*ClientUpdateReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{14} +} + +func (x *ClientUpdateReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ClientUpdateReq) GetClientId() string { + if x != nil { + return x.ClientId + } + return "" +} + +func (x *ClientUpdateReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *ClientUpdateReq) GetGrantType() string { + if x != nil { + return x.GrantType + } + return "" +} + +func (x *ClientUpdateReq) GetAdditionalInfo() string { + if x != nil { + return x.AdditionalInfo + } + return "" +} + +func (x *ClientUpdateReq) GetActiveTimeout() int64 { + if x != nil { + return x.ActiveTimeout + } + return 0 +} + +type ClientListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientListReq) Reset() { + *x = ClientListReq{} + mi := &file_pb_system_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientListReq) ProtoMessage() {} + +func (x *ClientListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 ClientListReq.ProtoReflect.Descriptor instead. +func (*ClientListReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{15} +} + +func (x *ClientListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *ClientListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *ClientListReq) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type ClientListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*ClientInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ClientListResp) Reset() { + *x = ClientListResp{} + mi := &file_pb_system_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ClientListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ClientListResp) ProtoMessage() {} + +func (x *ClientListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 ClientListResp.ProtoReflect.Descriptor instead. +func (*ClientListResp) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{16} +} + +func (x *ClientListResp) GetList() []*ClientInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *ClientListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type DictInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` + Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + Sort int32 `protobuf:"varint,5,opt,name=sort,proto3" json:"sort,omitempty"` + Desc string `protobuf:"bytes,6,opt,name=desc,proto3" json:"desc,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DictInfo) Reset() { + *x = DictInfo{} + mi := &file_pb_system_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DictInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DictInfo) ProtoMessage() {} + +func (x *DictInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 DictInfo.ProtoReflect.Descriptor instead. +func (*DictInfo) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{17} +} + +func (x *DictInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DictInfo) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *DictInfo) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *DictInfo) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *DictInfo) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *DictInfo) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type DictReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"` + Value string `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` + Sort int32 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` + Desc string `protobuf:"bytes,5,opt,name=desc,proto3" json:"desc,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DictReq) Reset() { + *x = DictReq{} + mi := &file_pb_system_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DictReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DictReq) ProtoMessage() {} + +func (x *DictReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 DictReq.ProtoReflect.Descriptor instead. +func (*DictReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{18} +} + +func (x *DictReq) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *DictReq) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *DictReq) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *DictReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *DictReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type DictUpdateReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` + Value string `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` + Sort int32 `protobuf:"varint,5,opt,name=sort,proto3" json:"sort,omitempty"` + Desc string `protobuf:"bytes,6,opt,name=desc,proto3" json:"desc,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DictUpdateReq) Reset() { + *x = DictUpdateReq{} + mi := &file_pb_system_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DictUpdateReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DictUpdateReq) ProtoMessage() {} + +func (x *DictUpdateReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 DictUpdateReq.ProtoReflect.Descriptor instead. +func (*DictUpdateReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{19} +} + +func (x *DictUpdateReq) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DictUpdateReq) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +func (x *DictUpdateReq) GetLabel() string { + if x != nil { + return x.Label + } + return "" +} + +func (x *DictUpdateReq) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +func (x *DictUpdateReq) GetSort() int32 { + if x != nil { + return x.Sort + } + return 0 +} + +func (x *DictUpdateReq) GetDesc() string { + if x != nil { + return x.Desc + } + return "" +} + +type DictListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DictListReq) Reset() { + *x = DictListReq{} + mi := &file_pb_system_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DictListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DictListReq) ProtoMessage() {} + +func (x *DictListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_proto_msgTypes[20] + 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 DictListReq.ProtoReflect.Descriptor instead. +func (*DictListReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{20} +} + +func (x *DictListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *DictListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *DictListReq) GetType() string { + if x != nil { + return x.Type + } + return "" +} + +type DictListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*DictInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *DictListResp) Reset() { + *x = DictListResp{} + mi := &file_pb_system_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *DictListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DictListResp) ProtoMessage() {} + +func (x *DictListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_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 DictListResp.ProtoReflect.Descriptor instead. +func (*DictListResp) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{21} +} + +func (x *DictListResp) GetList() []*DictInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *DictListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type OperationRecordInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` + Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + Agent string `protobuf:"bytes,6,opt,name=agent,proto3" json:"agent,omitempty"` + ErrorMessage string `protobuf:"bytes,7,opt,name=errorMessage,proto3" json:"errorMessage,omitempty"` + Body string `protobuf:"bytes,8,opt,name=body,proto3" json:"body,omitempty"` + Resp string `protobuf:"bytes,9,opt,name=resp,proto3" json:"resp,omitempty"` + UserId string `protobuf:"bytes,10,opt,name=userId,proto3" json:"userId,omitempty"` + CreatedAt int64 `protobuf:"varint,11,opt,name=createdAt,proto3" json:"createdAt,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OperationRecordInfo) Reset() { + *x = OperationRecordInfo{} + mi := &file_pb_system_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OperationRecordInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperationRecordInfo) ProtoMessage() {} + +func (x *OperationRecordInfo) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_proto_msgTypes[22] + 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 OperationRecordInfo.ProtoReflect.Descriptor instead. +func (*OperationRecordInfo) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{22} +} + +func (x *OperationRecordInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *OperationRecordInfo) GetIp() string { + if x != nil { + return x.Ip + } + return "" +} + +func (x *OperationRecordInfo) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *OperationRecordInfo) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *OperationRecordInfo) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +func (x *OperationRecordInfo) GetAgent() string { + if x != nil { + return x.Agent + } + return "" +} + +func (x *OperationRecordInfo) GetErrorMessage() string { + if x != nil { + return x.ErrorMessage + } + return "" +} + +func (x *OperationRecordInfo) GetBody() string { + if x != nil { + return x.Body + } + return "" +} + +func (x *OperationRecordInfo) GetResp() string { + if x != nil { + return x.Resp + } + return "" +} + +func (x *OperationRecordInfo) GetUserId() string { + if x != nil { + return x.UserId + } + return "" +} + +func (x *OperationRecordInfo) GetCreatedAt() int64 { + if x != nil { + return x.CreatedAt + } + return 0 +} + +type OperationRecordListReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + Current int32 `protobuf:"varint,1,opt,name=current,proto3" json:"current,omitempty"` + PageSize int32 `protobuf:"varint,2,opt,name=pageSize,proto3" json:"pageSize,omitempty"` + Method string `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` + Path string `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"` + Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OperationRecordListReq) Reset() { + *x = OperationRecordListReq{} + mi := &file_pb_system_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OperationRecordListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperationRecordListReq) ProtoMessage() {} + +func (x *OperationRecordListReq) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_proto_msgTypes[23] + 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 OperationRecordListReq.ProtoReflect.Descriptor instead. +func (*OperationRecordListReq) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{23} +} + +func (x *OperationRecordListReq) GetCurrent() int32 { + if x != nil { + return x.Current + } + return 0 +} + +func (x *OperationRecordListReq) GetPageSize() int32 { + if x != nil { + return x.PageSize + } + return 0 +} + +func (x *OperationRecordListReq) GetMethod() string { + if x != nil { + return x.Method + } + return "" +} + +func (x *OperationRecordListReq) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *OperationRecordListReq) GetStatus() int32 { + if x != nil { + return x.Status + } + return 0 +} + +type OperationRecordListResp struct { + state protoimpl.MessageState `protogen:"open.v1"` + List []*OperationRecordInfo `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *OperationRecordListResp) Reset() { + *x = OperationRecordListResp{} + mi := &file_pb_system_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *OperationRecordListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*OperationRecordListResp) ProtoMessage() {} + +func (x *OperationRecordListResp) ProtoReflect() protoreflect.Message { + mi := &file_pb_system_proto_msgTypes[24] + 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 OperationRecordListResp.ProtoReflect.Descriptor instead. +func (*OperationRecordListResp) Descriptor() ([]byte, []int) { + return file_pb_system_proto_rawDescGZIP(), []int{24} +} + +func (x *OperationRecordListResp) GetList() []*OperationRecordInfo { + if x != nil { + return x.List + } + return nil +} + +func (x *OperationRecordListResp) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + type GetRolesByUserIdReq struct { state protoimpl.MessageState `protogen:"open.v1"` UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"` @@ -366,7 +1882,7 @@ type GetRolesByUserIdReq struct { func (x *GetRolesByUserIdReq) Reset() { *x = GetRolesByUserIdReq{} - mi := &file_pb_system_proto_msgTypes[4] + mi := &file_pb_system_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -378,7 +1894,7 @@ func (x *GetRolesByUserIdReq) String() string { func (*GetRolesByUserIdReq) ProtoMessage() {} func (x *GetRolesByUserIdReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_system_proto_msgTypes[4] + mi := &file_pb_system_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -391,7 +1907,7 @@ func (x *GetRolesByUserIdReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRolesByUserIdReq.ProtoReflect.Descriptor instead. func (*GetRolesByUserIdReq) Descriptor() ([]byte, []int) { - return file_pb_system_proto_rawDescGZIP(), []int{4} + return file_pb_system_proto_rawDescGZIP(), []int{25} } func (x *GetRolesByUserIdReq) GetUserId() string { @@ -410,7 +1926,7 @@ type GetRolesByUserIdResp struct { func (x *GetRolesByUserIdResp) Reset() { *x = GetRolesByUserIdResp{} - mi := &file_pb_system_proto_msgTypes[5] + mi := &file_pb_system_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -422,7 +1938,7 @@ func (x *GetRolesByUserIdResp) String() string { func (*GetRolesByUserIdResp) ProtoMessage() {} func (x *GetRolesByUserIdResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_system_proto_msgTypes[5] + mi := &file_pb_system_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -435,7 +1951,7 @@ func (x *GetRolesByUserIdResp) ProtoReflect() protoreflect.Message { // Deprecated: Use GetRolesByUserIdResp.ProtoReflect.Descriptor instead. func (*GetRolesByUserIdResp) Descriptor() ([]byte, []int) { - return file_pb_system_proto_rawDescGZIP(), []int{5} + return file_pb_system_proto_rawDescGZIP(), []int{26} } func (x *GetRolesByUserIdResp) GetRoles() []*RoleInfo { @@ -454,7 +1970,7 @@ type GetMenusByRoleIdReq struct { func (x *GetMenusByRoleIdReq) Reset() { *x = GetMenusByRoleIdReq{} - mi := &file_pb_system_proto_msgTypes[6] + mi := &file_pb_system_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -466,7 +1982,7 @@ func (x *GetMenusByRoleIdReq) String() string { func (*GetMenusByRoleIdReq) ProtoMessage() {} func (x *GetMenusByRoleIdReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_system_proto_msgTypes[6] + mi := &file_pb_system_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -479,7 +1995,7 @@ func (x *GetMenusByRoleIdReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMenusByRoleIdReq.ProtoReflect.Descriptor instead. func (*GetMenusByRoleIdReq) Descriptor() ([]byte, []int) { - return file_pb_system_proto_rawDescGZIP(), []int{6} + return file_pb_system_proto_rawDescGZIP(), []int{27} } func (x *GetMenusByRoleIdReq) GetRoleId() string { @@ -498,7 +2014,7 @@ type GetMenusByRoleIdResp struct { func (x *GetMenusByRoleIdResp) Reset() { *x = GetMenusByRoleIdResp{} - mi := &file_pb_system_proto_msgTypes[7] + mi := &file_pb_system_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -510,7 +2026,7 @@ func (x *GetMenusByRoleIdResp) String() string { func (*GetMenusByRoleIdResp) ProtoMessage() {} func (x *GetMenusByRoleIdResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_system_proto_msgTypes[7] + mi := &file_pb_system_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -523,7 +2039,7 @@ func (x *GetMenusByRoleIdResp) ProtoReflect() protoreflect.Message { // Deprecated: Use GetMenusByRoleIdResp.ProtoReflect.Descriptor instead. func (*GetMenusByRoleIdResp) Descriptor() ([]byte, []int) { - return file_pb_system_proto_rawDescGZIP(), []int{7} + return file_pb_system_proto_rawDescGZIP(), []int{28} } func (x *GetMenusByRoleIdResp) GetMenus() []*MenuInfo { @@ -542,7 +2058,7 @@ type GetClientByIdReq struct { func (x *GetClientByIdReq) Reset() { *x = GetClientByIdReq{} - mi := &file_pb_system_proto_msgTypes[8] + mi := &file_pb_system_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -554,7 +2070,7 @@ func (x *GetClientByIdReq) String() string { func (*GetClientByIdReq) ProtoMessage() {} func (x *GetClientByIdReq) ProtoReflect() protoreflect.Message { - mi := &file_pb_system_proto_msgTypes[8] + mi := &file_pb_system_proto_msgTypes[29] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -567,7 +2083,7 @@ func (x *GetClientByIdReq) ProtoReflect() protoreflect.Message { // Deprecated: Use GetClientByIdReq.ProtoReflect.Descriptor instead. func (*GetClientByIdReq) Descriptor() ([]byte, []int) { - return file_pb_system_proto_rawDescGZIP(), []int{8} + return file_pb_system_proto_rawDescGZIP(), []int{29} } func (x *GetClientByIdReq) GetClientId() string { @@ -586,7 +2102,7 @@ type GetClientByIdResp struct { func (x *GetClientByIdResp) Reset() { *x = GetClientByIdResp{} - mi := &file_pb_system_proto_msgTypes[9] + mi := &file_pb_system_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -598,7 +2114,7 @@ func (x *GetClientByIdResp) String() string { func (*GetClientByIdResp) ProtoMessage() {} func (x *GetClientByIdResp) ProtoReflect() protoreflect.Message { - mi := &file_pb_system_proto_msgTypes[9] + mi := &file_pb_system_proto_msgTypes[30] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -611,7 +2127,7 @@ func (x *GetClientByIdResp) ProtoReflect() protoreflect.Message { // Deprecated: Use GetClientByIdResp.ProtoReflect.Descriptor instead. func (*GetClientByIdResp) Descriptor() ([]byte, []int) { - return file_pb_system_proto_rawDescGZIP(), []int{9} + return file_pb_system_proto_rawDescGZIP(), []int{30} } func (x *GetClientByIdResp) GetClient() *ClientInfo { @@ -629,12 +2145,35 @@ const file_pb_system_proto_rawDesc = "" + "\n" + "CommonResp\x12\x12\n" + "\x04code\x18\x01 \x01(\x03R\x04code\x12\x10\n" + - "\x03msg\x18\x02 \x01(\tR\x03msg\"V\n" + + "\x03msg\x18\x02 \x01(\tR\x03msg\"\x17\n" + + "\x05IdReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\"\x1a\n" + + "\x06IdsReq\x12\x10\n" + + "\x03ids\x18\x01 \x03(\tR\x03ids\"p\n" + "\bRoleInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + "\x04code\x18\x03 \x01(\tR\x04code\x12\x12\n" + - "\x04sort\x18\x04 \x01(\x05R\x04sort\"\xb2\x02\n" + + "\x04sort\x18\x04 \x01(\x05R\x04sort\x12\x18\n" + + "\amenuIds\x18\x05 \x03(\tR\amenuIds\"_\n" + + "\aRoleReq\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04code\x18\x02 \x01(\tR\x04code\x12\x12\n" + + "\x04sort\x18\x03 \x01(\x05R\x04sort\x12\x18\n" + + "\amenuIds\x18\x04 \x03(\tR\amenuIds\"u\n" + + "\rRoleUpdateReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x12\n" + + "\x04code\x18\x03 \x01(\tR\x04code\x12\x12\n" + + "\x04sort\x18\x04 \x01(\x05R\x04sort\x12\x18\n" + + "\amenuIds\x18\x05 \x03(\tR\amenuIds\"W\n" + + "\vRoleListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\"J\n" + + "\fRoleListResp\x12$\n" + + "\x04list\x18\x01 \x03(\v2\x10.system.RoleInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\xb2\x02\n" + "\bMenuInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + "\bparentId\x18\x02 \x01(\tR\bparentId\x12\x1a\n" + @@ -650,7 +2189,38 @@ const file_pb_system_proto_rawDesc = "" + "\x04icon\x18\n" + " \x01(\tR\x04icon\x12\x12\n" + "\x04sort\x18\v \x01(\x05R\x04sort\x12,\n" + - "\bchildren\x18\f \x03(\v2\x10.system.MenuInfoR\bchildren\"\xb8\x01\n" + + "\bchildren\x18\f \x03(\v2\x10.system.MenuInfoR\bchildren\"\xf3\x01\n" + + "\aMenuReq\x12\x1a\n" + + "\bparentId\x18\x01 \x01(\tR\bparentId\x12\x1a\n" + + "\bcategory\x18\x02 \x01(\x05R\bcategory\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x14\n" + + "\x05title\x18\x04 \x01(\tR\x05title\x12\x12\n" + + "\x04code\x18\x05 \x01(\tR\x04code\x12\x12\n" + + "\x04path\x18\x06 \x01(\tR\x04path\x12\x1e\n" + + "\n" + + "permission\x18\a \x01(\tR\n" + + "permission\x12\x16\n" + + "\x06locale\x18\b \x01(\tR\x06locale\x12\x12\n" + + "\x04icon\x18\t \x01(\tR\x04icon\x12\x12\n" + + "\x04sort\x18\n" + + " \x01(\x05R\x04sort\"\x89\x02\n" + + "\rMenuUpdateReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + + "\bparentId\x18\x02 \x01(\tR\bparentId\x12\x1a\n" + + "\bcategory\x18\x03 \x01(\x05R\bcategory\x12\x12\n" + + "\x04name\x18\x04 \x01(\tR\x04name\x12\x14\n" + + "\x05title\x18\x05 \x01(\tR\x05title\x12\x12\n" + + "\x04code\x18\x06 \x01(\tR\x04code\x12\x12\n" + + "\x04path\x18\a \x01(\tR\x04path\x12\x1e\n" + + "\n" + + "permission\x18\b \x01(\tR\n" + + "permission\x12\x16\n" + + "\x06locale\x18\t \x01(\tR\x06locale\x12\x12\n" + + "\x04icon\x18\n" + + " \x01(\tR\x04icon\x12\x12\n" + + "\x04sort\x18\v \x01(\x05R\x04sort\"6\n" + + "\fMenuListResp\x12&\n" + + "\x05menus\x18\x01 \x03(\v2\x10.system.MenuInfoR\x05menus\"\xb8\x01\n" + "\n" + "ClientInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + @@ -658,7 +2228,76 @@ const file_pb_system_proto_rawDesc = "" + "\x04name\x18\x03 \x01(\tR\x04name\x12\x1c\n" + "\tgrantType\x18\x04 \x01(\tR\tgrantType\x12&\n" + "\x0eadditionalInfo\x18\x05 \x01(\tR\x0eadditionalInfo\x12$\n" + - "\ractiveTimeout\x18\x06 \x01(\x03R\ractiveTimeout\"-\n" + + "\ractiveTimeout\x18\x06 \x01(\x03R\ractiveTimeout\"\xa7\x01\n" + + "\tClientReq\x12\x1a\n" + + "\bclientId\x18\x01 \x01(\tR\bclientId\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1c\n" + + "\tgrantType\x18\x03 \x01(\tR\tgrantType\x12&\n" + + "\x0eadditionalInfo\x18\x04 \x01(\tR\x0eadditionalInfo\x12$\n" + + "\ractiveTimeout\x18\x05 \x01(\x03R\ractiveTimeout\"\xbd\x01\n" + + "\x0fClientUpdateReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + + "\bclientId\x18\x02 \x01(\tR\bclientId\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\x12\x1c\n" + + "\tgrantType\x18\x04 \x01(\tR\tgrantType\x12&\n" + + "\x0eadditionalInfo\x18\x05 \x01(\tR\x0eadditionalInfo\x12$\n" + + "\ractiveTimeout\x18\x06 \x01(\x03R\ractiveTimeout\"Y\n" + + "\rClientListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x12\n" + + "\x04name\x18\x03 \x01(\tR\x04name\"N\n" + + "\x0eClientListResp\x12&\n" + + "\x04list\x18\x01 \x03(\v2\x12.system.ClientInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\x82\x01\n" + + "\bDictInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04type\x18\x02 \x01(\tR\x04type\x12\x14\n" + + "\x05label\x18\x03 \x01(\tR\x05label\x12\x14\n" + + "\x05value\x18\x04 \x01(\tR\x05value\x12\x12\n" + + "\x04sort\x18\x05 \x01(\x05R\x04sort\x12\x12\n" + + "\x04desc\x18\x06 \x01(\tR\x04desc\"q\n" + + "\aDictReq\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12\x14\n" + + "\x05label\x18\x02 \x01(\tR\x05label\x12\x14\n" + + "\x05value\x18\x03 \x01(\tR\x05value\x12\x12\n" + + "\x04sort\x18\x04 \x01(\x05R\x04sort\x12\x12\n" + + "\x04desc\x18\x05 \x01(\tR\x04desc\"\x87\x01\n" + + "\rDictUpdateReq\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x12\n" + + "\x04type\x18\x02 \x01(\tR\x04type\x12\x14\n" + + "\x05label\x18\x03 \x01(\tR\x05label\x12\x14\n" + + "\x05value\x18\x04 \x01(\tR\x05value\x12\x12\n" + + "\x04sort\x18\x05 \x01(\x05R\x04sort\x12\x12\n" + + "\x04desc\x18\x06 \x01(\tR\x04desc\"W\n" + + "\vDictListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x12\n" + + "\x04type\x18\x03 \x01(\tR\x04type\"J\n" + + "\fDictListResp\x12$\n" + + "\x04list\x18\x01 \x03(\v2\x10.system.DictInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"\x91\x02\n" + + "\x13OperationRecordInfo\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x0e\n" + + "\x02ip\x18\x02 \x01(\tR\x02ip\x12\x16\n" + + "\x06method\x18\x03 \x01(\tR\x06method\x12\x12\n" + + "\x04path\x18\x04 \x01(\tR\x04path\x12\x16\n" + + "\x06status\x18\x05 \x01(\x05R\x06status\x12\x14\n" + + "\x05agent\x18\x06 \x01(\tR\x05agent\x12\"\n" + + "\ferrorMessage\x18\a \x01(\tR\ferrorMessage\x12\x12\n" + + "\x04body\x18\b \x01(\tR\x04body\x12\x12\n" + + "\x04resp\x18\t \x01(\tR\x04resp\x12\x16\n" + + "\x06userId\x18\n" + + " \x01(\tR\x06userId\x12\x1c\n" + + "\tcreatedAt\x18\v \x01(\x03R\tcreatedAt\"\x92\x01\n" + + "\x16OperationRecordListReq\x12\x18\n" + + "\acurrent\x18\x01 \x01(\x05R\acurrent\x12\x1a\n" + + "\bpageSize\x18\x02 \x01(\x05R\bpageSize\x12\x16\n" + + "\x06method\x18\x03 \x01(\tR\x06method\x12\x12\n" + + "\x04path\x18\x04 \x01(\tR\x04path\x12\x16\n" + + "\x06status\x18\x05 \x01(\x05R\x06status\"`\n" + + "\x17OperationRecordListResp\x12/\n" + + "\x04list\x18\x01 \x03(\v2\x1b.system.OperationRecordInfoR\x04list\x12\x14\n" + + "\x05total\x18\x02 \x01(\x03R\x05total\"-\n" + "\x13GetRolesByUserIdReq\x12\x16\n" + "\x06userId\x18\x01 \x01(\tR\x06userId\">\n" + "\x14GetRolesByUserIdResp\x12&\n" + @@ -670,11 +2309,38 @@ const file_pb_system_proto_rawDesc = "" + "\x10GetClientByIdReq\x12\x1a\n" + "\bclientId\x18\x01 \x01(\tR\bclientId\"?\n" + "\x11GetClientByIdResp\x12*\n" + - "\x06client\x18\x01 \x01(\v2\x12.system.ClientInfoR\x06client2\xf3\x01\n" + + "\x06client\x18\x01 \x01(\v2\x12.system.ClientInfoR\x06client2\xf5\t\n" + "\rSystemService\x12M\n" + - "\x10GetRolesByUserId\x12\x1b.system.GetRolesByUserIdReq\x1a\x1c.system.GetRolesByUserIdResp\x12M\n" + - "\x10GetMenusByRoleId\x12\x1b.system.GetMenusByRoleIdReq\x1a\x1c.system.GetMenusByRoleIdResp\x12D\n" + - "\rGetClientById\x12\x18.system.GetClientByIdReq\x1a\x19.system.GetClientByIdRespB\n" + + "\x10GetRolesByUserId\x12\x1b.system.GetRolesByUserIdReq\x1a\x1c.system.GetRolesByUserIdResp\x121\n" + + "\n" + + "CreateRole\x12\x0f.system.RoleReq\x1a\x12.system.CommonResp\x127\n" + + "\n" + + "UpdateRole\x12\x15.system.RoleUpdateReq\x1a\x12.system.CommonResp\x120\n" + + "\n" + + "DeleteRole\x12\x0e.system.IdsReq\x1a\x12.system.CommonResp\x128\n" + + "\vGetRoleList\x12\x13.system.RoleListReq\x1a\x14.system.RoleListResp\x12M\n" + + "\x10GetMenusByRoleId\x12\x1b.system.GetMenusByRoleIdReq\x1a\x1c.system.GetMenusByRoleIdResp\x121\n" + + "\n" + + "CreateMenu\x12\x0f.system.MenuReq\x1a\x12.system.CommonResp\x127\n" + + "\n" + + "UpdateMenu\x12\x15.system.MenuUpdateReq\x1a\x12.system.CommonResp\x120\n" + + "\n" + + "DeleteMenu\x12\x0e.system.IdsReq\x1a\x12.system.CommonResp\x122\n" + + "\vGetMenuList\x12\r.system.IdReq\x1a\x14.system.MenuListResp\x12D\n" + + "\rGetClientById\x12\x18.system.GetClientByIdReq\x1a\x19.system.GetClientByIdResp\x125\n" + + "\fCreateClient\x12\x11.system.ClientReq\x1a\x12.system.CommonResp\x12;\n" + + "\fUpdateClient\x12\x17.system.ClientUpdateReq\x1a\x12.system.CommonResp\x122\n" + + "\fDeleteClient\x12\x0e.system.IdsReq\x1a\x12.system.CommonResp\x12>\n" + + "\rGetClientList\x12\x15.system.ClientListReq\x1a\x16.system.ClientListResp\x121\n" + + "\n" + + "CreateDict\x12\x0f.system.DictReq\x1a\x12.system.CommonResp\x127\n" + + "\n" + + "UpdateDict\x12\x15.system.DictUpdateReq\x1a\x12.system.CommonResp\x120\n" + + "\n" + + "DeleteDict\x12\x0e.system.IdsReq\x1a\x12.system.CommonResp\x128\n" + + "\vGetDictList\x12\x13.system.DictListReq\x1a\x14.system.DictListResp\x12;\n" + + "\x15DeleteOperationRecord\x12\x0e.system.IdsReq\x1a\x12.system.CommonResp\x12Y\n" + + "\x16GetOperationRecordList\x12\x1e.system.OperationRecordListReq\x1a\x1f.system.OperationRecordListRespB\n" + "Z\b./systemb\x06proto3" var ( @@ -689,35 +2355,97 @@ func file_pb_system_proto_rawDescGZIP() []byte { return file_pb_system_proto_rawDescData } -var file_pb_system_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_pb_system_proto_msgTypes = make([]protoimpl.MessageInfo, 31) var file_pb_system_proto_goTypes = []any{ - (*CommonResp)(nil), // 0: system.CommonResp - (*RoleInfo)(nil), // 1: system.RoleInfo - (*MenuInfo)(nil), // 2: system.MenuInfo - (*ClientInfo)(nil), // 3: system.ClientInfo - (*GetRolesByUserIdReq)(nil), // 4: system.GetRolesByUserIdReq - (*GetRolesByUserIdResp)(nil), // 5: system.GetRolesByUserIdResp - (*GetMenusByRoleIdReq)(nil), // 6: system.GetMenusByRoleIdReq - (*GetMenusByRoleIdResp)(nil), // 7: system.GetMenusByRoleIdResp - (*GetClientByIdReq)(nil), // 8: system.GetClientByIdReq - (*GetClientByIdResp)(nil), // 9: system.GetClientByIdResp + (*CommonResp)(nil), // 0: system.CommonResp + (*IdReq)(nil), // 1: system.IdReq + (*IdsReq)(nil), // 2: system.IdsReq + (*RoleInfo)(nil), // 3: system.RoleInfo + (*RoleReq)(nil), // 4: system.RoleReq + (*RoleUpdateReq)(nil), // 5: system.RoleUpdateReq + (*RoleListReq)(nil), // 6: system.RoleListReq + (*RoleListResp)(nil), // 7: system.RoleListResp + (*MenuInfo)(nil), // 8: system.MenuInfo + (*MenuReq)(nil), // 9: system.MenuReq + (*MenuUpdateReq)(nil), // 10: system.MenuUpdateReq + (*MenuListResp)(nil), // 11: system.MenuListResp + (*ClientInfo)(nil), // 12: system.ClientInfo + (*ClientReq)(nil), // 13: system.ClientReq + (*ClientUpdateReq)(nil), // 14: system.ClientUpdateReq + (*ClientListReq)(nil), // 15: system.ClientListReq + (*ClientListResp)(nil), // 16: system.ClientListResp + (*DictInfo)(nil), // 17: system.DictInfo + (*DictReq)(nil), // 18: system.DictReq + (*DictUpdateReq)(nil), // 19: system.DictUpdateReq + (*DictListReq)(nil), // 20: system.DictListReq + (*DictListResp)(nil), // 21: system.DictListResp + (*OperationRecordInfo)(nil), // 22: system.OperationRecordInfo + (*OperationRecordListReq)(nil), // 23: system.OperationRecordListReq + (*OperationRecordListResp)(nil), // 24: system.OperationRecordListResp + (*GetRolesByUserIdReq)(nil), // 25: system.GetRolesByUserIdReq + (*GetRolesByUserIdResp)(nil), // 26: system.GetRolesByUserIdResp + (*GetMenusByRoleIdReq)(nil), // 27: system.GetMenusByRoleIdReq + (*GetMenusByRoleIdResp)(nil), // 28: system.GetMenusByRoleIdResp + (*GetClientByIdReq)(nil), // 29: system.GetClientByIdReq + (*GetClientByIdResp)(nil), // 30: system.GetClientByIdResp } var file_pb_system_proto_depIdxs = []int32{ - 2, // 0: system.MenuInfo.children:type_name -> system.MenuInfo - 1, // 1: system.GetRolesByUserIdResp.roles:type_name -> system.RoleInfo - 2, // 2: system.GetMenusByRoleIdResp.menus:type_name -> system.MenuInfo - 3, // 3: system.GetClientByIdResp.client:type_name -> system.ClientInfo - 4, // 4: system.SystemService.GetRolesByUserId:input_type -> system.GetRolesByUserIdReq - 6, // 5: system.SystemService.GetMenusByRoleId:input_type -> system.GetMenusByRoleIdReq - 8, // 6: system.SystemService.GetClientById:input_type -> system.GetClientByIdReq - 5, // 7: system.SystemService.GetRolesByUserId:output_type -> system.GetRolesByUserIdResp - 7, // 8: system.SystemService.GetMenusByRoleId:output_type -> system.GetMenusByRoleIdResp - 9, // 9: system.SystemService.GetClientById:output_type -> system.GetClientByIdResp - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 3, // 0: system.RoleListResp.list:type_name -> system.RoleInfo + 8, // 1: system.MenuInfo.children:type_name -> system.MenuInfo + 8, // 2: system.MenuListResp.menus:type_name -> system.MenuInfo + 12, // 3: system.ClientListResp.list:type_name -> system.ClientInfo + 17, // 4: system.DictListResp.list:type_name -> system.DictInfo + 22, // 5: system.OperationRecordListResp.list:type_name -> system.OperationRecordInfo + 3, // 6: system.GetRolesByUserIdResp.roles:type_name -> system.RoleInfo + 8, // 7: system.GetMenusByRoleIdResp.menus:type_name -> system.MenuInfo + 12, // 8: system.GetClientByIdResp.client:type_name -> system.ClientInfo + 25, // 9: system.SystemService.GetRolesByUserId:input_type -> system.GetRolesByUserIdReq + 4, // 10: system.SystemService.CreateRole:input_type -> system.RoleReq + 5, // 11: system.SystemService.UpdateRole:input_type -> system.RoleUpdateReq + 2, // 12: system.SystemService.DeleteRole:input_type -> system.IdsReq + 6, // 13: system.SystemService.GetRoleList:input_type -> system.RoleListReq + 27, // 14: system.SystemService.GetMenusByRoleId:input_type -> system.GetMenusByRoleIdReq + 9, // 15: system.SystemService.CreateMenu:input_type -> system.MenuReq + 10, // 16: system.SystemService.UpdateMenu:input_type -> system.MenuUpdateReq + 2, // 17: system.SystemService.DeleteMenu:input_type -> system.IdsReq + 1, // 18: system.SystemService.GetMenuList:input_type -> system.IdReq + 29, // 19: system.SystemService.GetClientById:input_type -> system.GetClientByIdReq + 13, // 20: system.SystemService.CreateClient:input_type -> system.ClientReq + 14, // 21: system.SystemService.UpdateClient:input_type -> system.ClientUpdateReq + 2, // 22: system.SystemService.DeleteClient:input_type -> system.IdsReq + 15, // 23: system.SystemService.GetClientList:input_type -> system.ClientListReq + 18, // 24: system.SystemService.CreateDict:input_type -> system.DictReq + 19, // 25: system.SystemService.UpdateDict:input_type -> system.DictUpdateReq + 2, // 26: system.SystemService.DeleteDict:input_type -> system.IdsReq + 20, // 27: system.SystemService.GetDictList:input_type -> system.DictListReq + 2, // 28: system.SystemService.DeleteOperationRecord:input_type -> system.IdsReq + 23, // 29: system.SystemService.GetOperationRecordList:input_type -> system.OperationRecordListReq + 26, // 30: system.SystemService.GetRolesByUserId:output_type -> system.GetRolesByUserIdResp + 0, // 31: system.SystemService.CreateRole:output_type -> system.CommonResp + 0, // 32: system.SystemService.UpdateRole:output_type -> system.CommonResp + 0, // 33: system.SystemService.DeleteRole:output_type -> system.CommonResp + 7, // 34: system.SystemService.GetRoleList:output_type -> system.RoleListResp + 28, // 35: system.SystemService.GetMenusByRoleId:output_type -> system.GetMenusByRoleIdResp + 0, // 36: system.SystemService.CreateMenu:output_type -> system.CommonResp + 0, // 37: system.SystemService.UpdateMenu:output_type -> system.CommonResp + 0, // 38: system.SystemService.DeleteMenu:output_type -> system.CommonResp + 11, // 39: system.SystemService.GetMenuList:output_type -> system.MenuListResp + 30, // 40: system.SystemService.GetClientById:output_type -> system.GetClientByIdResp + 0, // 41: system.SystemService.CreateClient:output_type -> system.CommonResp + 0, // 42: system.SystemService.UpdateClient:output_type -> system.CommonResp + 0, // 43: system.SystemService.DeleteClient:output_type -> system.CommonResp + 16, // 44: system.SystemService.GetClientList:output_type -> system.ClientListResp + 0, // 45: system.SystemService.CreateDict:output_type -> system.CommonResp + 0, // 46: system.SystemService.UpdateDict:output_type -> system.CommonResp + 0, // 47: system.SystemService.DeleteDict:output_type -> system.CommonResp + 21, // 48: system.SystemService.GetDictList:output_type -> system.DictListResp + 0, // 49: system.SystemService.DeleteOperationRecord:output_type -> system.CommonResp + 24, // 50: system.SystemService.GetOperationRecordList:output_type -> system.OperationRecordListResp + 30, // [30:51] is the sub-list for method output_type + 9, // [9:30] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_pb_system_proto_init() } @@ -731,7 +2459,7 @@ func file_pb_system_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_pb_system_proto_rawDesc), len(file_pb_system_proto_rawDesc)), NumEnums: 0, - NumMessages: 10, + NumMessages: 31, NumExtensions: 0, NumServices: 1, }, diff --git a/app/system/rpc/system/system_grpc.pb.go b/app/system/rpc/system/system_grpc.pb.go index 086b126..05fb1a2 100644 --- a/app/system/rpc/system/system_grpc.pb.go +++ b/app/system/rpc/system/system_grpc.pb.go @@ -19,21 +19,59 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - SystemService_GetRolesByUserId_FullMethodName = "/system.SystemService/GetRolesByUserId" - SystemService_GetMenusByRoleId_FullMethodName = "/system.SystemService/GetMenusByRoleId" - SystemService_GetClientById_FullMethodName = "/system.SystemService/GetClientById" + SystemService_GetRolesByUserId_FullMethodName = "/system.SystemService/GetRolesByUserId" + SystemService_CreateRole_FullMethodName = "/system.SystemService/CreateRole" + SystemService_UpdateRole_FullMethodName = "/system.SystemService/UpdateRole" + SystemService_DeleteRole_FullMethodName = "/system.SystemService/DeleteRole" + SystemService_GetRoleList_FullMethodName = "/system.SystemService/GetRoleList" + SystemService_GetMenusByRoleId_FullMethodName = "/system.SystemService/GetMenusByRoleId" + SystemService_CreateMenu_FullMethodName = "/system.SystemService/CreateMenu" + SystemService_UpdateMenu_FullMethodName = "/system.SystemService/UpdateMenu" + SystemService_DeleteMenu_FullMethodName = "/system.SystemService/DeleteMenu" + SystemService_GetMenuList_FullMethodName = "/system.SystemService/GetMenuList" + SystemService_GetClientById_FullMethodName = "/system.SystemService/GetClientById" + SystemService_CreateClient_FullMethodName = "/system.SystemService/CreateClient" + SystemService_UpdateClient_FullMethodName = "/system.SystemService/UpdateClient" + SystemService_DeleteClient_FullMethodName = "/system.SystemService/DeleteClient" + SystemService_GetClientList_FullMethodName = "/system.SystemService/GetClientList" + SystemService_CreateDict_FullMethodName = "/system.SystemService/CreateDict" + SystemService_UpdateDict_FullMethodName = "/system.SystemService/UpdateDict" + SystemService_DeleteDict_FullMethodName = "/system.SystemService/DeleteDict" + SystemService_GetDictList_FullMethodName = "/system.SystemService/GetDictList" + SystemService_DeleteOperationRecord_FullMethodName = "/system.SystemService/DeleteOperationRecord" + SystemService_GetOperationRecordList_FullMethodName = "/system.SystemService/GetOperationRecordList" ) // SystemServiceClient is the client API for SystemService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type SystemServiceClient interface { - // 获取用户角色列表 + // --- 角色 --- GetRolesByUserId(ctx context.Context, in *GetRolesByUserIdReq, opts ...grpc.CallOption) (*GetRolesByUserIdResp, error) - // 获取角色菜单列表 + CreateRole(ctx context.Context, in *RoleReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateRole(ctx context.Context, in *RoleUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteRole(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetRoleList(ctx context.Context, in *RoleListReq, opts ...grpc.CallOption) (*RoleListResp, error) + // --- 菜单 --- GetMenusByRoleId(ctx context.Context, in *GetMenusByRoleIdReq, opts ...grpc.CallOption) (*GetMenusByRoleIdResp, error) - // 获取客户端信息 + CreateMenu(ctx context.Context, in *MenuReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateMenu(ctx context.Context, in *MenuUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteMenu(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetMenuList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*MenuListResp, error) + // --- 客户端 --- GetClientById(ctx context.Context, in *GetClientByIdReq, opts ...grpc.CallOption) (*GetClientByIdResp, error) + CreateClient(ctx context.Context, in *ClientReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateClient(ctx context.Context, in *ClientUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteClient(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetClientList(ctx context.Context, in *ClientListReq, opts ...grpc.CallOption) (*ClientListResp, error) + // --- 字典 --- + CreateDict(ctx context.Context, in *DictReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateDict(ctx context.Context, in *DictUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteDict(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetDictList(ctx context.Context, in *DictListReq, opts ...grpc.CallOption) (*DictListResp, error) + // --- 操作日志 --- + DeleteOperationRecord(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetOperationRecordList(ctx context.Context, in *OperationRecordListReq, opts ...grpc.CallOption) (*OperationRecordListResp, error) } type systemServiceClient struct { @@ -54,6 +92,46 @@ func (c *systemServiceClient) GetRolesByUserId(ctx context.Context, in *GetRoles return out, nil } +func (c *systemServiceClient) CreateRole(ctx context.Context, in *RoleReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_CreateRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) UpdateRole(ctx context.Context, in *RoleUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_UpdateRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) DeleteRole(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_DeleteRole_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) GetRoleList(ctx context.Context, in *RoleListReq, opts ...grpc.CallOption) (*RoleListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RoleListResp) + err := c.cc.Invoke(ctx, SystemService_GetRoleList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *systemServiceClient) GetMenusByRoleId(ctx context.Context, in *GetMenusByRoleIdReq, opts ...grpc.CallOption) (*GetMenusByRoleIdResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetMenusByRoleIdResp) @@ -64,6 +142,46 @@ func (c *systemServiceClient) GetMenusByRoleId(ctx context.Context, in *GetMenus return out, nil } +func (c *systemServiceClient) CreateMenu(ctx context.Context, in *MenuReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_CreateMenu_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) UpdateMenu(ctx context.Context, in *MenuUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_UpdateMenu_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) DeleteMenu(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_DeleteMenu_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) GetMenuList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*MenuListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(MenuListResp) + err := c.cc.Invoke(ctx, SystemService_GetMenuList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *systemServiceClient) GetClientById(ctx context.Context, in *GetClientByIdReq, opts ...grpc.CallOption) (*GetClientByIdResp, error) { cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetClientByIdResp) @@ -74,16 +192,136 @@ func (c *systemServiceClient) GetClientById(ctx context.Context, in *GetClientBy return out, nil } +func (c *systemServiceClient) CreateClient(ctx context.Context, in *ClientReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_CreateClient_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) UpdateClient(ctx context.Context, in *ClientUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_UpdateClient_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) DeleteClient(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_DeleteClient_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) GetClientList(ctx context.Context, in *ClientListReq, opts ...grpc.CallOption) (*ClientListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(ClientListResp) + err := c.cc.Invoke(ctx, SystemService_GetClientList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) CreateDict(ctx context.Context, in *DictReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_CreateDict_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) UpdateDict(ctx context.Context, in *DictUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_UpdateDict_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) DeleteDict(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_DeleteDict_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) GetDictList(ctx context.Context, in *DictListReq, opts ...grpc.CallOption) (*DictListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(DictListResp) + err := c.cc.Invoke(ctx, SystemService_GetDictList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) DeleteOperationRecord(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(CommonResp) + err := c.cc.Invoke(ctx, SystemService_DeleteOperationRecord_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *systemServiceClient) GetOperationRecordList(ctx context.Context, in *OperationRecordListReq, opts ...grpc.CallOption) (*OperationRecordListResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(OperationRecordListResp) + err := c.cc.Invoke(ctx, SystemService_GetOperationRecordList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // SystemServiceServer is the server API for SystemService service. // All implementations must embed UnimplementedSystemServiceServer // for forward compatibility. type SystemServiceServer interface { - // 获取用户角色列表 + // --- 角色 --- GetRolesByUserId(context.Context, *GetRolesByUserIdReq) (*GetRolesByUserIdResp, error) - // 获取角色菜单列表 + CreateRole(context.Context, *RoleReq) (*CommonResp, error) + UpdateRole(context.Context, *RoleUpdateReq) (*CommonResp, error) + DeleteRole(context.Context, *IdsReq) (*CommonResp, error) + GetRoleList(context.Context, *RoleListReq) (*RoleListResp, error) + // --- 菜单 --- GetMenusByRoleId(context.Context, *GetMenusByRoleIdReq) (*GetMenusByRoleIdResp, error) - // 获取客户端信息 + CreateMenu(context.Context, *MenuReq) (*CommonResp, error) + UpdateMenu(context.Context, *MenuUpdateReq) (*CommonResp, error) + DeleteMenu(context.Context, *IdsReq) (*CommonResp, error) + GetMenuList(context.Context, *IdReq) (*MenuListResp, error) + // --- 客户端 --- GetClientById(context.Context, *GetClientByIdReq) (*GetClientByIdResp, error) + CreateClient(context.Context, *ClientReq) (*CommonResp, error) + UpdateClient(context.Context, *ClientUpdateReq) (*CommonResp, error) + DeleteClient(context.Context, *IdsReq) (*CommonResp, error) + GetClientList(context.Context, *ClientListReq) (*ClientListResp, error) + // --- 字典 --- + CreateDict(context.Context, *DictReq) (*CommonResp, error) + UpdateDict(context.Context, *DictUpdateReq) (*CommonResp, error) + DeleteDict(context.Context, *IdsReq) (*CommonResp, error) + GetDictList(context.Context, *DictListReq) (*DictListResp, error) + // --- 操作日志 --- + DeleteOperationRecord(context.Context, *IdsReq) (*CommonResp, error) + GetOperationRecordList(context.Context, *OperationRecordListReq) (*OperationRecordListResp, error) mustEmbedUnimplementedSystemServiceServer() } @@ -97,12 +335,66 @@ type UnimplementedSystemServiceServer struct{} func (UnimplementedSystemServiceServer) GetRolesByUserId(context.Context, *GetRolesByUserIdReq) (*GetRolesByUserIdResp, error) { return nil, status.Error(codes.Unimplemented, "method GetRolesByUserId not implemented") } +func (UnimplementedSystemServiceServer) CreateRole(context.Context, *RoleReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateRole not implemented") +} +func (UnimplementedSystemServiceServer) UpdateRole(context.Context, *RoleUpdateReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateRole not implemented") +} +func (UnimplementedSystemServiceServer) DeleteRole(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteRole not implemented") +} +func (UnimplementedSystemServiceServer) GetRoleList(context.Context, *RoleListReq) (*RoleListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetRoleList not implemented") +} func (UnimplementedSystemServiceServer) GetMenusByRoleId(context.Context, *GetMenusByRoleIdReq) (*GetMenusByRoleIdResp, error) { return nil, status.Error(codes.Unimplemented, "method GetMenusByRoleId not implemented") } +func (UnimplementedSystemServiceServer) CreateMenu(context.Context, *MenuReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateMenu not implemented") +} +func (UnimplementedSystemServiceServer) UpdateMenu(context.Context, *MenuUpdateReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateMenu not implemented") +} +func (UnimplementedSystemServiceServer) DeleteMenu(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteMenu not implemented") +} +func (UnimplementedSystemServiceServer) GetMenuList(context.Context, *IdReq) (*MenuListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetMenuList not implemented") +} func (UnimplementedSystemServiceServer) GetClientById(context.Context, *GetClientByIdReq) (*GetClientByIdResp, error) { return nil, status.Error(codes.Unimplemented, "method GetClientById not implemented") } +func (UnimplementedSystemServiceServer) CreateClient(context.Context, *ClientReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateClient not implemented") +} +func (UnimplementedSystemServiceServer) UpdateClient(context.Context, *ClientUpdateReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateClient not implemented") +} +func (UnimplementedSystemServiceServer) DeleteClient(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteClient not implemented") +} +func (UnimplementedSystemServiceServer) GetClientList(context.Context, *ClientListReq) (*ClientListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetClientList not implemented") +} +func (UnimplementedSystemServiceServer) CreateDict(context.Context, *DictReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method CreateDict not implemented") +} +func (UnimplementedSystemServiceServer) UpdateDict(context.Context, *DictUpdateReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method UpdateDict not implemented") +} +func (UnimplementedSystemServiceServer) DeleteDict(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteDict not implemented") +} +func (UnimplementedSystemServiceServer) GetDictList(context.Context, *DictListReq) (*DictListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetDictList not implemented") +} +func (UnimplementedSystemServiceServer) DeleteOperationRecord(context.Context, *IdsReq) (*CommonResp, error) { + return nil, status.Error(codes.Unimplemented, "method DeleteOperationRecord not implemented") +} +func (UnimplementedSystemServiceServer) GetOperationRecordList(context.Context, *OperationRecordListReq) (*OperationRecordListResp, error) { + return nil, status.Error(codes.Unimplemented, "method GetOperationRecordList not implemented") +} func (UnimplementedSystemServiceServer) mustEmbedUnimplementedSystemServiceServer() {} func (UnimplementedSystemServiceServer) testEmbeddedByValue() {} @@ -142,6 +434,78 @@ func _SystemService_GetRolesByUserId_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _SystemService_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RoleReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).CreateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_CreateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).CreateRole(ctx, req.(*RoleReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RoleUpdateReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).UpdateRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_UpdateRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).UpdateRole(ctx, req.(*RoleUpdateReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).DeleteRole(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_DeleteRole_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).DeleteRole(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_GetRoleList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RoleListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).GetRoleList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_GetRoleList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).GetRoleList(ctx, req.(*RoleListReq)) + } + return interceptor(ctx, in, info, handler) +} + func _SystemService_GetMenusByRoleId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetMenusByRoleIdReq) if err := dec(in); err != nil { @@ -160,6 +524,78 @@ func _SystemService_GetMenusByRoleId_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _SystemService_CreateMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MenuReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).CreateMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_CreateMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).CreateMenu(ctx, req.(*MenuReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_UpdateMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MenuUpdateReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).UpdateMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_UpdateMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).UpdateMenu(ctx, req.(*MenuUpdateReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_DeleteMenu_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).DeleteMenu(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_DeleteMenu_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).DeleteMenu(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_GetMenuList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).GetMenuList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_GetMenuList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).GetMenuList(ctx, req.(*IdReq)) + } + return interceptor(ctx, in, info, handler) +} + func _SystemService_GetClientById_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(GetClientByIdReq) if err := dec(in); err != nil { @@ -178,6 +614,186 @@ func _SystemService_GetClientById_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _SystemService_CreateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClientReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).CreateClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_CreateClient_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).CreateClient(ctx, req.(*ClientReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_UpdateClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClientUpdateReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).UpdateClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_UpdateClient_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).UpdateClient(ctx, req.(*ClientUpdateReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_DeleteClient_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).DeleteClient(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_DeleteClient_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).DeleteClient(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_GetClientList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClientListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).GetClientList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_GetClientList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).GetClientList(ctx, req.(*ClientListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_CreateDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DictReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).CreateDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_CreateDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).CreateDict(ctx, req.(*DictReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_UpdateDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DictUpdateReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).UpdateDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_UpdateDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).UpdateDict(ctx, req.(*DictUpdateReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_DeleteDict_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).DeleteDict(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_DeleteDict_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).DeleteDict(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_GetDictList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DictListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).GetDictList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_GetDictList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).GetDictList(ctx, req.(*DictListReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_DeleteOperationRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IdsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).DeleteOperationRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_DeleteOperationRecord_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).DeleteOperationRecord(ctx, req.(*IdsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _SystemService_GetOperationRecordList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(OperationRecordListReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(SystemServiceServer).GetOperationRecordList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: SystemService_GetOperationRecordList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(SystemServiceServer).GetOperationRecordList(ctx, req.(*OperationRecordListReq)) + } + return interceptor(ctx, in, info, handler) +} + // SystemService_ServiceDesc is the grpc.ServiceDesc for SystemService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -189,14 +805,86 @@ var SystemService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetRolesByUserId", Handler: _SystemService_GetRolesByUserId_Handler, }, + { + MethodName: "CreateRole", + Handler: _SystemService_CreateRole_Handler, + }, + { + MethodName: "UpdateRole", + Handler: _SystemService_UpdateRole_Handler, + }, + { + MethodName: "DeleteRole", + Handler: _SystemService_DeleteRole_Handler, + }, + { + MethodName: "GetRoleList", + Handler: _SystemService_GetRoleList_Handler, + }, { MethodName: "GetMenusByRoleId", Handler: _SystemService_GetMenusByRoleId_Handler, }, + { + MethodName: "CreateMenu", + Handler: _SystemService_CreateMenu_Handler, + }, + { + MethodName: "UpdateMenu", + Handler: _SystemService_UpdateMenu_Handler, + }, + { + MethodName: "DeleteMenu", + Handler: _SystemService_DeleteMenu_Handler, + }, + { + MethodName: "GetMenuList", + Handler: _SystemService_GetMenuList_Handler, + }, { MethodName: "GetClientById", Handler: _SystemService_GetClientById_Handler, }, + { + MethodName: "CreateClient", + Handler: _SystemService_CreateClient_Handler, + }, + { + MethodName: "UpdateClient", + Handler: _SystemService_UpdateClient_Handler, + }, + { + MethodName: "DeleteClient", + Handler: _SystemService_DeleteClient_Handler, + }, + { + MethodName: "GetClientList", + Handler: _SystemService_GetClientList_Handler, + }, + { + MethodName: "CreateDict", + Handler: _SystemService_CreateDict_Handler, + }, + { + MethodName: "UpdateDict", + Handler: _SystemService_UpdateDict_Handler, + }, + { + MethodName: "DeleteDict", + Handler: _SystemService_DeleteDict_Handler, + }, + { + MethodName: "GetDictList", + Handler: _SystemService_GetDictList_Handler, + }, + { + MethodName: "DeleteOperationRecord", + Handler: _SystemService_DeleteOperationRecord_Handler, + }, + { + MethodName: "GetOperationRecordList", + Handler: _SystemService_GetOperationRecordList_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "pb/system.proto", diff --git a/app/system/rpc/systemservice/systemService.go b/app/system/rpc/systemservice/systemService.go index f338d23..58d6ee8 100644 --- a/app/system/rpc/systemservice/systemService.go +++ b/app/system/rpc/systemservice/systemService.go @@ -14,24 +14,65 @@ import ( ) type ( - ClientInfo = system.ClientInfo - CommonResp = system.CommonResp - GetClientByIdReq = system.GetClientByIdReq - GetClientByIdResp = system.GetClientByIdResp - GetMenusByRoleIdReq = system.GetMenusByRoleIdReq - GetMenusByRoleIdResp = system.GetMenusByRoleIdResp - GetRolesByUserIdReq = system.GetRolesByUserIdReq - GetRolesByUserIdResp = system.GetRolesByUserIdResp - MenuInfo = system.MenuInfo - RoleInfo = system.RoleInfo + ClientInfo = system.ClientInfo + ClientListReq = system.ClientListReq + ClientListResp = system.ClientListResp + ClientReq = system.ClientReq + ClientUpdateReq = system.ClientUpdateReq + CommonResp = system.CommonResp + DictInfo = system.DictInfo + DictListReq = system.DictListReq + DictListResp = system.DictListResp + DictReq = system.DictReq + DictUpdateReq = system.DictUpdateReq + GetClientByIdReq = system.GetClientByIdReq + GetClientByIdResp = system.GetClientByIdResp + GetMenusByRoleIdReq = system.GetMenusByRoleIdReq + GetMenusByRoleIdResp = system.GetMenusByRoleIdResp + GetRolesByUserIdReq = system.GetRolesByUserIdReq + GetRolesByUserIdResp = system.GetRolesByUserIdResp + IdReq = system.IdReq + IdsReq = system.IdsReq + MenuInfo = system.MenuInfo + MenuListResp = system.MenuListResp + MenuReq = system.MenuReq + MenuUpdateReq = system.MenuUpdateReq + OperationRecordInfo = system.OperationRecordInfo + OperationRecordListReq = system.OperationRecordListReq + OperationRecordListResp = system.OperationRecordListResp + RoleInfo = system.RoleInfo + RoleListReq = system.RoleListReq + RoleListResp = system.RoleListResp + RoleReq = system.RoleReq + RoleUpdateReq = system.RoleUpdateReq SystemService interface { - // 获取用户角色列表 + // --- 角色 --- GetRolesByUserId(ctx context.Context, in *GetRolesByUserIdReq, opts ...grpc.CallOption) (*GetRolesByUserIdResp, error) - // 获取角色菜单列表 + CreateRole(ctx context.Context, in *RoleReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateRole(ctx context.Context, in *RoleUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteRole(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetRoleList(ctx context.Context, in *RoleListReq, opts ...grpc.CallOption) (*RoleListResp, error) + // --- 菜单 --- GetMenusByRoleId(ctx context.Context, in *GetMenusByRoleIdReq, opts ...grpc.CallOption) (*GetMenusByRoleIdResp, error) - // 获取客户端信息 + CreateMenu(ctx context.Context, in *MenuReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateMenu(ctx context.Context, in *MenuUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteMenu(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetMenuList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*MenuListResp, error) + // --- 客户端 --- GetClientById(ctx context.Context, in *GetClientByIdReq, opts ...grpc.CallOption) (*GetClientByIdResp, error) + CreateClient(ctx context.Context, in *ClientReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateClient(ctx context.Context, in *ClientUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteClient(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetClientList(ctx context.Context, in *ClientListReq, opts ...grpc.CallOption) (*ClientListResp, error) + // --- 字典 --- + CreateDict(ctx context.Context, in *DictReq, opts ...grpc.CallOption) (*CommonResp, error) + UpdateDict(ctx context.Context, in *DictUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) + DeleteDict(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetDictList(ctx context.Context, in *DictListReq, opts ...grpc.CallOption) (*DictListResp, error) + // --- 操作日志 --- + DeleteOperationRecord(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) + GetOperationRecordList(ctx context.Context, in *OperationRecordListReq, opts ...grpc.CallOption) (*OperationRecordListResp, error) } defaultSystemService struct { @@ -45,20 +86,112 @@ func NewSystemService(cli zrpc.Client) SystemService { } } -// 获取用户角色列表 +// --- 角色 --- func (m *defaultSystemService) GetRolesByUserId(ctx context.Context, in *GetRolesByUserIdReq, opts ...grpc.CallOption) (*GetRolesByUserIdResp, error) { client := system.NewSystemServiceClient(m.cli.Conn()) return client.GetRolesByUserId(ctx, in, opts...) } -// 获取角色菜单列表 +func (m *defaultSystemService) CreateRole(ctx context.Context, in *RoleReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.CreateRole(ctx, in, opts...) +} + +func (m *defaultSystemService) UpdateRole(ctx context.Context, in *RoleUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.UpdateRole(ctx, in, opts...) +} + +func (m *defaultSystemService) DeleteRole(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.DeleteRole(ctx, in, opts...) +} + +func (m *defaultSystemService) GetRoleList(ctx context.Context, in *RoleListReq, opts ...grpc.CallOption) (*RoleListResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.GetRoleList(ctx, in, opts...) +} + +// --- 菜单 --- func (m *defaultSystemService) GetMenusByRoleId(ctx context.Context, in *GetMenusByRoleIdReq, opts ...grpc.CallOption) (*GetMenusByRoleIdResp, error) { client := system.NewSystemServiceClient(m.cli.Conn()) return client.GetMenusByRoleId(ctx, in, opts...) } -// 获取客户端信息 +func (m *defaultSystemService) CreateMenu(ctx context.Context, in *MenuReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.CreateMenu(ctx, in, opts...) +} + +func (m *defaultSystemService) UpdateMenu(ctx context.Context, in *MenuUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.UpdateMenu(ctx, in, opts...) +} + +func (m *defaultSystemService) DeleteMenu(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.DeleteMenu(ctx, in, opts...) +} + +func (m *defaultSystemService) GetMenuList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*MenuListResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.GetMenuList(ctx, in, opts...) +} + +// --- 客户端 --- func (m *defaultSystemService) GetClientById(ctx context.Context, in *GetClientByIdReq, opts ...grpc.CallOption) (*GetClientByIdResp, error) { client := system.NewSystemServiceClient(m.cli.Conn()) return client.GetClientById(ctx, in, opts...) } + +func (m *defaultSystemService) CreateClient(ctx context.Context, in *ClientReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.CreateClient(ctx, in, opts...) +} + +func (m *defaultSystemService) UpdateClient(ctx context.Context, in *ClientUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.UpdateClient(ctx, in, opts...) +} + +func (m *defaultSystemService) DeleteClient(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.DeleteClient(ctx, in, opts...) +} + +func (m *defaultSystemService) GetClientList(ctx context.Context, in *ClientListReq, opts ...grpc.CallOption) (*ClientListResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.GetClientList(ctx, in, opts...) +} + +// --- 字典 --- +func (m *defaultSystemService) CreateDict(ctx context.Context, in *DictReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.CreateDict(ctx, in, opts...) +} + +func (m *defaultSystemService) UpdateDict(ctx context.Context, in *DictUpdateReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.UpdateDict(ctx, in, opts...) +} + +func (m *defaultSystemService) DeleteDict(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.DeleteDict(ctx, in, opts...) +} + +func (m *defaultSystemService) GetDictList(ctx context.Context, in *DictListReq, opts ...grpc.CallOption) (*DictListResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.GetDictList(ctx, in, opts...) +} + +// --- 操作日志 --- +func (m *defaultSystemService) DeleteOperationRecord(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.DeleteOperationRecord(ctx, in, opts...) +} + +func (m *defaultSystemService) GetOperationRecordList(ctx context.Context, in *OperationRecordListReq, opts ...grpc.CallOption) (*OperationRecordListResp, error) { + client := system.NewSystemServiceClient(m.cli.Conn()) + return client.GetOperationRecordList(ctx, in, opts...) +} diff --git a/app/user/api/etc/user-api.yaml b/app/user/api/etc/user-api.yaml index 49406bf..98bafc0 100644 --- a/app/user/api/etc/user-api.yaml +++ b/app/user/api/etc/user-api.yaml @@ -1,4 +1,7 @@ Name: user-api + +Log: + Encoding: plain Host: 0.0.0.0 Port: 9001 diff --git a/app/user/rpc/etc/user.yaml b/app/user/rpc/etc/user.yaml index 6105a7e..0d480a2 100644 --- a/app/user/rpc/etc/user.yaml +++ b/app/user/rpc/etc/user.yaml @@ -1,4 +1,7 @@ Name: user.rpc + +Log: + Encoding: plain ListenOn: 0.0.0.0:9101 Etcd: Hosts: diff --git a/scripts/gen_system_api_logic.sh b/scripts/gen_system_api_logic.sh new file mode 100644 index 0000000..5eb2950 --- /dev/null +++ b/scripts/gen_system_api_logic.sh @@ -0,0 +1,536 @@ +#!/bin/bash +# 批量生成 system-api logic,全部改为调用 SystemRpc +BASE="/Users/zhangjianmin/sourceCode/GolandProjects/src/sundynix-micro-go/app/system/api/internal/logic" + +# Helper function +gen() { + local dir="$1" file="$2" content="$3" + mkdir -p "$BASE/$dir" + echo "$content" > "$BASE/$dir/$file" +} + +# ===== Client ===== +gen client createClientLogic.go 'package client + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateClientLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateClientLogic { + return &CreateClientLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *CreateClientLogic) CreateClient(req *types.ClientReq) error { + _, err := l.svcCtx.SystemRpc.CreateClient(l.ctx, &system.ClientReq{ + ClientId: req.ClientId, Name: req.Name, GrantType: req.GrantType, + AdditionalInfo: req.AdditionalInfo, ActiveTimeout: req.ActiveTimeout, + }) + return err +}' + +gen client updateClientLogic.go 'package client + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateClientLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateClientLogic { + return &UpdateClientLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateClientLogic) UpdateClient(req *types.ClientUpdateReq) error { + _, err := l.svcCtx.SystemRpc.UpdateClient(l.ctx, &system.ClientUpdateReq{ + Id: req.Id, ClientId: req.ClientId, Name: req.Name, GrantType: req.GrantType, + AdditionalInfo: req.AdditionalInfo, ActiveTimeout: req.ActiveTimeout, + }) + return err +}' + +gen client deleteClientLogic.go 'package client + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteClientLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteClientLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteClientLogic { + return &DeleteClientLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteClientLogic) DeleteClient(req *types.IdsReq) error { + _, err := l.svcCtx.SystemRpc.DeleteClient(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err +}' + +gen client getClientListLogic.go 'package client + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type GetClientListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetClientListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetClientListLogic { + return &GetClientListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetClientListLogic) GetClientList(req *types.ClientListReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetClientList(l.ctx, &system.ClientListReq{ + Current: int32(req.Current), PageSize: int32(req.PageSize), Name: req.Name, + }) + if err != nil { return nil, err } + return map[string]interface{}{"list": resp.List, "total": resp.Total, "current": req.Current, "size": req.PageSize}, nil +}' + +echo "===Client done===" + +# ===== Role ===== +gen role createRoleLogic.go 'package role + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateRoleLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateRoleLogic { + return &CreateRoleLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *CreateRoleLogic) CreateRole(req *types.RoleReq) error { + _, err := l.svcCtx.SystemRpc.CreateRole(l.ctx, &system.RoleReq{ + Name: req.Name, Code: req.Code, Sort: int32(req.Sort), MenuIds: req.MenuIds, + }) + return err +}' + +gen role updateRoleLogic.go 'package role + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateRoleLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateRoleLogic { + return &UpdateRoleLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateRoleLogic) UpdateRole(req *types.RoleUpdateReq) error { + _, err := l.svcCtx.SystemRpc.UpdateRole(l.ctx, &system.RoleUpdateReq{ + Id: req.Id, Name: req.Name, Code: req.Code, Sort: int32(req.Sort), MenuIds: req.MenuIds, + }) + return err +}' + +gen role deleteRoleLogic.go 'package role + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteRoleLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteRoleLogic { + return &DeleteRoleLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteRoleLogic) DeleteRole(req *types.IdsReq) error { + _, err := l.svcCtx.SystemRpc.DeleteRole(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err +}' + +gen role getRoleListLogic.go 'package role + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type GetRoleListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetRoleListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRoleListLogic { + return &GetRoleListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetRoleListLogic) GetRoleList(req *types.RoleListReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetRoleList(l.ctx, &system.RoleListReq{ + Current: int32(req.Current), PageSize: int32(req.PageSize), Name: req.Name, + }) + if err != nil { return nil, err } + return map[string]interface{}{"list": resp.List, "total": resp.Total}, nil +}' + +echo "===Role done===" + +# ===== Menu ===== +gen menu createMenuLogic.go 'package menu + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateMenuLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateMenuLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateMenuLogic { + return &CreateMenuLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *CreateMenuLogic) CreateMenu(req *types.MenuReq) error { + _, err := l.svcCtx.SystemRpc.CreateMenu(l.ctx, &system.MenuReq{ + ParentId: req.ParentId, Category: int32(req.Category), Name: req.Name, Title: req.Title, + Code: req.Code, Path: req.Path, Permission: req.Permission, Locale: req.Locale, + Icon: req.Icon, Sort: int32(req.Sort), + }) + return err +}' + +gen menu updateMenuLogic.go 'package menu + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateMenuLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateMenuLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateMenuLogic { + return &UpdateMenuLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateMenuLogic) UpdateMenu(req *types.MenuUpdateReq) error { + _, err := l.svcCtx.SystemRpc.UpdateMenu(l.ctx, &system.MenuUpdateReq{ + Id: req.Id, ParentId: req.ParentId, Category: int32(req.Category), Name: req.Name, Title: req.Title, + Code: req.Code, Path: req.Path, Permission: req.Permission, Locale: req.Locale, + Icon: req.Icon, Sort: int32(req.Sort), + }) + return err +}' + +gen menu deleteMenuLogic.go 'package menu + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteMenuLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteMenuLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteMenuLogic { + return &DeleteMenuLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteMenuLogic) DeleteMenu(req *types.IdsReq) error { + _, err := l.svcCtx.SystemRpc.DeleteMenu(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err +}' + +gen menu getMenuListLogic.go 'package menu + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type GetMenuListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetMenuListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMenuListLogic { + return &GetMenuListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetMenuListLogic) GetMenuList() (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetMenuList(l.ctx, &system.IdReq{}) + if err != nil { return nil, err } + return resp.Menus, nil +}' + +gen menu getMenuByRoleLogic.go 'package menu + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type GetMenuByRoleLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetMenuByRoleLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetMenuByRoleLogic { + return &GetMenuByRoleLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetMenuByRoleLogic) GetMenuByRole(req *types.MenuByRoleReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetMenusByRoleId(l.ctx, &system.GetMenusByRoleIdReq{RoleId: req.RoleId}) + if err != nil { return nil, err } + return resp.Menus, nil +}' + +echo "===Menu done===" + +# ===== Dict ===== +gen dict createDictLogic.go 'package dict + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type CreateDictLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewCreateDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateDictLogic { + return &CreateDictLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *CreateDictLogic) CreateDict(req *types.DictReq) error { + _, err := l.svcCtx.SystemRpc.CreateDict(l.ctx, &system.DictReq{ + Type: req.Type, Label: req.Label, Value: req.Value, Sort: int32(req.Sort), Desc: req.Desc, + }) + return err +}' + +gen dict updateDictLogic.go 'package dict + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateDictLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewUpdateDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateDictLogic { + return &UpdateDictLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *UpdateDictLogic) UpdateDict(req *types.DictUpdateReq) error { + _, err := l.svcCtx.SystemRpc.UpdateDict(l.ctx, &system.DictUpdateReq{ + Id: req.Id, Type: req.Type, Label: req.Label, Value: req.Value, Sort: int32(req.Sort), Desc: req.Desc, + }) + return err +}' + +gen dict deleteDictLogic.go 'package dict + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteDictLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteDictLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteDictLogic { + return &DeleteDictLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteDictLogic) DeleteDict(req *types.IdsReq) error { + _, err := l.svcCtx.SystemRpc.DeleteDict(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err +}' + +gen dict getDictListLogic.go 'package dict + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type GetDictListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetDictListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDictListLogic { + return &GetDictListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetDictListLogic) GetDictList(req *types.DictListReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetDictList(l.ctx, &system.DictListReq{ + Current: int32(req.Current), PageSize: int32(req.PageSize), Type: req.Type, + }) + if err != nil { return nil, err } + return map[string]interface{}{"list": resp.List, "total": resp.Total}, nil +}' + +echo "===Dict done===" + +# ===== OperationRecord ===== +gen operationRecord deleteOperationRecordLogic.go 'package operationRecord + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type DeleteOperationRecordLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewDeleteOperationRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteOperationRecordLogic { + return &DeleteOperationRecordLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *DeleteOperationRecordLogic) DeleteOperationRecord(req *types.IdsReq) error { + _, err := l.svcCtx.SystemRpc.DeleteOperationRecord(l.ctx, &system.IdsReq{Ids: req.Ids}) + return err +}' + +gen operationRecord getOperationRecordListLogic.go 'package operationRecord + +import ( + "context" + "sundynix-micro-go/app/system/api/internal/svc" + "sundynix-micro-go/app/system/api/internal/types" + "sundynix-micro-go/app/system/rpc/pb/system" + "github.com/zeromicro/go-zero/core/logx" +) + +type GetOperationRecordListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewGetOperationRecordListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetOperationRecordListLogic { + return &GetOperationRecordListLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx} +} + +func (l *GetOperationRecordListLogic) GetOperationRecordList(req *types.OperationRecordListReq) (interface{}, error) { + resp, err := l.svcCtx.SystemRpc.GetOperationRecordList(l.ctx, &system.OperationRecordListReq{ + Current: int32(req.Current), PageSize: int32(req.PageSize), + Method: req.Method, Path: req.Path, Status: int32(req.Status), + }) + if err != nil { return nil, err } + return map[string]interface{}{"list": resp.List, "total": resp.Total}, nil +}' + +echo "===ALL SYSTEM-API LOGIC DONE===" diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100755 index 0000000..f437577 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# Sundynix 微服务启动脚本 +# 用法: ./scripts/start.sh [服务名] +# 例如: ./scripts/start.sh user-rpc +# ./scripts/start.sh all (启动所有) +# ./scripts/start.sh gateway + +set -e + +BASE_DIR="$(cd "$(dirname "$0")/.." && pwd)" +APP_DIR="$BASE_DIR/app" + +start_service() { + local name="$1" + local dir="$2" + local entry="$3" + local config="$4" + + echo "🚀 启动 $name ..." + cd "$dir" + go run "$entry" -f "$config" & + echo " PID: $!" +} + +case "${1:-help}" in + user-rpc) + start_service "user-rpc" "$APP_DIR/user/rpc" "user.go" "etc/user.yaml" + ;; + user-api) + start_service "user-api" "$APP_DIR/user/api" "user.go" "etc/user-api.yaml" + ;; + file-rpc) + start_service "file-rpc" "$APP_DIR/file/rpc" "file.go" "etc/file.yaml" + ;; + file-api) + start_service "file-api" "$APP_DIR/file/api" "file.go" "etc/file-api.yaml" + ;; + system-rpc) + start_service "system-rpc" "$APP_DIR/system/rpc" "system.go" "etc/system.yaml" + ;; + system-api) + start_service "system-api" "$APP_DIR/system/api" "system.go" "etc/system-api.yaml" + ;; + plant-rpc) + start_service "plant-rpc" "$APP_DIR/plant/rpc" "plant.go" "etc/plant.yaml" + ;; + plant-api) + start_service "plant-api" "$APP_DIR/plant/api" "plant.go" "etc/plant-api.yaml" + ;; + radio-rpc) + start_service "radio-rpc" "$APP_DIR/radio/rpc" "radio.go" "etc/radio.yaml" + ;; + radio-api) + start_service "radio-api" "$APP_DIR/radio/api" "radio.go" "etc/radio-api.yaml" + ;; + gateway) + start_service "gateway" "$APP_DIR/gateway" "gateway.go" "etc/gateway.yaml" + ;; + all) + echo "===== 启动 RPC 层 =====" + start_service "user-rpc" "$APP_DIR/user/rpc" "user.go" "etc/user.yaml" + start_service "file-rpc" "$APP_DIR/file/rpc" "file.go" "etc/file.yaml" + start_service "system-rpc" "$APP_DIR/system/rpc" "system.go" "etc/system.yaml" + start_service "plant-rpc" "$APP_DIR/plant/rpc" "plant.go" "etc/plant.yaml" + start_service "radio-rpc" "$APP_DIR/radio/rpc" "radio.go" "etc/radio.yaml" + sleep 3 + echo "===== 启动 API 层 =====" + start_service "user-api" "$APP_DIR/user/api" "user.go" "etc/user-api.yaml" + start_service "file-api" "$APP_DIR/file/api" "file.go" "etc/file-api.yaml" + start_service "system-api" "$APP_DIR/system/api" "system.go" "etc/system-api.yaml" + start_service "plant-api" "$APP_DIR/plant/api" "plant.go" "etc/plant-api.yaml" + start_service "radio-api" "$APP_DIR/radio/api" "radio.go" "etc/radio-api.yaml" + sleep 2 + echo "===== 启动网关 =====" + start_service "gateway" "$APP_DIR/gateway" "gateway.go" "etc/gateway.yaml" + echo "" + echo "✅ 全部启动完成,按 Ctrl+C 停止所有服务" + wait + ;; + stop) + echo "停止所有 sundynix 服务..." + pkill -f "sundynix-micro-go/app" 2>/dev/null || true + echo "✅ 已停止" + ;; + *) + echo "用法: $0 {user-rpc|user-api|file-rpc|file-api|system-rpc|system-api|plant-rpc|plant-api|radio-rpc|radio-api|gateway|all|stop}" + ;; +esac