feat: minilogin改造
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
|
||||
"sundynix-micro-go/app/auth/api/internal/svc"
|
||||
"sundynix-micro-go/app/auth/api/internal/types"
|
||||
plantPb "sundynix-micro-go/app/plant/rpc/plant"
|
||||
sysPb "sundynix-micro-go/app/system/rpc/system"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
@@ -54,9 +55,20 @@ func (l *LoginByPhoneLogic) LoginByPhone(req *types.LoginByPhoneReq) (resp *type
|
||||
_ = jsonData
|
||||
_ = url.Values{}
|
||||
|
||||
// 2. 通过 user-rpc 查询用户
|
||||
userResp, err := l.svcCtx.SystemRpc.GetUserByOpenId(l.ctx, &sysPb.GetUserByOpenIdReq{
|
||||
OpenId: req.OpenId,
|
||||
// 2. 通过 plant-rpc 和 system-rpc 获取用户
|
||||
if l.svcCtx.PlantRpc == nil {
|
||||
return nil, fmt.Errorf("植物服务不可用")
|
||||
}
|
||||
profileResp, err := l.svcCtx.PlantRpc.FindOrCreateUserByOpenId(l.ctx, &plantPb.FindOrCreateUserByOpenIdReq{
|
||||
OpenId: req.OpenId,
|
||||
ClientId: req.ClientId,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("微信登录解析失败")
|
||||
}
|
||||
|
||||
userResp, err := l.svcCtx.SystemRpc.GetUserById(l.ctx, &sysPb.GetUserByIdReq{
|
||||
Id: profileResp.UserId,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("用户不存在")
|
||||
|
||||
@@ -112,46 +112,39 @@ func (l *MiniLoginLogic) MiniLogin(req *types.MiniLoginReq) (resp *types.LoginRe
|
||||
return nil, fmt.Errorf("openid为空")
|
||||
}
|
||||
|
||||
// 4. 通过 system-rpc 创建或获取基础用户
|
||||
createResp, err := l.svcCtx.SystemRpc.CreateUser(l.ctx, &sysPb.CreateUserReq{
|
||||
Name: "",
|
||||
OpenId: wxResp.Openid,
|
||||
SessionKey: wxResp.SessionKey,
|
||||
ClientId: req.ClientId,
|
||||
// 4. 根据 clientId 路由到对应业务服务,获取或注册其扩展用户并得到 userId
|
||||
var userId string
|
||||
switch req.ClientId {
|
||||
case ClientIdPlant:
|
||||
if l.svcCtx.PlantRpc == nil {
|
||||
return nil, fmt.Errorf("植物小程序服务不可用")
|
||||
}
|
||||
profileResp, err := l.svcCtx.PlantRpc.FindOrCreateUserByOpenId(l.ctx, &plantPb.FindOrCreateUserByOpenIdReq{
|
||||
OpenId: wxResp.Openid,
|
||||
SessionKey: wxResp.SessionKey,
|
||||
UnionId: wxResp.Unionid,
|
||||
ClientId: req.ClientId,
|
||||
})
|
||||
if err != nil {
|
||||
l.Errorf("微信登录失败(植物服务):%v", err)
|
||||
return nil, fmt.Errorf("登录失败")
|
||||
}
|
||||
userId = profileResp.UserId
|
||||
default:
|
||||
return nil, fmt.Errorf("暂不支持该客户端: %s", req.ClientId)
|
||||
}
|
||||
|
||||
// 5. 根据 userId 获取系统核心基础用户信息
|
||||
userResp, err := l.svcCtx.SystemRpc.GetUserById(l.ctx, &sysPb.GetUserByIdReq{
|
||||
Id: userId,
|
||||
})
|
||||
if err != nil {
|
||||
l.Errorf("创建用户失败: %v", err)
|
||||
l.Errorf("获取系统基础用户信息失败: userId=%s, err=%v", userId, err)
|
||||
return nil, fmt.Errorf("登录失败")
|
||||
}
|
||||
|
||||
userId := createResp.User.Id
|
||||
|
||||
// 5. 异步初始化各业务服务的用户扩展表
|
||||
// 新增小程序:在 switch 里加一个 case 即可
|
||||
go func(uid, clientId string) {
|
||||
bgCtx := context.Background()
|
||||
switch clientId {
|
||||
case ClientIdPlant:
|
||||
if l.svcCtx.PlantRpc == nil {
|
||||
l.Errorf("[MiniLogin] PlantRpc 未配置,跳过 plant profile 初始化")
|
||||
return
|
||||
}
|
||||
if _, err := l.svcCtx.PlantRpc.GetUserProfile(bgCtx, &plantPb.GetProfileReq{
|
||||
UserId: uid,
|
||||
}); err != nil {
|
||||
l.Errorf("[MiniLogin] 初始化 plant profile 失败: userId=%s, err=%v", uid, err)
|
||||
} else {
|
||||
l.Infof("[MiniLogin] plant profile 初始化成功: userId=%s", uid)
|
||||
}
|
||||
// case ClientIdRadio:
|
||||
// l.svcCtx.RadioRpc.GetUserProfile(bgCtx, &radioPb.GetProfileReq{UserId: uid})
|
||||
default:
|
||||
// 未知 clientId 或无需扩展表的场景,跳过
|
||||
}
|
||||
}(userId, req.ClientId)
|
||||
|
||||
// 6. 生成JWT Token
|
||||
token, err := generateToken(l.svcCtx.Config.Auth.AccessSecret, l.svcCtx.Config.Auth.AccessExpire, createResp.User)
|
||||
token, err := generateToken(l.svcCtx.Config.Auth.AccessSecret, l.svcCtx.Config.Auth.AccessExpire, userResp.User)
|
||||
if err != nil {
|
||||
l.Errorf("生成Token失败: %v", err)
|
||||
return nil, fmt.Errorf("登录失败")
|
||||
@@ -159,6 +152,6 @@ func (l *MiniLoginLogic) MiniLogin(req *types.MiniLoginReq) (resp *types.LoginRe
|
||||
|
||||
return &types.LoginResp{
|
||||
Token: token,
|
||||
UserInfo: createResp.User,
|
||||
UserInfo: userResp.User,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -15,10 +15,6 @@ type SundynixUser struct {
|
||||
Password string `gorm:"size:100;column:password" json:"-"`
|
||||
NickName string `gorm:"size:100;column:nick_name" json:"nickName"`
|
||||
Phone string `gorm:"size:20;column:phone" json:"phone"`
|
||||
SessionKey string `gorm:"size:80;column:session_key" json:"-"`
|
||||
UnionID string `gorm:"size:80;column:union_id" json:"unionId"`
|
||||
OpenID string `gorm:"size:80;column:open_id;index" json:"openId"`
|
||||
SaOpenID string `gorm:"size:80;column:sa_open_id" json:"saOpenId"`
|
||||
AvatarID string `gorm:"size:50;column:avatar_id" json:"avatarId"`
|
||||
Gender int `gorm:"default:0;column:gender" json:"gender"`
|
||||
LastLoginIP string `gorm:"size:20;column:last_login_ip" json:"lastLoginIp"`
|
||||
|
||||
@@ -18,8 +18,10 @@ func GetLevelConfigListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.LevelConfigListReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
response.Fail(w, err.Error())
|
||||
return
|
||||
if r.Method != http.MethodGet {
|
||||
response.Fail(w, err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
l := config.NewGetLevelConfigListLogic(r.Context(), svcCtx)
|
||||
|
||||
@@ -3,11 +3,15 @@ package complete
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
filePb "sundynix-micro-go/app/file/rpc/file"
|
||||
"sundynix-micro-go/app/plant/api/internal/svc"
|
||||
"sundynix-micro-go/app/plant/api/internal/types"
|
||||
plantModel "sundynix-micro-go/app/plant/model"
|
||||
plantPb "sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type CompleteTaskLogic struct {
|
||||
@@ -20,9 +24,93 @@ func NewCompleteTaskLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Comp
|
||||
return &CompleteTaskLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
|
||||
}
|
||||
|
||||
func (l *CompleteTaskLogic) CompleteTask(req *types.CompleteTaskApiReq) (*plantPb.TaskCompletionResult, error) {
|
||||
func (l *CompleteTaskLogic) CompleteTask(req *types.CompleteTaskApiReq) (interface{}, error) {
|
||||
userId := fmt.Sprintf("%v", l.ctx.Value("userId"))
|
||||
return l.svcCtx.PlantRpc.CompleteTask(l.ctx, &plantPb.CompleteTaskReq{
|
||||
resp, err := l.svcCtx.PlantRpc.CompleteTask(l.ctx, &plantPb.CompleteTaskReq{
|
||||
UserId: userId, TaskId: req.TaskId, Remark: req.Remark,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// 1. 拼装当前等级详情(在升级时包含 perks 等完整字段,完美渲染等级弹窗)
|
||||
var currentLevelData map[string]interface{}
|
||||
if resp.CurrentLevel != nil {
|
||||
currentLevelData = map[string]interface{}{
|
||||
"id": resp.CurrentLevel.Id,
|
||||
"level": resp.CurrentLevel.Level,
|
||||
"title": resp.CurrentLevel.Title,
|
||||
"minSunlight": resp.CurrentLevel.MinSunlight,
|
||||
"perks": "",
|
||||
}
|
||||
// 若发生升级,自动利用 GORM 提取等级的 Perks 描述
|
||||
if resp.IsLevelUp {
|
||||
var lvl plantModel.LevelConfig
|
||||
if errLvl := l.svcCtx.DB.Where("id = ?", resp.CurrentLevel.Id).First(&lvl).Error; errLvl == nil {
|
||||
currentLevelData["perks"] = lvl.Perks
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2. 拼装新获得徽章详情(包含 description 和 icon.url,完美渲染新徽章弹窗)
|
||||
var newBadgeData map[string]interface{}
|
||||
if resp.IsGetBadge && resp.NewBadge != nil {
|
||||
var bc plantModel.BadgeConfig
|
||||
if errBc := l.svcCtx.DB.Where("id = ?", resp.NewBadge.Id).First(&bc).Error; errBc == nil {
|
||||
newBadgeData = map[string]interface{}{
|
||||
"id": bc.ID,
|
||||
"name": bc.Name,
|
||||
"description": bc.Description,
|
||||
"iconId": bc.IconID,
|
||||
"dimension": bc.Dimension,
|
||||
"groupId": bc.GroupID,
|
||||
"tier": bc.Tier,
|
||||
"targetAction": bc.TargetAction,
|
||||
"threshold": bc.Threshold,
|
||||
"comparator": bc.Comparator,
|
||||
"rewardSunlight": bc.RewardSunlight,
|
||||
"sort": bc.Sort,
|
||||
"icon": nil,
|
||||
}
|
||||
// 跨微服务请求获取 Icon 图片 URL 等元数据
|
||||
if bc.IconID != "" {
|
||||
fileResp, errFile := l.svcCtx.FileRpc.GetFilesByIds(l.ctx, &filePb.GetFilesByIdsReq{Ids: []string{bc.IconID}})
|
||||
if errFile == nil && fileResp != nil && len(fileResp.Files) > 0 {
|
||||
f := fileResp.Files[0]
|
||||
newBadgeData["icon"] = map[string]interface{}{
|
||||
"id": f.Id,
|
||||
"name": f.Name,
|
||||
"url": f.Url,
|
||||
"tag": f.Tag,
|
||||
"key": f.Key,
|
||||
"suffix": f.Suffix,
|
||||
"md5": f.Md5,
|
||||
"createdAt": time.Unix(f.CreatedAt, 0).Format(time.RFC3339),
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 兜底映射
|
||||
newBadgeData = map[string]interface{}{
|
||||
"id": resp.NewBadge.Id,
|
||||
"name": resp.NewBadge.Name,
|
||||
"dimension": resp.NewBadge.Dimension,
|
||||
"tier": resp.NewBadge.Tier,
|
||||
"rewardSunlight": resp.NewBadge.RewardSunlight,
|
||||
"icon": nil,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 构建高度兼容的 JSON 响应,同时适配大小写驼峰字段
|
||||
res := map[string]interface{}{
|
||||
"isLevelUp": resp.IsLevelUp,
|
||||
"currentLevel": currentLevelData,
|
||||
"isGetBadge": resp.IsGetBadge,
|
||||
"IsGetBadge": resp.IsGetBadge, // 兼容前端多处命名差异
|
||||
"newBadge": newBadgeData,
|
||||
"rewardSunlight": resp.RewardSunlight,
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
@@ -2,10 +2,13 @@ package complete
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
filePb "sundynix-micro-go/app/file/rpc/file"
|
||||
"sundynix-micro-go/app/plant/api/internal/svc"
|
||||
plantModel "sundynix-micro-go/app/plant/model"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"sundynix-micro-go/app/plant/api/internal/svc"
|
||||
plantPb "sundynix-micro-go/app/plant/rpc/plant"
|
||||
)
|
||||
|
||||
type GetBadgeConfigTreeLogic struct {
|
||||
@@ -18,6 +21,142 @@ func NewGetBadgeConfigTreeLogic(ctx context.Context, svcCtx *svc.ServiceContext)
|
||||
return &GetBadgeConfigTreeLogic{Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx}
|
||||
}
|
||||
|
||||
func (l *GetBadgeConfigTreeLogic) GetBadgeConfigTree() (*plantPb.BadgeConfigTreeResp, error) {
|
||||
return l.svcCtx.PlantRpc.GetBadgeConfigTree(l.ctx, &plantPb.IdReq{})
|
||||
func (l *GetBadgeConfigTreeLogic) GetBadgeConfigTree() (interface{}, error) {
|
||||
var allBadges []plantModel.BadgeConfig
|
||||
err := l.svcCtx.DB.Order("dimension desc, group_id asc, tier asc, sort asc").Find(&allBadges).Error
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
iconIds := make([]string, 0)
|
||||
iconIdMap := make(map[string]bool)
|
||||
for _, b := range allBadges {
|
||||
if b.IconID != "" && !iconIdMap[b.IconID] {
|
||||
iconIdMap[b.IconID] = true
|
||||
iconIds = append(iconIds, b.IconID)
|
||||
}
|
||||
}
|
||||
|
||||
fileMap := make(map[string]map[string]interface{})
|
||||
if len(iconIds) > 0 {
|
||||
resp, err := l.svcCtx.FileRpc.GetFilesByIds(l.ctx, &filePb.GetFilesByIdsReq{Ids: iconIds})
|
||||
if err == nil && resp != nil {
|
||||
for _, f := range resp.Files {
|
||||
fileMap[f.Id] = map[string]interface{}{
|
||||
"id": f.Id,
|
||||
"name": f.Name,
|
||||
"url": f.Url,
|
||||
"tag": f.Tag,
|
||||
"key": f.Key,
|
||||
"suffix": f.Suffix,
|
||||
"md5": f.Md5,
|
||||
"createdAt": time.Unix(f.CreatedAt, 0).Format(time.RFC3339),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dimLabelMap := map[string]string{
|
||||
"PERSISTENCE": "勤勉成就",
|
||||
"EXPERTISE": "专家成就",
|
||||
"JOURNAL": "岁月记录",
|
||||
"DISCOVERY": "探索发现",
|
||||
}
|
||||
|
||||
groupLabelMap := map[string]string{
|
||||
"water_master": "雨露均沾",
|
||||
"alive_master": "长情陪伴",
|
||||
"fert_master": "炼金术士",
|
||||
"prune_master": "园艺理发师",
|
||||
"repot_master": "乔迁之喜",
|
||||
"doctor_master": "植物医生",
|
||||
"photo_master": "光影捕手",
|
||||
"night_owl": "守夜人",
|
||||
}
|
||||
|
||||
dimOrder := []string{"PERSISTENCE", "EXPERTISE", "JOURNAL", "DISCOVERY"}
|
||||
|
||||
// Build dimension -> groupId -> badge list
|
||||
tempMap := make(map[string]map[string][]map[string]interface{})
|
||||
for _, b := range allBadges {
|
||||
dim := b.Dimension
|
||||
group := b.GroupID
|
||||
|
||||
badgeData := map[string]interface{}{
|
||||
"id": b.ID,
|
||||
"name": b.Name,
|
||||
"description": b.Description,
|
||||
"iconId": b.IconID,
|
||||
"dimension": b.Dimension,
|
||||
"groupId": b.GroupID,
|
||||
"tier": b.Tier,
|
||||
"targetAction": b.TargetAction,
|
||||
"threshold": b.Threshold,
|
||||
"comparator": b.Comparator,
|
||||
"rewardSunlight": b.RewardSunlight,
|
||||
"sort": b.Sort,
|
||||
"createdAt": b.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
}
|
||||
if iconData, ok := fileMap[b.IconID]; ok {
|
||||
badgeData["icon"] = iconData
|
||||
} else {
|
||||
badgeData["icon"] = nil
|
||||
}
|
||||
|
||||
if tempMap[dim] == nil {
|
||||
tempMap[dim] = make(map[string][]map[string]interface{})
|
||||
}
|
||||
tempMap[dim][group] = append(tempMap[dim][group], badgeData)
|
||||
}
|
||||
|
||||
var tree []map[string]interface{}
|
||||
for _, dimKey := range dimOrder {
|
||||
if groupMap, exists := tempMap[dimKey]; exists {
|
||||
var groupNodes []map[string]interface{}
|
||||
for groupKey, badges := range groupMap {
|
||||
gLabel := groupLabelMap[groupKey]
|
||||
if gLabel == "" {
|
||||
gLabel = groupKey
|
||||
}
|
||||
groupNodes = append(groupNodes, map[string]interface{}{
|
||||
"groupId": groupKey,
|
||||
"groupLabel": gLabel,
|
||||
"badges": badges,
|
||||
})
|
||||
}
|
||||
dLabel := dimLabelMap[dimKey]
|
||||
if dLabel == "" {
|
||||
dLabel = dimKey
|
||||
}
|
||||
tree = append(tree, map[string]interface{}{
|
||||
"dimension": dimKey,
|
||||
"label": dLabel,
|
||||
"groups": groupNodes,
|
||||
})
|
||||
delete(tempMap, dimKey)
|
||||
}
|
||||
}
|
||||
|
||||
// Handle leftover dimensions
|
||||
for dimKey, groupMap := range tempMap {
|
||||
var groupNodes []map[string]interface{}
|
||||
for groupKey, badges := range groupMap {
|
||||
gLabel := groupLabelMap[groupKey]
|
||||
if gLabel == "" {
|
||||
gLabel = groupKey
|
||||
}
|
||||
groupNodes = append(groupNodes, map[string]interface{}{
|
||||
"groupId": groupKey,
|
||||
"groupLabel": gLabel,
|
||||
"badges": badges,
|
||||
})
|
||||
}
|
||||
tree = append(tree, map[string]interface{}{
|
||||
"dimension": dimKey,
|
||||
"label": dimKey,
|
||||
"groups": groupNodes,
|
||||
})
|
||||
}
|
||||
|
||||
return tree, nil
|
||||
}
|
||||
|
||||
@@ -36,7 +36,18 @@ func (l *GetLevelConfigListLogic) GetLevelConfigList(req *types.LevelConfigListR
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resList := make([]map[string]interface{}, 0, len(result.List))
|
||||
for _, item := range result.List {
|
||||
resList = append(resList, map[string]interface{}{
|
||||
"id": item.Id,
|
||||
"level": item.Level,
|
||||
"title": item.Title,
|
||||
"minSunlight": item.MinSunlight, // Explicitly keep 0 values in JSON
|
||||
"perks": item.Perks,
|
||||
})
|
||||
}
|
||||
|
||||
return map[string]interface{}{
|
||||
"list": result.List,
|
||||
"list": resList,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.10.1
|
||||
|
||||
package userProfile
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
filePb "sundynix-micro-go/app/file/rpc/file"
|
||||
"sundynix-micro-go/app/plant/api/internal/svc"
|
||||
plantModel "sundynix-micro-go/app/plant/model"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"sundynix-micro-go/app/plant/api/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
)
|
||||
|
||||
type GetUserProfileLogic struct {
|
||||
@@ -33,5 +34,98 @@ func (l *GetUserProfileLogic) GetUserProfile() (interface{}, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return result, nil
|
||||
|
||||
// 1. 获取 Avatar 详情
|
||||
var avatarData map[string]interface{}
|
||||
if result.AvatarId != "" {
|
||||
avatarData = l.fetchAvatar(result.AvatarId)
|
||||
}
|
||||
|
||||
// 2. 获取 Level 详情
|
||||
var levelData map[string]interface{}
|
||||
var lvl plantModel.LevelConfig
|
||||
levelFound := false
|
||||
|
||||
if result.LevelId != "" {
|
||||
if errLvl := l.svcCtx.DB.Where("id = ?", result.LevelId).First(&lvl).Error; errLvl == nil {
|
||||
levelFound = true
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有在数据库中找到 level_id,或者 level_id 为空,根据用户 totalSunlight 动态查找最匹配的等级
|
||||
if !levelFound {
|
||||
var matchedLvl plantModel.LevelConfig
|
||||
// 查找最匹配的等级:total_sunlight >= min_sunlight 中 level 最大的那一个
|
||||
errLvl := l.svcCtx.DB.Order("level desc").Where("min_sunlight <= ?", result.TotalSunlight).First(&matchedLvl).Error
|
||||
if errLvl == nil {
|
||||
lvl = matchedLvl
|
||||
levelFound = true
|
||||
// 自动更新用户资料表的 level_id,保证后续一致性
|
||||
l.svcCtx.DB.Model(&plantModel.UserProfile{}).Where("id = ?", result.Id).Update("level_id", matchedLvl.ID)
|
||||
} else {
|
||||
// 如果没有等级配置,使用 level = 1 的配置作为默认
|
||||
var firstLvl plantModel.LevelConfig
|
||||
if l.svcCtx.DB.Order("level asc").First(&firstLvl).Error == nil {
|
||||
lvl = firstLvl
|
||||
levelFound = true
|
||||
l.svcCtx.DB.Model(&plantModel.UserProfile{}).Where("id = ?", result.Id).Update("level_id", firstLvl.ID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if levelFound {
|
||||
levelData = map[string]interface{}{
|
||||
"id": lvl.ID,
|
||||
"level": lvl.Level,
|
||||
"title": lvl.Title,
|
||||
"minSunlight": lvl.MinSunlight,
|
||||
"perks": lvl.Perks,
|
||||
"createdAt": lvl.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 构造兼容新旧版本的复合 JSON 数据
|
||||
res := map[string]interface{}{
|
||||
"id": result.Id,
|
||||
"userId": result.UserId,
|
||||
"nickName": result.NickName,
|
||||
"nickname": result.NickName, // 兼容旧版 json tag
|
||||
"avatarId": result.AvatarId,
|
||||
"levelId": result.LevelId,
|
||||
"currentSunlight": result.CurrentSunlight,
|
||||
"totalSunlight": result.TotalSunlight,
|
||||
"plantCount": result.PlantCount,
|
||||
"careCount": result.CareCount,
|
||||
"postCount": result.PostCount,
|
||||
"waterCount": result.WaterCount,
|
||||
"fertilizeCount": result.FertilizeCount,
|
||||
"repotCount": result.RepotCount,
|
||||
"pruneCount": result.PruneCount,
|
||||
"photoCount": result.PhotoCount,
|
||||
"avatar": avatarData,
|
||||
"level": levelData,
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (l *GetUserProfileLogic) fetchAvatar(avatarId string) map[string]interface{} {
|
||||
if avatarId == "" {
|
||||
return nil
|
||||
}
|
||||
resp, err := l.svcCtx.FileRpc.GetFilesByIds(l.ctx, &filePb.GetFilesByIdsReq{Ids: []string{avatarId}})
|
||||
if err != nil || resp == nil || len(resp.Files) == 0 {
|
||||
return nil
|
||||
}
|
||||
f := resp.Files[0]
|
||||
return map[string]interface{}{
|
||||
"id": f.Id,
|
||||
"name": f.Name,
|
||||
"url": f.Url,
|
||||
"tag": f.Tag,
|
||||
"key": f.Key,
|
||||
"suffix": f.Suffix,
|
||||
"md5": f.Md5,
|
||||
"createdAt": time.Unix(f.CreatedAt, 0).Format(time.RFC3339),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@ type UserProfile struct {
|
||||
model.BaseModel
|
||||
UserID string `gorm:"size:50;uniqueIndex;column:user_id" json:"userId"`
|
||||
MiniOpenID string `gorm:"size:80;column:mini_open_id" json:"miniOpenId"`
|
||||
SessionKey string `gorm:"size:80;column:session_key" json:"sessionKey"`
|
||||
UnionID string `gorm:"size:80;column:union_id" json:"unionId"`
|
||||
SaOpenID string `gorm:"size:80;column:sa_open_id" json:"saOpenId"`
|
||||
NickName string `gorm:"size:100;column:nick_name" json:"nickName"`
|
||||
AvatarID string `gorm:"size:50;column:avatar_id" json:"avatarId"`
|
||||
LevelID string `gorm:"size:50;column:level_id" json:"levelId"`
|
||||
@@ -302,6 +305,7 @@ type LevelConfig struct {
|
||||
Title string `gorm:"size:50;column:title" json:"title"`
|
||||
MinSunlight int64 `gorm:"column:min_sunlight" json:"minSunlight"`
|
||||
Perks string `gorm:"size:200;column:perks" json:"perks"`
|
||||
Preserve string `gorm:"column:preserve" json:"preserve"`
|
||||
}
|
||||
|
||||
func (LevelConfig) TableName() string { return "sundynix_plant_level_config" }
|
||||
|
||||
@@ -10,3 +10,9 @@ Etcd:
|
||||
|
||||
DB:
|
||||
DataSource: root:root@tcp(192.168.100.127:3307)/sundynix_micro_go?charset=utf8mb4&parseTime=True&loc=Local
|
||||
|
||||
SystemRpc:
|
||||
Etcd:
|
||||
Hosts:
|
||||
- 192.168.100.127:2379
|
||||
Key: system.rpc
|
||||
|
||||
@@ -7,4 +7,5 @@ type Config struct {
|
||||
DB struct {
|
||||
DataSource string
|
||||
}
|
||||
SystemRpc zrpc.RpcClientConf
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
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 CreateBannerLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewCreateBannerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateBannerLogic {
|
||||
return &CreateBannerLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// Banner
|
||||
func (l *CreateBannerLogic) CreateBanner(in *plant.CreateBannerReq) (*plant.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CommonResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
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 DeleteBannerLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewDeleteBannerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteBannerLogic {
|
||||
return &DeleteBannerLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DeleteBannerLogic) DeleteBanner(in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CommonResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
plantModel "sundynix-micro-go/app/plant/model"
|
||||
"sundynix-micro-go/app/plant/rpc/internal/svc"
|
||||
"sundynix-micro-go/app/plant/rpc/plant"
|
||||
sysPb "sundynix-micro-go/app/system/rpc/system"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type FindOrCreateUserByOpenIdLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewFindOrCreateUserByOpenIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FindOrCreateUserByOpenIdLogic {
|
||||
return &FindOrCreateUserByOpenIdLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *FindOrCreateUserByOpenIdLogic) FindOrCreateUserByOpenId(in *plant.FindOrCreateUserByOpenIdReq) (*plant.PlantUserProfile, error) {
|
||||
if in.OpenId == "" {
|
||||
return nil, fmt.Errorf("openid 不能为空")
|
||||
}
|
||||
|
||||
// 1. 根据 mini_open_id 查询植物用户扩展表
|
||||
var profile plantModel.UserProfile
|
||||
err := l.svcCtx.DB.Where("mini_open_id = ?", in.OpenId).First(&profile).Error
|
||||
|
||||
if err == nil {
|
||||
// 1.1 用户已存在:如果 session_key 发生变化则进行更新
|
||||
if in.SessionKey != "" && (in.SessionKey != profile.SessionKey || in.UnionId != profile.UnionID || in.SaOpenId != profile.SaOpenID) {
|
||||
l.svcCtx.DB.Model(&profile).Updates(map[string]interface{}{
|
||||
"session_key": in.SessionKey,
|
||||
"union_id": in.UnionId,
|
||||
"sa_open_id": in.SaOpenId,
|
||||
})
|
||||
}
|
||||
return profileToProto(&profile), nil
|
||||
}
|
||||
|
||||
// 2. 用户不存在:分步创建(先 System RPC 创建基础用户,再本地创建扩展用户)
|
||||
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
l.Errorf("[FindOrCreateUserByOpenId] 查询扩展表失败: openid=%s, err=%v", in.OpenId, err)
|
||||
return nil, fmt.Errorf("系统繁忙,请稍后再试")
|
||||
}
|
||||
|
||||
// 2.1 调用 System RPC 创建基础用户(遵守服务边界,不直接写 system 表)
|
||||
createResp, err := l.svcCtx.SystemRpc.CreateUser(l.ctx, &sysPb.CreateUserReq{
|
||||
ClientId: in.ClientId,
|
||||
NickName: "园艺新手",
|
||||
})
|
||||
if err != nil {
|
||||
l.Errorf("[FindOrCreateUserByOpenId] 调用 System RPC 创建基础用户失败: err=%v", err)
|
||||
return nil, fmt.Errorf("注册用户失败")
|
||||
}
|
||||
userId := createResp.User.Id
|
||||
l.Infof("[FindOrCreateUserByOpenId] ✅ System 基础用户创建成功: userId=%s", userId)
|
||||
|
||||
// 2.2 自动匹配初始等级 ID (获取首个等级,一般是 Level 1)
|
||||
var firstLevel plantModel.LevelConfig
|
||||
levelErr := l.svcCtx.DB.Order("level asc").First(&firstLevel).Error
|
||||
levelID := ""
|
||||
if levelErr == nil {
|
||||
levelID = firstLevel.ID
|
||||
}
|
||||
|
||||
// 2.3 本地事务创建应用专属扩展表
|
||||
profile = plantModel.UserProfile{
|
||||
UserID: userId,
|
||||
MiniOpenID: in.OpenId,
|
||||
SessionKey: in.SessionKey,
|
||||
UnionID: in.UnionId,
|
||||
SaOpenID: in.SaOpenId,
|
||||
NickName: "园艺新手",
|
||||
LevelID: levelID,
|
||||
CurrentSunlight: 0,
|
||||
TotalSunlight: 0,
|
||||
}
|
||||
|
||||
if err = l.svcCtx.DB.Create(&profile).Error; err != nil {
|
||||
l.Errorf("[FindOrCreateUserByOpenId] 创建用户扩展表失败: err=%v", err)
|
||||
|
||||
// 2.4 补偿回滚:删除已创建的 System 基础用户,避免孤儿记录
|
||||
_, delErr := l.svcCtx.SystemRpc.DeleteUser(l.ctx, &sysPb.DeleteUserReq{
|
||||
Ids: []string{userId},
|
||||
})
|
||||
if delErr != nil {
|
||||
l.Errorf("[FindOrCreateUserByOpenId] ⚠️ 补偿删除基础用户失败: userId=%s, err=%v", userId, delErr)
|
||||
// 即使补偿失败也返回原始错误,孤儿记录可通过后台定期清理
|
||||
} else {
|
||||
l.Infof("[FindOrCreateUserByOpenId] 补偿删除基础用户成功: userId=%s", userId)
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("注册应用扩展失败")
|
||||
}
|
||||
|
||||
l.Infof("[FindOrCreateUserByOpenId] ✅ 成功创建游客账户: userId=%s, openid=%s", userId, in.OpenId)
|
||||
|
||||
return profileToProto(&profile), nil
|
||||
}
|
||||
|
||||
// profileToProto 将 model 转为 proto 响应
|
||||
func profileToProto(p *plantModel.UserProfile) *plant.PlantUserProfile {
|
||||
return &plant.PlantUserProfile{
|
||||
Id: p.ID,
|
||||
UserId: p.UserID,
|
||||
NickName: p.NickName,
|
||||
AvatarId: p.AvatarID,
|
||||
LevelId: p.LevelID,
|
||||
CurrentSunlight: p.CurrentSunlight,
|
||||
TotalSunlight: p.TotalSunlight,
|
||||
PlantCount: p.PlantCount,
|
||||
CareCount: p.CareCount,
|
||||
PostCount: p.PostCount,
|
||||
WaterCount: p.WaterCount,
|
||||
FertilizeCount: p.FertilizeCount,
|
||||
RepotCount: p.RepotCount,
|
||||
PruneCount: p.PruneCount,
|
||||
PhotoCount: p.PhotoCount,
|
||||
MiniOpenId: p.MiniOpenID,
|
||||
SessionKey: p.SessionKey,
|
||||
UnionId: p.UnionID,
|
||||
SaOpenId: p.SaOpenID,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
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 GetActiveBannerListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetActiveBannerListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetActiveBannerListLogic {
|
||||
return &GetActiveBannerListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetActiveBannerListLogic) GetActiveBannerList(in *plant.PageReq) (*plant.BannerListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.BannerListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
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 GetBannerListLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetBannerListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetBannerListLogic {
|
||||
return &GetBannerListLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *GetBannerListLogic) GetBannerList(in *plant.BannerListReq) (*plant.BannerListResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.BannerListResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
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 QuickCareLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewQuickCareLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QuickCareLogic {
|
||||
return &QuickCareLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// 快捷养护
|
||||
func (l *QuickCareLogic) QuickCare(in *plant.QuickCareReq) (*plant.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CommonResp{}, nil
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
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 UpdateBannerLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewUpdateBannerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateBannerLogic {
|
||||
return &UpdateBannerLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *UpdateBannerLogic) UpdateBanner(in *plant.UpdateBannerReq) (*plant.CommonResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &plant.CommonResp{}, nil
|
||||
}
|
||||
@@ -18,244 +18,399 @@ type PlantServiceServer struct {
|
||||
}
|
||||
|
||||
func NewPlantServiceServer(svcCtx *svc.ServiceContext) *PlantServiceServer {
|
||||
return &PlantServiceServer{svcCtx: svcCtx}
|
||||
return &PlantServiceServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// ---- 用户Profile ----
|
||||
// 用户Profile
|
||||
func (s *PlantServiceServer) GetUserProfile(ctx context.Context, in *plant.GetProfileReq) (*plant.PlantUserProfile, error) {
|
||||
return logic.NewGetUserProfileLogic(ctx, s.svcCtx).GetUserProfile(in)
|
||||
l := logic.NewGetUserProfileLogic(ctx, s.svcCtx)
|
||||
return l.GetUserProfile(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) FindOrCreateUserByOpenId(ctx context.Context, in *plant.FindOrCreateUserByOpenIdReq) (*plant.PlantUserProfile, error) {
|
||||
l := logic.NewFindOrCreateUserByOpenIdLogic(ctx, s.svcCtx)
|
||||
return l.FindOrCreateUserByOpenId(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdateUserProfile(ctx context.Context, in *plant.UpdateProfileReq) (*plant.CommonResp, error) {
|
||||
return logic.NewUpdateUserProfileLogic(ctx, s.svcCtx).UpdateUserProfile(in)
|
||||
l := logic.NewUpdateUserProfileLogic(ctx, s.svcCtx)
|
||||
return l.UpdateUserProfile(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetMyBadges(ctx context.Context, in *plant.GetProfileReq) (*plant.UserBadgeListResp, error) {
|
||||
return logic.NewGetMyBadgesLogic(ctx, s.svcCtx).GetMyBadges(in)
|
||||
l := logic.NewGetMyBadgesLogic(ctx, s.svcCtx)
|
||||
return l.GetMyBadges(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetMyStars(ctx context.Context, in *plant.GetProfileReq) (*plant.UserStarListResp, error) {
|
||||
return logic.NewGetMyStarsLogic(ctx, s.svcCtx).GetMyStars(in)
|
||||
l := logic.NewGetMyStarsLogic(ctx, s.svcCtx)
|
||||
return l.GetMyStars(in)
|
||||
}
|
||||
|
||||
// ---- 我的植物 ----
|
||||
// 我的植物
|
||||
func (s *PlantServiceServer) CreatePlant(ctx context.Context, in *plant.CreatePlantReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCreatePlantLogic(ctx, s.svcCtx).CreatePlant(in)
|
||||
l := logic.NewCreatePlantLogic(ctx, s.svcCtx)
|
||||
return l.CreatePlant(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdatePlant(ctx context.Context, in *plant.UpdatePlantReq) (*plant.CommonResp, error) {
|
||||
return logic.NewUpdatePlantLogic(ctx, s.svcCtx).UpdatePlant(in)
|
||||
l := logic.NewUpdatePlantLogic(ctx, s.svcCtx)
|
||||
return l.UpdatePlant(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeletePlant(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeletePlantLogic(ctx, s.svcCtx).DeletePlant(in)
|
||||
l := logic.NewDeletePlantLogic(ctx, s.svcCtx)
|
||||
return l.DeletePlant(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetPlantList(ctx context.Context, in *plant.PlantListReq) (*plant.PlantListResp, error) {
|
||||
return logic.NewGetPlantListLogic(ctx, s.svcCtx).GetPlantList(in)
|
||||
l := logic.NewGetPlantListLogic(ctx, s.svcCtx)
|
||||
return l.GetPlantList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetPlantDetail(ctx context.Context, in *plant.IdReq) (*plant.PlantDetailResp, error) {
|
||||
return logic.NewGetPlantDetailLogic(ctx, s.svcCtx).GetPlantDetail(in)
|
||||
l := logic.NewGetPlantDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetPlantDetail(in)
|
||||
}
|
||||
|
||||
// ---- 养护 ----
|
||||
// 养护
|
||||
func (s *PlantServiceServer) AddCarePlan(ctx context.Context, in *plant.AddCarePlanReq) (*plant.CommonResp, error) {
|
||||
return logic.NewAddCarePlanLogic(ctx, s.svcCtx).AddCarePlan(in)
|
||||
l := logic.NewAddCarePlanLogic(ctx, s.svcCtx)
|
||||
return l.AddCarePlan(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteCarePlan(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteCarePlanLogic(ctx, s.svcCtx).DeleteCarePlan(in)
|
||||
l := logic.NewDeleteCarePlanLogic(ctx, s.svcCtx)
|
||||
return l.DeleteCarePlan(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetTodayTaskList(ctx context.Context, in *plant.GetProfileReq) (*plant.CareTaskListResp, error) {
|
||||
return logic.NewGetTodayTaskListLogic(ctx, s.svcCtx).GetTodayTaskList(in)
|
||||
}
|
||||
func (s *PlantServiceServer) AddCareRecord(ctx context.Context, in *plant.AddCareRecordReq) (*plant.CommonResp, error) {
|
||||
return logic.NewAddCareRecordLogic(ctx, s.svcCtx).AddCareRecord(in)
|
||||
}
|
||||
func (s *PlantServiceServer) AddGrowthRecord(ctx context.Context, in *plant.AddGrowthRecordReq) (*plant.CommonResp, error) {
|
||||
return logic.NewAddGrowthRecordLogic(ctx, s.svcCtx).AddGrowthRecord(in)
|
||||
l := logic.NewGetTodayTaskListLogic(ctx, s.svcCtx)
|
||||
return l.GetTodayTaskList(in)
|
||||
}
|
||||
|
||||
// ---- 百科 ----
|
||||
func (s *PlantServiceServer) GetWikiList(ctx context.Context, in *plant.WikiListReq) (*plant.WikiListResp, error) {
|
||||
return logic.NewGetWikiListLogic(ctx, s.svcCtx).GetWikiList(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetWikiDetail(ctx context.Context, in *plant.IdReq) (*plant.WikiDetailResp, error) {
|
||||
return logic.NewGetWikiDetailLogic(ctx, s.svcCtx).GetWikiDetail(in)
|
||||
}
|
||||
func (s *PlantServiceServer) CreateWiki(ctx context.Context, in *plant.CreateWikiReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCreateWikiLogic(ctx, s.svcCtx).CreateWiki(in)
|
||||
}
|
||||
func (s *PlantServiceServer) UpdateWiki(ctx context.Context, in *plant.UpdateWikiReq) (*plant.CommonResp, error) {
|
||||
return logic.NewUpdateWikiLogic(ctx, s.svcCtx).UpdateWiki(in)
|
||||
}
|
||||
func (s *PlantServiceServer) DeleteWiki(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteWikiLogic(ctx, s.svcCtx).DeleteWiki(in)
|
||||
}
|
||||
func (s *PlantServiceServer) SyncWikiVector(ctx context.Context, in *plant.SyncWikiVectorReq) (*plant.CommonResp, error) {
|
||||
return logic.NewSyncWikiVectorLogic(ctx, s.svcCtx).SyncWikiVector(in)
|
||||
}
|
||||
func (s *PlantServiceServer) DeleteWikiVector(ctx context.Context, in *plant.SyncWikiVectorReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteWikiVectorLogic(ctx, s.svcCtx).DeleteWikiVector(in)
|
||||
}
|
||||
func (s *PlantServiceServer) SyncAllWikiVector(ctx context.Context, in *plant.PageReq) (*plant.CommonResp, error) {
|
||||
return logic.NewSyncAllWikiVectorLogic(ctx, s.svcCtx).SyncAllWikiVector(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetWikiClassList(ctx context.Context, in *plant.IdReq) (*plant.WikiClassListResp, error) {
|
||||
return logic.NewGetWikiClassListLogic(ctx, s.svcCtx).GetWikiClassList(in)
|
||||
}
|
||||
func (s *PlantServiceServer) CreateWikiClass(ctx context.Context, in *plant.CreateWikiClassReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCreateWikiClassLogic(ctx, s.svcCtx).CreateWikiClass(in)
|
||||
}
|
||||
func (s *PlantServiceServer) UpdateWikiClass(ctx context.Context, in *plant.UpdateWikiClassReq) (*plant.CommonResp, error) {
|
||||
return logic.NewUpdateWikiClassLogic(ctx, s.svcCtx).UpdateWikiClass(in)
|
||||
}
|
||||
func (s *PlantServiceServer) DeleteWikiClass(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteWikiClassLogic(ctx, s.svcCtx).DeleteWikiClass(in)
|
||||
}
|
||||
func (s *PlantServiceServer) ToggleWikiStar(ctx context.Context, in *plant.ToggleStarReq) (*plant.CommonResp, error) {
|
||||
return logic.NewToggleWikiStarLogic(ctx, s.svcCtx).ToggleWikiStar(in)
|
||||
}
|
||||
|
||||
// ---- OCR ----
|
||||
func (s *PlantServiceServer) GetMyClassifyLog(ctx context.Context, in *plant.GetProfileReq) (*plant.ClassifyLogListResp, error) {
|
||||
return logic.NewGetMyClassifyLogLogic(ctx, s.svcCtx).GetMyClassifyLog(in)
|
||||
}
|
||||
func (s *PlantServiceServer) DeleteClassifyLog(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteClassifyLogLogic(ctx, s.svcCtx).DeleteClassifyLog(in)
|
||||
}
|
||||
|
||||
// ---- 社区 ----
|
||||
func (s *PlantServiceServer) CreatePost(ctx context.Context, in *plant.CreatePostReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCreatePostLogic(ctx, s.svcCtx).CreatePost(in)
|
||||
}
|
||||
func (s *PlantServiceServer) DeletePost(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeletePostLogic(ctx, s.svcCtx).DeletePost(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetPostList(ctx context.Context, in *plant.PostListReq) (*plant.PostListResp, error) {
|
||||
return logic.NewGetPostListLogic(ctx, s.svcCtx).GetPostList(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetPostDetail(ctx context.Context, in *plant.IdReq) (*plant.PostDetailResp, error) {
|
||||
return logic.NewGetPostDetailLogic(ctx, s.svcCtx).GetPostDetail(in)
|
||||
}
|
||||
func (s *PlantServiceServer) CommentPost(ctx context.Context, in *plant.CommentPostReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCommentPostLogic(ctx, s.svcCtx).CommentPost(in)
|
||||
}
|
||||
func (s *PlantServiceServer) LikePost(ctx context.Context, in *plant.LikePostReq) (*plant.CommonResp, error) {
|
||||
return logic.NewLikePostLogic(ctx, s.svcCtx).LikePost(in)
|
||||
}
|
||||
func (s *PlantServiceServer) StarPost(ctx context.Context, in *plant.LikePostReq) (*plant.CommonResp, error) {
|
||||
return logic.NewStarPostLogic(ctx, s.svcCtx).StarPost(in)
|
||||
}
|
||||
func (s *PlantServiceServer) MediaCheckCallback(ctx context.Context, in *plant.MediaCheckCallbackReq) (*plant.CommonResp, error) {
|
||||
return logic.NewMediaCheckCallbackLogic(ctx, s.svcCtx).MediaCheckCallback(in)
|
||||
}
|
||||
|
||||
// ---- 话题 ----
|
||||
func (s *PlantServiceServer) GetTopicList(ctx context.Context, in *plant.IdReq) (*plant.TopicListResp, error) {
|
||||
return logic.NewGetTopicListLogic(ctx, s.svcCtx).GetTopicList(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetTopicDetail(ctx context.Context, in *plant.IdReq) (*plant.TopicInfo, error) {
|
||||
return logic.NewGetTopicDetailLogic(ctx, s.svcCtx).GetTopicDetail(in)
|
||||
}
|
||||
func (s *PlantServiceServer) CreateTopic(ctx context.Context, in *plant.CreateTopicReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCreateTopicLogic(ctx, s.svcCtx).CreateTopic(in)
|
||||
}
|
||||
func (s *PlantServiceServer) UpdateTopic(ctx context.Context, in *plant.UpdateTopicReq) (*plant.CommonResp, error) {
|
||||
return logic.NewUpdateTopicLogic(ctx, s.svcCtx).UpdateTopic(in)
|
||||
}
|
||||
func (s *PlantServiceServer) DeleteTopic(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteTopicLogic(ctx, s.svcCtx).DeleteTopic(in)
|
||||
}
|
||||
|
||||
// ---- 兑换 ----
|
||||
func (s *PlantServiceServer) GetExchangeItemList(ctx context.Context, in *plant.ExchangeItemListReq) (*plant.ExchangeItemListResp, error) {
|
||||
return logic.NewGetExchangeItemListLogic(ctx, s.svcCtx).GetExchangeItemList(in)
|
||||
}
|
||||
func (s *PlantServiceServer) CreateExchangeItem(ctx context.Context, in *plant.CreateExchangeItemReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCreateExchangeItemLogic(ctx, s.svcCtx).CreateExchangeItem(in)
|
||||
}
|
||||
func (s *PlantServiceServer) UpdateExchangeItem(ctx context.Context, in *plant.UpdateExchangeItemReq) (*plant.CommonResp, error) {
|
||||
return logic.NewUpdateExchangeItemLogic(ctx, s.svcCtx).UpdateExchangeItem(in)
|
||||
}
|
||||
func (s *PlantServiceServer) DeleteExchangeItem(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteExchangeItemLogic(ctx, s.svcCtx).DeleteExchangeItem(in)
|
||||
}
|
||||
func (s *PlantServiceServer) CreateExchangeOrder(ctx context.Context, in *plant.CreateExchangeOrderReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCreateExchangeOrderLogic(ctx, s.svcCtx).CreateExchangeOrder(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetMyExchangeOrders(ctx context.Context, in *plant.ExchangeOrderListReq) (*plant.ExchangeOrderListResp, error) {
|
||||
return logic.NewGetMyExchangeOrdersLogic(ctx, s.svcCtx).GetMyExchangeOrders(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetExchangeOrderList(ctx context.Context, in *plant.ExchangeOrderListReq) (*plant.ExchangeOrderListResp, error) {
|
||||
return logic.NewGetExchangeOrderListLogic(ctx, s.svcCtx).GetExchangeOrderList(in)
|
||||
}
|
||||
func (s *PlantServiceServer) UpdateExchangeOrder(ctx context.Context, in *plant.UpdateExchangeOrderReq) (*plant.CommonResp, error) {
|
||||
return logic.NewUpdateExchangeOrderLogic(ctx, s.svcCtx).UpdateExchangeOrder(in)
|
||||
}
|
||||
|
||||
// ---- 配置 ----
|
||||
func (s *PlantServiceServer) GetLevelConfigList(ctx context.Context, in *plant.PageReq) (*plant.LevelConfigListResp, error) {
|
||||
return logic.NewGetLevelConfigListLogic(ctx, s.svcCtx).GetLevelConfigList(in)
|
||||
}
|
||||
func (s *PlantServiceServer) CreateLevelConfig(ctx context.Context, in *plant.CreateLevelConfigReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCreateLevelConfigLogic(ctx, s.svcCtx).CreateLevelConfig(in)
|
||||
}
|
||||
func (s *PlantServiceServer) UpdateLevelConfig(ctx context.Context, in *plant.UpdateLevelConfigReq) (*plant.CommonResp, error) {
|
||||
return logic.NewUpdateLevelConfigLogic(ctx, s.svcCtx).UpdateLevelConfig(in)
|
||||
}
|
||||
func (s *PlantServiceServer) DeleteLevelConfig(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteLevelConfigLogic(ctx, s.svcCtx).DeleteLevelConfig(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetBadgeConfigList(ctx context.Context, in *plant.BadgeConfigListReq) (*plant.BadgeConfigListResp, error) {
|
||||
return logic.NewGetBadgeConfigListLogic(ctx, s.svcCtx).GetBadgeConfigList(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetBadgeConfigDetail(ctx context.Context, in *plant.IdReq) (*plant.BadgeConfigInfo, error) {
|
||||
return logic.NewGetBadgeConfigDetailLogic(ctx, s.svcCtx).GetBadgeConfigDetail(in)
|
||||
}
|
||||
func (s *PlantServiceServer) CreateBadgeConfig(ctx context.Context, in *plant.CreateBadgeConfigReq) (*plant.CommonResp, error) {
|
||||
return logic.NewCreateBadgeConfigLogic(ctx, s.svcCtx).CreateBadgeConfig(in)
|
||||
}
|
||||
func (s *PlantServiceServer) UpdateBadgeConfig(ctx context.Context, in *plant.UpdateBadgeConfigReq) (*plant.CommonResp, error) {
|
||||
return logic.NewUpdateBadgeConfigLogic(ctx, s.svcCtx).UpdateBadgeConfig(in)
|
||||
}
|
||||
func (s *PlantServiceServer) DeleteBadgeConfig(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteBadgeConfigLogic(ctx, s.svcCtx).DeleteBadgeConfig(in)
|
||||
}
|
||||
|
||||
// ---- AI ----
|
||||
func (s *PlantServiceServer) DeleteAiChatHistory(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
return logic.NewDeleteAiChatHistoryLogic(ctx, s.svcCtx).DeleteAiChatHistory(in)
|
||||
}
|
||||
func (s *PlantServiceServer) SaveAiChatHistory(ctx context.Context, in *plant.SaveAiChatHistoryReq) (*plant.CommonResp, error) {
|
||||
return logic.NewSaveAiChatHistoryLogic(ctx, s.svcCtx).SaveAiChatHistory(in)
|
||||
}
|
||||
func (s *PlantServiceServer) ClearAiChatHistory(ctx context.Context, in *plant.GetProfileReq) (*plant.CommonResp, error) {
|
||||
return logic.NewClearAiChatHistoryLogic(ctx, s.svcCtx).ClearAiChatHistory(in)
|
||||
}
|
||||
func (s *PlantServiceServer) GetAiChatQuota(ctx context.Context, in *plant.GetProfileReq) (*plant.AiQuotaResp, error) {
|
||||
return logic.NewGetAiChatQuotaLogic(ctx, s.svcCtx).GetAiChatQuota(in)
|
||||
}
|
||||
|
||||
// ---- 完成任务 ----
|
||||
func (s *PlantServiceServer) CompleteTask(ctx context.Context, in *plant.CompleteTaskReq) (*plant.TaskCompletionResult, error) {
|
||||
return logic.NewCompleteTaskLogic(ctx, s.svcCtx).CompleteTask(in)
|
||||
l := logic.NewCompleteTaskLogic(ctx, s.svcCtx)
|
||||
return l.CompleteTask(in)
|
||||
}
|
||||
|
||||
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.CommonResp, error) {
|
||||
l := logic.NewAddGrowthRecordLogic(ctx, s.svcCtx)
|
||||
return l.AddGrowthRecord(in)
|
||||
}
|
||||
|
||||
// 百科
|
||||
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.IdReq) (*plant.WikiDetailResp, error) {
|
||||
l := logic.NewGetWikiDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetWikiDetail(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) CreateWiki(ctx context.Context, in *plant.CreateWikiReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewCreateWikiLogic(ctx, s.svcCtx)
|
||||
return l.CreateWiki(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdateWiki(ctx context.Context, in *plant.UpdateWikiReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewUpdateWikiLogic(ctx, s.svcCtx)
|
||||
return l.UpdateWiki(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteWiki(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeleteWikiLogic(ctx, s.svcCtx)
|
||||
return l.DeleteWiki(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) SyncWikiVector(ctx context.Context, in *plant.SyncWikiVectorReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewSyncWikiVectorLogic(ctx, s.svcCtx)
|
||||
return l.SyncWikiVector(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteWikiVector(ctx context.Context, in *plant.SyncWikiVectorReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeleteWikiVectorLogic(ctx, s.svcCtx)
|
||||
return l.DeleteWikiVector(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) SyncAllWikiVector(ctx context.Context, in *plant.PageReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewSyncAllWikiVectorLogic(ctx, s.svcCtx)
|
||||
return l.SyncAllWikiVector(in)
|
||||
}
|
||||
|
||||
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.CommonResp, error) {
|
||||
l := logic.NewCreateWikiClassLogic(ctx, s.svcCtx)
|
||||
return l.CreateWikiClass(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdateWikiClass(ctx context.Context, in *plant.UpdateWikiClassReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewUpdateWikiClassLogic(ctx, s.svcCtx)
|
||||
return l.UpdateWikiClass(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteWikiClass(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeleteWikiClassLogic(ctx, s.svcCtx)
|
||||
return l.DeleteWikiClass(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) ToggleWikiStar(ctx context.Context, in *plant.ToggleStarReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewToggleWikiStarLogic(ctx, s.svcCtx)
|
||||
return l.ToggleWikiStar(in)
|
||||
}
|
||||
|
||||
// OCR
|
||||
func (s *PlantServiceServer) GetMyClassifyLog(ctx context.Context, in *plant.GetProfileReq) (*plant.ClassifyLogListResp, error) {
|
||||
l := logic.NewGetMyClassifyLogLogic(ctx, s.svcCtx)
|
||||
return l.GetMyClassifyLog(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteClassifyLog(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeleteClassifyLogLogic(ctx, s.svcCtx)
|
||||
return l.DeleteClassifyLog(in)
|
||||
}
|
||||
|
||||
// 社区
|
||||
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) DeletePost(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeletePostLogic(ctx, s.svcCtx)
|
||||
return l.DeletePost(in)
|
||||
}
|
||||
|
||||
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.CommonResp, error) {
|
||||
l := logic.NewLikePostLogic(ctx, s.svcCtx)
|
||||
return l.LikePost(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) StarPost(ctx context.Context, in *plant.LikePostReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewStarPostLogic(ctx, s.svcCtx)
|
||||
return l.StarPost(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) MediaCheckCallback(ctx context.Context, in *plant.MediaCheckCallbackReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewMediaCheckCallbackLogic(ctx, s.svcCtx)
|
||||
return l.MediaCheckCallback(in)
|
||||
}
|
||||
|
||||
// 话题
|
||||
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) GetTopicDetail(ctx context.Context, in *plant.IdReq) (*plant.TopicInfo, error) {
|
||||
l := logic.NewGetTopicDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetTopicDetail(in)
|
||||
}
|
||||
|
||||
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) UpdateTopic(ctx context.Context, in *plant.UpdateTopicReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewUpdateTopicLogic(ctx, s.svcCtx)
|
||||
return l.UpdateTopic(in)
|
||||
}
|
||||
|
||||
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) GetExchangeItemList(ctx context.Context, in *plant.ExchangeItemListReq) (*plant.ExchangeItemListResp, error) {
|
||||
l := logic.NewGetExchangeItemListLogic(ctx, s.svcCtx)
|
||||
return l.GetExchangeItemList(in)
|
||||
}
|
||||
|
||||
// ---- 兑换详情 ----
|
||||
func (s *PlantServiceServer) GetExchangeItemDetail(ctx context.Context, in *plant.IdReq) (*plant.ExchangeItemInfo, error) {
|
||||
return logic.NewGetExchangeItemDetailLogic(ctx, s.svcCtx).GetExchangeItemDetail(in)
|
||||
l := logic.NewGetExchangeItemDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetExchangeItemDetail(in)
|
||||
}
|
||||
|
||||
// ---- 百科分类详情 ----
|
||||
func (s *PlantServiceServer) GetWikiClassDetail(ctx context.Context, in *plant.IdReq) (*plant.WikiClassInfo, error) {
|
||||
return logic.NewGetWikiClassDetailLogic(ctx, s.svcCtx).GetWikiClassDetail(in)
|
||||
func (s *PlantServiceServer) CreateExchangeItem(ctx context.Context, in *plant.CreateExchangeItemReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewCreateExchangeItemLogic(ctx, s.svcCtx)
|
||||
return l.CreateExchangeItem(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdateExchangeItem(ctx context.Context, in *plant.UpdateExchangeItemReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewUpdateExchangeItemLogic(ctx, s.svcCtx)
|
||||
return l.UpdateExchangeItem(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteExchangeItem(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeleteExchangeItemLogic(ctx, s.svcCtx)
|
||||
return l.DeleteExchangeItem(in)
|
||||
}
|
||||
|
||||
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) GetMyExchangeOrders(ctx context.Context, in *plant.ExchangeOrderListReq) (*plant.ExchangeOrderListResp, error) {
|
||||
l := logic.NewGetMyExchangeOrdersLogic(ctx, s.svcCtx)
|
||||
return l.GetMyExchangeOrders(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetExchangeOrderList(ctx context.Context, in *plant.ExchangeOrderListReq) (*plant.ExchangeOrderListResp, error) {
|
||||
l := logic.NewGetExchangeOrderListLogic(ctx, s.svcCtx)
|
||||
return l.GetExchangeOrderList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdateExchangeOrder(ctx context.Context, in *plant.UpdateExchangeOrderReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewUpdateExchangeOrderLogic(ctx, s.svcCtx)
|
||||
return l.UpdateExchangeOrder(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) GetLevelConfigDetail(ctx context.Context, in *plant.IdReq) (*plant.LevelConfigInfo, error) {
|
||||
return logic.NewGetLevelConfigDetailLogic(ctx, s.svcCtx).GetLevelConfigDetail(in)
|
||||
l := logic.NewGetLevelConfigDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetLevelConfigDetail(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) CreateLevelConfig(ctx context.Context, in *plant.CreateLevelConfigReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewCreateLevelConfigLogic(ctx, s.svcCtx)
|
||||
return l.CreateLevelConfig(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdateLevelConfig(ctx context.Context, in *plant.UpdateLevelConfigReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewUpdateLevelConfigLogic(ctx, s.svcCtx)
|
||||
return l.UpdateLevelConfig(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteLevelConfig(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeleteLevelConfigLogic(ctx, s.svcCtx)
|
||||
return l.DeleteLevelConfig(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetBadgeConfigList(ctx context.Context, in *plant.BadgeConfigListReq) (*plant.BadgeConfigListResp, error) {
|
||||
l := logic.NewGetBadgeConfigListLogic(ctx, s.svcCtx)
|
||||
return l.GetBadgeConfigList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetBadgeConfigDetail(ctx context.Context, in *plant.IdReq) (*plant.BadgeConfigInfo, error) {
|
||||
l := logic.NewGetBadgeConfigDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetBadgeConfigDetail(in)
|
||||
}
|
||||
|
||||
// ---- 徽章配置树 ----
|
||||
func (s *PlantServiceServer) GetBadgeConfigTree(ctx context.Context, in *plant.IdReq) (*plant.BadgeConfigTreeResp, error) {
|
||||
return logic.NewGetBadgeConfigTreeLogic(ctx, s.svcCtx).GetBadgeConfigTree(in)
|
||||
l := logic.NewGetBadgeConfigTreeLogic(ctx, s.svcCtx)
|
||||
return l.GetBadgeConfigTree(in)
|
||||
}
|
||||
|
||||
// ---- AI 历史 ----
|
||||
func (s *PlantServiceServer) GetAiChatHistory(ctx context.Context, in *plant.AiChatHistoryReq) (*plant.AiChatHistoryResp, error) {
|
||||
return logic.NewGetAiChatHistoryLogic(ctx, s.svcCtx).GetAiChatHistory(in)
|
||||
func (s *PlantServiceServer) CreateBadgeConfig(ctx context.Context, in *plant.CreateBadgeConfigReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewCreateBadgeConfigLogic(ctx, s.svcCtx)
|
||||
return l.CreateBadgeConfig(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdateBadgeConfig(ctx context.Context, in *plant.UpdateBadgeConfigReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewUpdateBadgeConfigLogic(ctx, s.svcCtx)
|
||||
return l.UpdateBadgeConfig(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteBadgeConfig(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeleteBadgeConfigLogic(ctx, s.svcCtx)
|
||||
return l.DeleteBadgeConfig(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetWikiClassDetail(ctx context.Context, in *plant.IdReq) (*plant.WikiClassInfo, error) {
|
||||
l := logic.NewGetWikiClassDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetWikiClassDetail(in)
|
||||
}
|
||||
|
||||
// AI
|
||||
func (s *PlantServiceServer) GetAiChatHistory(ctx context.Context, in *plant.AiChatHistoryReq) (*plant.AiChatHistoryResp, error) {
|
||||
l := logic.NewGetAiChatHistoryLogic(ctx, s.svcCtx)
|
||||
return l.GetAiChatHistory(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) SaveAiChatHistory(ctx context.Context, in *plant.SaveAiChatHistoryReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewSaveAiChatHistoryLogic(ctx, s.svcCtx)
|
||||
return l.SaveAiChatHistory(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteAiChatHistory(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeleteAiChatHistoryLogic(ctx, s.svcCtx)
|
||||
return l.DeleteAiChatHistory(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) ClearAiChatHistory(ctx context.Context, in *plant.GetProfileReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewClearAiChatHistoryLogic(ctx, s.svcCtx)
|
||||
return l.ClearAiChatHistory(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetAiChatQuota(ctx context.Context, in *plant.GetProfileReq) (*plant.AiQuotaResp, error) {
|
||||
l := logic.NewGetAiChatQuotaLogic(ctx, s.svcCtx)
|
||||
return l.GetAiChatQuota(in)
|
||||
}
|
||||
|
||||
// 快捷养护
|
||||
func (s *PlantServiceServer) QuickCare(ctx context.Context, in *plant.QuickCareReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewQuickCareLogic(ctx, s.svcCtx)
|
||||
return l.QuickCare(in)
|
||||
}
|
||||
|
||||
// Banner
|
||||
func (s *PlantServiceServer) CreateBanner(ctx context.Context, in *plant.CreateBannerReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewCreateBannerLogic(ctx, s.svcCtx)
|
||||
return l.CreateBanner(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) UpdateBanner(ctx context.Context, in *plant.UpdateBannerReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewUpdateBannerLogic(ctx, s.svcCtx)
|
||||
return l.UpdateBanner(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) DeleteBanner(ctx context.Context, in *plant.IdsReq) (*plant.CommonResp, error) {
|
||||
l := logic.NewDeleteBannerLogic(ctx, s.svcCtx)
|
||||
return l.DeleteBanner(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetBannerList(ctx context.Context, in *plant.BannerListReq) (*plant.BannerListResp, error) {
|
||||
l := logic.NewGetBannerListLogic(ctx, s.svcCtx)
|
||||
return l.GetBannerList(in)
|
||||
}
|
||||
|
||||
func (s *PlantServiceServer) GetActiveBannerList(ctx context.Context, in *plant.PageReq) (*plant.BannerListResp, error) {
|
||||
l := logic.NewGetActiveBannerListLogic(ctx, s.svcCtx)
|
||||
return l.GetActiveBannerList(in)
|
||||
}
|
||||
|
||||
@@ -3,15 +3,18 @@ package svc
|
||||
import (
|
||||
plantModel "sundynix-micro-go/app/plant/model"
|
||||
"sundynix-micro-go/app/plant/rpc/internal/config"
|
||||
"sundynix-micro-go/app/system/rpc/systemservice"
|
||||
|
||||
"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
|
||||
Config config.Config
|
||||
DB *gorm.DB
|
||||
SystemRpc systemservice.SystemService
|
||||
}
|
||||
|
||||
func NewServiceContext(c config.Config) *ServiceContext {
|
||||
@@ -55,5 +58,9 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
logx.Errorf("数据库迁移失败: %v", err)
|
||||
}
|
||||
|
||||
return &ServiceContext{Config: c, DB: db}
|
||||
// 初始化 System RPC 客户端
|
||||
sysRpc := systemservice.NewSystemService(zrpc.MustNewClient(c.SystemRpc))
|
||||
logx.Info("[plant-rpc] ✅ SystemRpc 已连接")
|
||||
|
||||
return &ServiceContext{Config: c, DB: db, SystemRpc: sysRpc}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -42,6 +42,18 @@ message PlantUserProfile {
|
||||
int64 repotCount = 13;
|
||||
int64 pruneCount = 14;
|
||||
int64 photoCount = 15;
|
||||
string miniOpenId = 16;
|
||||
string sessionKey = 17;
|
||||
string unionId = 18;
|
||||
string saOpenId = 19;
|
||||
}
|
||||
|
||||
message FindOrCreateUserByOpenIdReq {
|
||||
string openId = 1;
|
||||
string sessionKey = 2;
|
||||
string clientId = 3;
|
||||
string unionId = 4;
|
||||
string saOpenId = 5;
|
||||
}
|
||||
|
||||
message GetProfileReq {
|
||||
@@ -778,6 +790,7 @@ message AiChatHistoryResp {
|
||||
service PlantService {
|
||||
// 用户Profile
|
||||
rpc GetUserProfile(GetProfileReq) returns (PlantUserProfile);
|
||||
rpc FindOrCreateUserByOpenId(FindOrCreateUserByOpenIdReq) returns (PlantUserProfile);
|
||||
rpc UpdateUserProfile(UpdateProfileReq) returns (CommonResp);
|
||||
rpc GetMyBadges(GetProfileReq) returns (UserBadgeListResp);
|
||||
rpc GetMyStars(GetProfileReq) returns (UserStarListResp);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+1113
-476
File diff suppressed because it is too large
Load Diff
@@ -19,75 +19,82 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
PlantService_GetUserProfile_FullMethodName = "/plant.PlantService/GetUserProfile"
|
||||
PlantService_UpdateUserProfile_FullMethodName = "/plant.PlantService/UpdateUserProfile"
|
||||
PlantService_GetMyBadges_FullMethodName = "/plant.PlantService/GetMyBadges"
|
||||
PlantService_GetMyStars_FullMethodName = "/plant.PlantService/GetMyStars"
|
||||
PlantService_CreatePlant_FullMethodName = "/plant.PlantService/CreatePlant"
|
||||
PlantService_UpdatePlant_FullMethodName = "/plant.PlantService/UpdatePlant"
|
||||
PlantService_DeletePlant_FullMethodName = "/plant.PlantService/DeletePlant"
|
||||
PlantService_GetPlantList_FullMethodName = "/plant.PlantService/GetPlantList"
|
||||
PlantService_GetPlantDetail_FullMethodName = "/plant.PlantService/GetPlantDetail"
|
||||
PlantService_AddCarePlan_FullMethodName = "/plant.PlantService/AddCarePlan"
|
||||
PlantService_DeleteCarePlan_FullMethodName = "/plant.PlantService/DeleteCarePlan"
|
||||
PlantService_GetTodayTaskList_FullMethodName = "/plant.PlantService/GetTodayTaskList"
|
||||
PlantService_CompleteTask_FullMethodName = "/plant.PlantService/CompleteTask"
|
||||
PlantService_AddCareRecord_FullMethodName = "/plant.PlantService/AddCareRecord"
|
||||
PlantService_AddGrowthRecord_FullMethodName = "/plant.PlantService/AddGrowthRecord"
|
||||
PlantService_GetWikiList_FullMethodName = "/plant.PlantService/GetWikiList"
|
||||
PlantService_GetWikiDetail_FullMethodName = "/plant.PlantService/GetWikiDetail"
|
||||
PlantService_CreateWiki_FullMethodName = "/plant.PlantService/CreateWiki"
|
||||
PlantService_UpdateWiki_FullMethodName = "/plant.PlantService/UpdateWiki"
|
||||
PlantService_DeleteWiki_FullMethodName = "/plant.PlantService/DeleteWiki"
|
||||
PlantService_SyncWikiVector_FullMethodName = "/plant.PlantService/SyncWikiVector"
|
||||
PlantService_DeleteWikiVector_FullMethodName = "/plant.PlantService/DeleteWikiVector"
|
||||
PlantService_SyncAllWikiVector_FullMethodName = "/plant.PlantService/SyncAllWikiVector"
|
||||
PlantService_GetWikiClassList_FullMethodName = "/plant.PlantService/GetWikiClassList"
|
||||
PlantService_CreateWikiClass_FullMethodName = "/plant.PlantService/CreateWikiClass"
|
||||
PlantService_UpdateWikiClass_FullMethodName = "/plant.PlantService/UpdateWikiClass"
|
||||
PlantService_DeleteWikiClass_FullMethodName = "/plant.PlantService/DeleteWikiClass"
|
||||
PlantService_ToggleWikiStar_FullMethodName = "/plant.PlantService/ToggleWikiStar"
|
||||
PlantService_GetMyClassifyLog_FullMethodName = "/plant.PlantService/GetMyClassifyLog"
|
||||
PlantService_DeleteClassifyLog_FullMethodName = "/plant.PlantService/DeleteClassifyLog"
|
||||
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_CommentPost_FullMethodName = "/plant.PlantService/CommentPost"
|
||||
PlantService_LikePost_FullMethodName = "/plant.PlantService/LikePost"
|
||||
PlantService_StarPost_FullMethodName = "/plant.PlantService/StarPost"
|
||||
PlantService_MediaCheckCallback_FullMethodName = "/plant.PlantService/MediaCheckCallback"
|
||||
PlantService_GetTopicList_FullMethodName = "/plant.PlantService/GetTopicList"
|
||||
PlantService_GetTopicDetail_FullMethodName = "/plant.PlantService/GetTopicDetail"
|
||||
PlantService_CreateTopic_FullMethodName = "/plant.PlantService/CreateTopic"
|
||||
PlantService_UpdateTopic_FullMethodName = "/plant.PlantService/UpdateTopic"
|
||||
PlantService_DeleteTopic_FullMethodName = "/plant.PlantService/DeleteTopic"
|
||||
PlantService_GetExchangeItemList_FullMethodName = "/plant.PlantService/GetExchangeItemList"
|
||||
PlantService_GetExchangeItemDetail_FullMethodName = "/plant.PlantService/GetExchangeItemDetail"
|
||||
PlantService_CreateExchangeItem_FullMethodName = "/plant.PlantService/CreateExchangeItem"
|
||||
PlantService_UpdateExchangeItem_FullMethodName = "/plant.PlantService/UpdateExchangeItem"
|
||||
PlantService_DeleteExchangeItem_FullMethodName = "/plant.PlantService/DeleteExchangeItem"
|
||||
PlantService_CreateExchangeOrder_FullMethodName = "/plant.PlantService/CreateExchangeOrder"
|
||||
PlantService_GetMyExchangeOrders_FullMethodName = "/plant.PlantService/GetMyExchangeOrders"
|
||||
PlantService_GetExchangeOrderList_FullMethodName = "/plant.PlantService/GetExchangeOrderList"
|
||||
PlantService_UpdateExchangeOrder_FullMethodName = "/plant.PlantService/UpdateExchangeOrder"
|
||||
PlantService_GetLevelConfigList_FullMethodName = "/plant.PlantService/GetLevelConfigList"
|
||||
PlantService_GetLevelConfigDetail_FullMethodName = "/plant.PlantService/GetLevelConfigDetail"
|
||||
PlantService_CreateLevelConfig_FullMethodName = "/plant.PlantService/CreateLevelConfig"
|
||||
PlantService_UpdateLevelConfig_FullMethodName = "/plant.PlantService/UpdateLevelConfig"
|
||||
PlantService_DeleteLevelConfig_FullMethodName = "/plant.PlantService/DeleteLevelConfig"
|
||||
PlantService_GetBadgeConfigList_FullMethodName = "/plant.PlantService/GetBadgeConfigList"
|
||||
PlantService_GetBadgeConfigDetail_FullMethodName = "/plant.PlantService/GetBadgeConfigDetail"
|
||||
PlantService_GetBadgeConfigTree_FullMethodName = "/plant.PlantService/GetBadgeConfigTree"
|
||||
PlantService_CreateBadgeConfig_FullMethodName = "/plant.PlantService/CreateBadgeConfig"
|
||||
PlantService_UpdateBadgeConfig_FullMethodName = "/plant.PlantService/UpdateBadgeConfig"
|
||||
PlantService_DeleteBadgeConfig_FullMethodName = "/plant.PlantService/DeleteBadgeConfig"
|
||||
PlantService_GetWikiClassDetail_FullMethodName = "/plant.PlantService/GetWikiClassDetail"
|
||||
PlantService_GetAiChatHistory_FullMethodName = "/plant.PlantService/GetAiChatHistory"
|
||||
PlantService_SaveAiChatHistory_FullMethodName = "/plant.PlantService/SaveAiChatHistory"
|
||||
PlantService_DeleteAiChatHistory_FullMethodName = "/plant.PlantService/DeleteAiChatHistory"
|
||||
PlantService_ClearAiChatHistory_FullMethodName = "/plant.PlantService/ClearAiChatHistory"
|
||||
PlantService_GetAiChatQuota_FullMethodName = "/plant.PlantService/GetAiChatQuota"
|
||||
PlantService_GetUserProfile_FullMethodName = "/plant.PlantService/GetUserProfile"
|
||||
PlantService_FindOrCreateUserByOpenId_FullMethodName = "/plant.PlantService/FindOrCreateUserByOpenId"
|
||||
PlantService_UpdateUserProfile_FullMethodName = "/plant.PlantService/UpdateUserProfile"
|
||||
PlantService_GetMyBadges_FullMethodName = "/plant.PlantService/GetMyBadges"
|
||||
PlantService_GetMyStars_FullMethodName = "/plant.PlantService/GetMyStars"
|
||||
PlantService_CreatePlant_FullMethodName = "/plant.PlantService/CreatePlant"
|
||||
PlantService_UpdatePlant_FullMethodName = "/plant.PlantService/UpdatePlant"
|
||||
PlantService_DeletePlant_FullMethodName = "/plant.PlantService/DeletePlant"
|
||||
PlantService_GetPlantList_FullMethodName = "/plant.PlantService/GetPlantList"
|
||||
PlantService_GetPlantDetail_FullMethodName = "/plant.PlantService/GetPlantDetail"
|
||||
PlantService_AddCarePlan_FullMethodName = "/plant.PlantService/AddCarePlan"
|
||||
PlantService_DeleteCarePlan_FullMethodName = "/plant.PlantService/DeleteCarePlan"
|
||||
PlantService_GetTodayTaskList_FullMethodName = "/plant.PlantService/GetTodayTaskList"
|
||||
PlantService_CompleteTask_FullMethodName = "/plant.PlantService/CompleteTask"
|
||||
PlantService_AddCareRecord_FullMethodName = "/plant.PlantService/AddCareRecord"
|
||||
PlantService_AddGrowthRecord_FullMethodName = "/plant.PlantService/AddGrowthRecord"
|
||||
PlantService_GetWikiList_FullMethodName = "/plant.PlantService/GetWikiList"
|
||||
PlantService_GetWikiDetail_FullMethodName = "/plant.PlantService/GetWikiDetail"
|
||||
PlantService_CreateWiki_FullMethodName = "/plant.PlantService/CreateWiki"
|
||||
PlantService_UpdateWiki_FullMethodName = "/plant.PlantService/UpdateWiki"
|
||||
PlantService_DeleteWiki_FullMethodName = "/plant.PlantService/DeleteWiki"
|
||||
PlantService_SyncWikiVector_FullMethodName = "/plant.PlantService/SyncWikiVector"
|
||||
PlantService_DeleteWikiVector_FullMethodName = "/plant.PlantService/DeleteWikiVector"
|
||||
PlantService_SyncAllWikiVector_FullMethodName = "/plant.PlantService/SyncAllWikiVector"
|
||||
PlantService_GetWikiClassList_FullMethodName = "/plant.PlantService/GetWikiClassList"
|
||||
PlantService_CreateWikiClass_FullMethodName = "/plant.PlantService/CreateWikiClass"
|
||||
PlantService_UpdateWikiClass_FullMethodName = "/plant.PlantService/UpdateWikiClass"
|
||||
PlantService_DeleteWikiClass_FullMethodName = "/plant.PlantService/DeleteWikiClass"
|
||||
PlantService_ToggleWikiStar_FullMethodName = "/plant.PlantService/ToggleWikiStar"
|
||||
PlantService_GetMyClassifyLog_FullMethodName = "/plant.PlantService/GetMyClassifyLog"
|
||||
PlantService_DeleteClassifyLog_FullMethodName = "/plant.PlantService/DeleteClassifyLog"
|
||||
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_CommentPost_FullMethodName = "/plant.PlantService/CommentPost"
|
||||
PlantService_LikePost_FullMethodName = "/plant.PlantService/LikePost"
|
||||
PlantService_StarPost_FullMethodName = "/plant.PlantService/StarPost"
|
||||
PlantService_MediaCheckCallback_FullMethodName = "/plant.PlantService/MediaCheckCallback"
|
||||
PlantService_GetTopicList_FullMethodName = "/plant.PlantService/GetTopicList"
|
||||
PlantService_GetTopicDetail_FullMethodName = "/plant.PlantService/GetTopicDetail"
|
||||
PlantService_CreateTopic_FullMethodName = "/plant.PlantService/CreateTopic"
|
||||
PlantService_UpdateTopic_FullMethodName = "/plant.PlantService/UpdateTopic"
|
||||
PlantService_DeleteTopic_FullMethodName = "/plant.PlantService/DeleteTopic"
|
||||
PlantService_GetExchangeItemList_FullMethodName = "/plant.PlantService/GetExchangeItemList"
|
||||
PlantService_GetExchangeItemDetail_FullMethodName = "/plant.PlantService/GetExchangeItemDetail"
|
||||
PlantService_CreateExchangeItem_FullMethodName = "/plant.PlantService/CreateExchangeItem"
|
||||
PlantService_UpdateExchangeItem_FullMethodName = "/plant.PlantService/UpdateExchangeItem"
|
||||
PlantService_DeleteExchangeItem_FullMethodName = "/plant.PlantService/DeleteExchangeItem"
|
||||
PlantService_CreateExchangeOrder_FullMethodName = "/plant.PlantService/CreateExchangeOrder"
|
||||
PlantService_GetMyExchangeOrders_FullMethodName = "/plant.PlantService/GetMyExchangeOrders"
|
||||
PlantService_GetExchangeOrderList_FullMethodName = "/plant.PlantService/GetExchangeOrderList"
|
||||
PlantService_UpdateExchangeOrder_FullMethodName = "/plant.PlantService/UpdateExchangeOrder"
|
||||
PlantService_GetLevelConfigList_FullMethodName = "/plant.PlantService/GetLevelConfigList"
|
||||
PlantService_GetLevelConfigDetail_FullMethodName = "/plant.PlantService/GetLevelConfigDetail"
|
||||
PlantService_CreateLevelConfig_FullMethodName = "/plant.PlantService/CreateLevelConfig"
|
||||
PlantService_UpdateLevelConfig_FullMethodName = "/plant.PlantService/UpdateLevelConfig"
|
||||
PlantService_DeleteLevelConfig_FullMethodName = "/plant.PlantService/DeleteLevelConfig"
|
||||
PlantService_GetBadgeConfigList_FullMethodName = "/plant.PlantService/GetBadgeConfigList"
|
||||
PlantService_GetBadgeConfigDetail_FullMethodName = "/plant.PlantService/GetBadgeConfigDetail"
|
||||
PlantService_GetBadgeConfigTree_FullMethodName = "/plant.PlantService/GetBadgeConfigTree"
|
||||
PlantService_CreateBadgeConfig_FullMethodName = "/plant.PlantService/CreateBadgeConfig"
|
||||
PlantService_UpdateBadgeConfig_FullMethodName = "/plant.PlantService/UpdateBadgeConfig"
|
||||
PlantService_DeleteBadgeConfig_FullMethodName = "/plant.PlantService/DeleteBadgeConfig"
|
||||
PlantService_GetWikiClassDetail_FullMethodName = "/plant.PlantService/GetWikiClassDetail"
|
||||
PlantService_GetAiChatHistory_FullMethodName = "/plant.PlantService/GetAiChatHistory"
|
||||
PlantService_SaveAiChatHistory_FullMethodName = "/plant.PlantService/SaveAiChatHistory"
|
||||
PlantService_DeleteAiChatHistory_FullMethodName = "/plant.PlantService/DeleteAiChatHistory"
|
||||
PlantService_ClearAiChatHistory_FullMethodName = "/plant.PlantService/ClearAiChatHistory"
|
||||
PlantService_GetAiChatQuota_FullMethodName = "/plant.PlantService/GetAiChatQuota"
|
||||
PlantService_QuickCare_FullMethodName = "/plant.PlantService/QuickCare"
|
||||
PlantService_CreateBanner_FullMethodName = "/plant.PlantService/CreateBanner"
|
||||
PlantService_UpdateBanner_FullMethodName = "/plant.PlantService/UpdateBanner"
|
||||
PlantService_DeleteBanner_FullMethodName = "/plant.PlantService/DeleteBanner"
|
||||
PlantService_GetBannerList_FullMethodName = "/plant.PlantService/GetBannerList"
|
||||
PlantService_GetActiveBannerList_FullMethodName = "/plant.PlantService/GetActiveBannerList"
|
||||
)
|
||||
|
||||
// PlantServiceClient is the client API for PlantService service.
|
||||
@@ -96,6 +103,7 @@ const (
|
||||
type PlantServiceClient interface {
|
||||
// 用户Profile
|
||||
GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error)
|
||||
FindOrCreateUserByOpenId(ctx context.Context, in *FindOrCreateUserByOpenIdReq, opts ...grpc.CallOption) (*PlantUserProfile, error)
|
||||
UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
GetMyBadges(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserBadgeListResp, error)
|
||||
GetMyStars(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserStarListResp, error)
|
||||
@@ -173,6 +181,14 @@ type PlantServiceClient interface {
|
||||
DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
ClearAiChatHistory(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
GetAiChatQuota(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*AiQuotaResp, error)
|
||||
// 快捷养护
|
||||
QuickCare(ctx context.Context, in *QuickCareReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
// Banner
|
||||
CreateBanner(ctx context.Context, in *CreateBannerReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
UpdateBanner(ctx context.Context, in *UpdateBannerReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
DeleteBanner(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
GetBannerList(ctx context.Context, in *BannerListReq, opts ...grpc.CallOption) (*BannerListResp, error)
|
||||
GetActiveBannerList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*BannerListResp, error)
|
||||
}
|
||||
|
||||
type plantServiceClient struct {
|
||||
@@ -193,6 +209,16 @@ func (c *plantServiceClient) GetUserProfile(ctx context.Context, in *GetProfileR
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *plantServiceClient) FindOrCreateUserByOpenId(ctx context.Context, in *FindOrCreateUserByOpenIdReq, opts ...grpc.CallOption) (*PlantUserProfile, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PlantUserProfile)
|
||||
err := c.cc.Invoke(ctx, PlantService_FindOrCreateUserByOpenId_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *plantServiceClient) UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CommonResp)
|
||||
@@ -873,12 +899,73 @@ func (c *plantServiceClient) GetAiChatQuota(ctx context.Context, in *GetProfileR
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *plantServiceClient) QuickCare(ctx context.Context, in *QuickCareReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CommonResp)
|
||||
err := c.cc.Invoke(ctx, PlantService_QuickCare_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *plantServiceClient) CreateBanner(ctx context.Context, in *CreateBannerReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CommonResp)
|
||||
err := c.cc.Invoke(ctx, PlantService_CreateBanner_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *plantServiceClient) UpdateBanner(ctx context.Context, in *UpdateBannerReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CommonResp)
|
||||
err := c.cc.Invoke(ctx, PlantService_UpdateBanner_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *plantServiceClient) DeleteBanner(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, PlantService_DeleteBanner_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *plantServiceClient) GetBannerList(ctx context.Context, in *BannerListReq, opts ...grpc.CallOption) (*BannerListResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BannerListResp)
|
||||
err := c.cc.Invoke(ctx, PlantService_GetBannerList_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *plantServiceClient) GetActiveBannerList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*BannerListResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(BannerListResp)
|
||||
err := c.cc.Invoke(ctx, PlantService_GetActiveBannerList_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, *GetProfileReq) (*PlantUserProfile, error)
|
||||
FindOrCreateUserByOpenId(context.Context, *FindOrCreateUserByOpenIdReq) (*PlantUserProfile, error)
|
||||
UpdateUserProfile(context.Context, *UpdateProfileReq) (*CommonResp, error)
|
||||
GetMyBadges(context.Context, *GetProfileReq) (*UserBadgeListResp, error)
|
||||
GetMyStars(context.Context, *GetProfileReq) (*UserStarListResp, error)
|
||||
@@ -956,6 +1043,14 @@ type PlantServiceServer interface {
|
||||
DeleteAiChatHistory(context.Context, *IdsReq) (*CommonResp, error)
|
||||
ClearAiChatHistory(context.Context, *GetProfileReq) (*CommonResp, error)
|
||||
GetAiChatQuota(context.Context, *GetProfileReq) (*AiQuotaResp, error)
|
||||
// 快捷养护
|
||||
QuickCare(context.Context, *QuickCareReq) (*CommonResp, error)
|
||||
// Banner
|
||||
CreateBanner(context.Context, *CreateBannerReq) (*CommonResp, error)
|
||||
UpdateBanner(context.Context, *UpdateBannerReq) (*CommonResp, error)
|
||||
DeleteBanner(context.Context, *IdsReq) (*CommonResp, error)
|
||||
GetBannerList(context.Context, *BannerListReq) (*BannerListResp, error)
|
||||
GetActiveBannerList(context.Context, *PageReq) (*BannerListResp, error)
|
||||
mustEmbedUnimplementedPlantServiceServer()
|
||||
}
|
||||
|
||||
@@ -969,6 +1064,9 @@ type UnimplementedPlantServiceServer struct{}
|
||||
func (UnimplementedPlantServiceServer) GetUserProfile(context.Context, *GetProfileReq) (*PlantUserProfile, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetUserProfile not implemented")
|
||||
}
|
||||
func (UnimplementedPlantServiceServer) FindOrCreateUserByOpenId(context.Context, *FindOrCreateUserByOpenIdReq) (*PlantUserProfile, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method FindOrCreateUserByOpenId not implemented")
|
||||
}
|
||||
func (UnimplementedPlantServiceServer) UpdateUserProfile(context.Context, *UpdateProfileReq) (*CommonResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateUserProfile not implemented")
|
||||
}
|
||||
@@ -1173,6 +1271,24 @@ func (UnimplementedPlantServiceServer) ClearAiChatHistory(context.Context, *GetP
|
||||
func (UnimplementedPlantServiceServer) GetAiChatQuota(context.Context, *GetProfileReq) (*AiQuotaResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAiChatQuota not implemented")
|
||||
}
|
||||
func (UnimplementedPlantServiceServer) QuickCare(context.Context, *QuickCareReq) (*CommonResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method QuickCare not implemented")
|
||||
}
|
||||
func (UnimplementedPlantServiceServer) CreateBanner(context.Context, *CreateBannerReq) (*CommonResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateBanner not implemented")
|
||||
}
|
||||
func (UnimplementedPlantServiceServer) UpdateBanner(context.Context, *UpdateBannerReq) (*CommonResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateBanner not implemented")
|
||||
}
|
||||
func (UnimplementedPlantServiceServer) DeleteBanner(context.Context, *IdsReq) (*CommonResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteBanner not implemented")
|
||||
}
|
||||
func (UnimplementedPlantServiceServer) GetBannerList(context.Context, *BannerListReq) (*BannerListResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetBannerList not implemented")
|
||||
}
|
||||
func (UnimplementedPlantServiceServer) GetActiveBannerList(context.Context, *PageReq) (*BannerListResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetActiveBannerList not implemented")
|
||||
}
|
||||
func (UnimplementedPlantServiceServer) mustEmbedUnimplementedPlantServiceServer() {}
|
||||
func (UnimplementedPlantServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
@@ -1212,6 +1328,24 @@ func _PlantService_GetUserProfile_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PlantService_FindOrCreateUserByOpenId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(FindOrCreateUserByOpenIdReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PlantServiceServer).FindOrCreateUserByOpenId(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PlantService_FindOrCreateUserByOpenId_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PlantServiceServer).FindOrCreateUserByOpenId(ctx, req.(*FindOrCreateUserByOpenIdReq))
|
||||
}
|
||||
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(UpdateProfileReq)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -2436,6 +2570,114 @@ func _PlantService_GetAiChatQuota_Handler(srv interface{}, ctx context.Context,
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PlantService_QuickCare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QuickCareReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PlantServiceServer).QuickCare(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PlantService_QuickCare_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PlantServiceServer).QuickCare(ctx, req.(*QuickCareReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PlantService_CreateBanner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateBannerReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PlantServiceServer).CreateBanner(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PlantService_CreateBanner_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PlantServiceServer).CreateBanner(ctx, req.(*CreateBannerReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PlantService_UpdateBanner_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateBannerReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PlantServiceServer).UpdateBanner(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PlantService_UpdateBanner_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PlantServiceServer).UpdateBanner(ctx, req.(*UpdateBannerReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PlantService_DeleteBanner_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.(PlantServiceServer).DeleteBanner(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PlantService_DeleteBanner_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PlantServiceServer).DeleteBanner(ctx, req.(*IdsReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PlantService_GetBannerList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(BannerListReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(PlantServiceServer).GetBannerList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PlantService_GetBannerList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PlantServiceServer).GetBannerList(ctx, req.(*BannerListReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _PlantService_GetActiveBannerList_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).GetActiveBannerList(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: PlantService_GetActiveBannerList_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PlantServiceServer).GetActiveBannerList(ctx, req.(*PageReq))
|
||||
}
|
||||
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)
|
||||
@@ -2447,6 +2689,10 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetUserProfile",
|
||||
Handler: _PlantService_GetUserProfile_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "FindOrCreateUserByOpenId",
|
||||
Handler: _PlantService_FindOrCreateUserByOpenId_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateUserProfile",
|
||||
Handler: _PlantService_UpdateUserProfile_Handler,
|
||||
@@ -2719,6 +2965,30 @@ var PlantService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetAiChatQuota",
|
||||
Handler: _PlantService_GetAiChatQuota_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "QuickCare",
|
||||
Handler: _PlantService_QuickCare_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CreateBanner",
|
||||
Handler: _PlantService_CreateBanner_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UpdateBanner",
|
||||
Handler: _PlantService_UpdateBanner_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteBanner",
|
||||
Handler: _PlantService_DeleteBanner_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetBannerList",
|
||||
Handler: _PlantService_GetBannerList_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetActiveBannerList",
|
||||
Handler: _PlantService_GetActiveBannerList_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "pb/plant.proto",
|
||||
|
||||
@@ -14,90 +14,97 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
AddCarePlanReq = plant.AddCarePlanReq
|
||||
AddCareRecordReq = plant.AddCareRecordReq
|
||||
AddGrowthRecordReq = plant.AddGrowthRecordReq
|
||||
AiQuotaResp = plant.AiQuotaResp
|
||||
BadgeConfigInfo = plant.BadgeConfigInfo
|
||||
BadgeConfigListReq = plant.BadgeConfigListReq
|
||||
BadgeConfigListResp = plant.BadgeConfigListResp
|
||||
CarePlanInfo = plant.CarePlanInfo
|
||||
CareTaskInfo = plant.CareTaskInfo
|
||||
CareTaskListResp = plant.CareTaskListResp
|
||||
ClassifyLogInfo = plant.ClassifyLogInfo
|
||||
ClassifyLogListResp = plant.ClassifyLogListResp
|
||||
CommentPostReq = plant.CommentPostReq
|
||||
CommonResp = plant.CommonResp
|
||||
CreateBadgeConfigReq = plant.CreateBadgeConfigReq
|
||||
CreateExchangeItemReq = plant.CreateExchangeItemReq
|
||||
CreateExchangeOrderReq = plant.CreateExchangeOrderReq
|
||||
CreateLevelConfigReq = plant.CreateLevelConfigReq
|
||||
CreatePlantReq = plant.CreatePlantReq
|
||||
CreatePostReq = plant.CreatePostReq
|
||||
CreateTopicReq = plant.CreateTopicReq
|
||||
CreateWikiClassReq = plant.CreateWikiClassReq
|
||||
CreateWikiReq = plant.CreateWikiReq
|
||||
ExchangeItemInfo = plant.ExchangeItemInfo
|
||||
ExchangeItemListReq = plant.ExchangeItemListReq
|
||||
ExchangeItemListResp = plant.ExchangeItemListResp
|
||||
ExchangeOrderInfo = plant.ExchangeOrderInfo
|
||||
ExchangeOrderListReq = plant.ExchangeOrderListReq
|
||||
ExchangeOrderListResp = plant.ExchangeOrderListResp
|
||||
GetProfileReq = plant.GetProfileReq
|
||||
GrowthRecordInfo = plant.GrowthRecordInfo
|
||||
IdReq = plant.IdReq
|
||||
IdsReq = plant.IdsReq
|
||||
LevelConfigInfo = plant.LevelConfigInfo
|
||||
LevelConfigListResp = plant.LevelConfigListResp
|
||||
LikePostReq = plant.LikePostReq
|
||||
MediaCheckCallbackReq = plant.MediaCheckCallbackReq
|
||||
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
|
||||
UpdateBadgeConfigReq = plant.UpdateBadgeConfigReq
|
||||
UpdateExchangeItemReq = plant.UpdateExchangeItemReq
|
||||
UpdateExchangeOrderReq = plant.UpdateExchangeOrderReq
|
||||
UpdateLevelConfigReq = plant.UpdateLevelConfigReq
|
||||
UpdatePlantReq = plant.UpdatePlantReq
|
||||
UpdateProfileReq = plant.UpdateProfileReq
|
||||
UpdateTopicReq = plant.UpdateTopicReq
|
||||
UpdateWikiClassReq = plant.UpdateWikiClassReq
|
||||
UpdateWikiReq = plant.UpdateWikiReq
|
||||
UserBadgeInfo = plant.UserBadgeInfo
|
||||
UserBadgeListResp = plant.UserBadgeListResp
|
||||
UserStarInfo = plant.UserStarInfo
|
||||
UserStarListResp = plant.UserStarListResp
|
||||
WikiClassInfo = plant.WikiClassInfo
|
||||
WikiClassListResp = plant.WikiClassListResp
|
||||
WikiDetailResp = plant.WikiDetailResp
|
||||
WikiInfo = plant.WikiInfo
|
||||
WikiListReq = plant.WikiListReq
|
||||
WikiListResp = plant.WikiListResp
|
||||
// new types
|
||||
AiChatHistoryInfo = plant.AiChatHistoryInfo
|
||||
AiChatHistoryReq = plant.AiChatHistoryReq
|
||||
AiChatHistoryResp = plant.AiChatHistoryResp
|
||||
BadgeGroupInfo = plant.BadgeGroupInfo
|
||||
BadgeConfigTreeResp = plant.BadgeConfigTreeResp
|
||||
CompleteTaskReq = plant.CompleteTaskReq
|
||||
TaskCompletionResult = plant.TaskCompletionResult
|
||||
SaveAiChatHistoryReq = plant.SaveAiChatHistoryReq
|
||||
SyncWikiVectorReq = plant.SyncWikiVectorReq
|
||||
AddCarePlanReq = plant.AddCarePlanReq
|
||||
AddCareRecordReq = plant.AddCareRecordReq
|
||||
AddGrowthRecordReq = plant.AddGrowthRecordReq
|
||||
AiChatHistoryInfo = plant.AiChatHistoryInfo
|
||||
AiChatHistoryReq = plant.AiChatHistoryReq
|
||||
AiChatHistoryResp = plant.AiChatHistoryResp
|
||||
AiQuotaResp = plant.AiQuotaResp
|
||||
BadgeConfigInfo = plant.BadgeConfigInfo
|
||||
BadgeConfigListReq = plant.BadgeConfigListReq
|
||||
BadgeConfigListResp = plant.BadgeConfigListResp
|
||||
BadgeConfigTreeResp = plant.BadgeConfigTreeResp
|
||||
BadgeGroupInfo = plant.BadgeGroupInfo
|
||||
BannerInfo = plant.BannerInfo
|
||||
BannerListReq = plant.BannerListReq
|
||||
BannerListResp = plant.BannerListResp
|
||||
CarePlanInfo = plant.CarePlanInfo
|
||||
CareTaskInfo = plant.CareTaskInfo
|
||||
CareTaskListResp = plant.CareTaskListResp
|
||||
ClassifyLogInfo = plant.ClassifyLogInfo
|
||||
ClassifyLogListResp = plant.ClassifyLogListResp
|
||||
CommentPostReq = plant.CommentPostReq
|
||||
CommonResp = plant.CommonResp
|
||||
CompleteTaskReq = plant.CompleteTaskReq
|
||||
CreateBadgeConfigReq = plant.CreateBadgeConfigReq
|
||||
CreateBannerReq = plant.CreateBannerReq
|
||||
CreateExchangeItemReq = plant.CreateExchangeItemReq
|
||||
CreateExchangeOrderReq = plant.CreateExchangeOrderReq
|
||||
CreateLevelConfigReq = plant.CreateLevelConfigReq
|
||||
CreatePlantReq = plant.CreatePlantReq
|
||||
CreatePostReq = plant.CreatePostReq
|
||||
CreateTopicReq = plant.CreateTopicReq
|
||||
CreateWikiClassReq = plant.CreateWikiClassReq
|
||||
CreateWikiReq = plant.CreateWikiReq
|
||||
ExchangeItemInfo = plant.ExchangeItemInfo
|
||||
ExchangeItemListReq = plant.ExchangeItemListReq
|
||||
ExchangeItemListResp = plant.ExchangeItemListResp
|
||||
ExchangeOrderInfo = plant.ExchangeOrderInfo
|
||||
ExchangeOrderListReq = plant.ExchangeOrderListReq
|
||||
ExchangeOrderListResp = plant.ExchangeOrderListResp
|
||||
FindOrCreateUserByOpenIdReq = plant.FindOrCreateUserByOpenIdReq
|
||||
GetProfileReq = plant.GetProfileReq
|
||||
GrowthRecordInfo = plant.GrowthRecordInfo
|
||||
IdReq = plant.IdReq
|
||||
IdsReq = plant.IdsReq
|
||||
LevelConfigInfo = plant.LevelConfigInfo
|
||||
LevelConfigListResp = plant.LevelConfigListResp
|
||||
LikePostReq = plant.LikePostReq
|
||||
MediaCheckCallbackReq = plant.MediaCheckCallbackReq
|
||||
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
|
||||
QuickCareReq = plant.QuickCareReq
|
||||
SaveAiChatHistoryReq = plant.SaveAiChatHistoryReq
|
||||
SyncWikiVectorReq = plant.SyncWikiVectorReq
|
||||
TaskCompletionResult = plant.TaskCompletionResult
|
||||
ToggleStarReq = plant.ToggleStarReq
|
||||
TopicInfo = plant.TopicInfo
|
||||
TopicListResp = plant.TopicListResp
|
||||
UpdateBadgeConfigReq = plant.UpdateBadgeConfigReq
|
||||
UpdateBannerReq = plant.UpdateBannerReq
|
||||
UpdateExchangeItemReq = plant.UpdateExchangeItemReq
|
||||
UpdateExchangeOrderReq = plant.UpdateExchangeOrderReq
|
||||
UpdateLevelConfigReq = plant.UpdateLevelConfigReq
|
||||
UpdatePlantReq = plant.UpdatePlantReq
|
||||
UpdateProfileReq = plant.UpdateProfileReq
|
||||
UpdateTopicReq = plant.UpdateTopicReq
|
||||
UpdateWikiClassReq = plant.UpdateWikiClassReq
|
||||
UpdateWikiReq = plant.UpdateWikiReq
|
||||
UserBadgeInfo = plant.UserBadgeInfo
|
||||
UserBadgeListResp = plant.UserBadgeListResp
|
||||
UserStarInfo = plant.UserStarInfo
|
||||
UserStarListResp = plant.UserStarListResp
|
||||
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 *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error)
|
||||
FindOrCreateUserByOpenId(ctx context.Context, in *FindOrCreateUserByOpenIdReq, opts ...grpc.CallOption) (*PlantUserProfile, error)
|
||||
UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
GetMyBadges(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserBadgeListResp, error)
|
||||
GetMyStars(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserStarListResp, error)
|
||||
@@ -111,6 +118,7 @@ type (
|
||||
AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
DeleteCarePlan(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
GetTodayTaskList(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CareTaskListResp, error)
|
||||
CompleteTask(ctx context.Context, in *CompleteTaskReq, opts ...grpc.CallOption) (*TaskCompletionResult, error)
|
||||
AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
// 百科
|
||||
@@ -147,6 +155,7 @@ type (
|
||||
DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
// 兑换
|
||||
GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error)
|
||||
GetExchangeItemDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ExchangeItemInfo, error)
|
||||
CreateExchangeItem(ctx context.Context, in *CreateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
UpdateExchangeItem(ctx context.Context, in *UpdateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
DeleteExchangeItem(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
@@ -167,16 +176,20 @@ type (
|
||||
UpdateBadgeConfig(ctx context.Context, in *UpdateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
DeleteBadgeConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
GetWikiClassDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassInfo, error)
|
||||
// 兑换详情
|
||||
GetExchangeItemDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ExchangeItemInfo, error)
|
||||
// 养护完成任务
|
||||
CompleteTask(ctx context.Context, in *CompleteTaskReq, opts ...grpc.CallOption) (*TaskCompletionResult, error)
|
||||
// AI
|
||||
GetAiChatHistory(ctx context.Context, in *AiChatHistoryReq, opts ...grpc.CallOption) (*AiChatHistoryResp, error)
|
||||
SaveAiChatHistory(ctx context.Context, in *SaveAiChatHistoryReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
ClearAiChatHistory(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
GetAiChatQuota(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*AiQuotaResp, error)
|
||||
// 快捷养护
|
||||
QuickCare(ctx context.Context, in *QuickCareReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
// Banner
|
||||
CreateBanner(ctx context.Context, in *CreateBannerReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
UpdateBanner(ctx context.Context, in *UpdateBannerReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
DeleteBanner(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
GetBannerList(ctx context.Context, in *BannerListReq, opts ...grpc.CallOption) (*BannerListResp, error)
|
||||
GetActiveBannerList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*BannerListResp, error)
|
||||
}
|
||||
|
||||
defaultPlantService struct {
|
||||
@@ -185,238 +198,399 @@ type (
|
||||
)
|
||||
|
||||
func NewPlantService(cli zrpc.Client) PlantService {
|
||||
return &defaultPlantService{cli: cli}
|
||||
return &defaultPlantService{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// ---- 用户Profile ----
|
||||
// 用户Profile
|
||||
func (m *defaultPlantService) GetUserProfile(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*PlantUserProfile, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetUserProfile(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetUserProfile(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) FindOrCreateUserByOpenId(ctx context.Context, in *FindOrCreateUserByOpenIdReq, opts ...grpc.CallOption) (*PlantUserProfile, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.FindOrCreateUserByOpenId(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdateUserProfile(ctx context.Context, in *UpdateProfileReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).UpdateUserProfile(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateUserProfile(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetMyBadges(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserBadgeListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetMyBadges(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetMyBadges(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetMyStars(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*UserStarListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetMyStars(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetMyStars(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// ---- 我的植物 ----
|
||||
// 我的植物
|
||||
func (m *defaultPlantService) CreatePlant(ctx context.Context, in *CreatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CreatePlant(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreatePlant(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdatePlant(ctx context.Context, in *UpdatePlantReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).UpdatePlant(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdatePlant(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeletePlant(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeletePlant(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeletePlant(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetPlantList(ctx context.Context, in *PlantListReq, opts ...grpc.CallOption) (*PlantListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetPlantList(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetPlantList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetPlantDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*PlantDetailResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetPlantDetail(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetPlantDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// ---- 养护 ----
|
||||
// 养护
|
||||
func (m *defaultPlantService) AddCarePlan(ctx context.Context, in *AddCarePlanReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).AddCarePlan(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.AddCarePlan(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteCarePlan(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteCarePlan(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteCarePlan(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetTodayTaskList(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CareTaskListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetTodayTaskList(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetTodayTaskList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CompleteTask(ctx context.Context, in *CompleteTaskReq, opts ...grpc.CallOption) (*TaskCompletionResult, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CompleteTask(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) AddCareRecord(ctx context.Context, in *AddCareRecordReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).AddCareRecord(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.AddCareRecord(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) AddGrowthRecord(ctx context.Context, in *AddGrowthRecordReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).AddGrowthRecord(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.AddGrowthRecord(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// ---- 百科 ----
|
||||
// 百科
|
||||
func (m *defaultPlantService) GetWikiList(ctx context.Context, in *WikiListReq, opts ...grpc.CallOption) (*WikiListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetWikiList(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetWikiList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetWikiDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiDetailResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetWikiDetail(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetWikiDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateWiki(ctx context.Context, in *CreateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CreateWiki(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateWiki(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdateWiki(ctx context.Context, in *UpdateWikiReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).UpdateWiki(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateWiki(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteWiki(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteWiki(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteWiki(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) SyncWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).SyncWikiVector(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.SyncWikiVector(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteWikiVector(ctx context.Context, in *SyncWikiVectorReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteWikiVector(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteWikiVector(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) SyncAllWikiVector(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).SyncAllWikiVector(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.SyncAllWikiVector(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetWikiClassList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetWikiClassList(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetWikiClassList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateWikiClass(ctx context.Context, in *CreateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CreateWikiClass(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateWikiClass(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdateWikiClass(ctx context.Context, in *UpdateWikiClassReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).UpdateWikiClass(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateWikiClass(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteWikiClass(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteWikiClass(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteWikiClass(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) ToggleWikiStar(ctx context.Context, in *ToggleStarReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).ToggleWikiStar(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.ToggleWikiStar(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// ---- OCR ----
|
||||
// OCR
|
||||
func (m *defaultPlantService) GetMyClassifyLog(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*ClassifyLogListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetMyClassifyLog(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetMyClassifyLog(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteClassifyLog(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteClassifyLog(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteClassifyLog(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// ---- 社区 ----
|
||||
// 社区
|
||||
func (m *defaultPlantService) CreatePost(ctx context.Context, in *CreatePostReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CreatePost(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreatePost(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeletePost(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeletePost(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeletePost(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetPostList(ctx context.Context, in *PostListReq, opts ...grpc.CallOption) (*PostListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetPostList(ctx, in, opts...)
|
||||
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) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetPostDetail(ctx, in, opts...)
|
||||
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) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CommentPost(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CommentPost(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) LikePost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).LikePost(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.LikePost(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) StarPost(ctx context.Context, in *LikePostReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).StarPost(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.StarPost(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) MediaCheckCallback(ctx context.Context, in *MediaCheckCallbackReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).MediaCheckCallback(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.MediaCheckCallback(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// ---- 话题 ----
|
||||
// 话题
|
||||
func (m *defaultPlantService) GetTopicList(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetTopicList(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetTopicList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetTopicDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*TopicInfo, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetTopicDetail(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetTopicDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateTopic(ctx context.Context, in *CreateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CreateTopic(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateTopic(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdateTopic(ctx context.Context, in *UpdateTopicReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).UpdateTopic(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateTopic(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteTopic(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteTopic(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteTopic(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// ---- 兑换 ----
|
||||
// 兑换
|
||||
func (m *defaultPlantService) GetExchangeItemList(ctx context.Context, in *ExchangeItemListReq, opts ...grpc.CallOption) (*ExchangeItemListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetExchangeItemList(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetExchangeItemList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetExchangeItemDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*ExchangeItemInfo, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetExchangeItemDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateExchangeItem(ctx context.Context, in *CreateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CreateExchangeItem(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateExchangeItem(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdateExchangeItem(ctx context.Context, in *UpdateExchangeItemReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).UpdateExchangeItem(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateExchangeItem(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteExchangeItem(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteExchangeItem(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteExchangeItem(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateExchangeOrder(ctx context.Context, in *CreateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CreateExchangeOrder(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateExchangeOrder(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetMyExchangeOrders(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetMyExchangeOrders(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetMyExchangeOrders(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetExchangeOrderList(ctx context.Context, in *ExchangeOrderListReq, opts ...grpc.CallOption) (*ExchangeOrderListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetExchangeOrderList(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetExchangeOrderList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdateExchangeOrder(ctx context.Context, in *UpdateExchangeOrderReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).UpdateExchangeOrder(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateExchangeOrder(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// ---- 配置 ----
|
||||
// 配置
|
||||
func (m *defaultPlantService) GetLevelConfigList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*LevelConfigListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetLevelConfigList(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetLevelConfigList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetLevelConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*LevelConfigInfo, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetLevelConfigDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateLevelConfig(ctx context.Context, in *CreateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CreateLevelConfig(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateLevelConfig(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdateLevelConfig(ctx context.Context, in *UpdateLevelConfigReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).UpdateLevelConfig(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateLevelConfig(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteLevelConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteLevelConfig(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteLevelConfig(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetBadgeConfigList(ctx context.Context, in *BadgeConfigListReq, opts ...grpc.CallOption) (*BadgeConfigListResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetBadgeConfigList(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetBadgeConfigList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetBadgeConfigDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigInfo, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetBadgeConfigDetail(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetBadgeConfigDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetBadgeConfigTree(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*BadgeConfigTreeResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetBadgeConfigTree(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CreateBadgeConfig(ctx context.Context, in *CreateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CreateBadgeConfig(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateBadgeConfig(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) UpdateBadgeConfig(ctx context.Context, in *UpdateBadgeConfigReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).UpdateBadgeConfig(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateBadgeConfig(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteBadgeConfig(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteBadgeConfig(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteBadgeConfig(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// ---- AI ----
|
||||
func (m *defaultPlantService) DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).DeleteAiChatHistory(ctx, in, opts...)
|
||||
func (m *defaultPlantService) GetWikiClassDetail(ctx context.Context, in *IdReq, opts ...grpc.CallOption) (*WikiClassInfo, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetWikiClassDetail(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// AI
|
||||
func (m *defaultPlantService) GetAiChatHistory(ctx context.Context, in *AiChatHistoryReq, opts ...grpc.CallOption) (*AiChatHistoryResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetAiChatHistory(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) SaveAiChatHistory(ctx context.Context, in *SaveAiChatHistoryReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).SaveAiChatHistory(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.SaveAiChatHistory(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) DeleteAiChatHistory(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteAiChatHistory(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) ClearAiChatHistory(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).ClearAiChatHistory(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.ClearAiChatHistory(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetAiChatQuota(ctx context.Context, in *GetProfileReq, opts ...grpc.CallOption) (*AiQuotaResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetAiChatQuota(ctx, in, opts...)
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetAiChatQuota(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) CompleteTask(ctx context.Context, in *plant.CompleteTaskReq, opts ...grpc.CallOption) (*plant.TaskCompletionResult, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).CompleteTask(ctx, in, opts...)
|
||||
// 快捷养护
|
||||
func (m *defaultPlantService) QuickCare(ctx context.Context, in *QuickCareReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.QuickCare(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetExchangeItemDetail(ctx context.Context, in *plant.IdReq, opts ...grpc.CallOption) (*plant.ExchangeItemInfo, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetExchangeItemDetail(ctx, in, opts...)
|
||||
// Banner
|
||||
func (m *defaultPlantService) CreateBanner(ctx context.Context, in *CreateBannerReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.CreateBanner(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetWikiClassDetail(ctx context.Context, in *plant.IdReq, opts ...grpc.CallOption) (*plant.WikiClassInfo, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetWikiClassDetail(ctx, in, opts...)
|
||||
func (m *defaultPlantService) UpdateBanner(ctx context.Context, in *UpdateBannerReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.UpdateBanner(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetLevelConfigDetail(ctx context.Context, in *plant.IdReq, opts ...grpc.CallOption) (*plant.LevelConfigInfo, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetLevelConfigDetail(ctx, in, opts...)
|
||||
func (m *defaultPlantService) DeleteBanner(ctx context.Context, in *IdsReq, opts ...grpc.CallOption) (*CommonResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.DeleteBanner(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetBadgeConfigTree(ctx context.Context, in *plant.IdReq, opts ...grpc.CallOption) (*plant.BadgeConfigTreeResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetBadgeConfigTree(ctx, in, opts...)
|
||||
func (m *defaultPlantService) GetBannerList(ctx context.Context, in *BannerListReq, opts ...grpc.CallOption) (*BannerListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetBannerList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultPlantService) GetAiChatHistory(ctx context.Context, in *plant.AiChatHistoryReq, opts ...grpc.CallOption) (*plant.AiChatHistoryResp, error) {
|
||||
return plant.NewPlantServiceClient(m.cli.Conn()).GetAiChatHistory(ctx, in, opts...)
|
||||
func (m *defaultPlantService) GetActiveBannerList(ctx context.Context, in *PageReq, opts ...grpc.CallOption) (*BannerListResp, error) {
|
||||
client := plant.NewPlantServiceClient(m.cli.Conn())
|
||||
return client.GetActiveBannerList(ctx, in, opts...)
|
||||
}
|
||||
|
||||
@@ -106,10 +106,6 @@ type SundynixUser struct {
|
||||
Password string `gorm:"size:100;column:password" json:"-"`
|
||||
NickName string `gorm:"size:100;column:nick_name" json:"nickName"`
|
||||
Phone string `gorm:"size:20;column:phone" json:"phone"`
|
||||
SessionKey string `gorm:"size:80;column:session_key" json:"-"`
|
||||
UnionID string `gorm:"size:80;column:union_id" json:"unionId"`
|
||||
OpenID string `gorm:"size:80;column:open_id;index" json:"openId"`
|
||||
SaOpenID string `gorm:"size:80;column:sa_open_id" json:"saOpenId"`
|
||||
AvatarID string `gorm:"size:50;column:avatar_id" json:"avatarId"`
|
||||
Gender int `gorm:"default:0;column:gender" json:"gender"`
|
||||
LastLoginIP string `gorm:"size:20;column:last_login_ip" json:"lastLoginIp"`
|
||||
|
||||
@@ -23,18 +23,6 @@ func NewCreateUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create
|
||||
}
|
||||
|
||||
func (l *CreateUserLogic) CreateUser(in *system.CreateUserReq) (*system.CreateUserResp, error) {
|
||||
// 如果有 OpenId,先查是否已存在(社交登录场景:已有用户直接返回)
|
||||
if in.OpenId != "" {
|
||||
var existing sysModel.SundynixUser
|
||||
if err := l.svcCtx.DB.Where("open_id = ?", in.OpenId).First(&existing).Error; err == nil {
|
||||
// 用户已存在,更新 session_key 后直接返回
|
||||
if in.SessionKey != "" {
|
||||
l.svcCtx.DB.Model(&existing).Update("session_key", in.SessionKey)
|
||||
}
|
||||
return &system.CreateUserResp{User: convertUserToProto(&existing)}, nil
|
||||
}
|
||||
}
|
||||
|
||||
// 如果有 Account,检查是否重复(后台创建用户场景:禁止重复)
|
||||
if in.Account != "" {
|
||||
var count int64
|
||||
@@ -45,12 +33,11 @@ func (l *CreateUserLogic) CreateUser(in *system.CreateUserReq) (*system.CreateUs
|
||||
}
|
||||
|
||||
u := sysModel.SundynixUser{
|
||||
Name: in.Name,
|
||||
Account: in.Account,
|
||||
Phone: in.Phone,
|
||||
OpenID: in.OpenId,
|
||||
SessionKey: in.SessionKey,
|
||||
ClientID: in.ClientId,
|
||||
Name: in.Name,
|
||||
Account: in.Account,
|
||||
Phone: in.Phone,
|
||||
NickName: in.NickName,
|
||||
ClientID: in.ClientId,
|
||||
}
|
||||
if in.Password != "" {
|
||||
u.Password = hash.BcryptHash(in.Password)
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
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"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type GetUserByOpenIdLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewGetUserByOpenIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserByOpenIdLogic {
|
||||
return &GetUserByOpenIdLogic{ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx)}
|
||||
}
|
||||
|
||||
func (l *GetUserByOpenIdLogic) GetUserByOpenId(in *system.GetUserByOpenIdReq) (*system.GetUserByOpenIdResp, error) {
|
||||
var u sysModel.SundynixUser
|
||||
if err := l.svcCtx.DB.Where("open_id = ?", in.OpenId).First(&u).Error; err != nil {
|
||||
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||
return nil, status.Error(codes.NotFound, "用户不存在")
|
||||
}
|
||||
return nil, status.Error(codes.Internal, "查询失败")
|
||||
}
|
||||
return &system.GetUserByOpenIdResp{User: convertUserToProto(&u)}, nil
|
||||
}
|
||||
@@ -8,21 +8,17 @@ import (
|
||||
// convertUserToProto 将 model 转为 proto UserInfo
|
||||
func convertUserToProto(u *sysModel.SundynixUser) *system.UserInfo {
|
||||
info := &system.UserInfo{
|
||||
Id: u.ID,
|
||||
TenantId: u.TenantID,
|
||||
ClientId: u.ClientID,
|
||||
Name: u.Name,
|
||||
Account: u.Account,
|
||||
NickName: u.NickName,
|
||||
Phone: u.Phone,
|
||||
SessionKey: u.SessionKey,
|
||||
UnionId: u.UnionID,
|
||||
OpenId: u.OpenID,
|
||||
SaOpenId: u.SaOpenID,
|
||||
AvatarId: u.AvatarID,
|
||||
Gender: int32(u.Gender),
|
||||
CreatedAt: u.CreatedAt.Unix(),
|
||||
UpdatedAt: u.UpdatedAt.Unix(),
|
||||
Id: u.ID,
|
||||
TenantId: u.TenantID,
|
||||
ClientId: u.ClientID,
|
||||
Name: u.Name,
|
||||
Account: u.Account,
|
||||
NickName: u.NickName,
|
||||
Phone: u.Phone,
|
||||
AvatarId: u.AvatarID,
|
||||
Gender: int32(u.Gender),
|
||||
CreatedAt: u.CreatedAt.Unix(),
|
||||
UpdatedAt: u.UpdatedAt.Unix(),
|
||||
}
|
||||
if u.LastLoginAt != nil {
|
||||
info.LastLoginAt = u.LastLoginAt.Unix()
|
||||
|
||||
@@ -29,11 +29,6 @@ func (s *SystemServiceServer) GetUserById(ctx context.Context, in *system.GetUse
|
||||
return l.GetUserById(in)
|
||||
}
|
||||
|
||||
func (s *SystemServiceServer) GetUserByOpenId(ctx context.Context, in *system.GetUserByOpenIdReq) (*system.GetUserByOpenIdResp, error) {
|
||||
l := logic.NewGetUserByOpenIdLogic(ctx, s.svcCtx)
|
||||
return l.GetUserByOpenId(in)
|
||||
}
|
||||
|
||||
func (s *SystemServiceServer) LoginByAccount(ctx context.Context, in *system.LoginByAccountReq) (*system.LoginByAccountResp, error) {
|
||||
l := logic.NewLoginByAccountLogic(ctx, s.svcCtx)
|
||||
return l.LoginByAccount(in)
|
||||
|
||||
@@ -259,10 +259,6 @@ message UserInfo {
|
||||
string account = 5;
|
||||
string nickName = 6;
|
||||
string phone = 7;
|
||||
string sessionKey = 8;
|
||||
string unionId = 9;
|
||||
string openId = 10;
|
||||
string saOpenId = 11;
|
||||
string avatarId = 12;
|
||||
int32 gender = 13;
|
||||
string country = 14;
|
||||
@@ -287,20 +283,11 @@ message GetUserByIdResp {
|
||||
UserInfo user = 1;
|
||||
}
|
||||
|
||||
message GetUserByOpenIdReq {
|
||||
string openId = 1;
|
||||
}
|
||||
|
||||
message GetUserByOpenIdResp {
|
||||
UserInfo user = 1;
|
||||
}
|
||||
|
||||
message CreateUserReq {
|
||||
string name = 1;
|
||||
string account = 2;
|
||||
string password = 3;
|
||||
string openId = 4;
|
||||
string sessionKey = 5;
|
||||
string nickName = 4;
|
||||
string clientId = 6;
|
||||
string phone = 7;
|
||||
}
|
||||
@@ -392,7 +379,6 @@ message GetClientByIdResp {
|
||||
service SystemService {
|
||||
// --- 用户 ---
|
||||
rpc GetUserById(GetUserByIdReq) returns (GetUserByIdResp);
|
||||
rpc GetUserByOpenId(GetUserByOpenIdReq) returns (GetUserByOpenIdResp);
|
||||
rpc LoginByAccount(LoginByAccountReq) returns (LoginByAccountResp);
|
||||
rpc CreateUser(CreateUserReq) returns (CreateUserResp);
|
||||
rpc UpdateUser(UpdateUserReq) returns (CommonResp);
|
||||
|
||||
+278
-426
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.6.1
|
||||
// - protoc v7.34.1
|
||||
// source: pb/system.proto
|
||||
// source: app/system/rpc/pb/system.proto
|
||||
|
||||
package system
|
||||
|
||||
@@ -20,7 +20,6 @@ const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
SystemService_GetUserById_FullMethodName = "/system.SystemService/GetUserById"
|
||||
SystemService_GetUserByOpenId_FullMethodName = "/system.SystemService/GetUserByOpenId"
|
||||
SystemService_LoginByAccount_FullMethodName = "/system.SystemService/LoginByAccount"
|
||||
SystemService_CreateUser_FullMethodName = "/system.SystemService/CreateUser"
|
||||
SystemService_UpdateUser_FullMethodName = "/system.SystemService/UpdateUser"
|
||||
@@ -61,7 +60,6 @@ const (
|
||||
type SystemServiceClient interface {
|
||||
// --- 用户 ---
|
||||
GetUserById(ctx context.Context, in *GetUserByIdReq, opts ...grpc.CallOption) (*GetUserByIdResp, error)
|
||||
GetUserByOpenId(ctx context.Context, in *GetUserByOpenIdReq, opts ...grpc.CallOption) (*GetUserByOpenIdResp, error)
|
||||
LoginByAccount(ctx context.Context, in *LoginByAccountReq, opts ...grpc.CallOption) (*LoginByAccountResp, error)
|
||||
CreateUser(ctx context.Context, in *CreateUserReq, opts ...grpc.CallOption) (*CreateUserResp, error)
|
||||
UpdateUser(ctx context.Context, in *UpdateUserReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
@@ -120,16 +118,6 @@ func (c *systemServiceClient) GetUserById(ctx context.Context, in *GetUserByIdRe
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *systemServiceClient) GetUserByOpenId(ctx context.Context, in *GetUserByOpenIdReq, opts ...grpc.CallOption) (*GetUserByOpenIdResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetUserByOpenIdResp)
|
||||
err := c.cc.Invoke(ctx, SystemService_GetUserByOpenId_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *systemServiceClient) LoginByAccount(ctx context.Context, in *LoginByAccountReq, opts ...grpc.CallOption) (*LoginByAccountResp, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(LoginByAccountResp)
|
||||
@@ -456,7 +444,6 @@ func (c *systemServiceClient) GetOperationRecordList(ctx context.Context, in *Op
|
||||
type SystemServiceServer interface {
|
||||
// --- 用户 ---
|
||||
GetUserById(context.Context, *GetUserByIdReq) (*GetUserByIdResp, error)
|
||||
GetUserByOpenId(context.Context, *GetUserByOpenIdReq) (*GetUserByOpenIdResp, error)
|
||||
LoginByAccount(context.Context, *LoginByAccountReq) (*LoginByAccountResp, error)
|
||||
CreateUser(context.Context, *CreateUserReq) (*CreateUserResp, error)
|
||||
UpdateUser(context.Context, *UpdateUserReq) (*CommonResp, error)
|
||||
@@ -508,9 +495,6 @@ type UnimplementedSystemServiceServer struct{}
|
||||
func (UnimplementedSystemServiceServer) GetUserById(context.Context, *GetUserByIdReq) (*GetUserByIdResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetUserById not implemented")
|
||||
}
|
||||
func (UnimplementedSystemServiceServer) GetUserByOpenId(context.Context, *GetUserByOpenIdReq) (*GetUserByOpenIdResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetUserByOpenId not implemented")
|
||||
}
|
||||
func (UnimplementedSystemServiceServer) LoginByAccount(context.Context, *LoginByAccountReq) (*LoginByAccountResp, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method LoginByAccount not implemented")
|
||||
}
|
||||
@@ -646,24 +630,6 @@ func _SystemService_GetUserById_Handler(srv interface{}, ctx context.Context, de
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SystemService_GetUserByOpenId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserByOpenIdReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SystemServiceServer).GetUserByOpenId(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SystemService_GetUserByOpenId_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SystemServiceServer).GetUserByOpenId(ctx, req.(*GetUserByOpenIdReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SystemService_LoginByAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoginByAccountReq)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -1251,10 +1217,6 @@ var SystemService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetUserById",
|
||||
Handler: _SystemService_GetUserById_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUserByOpenId",
|
||||
Handler: _SystemService_GetUserByOpenId_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoginByAccount",
|
||||
Handler: _SystemService_LoginByAccount_Handler,
|
||||
@@ -1385,5 +1347,5 @@ var SystemService_ServiceDesc = grpc.ServiceDesc{
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "pb/system.proto",
|
||||
Metadata: "app/system/rpc/pb/system.proto",
|
||||
}
|
||||
|
||||
@@ -36,14 +36,10 @@ type (
|
||||
GetMenusByRoleIdReq = system.GetMenusByRoleIdReq
|
||||
GetMenusByRoleIdResp = system.GetMenusByRoleIdResp
|
||||
GetRoleDetailReq = system.GetRoleDetailReq
|
||||
GetRoleListReq = system.RoleListReq
|
||||
GetRoleListResp = system.RoleListResp
|
||||
GetRolesByUserIdReq = system.GetRolesByUserIdReq
|
||||
GetRolesByUserIdResp = system.GetRolesByUserIdResp
|
||||
GetUserByIdReq = system.GetUserByIdReq
|
||||
GetUserByIdResp = system.GetUserByIdResp
|
||||
GetUserByOpenIdReq = system.GetUserByOpenIdReq
|
||||
GetUserByOpenIdResp = system.GetUserByOpenIdResp
|
||||
GetUserDetailReq = system.GetUserDetailReq
|
||||
GetUserListReq = system.GetUserListReq
|
||||
GetUserListResp = system.GetUserListResp
|
||||
@@ -72,7 +68,6 @@ type (
|
||||
SystemService interface {
|
||||
// --- 用户 ---
|
||||
GetUserById(ctx context.Context, in *GetUserByIdReq, opts ...grpc.CallOption) (*GetUserByIdResp, error)
|
||||
GetUserByOpenId(ctx context.Context, in *GetUserByOpenIdReq, opts ...grpc.CallOption) (*GetUserByOpenIdResp, error)
|
||||
LoginByAccount(ctx context.Context, in *LoginByAccountReq, opts ...grpc.CallOption) (*LoginByAccountResp, error)
|
||||
CreateUser(ctx context.Context, in *CreateUserReq, opts ...grpc.CallOption) (*CreateUserResp, error)
|
||||
UpdateUser(ctx context.Context, in *UpdateUserReq, opts ...grpc.CallOption) (*CommonResp, error)
|
||||
@@ -130,11 +125,6 @@ func (m *defaultSystemService) GetUserById(ctx context.Context, in *GetUserByIdR
|
||||
return client.GetUserById(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultSystemService) GetUserByOpenId(ctx context.Context, in *GetUserByOpenIdReq, opts ...grpc.CallOption) (*GetUserByOpenIdResp, error) {
|
||||
client := system.NewSystemServiceClient(m.cli.Conn())
|
||||
return client.GetUserByOpenId(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultSystemService) LoginByAccount(ctx context.Context, in *LoginByAccountReq, opts ...grpc.CallOption) (*LoginByAccountResp, error) {
|
||||
client := system.NewSystemServiceClient(m.cli.Conn())
|
||||
return client.LoginByAccount(ctx, in, opts...)
|
||||
|
||||
Reference in New Issue
Block a user