feat: 迁移plant

This commit is contained in:
Blizzard
2026-05-23 13:55:05 +08:00
parent a93477ea8e
commit ae6d03d351
228 changed files with 25296 additions and 917 deletions
@@ -3,6 +3,7 @@ package logic
import (
"context"
plantModel "sundynix-micro-go/app/plant/model"
"sundynix-micro-go/app/plant/rpc/internal/svc"
"sundynix-micro-go/app/plant/rpc/plant"
@@ -23,8 +24,18 @@ func NewUpdatePlantLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Updat
}
}
// 更新植物
func (l *UpdatePlantLogic) UpdatePlant(in *plant.UpdatePlantReq) (*plant.CommonResp, error) {
// todo: add your logic here and delete this line
return &plant.CommonResp{}, nil
updateMap := map[string]interface{}{
"name": in.Name,
"placement": in.Placement,
"pot_material": in.PotMaterial,
"pot_size": in.PotSize,
"sunlight": in.Sunlight,
"planting_material": in.PlantingMaterial,
}
if err := l.svcCtx.DB.Model(&plantModel.MyPlant{}).Where("id = ?", in.Id).Updates(updateMap).Error; err != nil {
return nil, err
}
return &plant.CommonResp{Code: 0, Msg: "ok"}, nil
}