From 556ab6baff4b7f4fba5ae85bd8cb84e2e249d7c6 Mon Sep 17 00:00:00 2001 From: Blizzard Date: Tue, 10 Feb 2026 12:35:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A4=8D=E7=89=A9=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/v1/plant/enter.go | 2 + api/v1/plant/ocr.go | 36 + api/v1/plant/post.go | 31 + api/v1/plant/wiki_class.go | 2 +- api/v1/system/sys_menu.go | 9 +- config-dev.yaml | 18 +- config/baidu_img_classify.go | 6 + config/config.go | 7 +- docs/docs.go | 5267 ++++++---------------------------- docs/swagger.json | 5267 ++++++---------------------------- docs/swagger.yaml | 3374 ++++------------------ initialize/router.go | 1 + main.go | 2 +- model/system/oss.go | 2 - router/plant/enter.go | 2 + router/plant/ocr_router.go | 13 + router/plant/post_router.go | 1 + service/plant/enter.go | 1 + service/plant/ocr.go | 78 + service/plant/post.go | 61 + service/plant/wiki.go | 4 +- service/plant/wiki_class.go | 12 +- service/system/oss.go | 20 - service/system/sys_menu.go | 2 +- 24 files changed, 2745 insertions(+), 11473 deletions(-) create mode 100644 api/v1/plant/ocr.go create mode 100644 config/baidu_img_classify.go create mode 100644 router/plant/ocr_router.go create mode 100644 service/plant/ocr.go diff --git a/api/v1/plant/enter.go b/api/v1/plant/enter.go index 3de3d2e..217c7b1 100644 --- a/api/v1/plant/enter.go +++ b/api/v1/plant/enter.go @@ -8,6 +8,7 @@ type ApiGroup struct { PostApi WikiClassApi WikiApi + OcrApi } var ( @@ -16,4 +17,5 @@ var ( postService = service.GroupApp.PlantServiceGroup.PostService wikiClassService = service.GroupApp.PlantServiceGroup.WikiClassService wikiService = service.GroupApp.PlantServiceGroup.WikiService + ocrService = service.GroupApp.PlantServiceGroup.OcrService ) diff --git a/api/v1/plant/ocr.go b/api/v1/plant/ocr.go new file mode 100644 index 0000000..1de796a --- /dev/null +++ b/api/v1/plant/ocr.go @@ -0,0 +1,36 @@ +package plant + +import ( + "sundynix-go/global" + "sundynix-go/model/commom/response" + + "github.com/gin-gonic/gin" + "go.uber.org/zap" +) + +type OcrApi struct{} + +// ClassifyPlant +// @tags 识别相关 +// @Summary base64植物识别 +// @Security ApiKeyAuth +// @accept multipart/form-data +// @Produce application/json +// @Param file formData file true "植物识别" +// @Success 200 {object} response.Response{msg=string} "文件OCR" +// @router /ocr/base64 [post] +func (o *OcrApi) ClassifyPlant(c *gin.Context) { + multipartFile, header, err := c.Request.FormFile("file") + if err != nil { + global.Logger.Error("接收文件失败!", zap.Error(err)) + response.FailWithMsg("接收文件失败!", c) + return + } + res, err := ocrService.ClassifyPlant(multipartFile, header) + if err != nil { + global.Logger.Error("植物识别识别!", zap.Error(err)) + response.FailWithMsg("植物识别失败!", c) + return + } + response.OkWithData(res, c) +} diff --git a/api/v1/plant/post.go b/api/v1/plant/post.go index 1635113..e5ef13d 100644 --- a/api/v1/plant/post.go +++ b/api/v1/plant/post.go @@ -70,6 +70,37 @@ func (a *PostApi) PostPage(c *gin.Context) { }, c) } +// MyPost 我的发布 +// @Tags 帖子 +// @Summary 我的发布 +// @Security BearerAuth +// @accept json +// @Produce application/json +// @Param data body plantReq.PostPage true "分页获取帖子列表" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /post/myPost [post] +func (a *PostApi) MyPost(c *gin.Context) { + var req plantReq.PostPage + err := c.ShouldBindJSON(&req) + if err != nil { + response.FailWithMsg("请求参数错误", c) + return + } + userId := auth.GetUserId(c) + posts, total, err := postService.MyPost(req, userId) + if err != nil { + global.Logger.Error("获取帖子列表失败", zap.Error(err)) + response.FailWithMsg("获取帖子列表失败", c) + return + } + response.OkWithData(response.PageResult{ + List: posts, + Total: total, + Page: req.Current, + PageSize: req.PageSize, + }, c) +} + // LikePost 点赞帖子 // @Tags 帖子 // @Summary 点赞帖子 diff --git a/api/v1/plant/wiki_class.go b/api/v1/plant/wiki_class.go index 0019dad..e7cfdaa 100644 --- a/api/v1/plant/wiki_class.go +++ b/api/v1/plant/wiki_class.go @@ -42,7 +42,7 @@ func (a *WikiClassApi) AddClass(c *gin.Context) { // @Security BearerAuth // @accept json // @Produce application/json -// @Param data body lantReq.UpdateWikiClass true "修改分类" +// @Param data body plantReq.UpdateWikiClass true "修改分类" // @Success 200 {string} string "{"success":true,"data":{},"msg":"发布成功"}" // @Router /wiki-class/update [post] func (a *WikiClassApi) UpdateClass(c *gin.Context) { diff --git a/api/v1/system/sys_menu.go b/api/v1/system/sys_menu.go index e0cddd1..e5dbe2c 100644 --- a/api/v1/system/sys_menu.go +++ b/api/v1/system/sys_menu.go @@ -137,7 +137,14 @@ func (m *MenuApi) GetAllMenuTree(c *gin.Context) { // @Success 200 {object} response.Response{data=[]system.Menu,msg=string} "用户菜单数据" // @Router /menu/getUserMenuTree [get] func (m *MenuApi) GetUserMenuTree(c *gin.Context) { - + userId := auth.GetUserId(c) + routes, err := menuService.GetUserRoutes(userId) + if err != nil { + global.Logger.Error("获取用户菜单失败!", zap.Error(err)) + response.FailWithMsg(err.Error(), c) + return + } + response.OkWithData(routes, c) } // Route diff --git a/config-dev.yaml b/config-dev.yaml index a747928..edd695b 100644 --- a/config-dev.yaml +++ b/config-dev.yaml @@ -1,5 +1,5 @@ system: - addr: 8888 + addr: 8889 db-type: mysql router-prefix: "" enable-captcha: 0 @@ -14,9 +14,14 @@ jwt: # 植趣微信小程序 +#mini-program: +# app-id: wxb463820bf36dd5d6 +# app-secret: 731784a74c76c6d31fa00bb847af2c7d + +# 植遇微信小程序 mini-program: - app-id: wxb463820bf36dd5d6 - app-secret: 731784a74c76c6d31fa00bb847af2c7d + app-id: wx52dfc635739a9c19 + app-secret: 5aaed22f05352b7cd991870de6600bef # 植趣服务号 service-account: @@ -32,6 +37,9 @@ wechat-pay: public-key-path: /Users/blizzard/privateFolder/cert/pub_key.pem # 商户APIv3密钥对应的公钥 notify-url: https://prod.sundynix.cn/api/wechatpay/notify # 微信支付结果通知回调地址 +baidu-img-classify: + api-key: hpBfjwy8ifv3qswYGYjUCNKN + secret-key: i5aXZdM4XZVuDroBslL0f3uIuwbAyXFS minio: access-key-id: qP5QXP3g6Axw1hkwX21Y @@ -74,8 +82,8 @@ redis: - 172.21.0.4:7001 - 172.21.0.2:7002 db: 1 -# name: "" -# password: "sundynix" + # name: "" + # password: "sundynix" cluster: false zap: diff --git a/config/baidu_img_classify.go b/config/baidu_img_classify.go new file mode 100644 index 0000000..5ef83b8 --- /dev/null +++ b/config/baidu_img_classify.go @@ -0,0 +1,6 @@ +package config + +type BaiduImgClassify struct { + ApiKey string `mapstructure:"api-key" json:"api-key" yaml:"api-key"` + SecretKey string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"` +} diff --git a/config/config.go b/config/config.go index 7e7d181..1ade0d4 100644 --- a/config/config.go +++ b/config/config.go @@ -13,7 +13,8 @@ type Config struct { RocketMQConfig RocketMQConfig `mapstructure:"rocket-mq" json:"rocket-mq" yaml:"rocket-mq"` TencentCOS TencentCOS `mapstructure:"tencent-cos" json:"tencent-cos" yaml:"tencent-cos"` - MiniProgram MiniProgram `mapstructure:"mini-program" json:"mini-program" yaml:"mini-program"` //小程序 - ServiceAccount ServiceAccount `mapstructure:"service-account" json:"service-account" yaml:"service-account"` //服务号 - WechatPay WechatPay `mapstructure:"wechat-pay" json:"wechat-pay" yaml:"wechat-pay"` //微信支付 + MiniProgram MiniProgram `mapstructure:"mini-program" json:"mini-program" yaml:"mini-program"` //小程序 + ServiceAccount ServiceAccount `mapstructure:"service-account" json:"service-account" yaml:"service-account"` //服务号 + WechatPay WechatPay `mapstructure:"wechat-pay" json:"wechat-pay" yaml:"wechat-pay"` //微信支付 + BaiduImgClassify BaiduImgClassify `mapstructure:"baidu-img-classify" json:"baidu-img-classify" yaml:"baidu-img-classify"` // 百度植物识别 } diff --git a/docs/docs.go b/docs/docs.go index 01db91d..527ea3f 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -244,1072 +244,6 @@ const docTemplate = `{ } } }, - "/badge/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "添加", - "parameters": [ - { - "description": "添加", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateBadge" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/all": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "获取所有无分页", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "添加分类", - "parameters": [ - { - "description": "添加分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateBadgeCategory" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "删除分类", - "parameters": [ - { - "description": "删除分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "分类详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "分类列表", - "parameters": [ - { - "description": "分类列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageCategory" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "修改分类", - "parameters": [ - { - "description": "修改分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateBadgeCategory" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "删除ByIds", - "parameters": [ - { - "description": "删除ByIds", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "获取列表有分页", - "parameters": [ - { - "description": "获取列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageBadge" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/listByKeyword": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "获取列表byKeyword无分页", - "parameters": [ - { - "type": "string", - "description": "keyword", - "name": "keyword", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/my/all": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "我的所有徽章", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/my/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "我的徽章详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/my/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "我的徽章", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "修改", - "parameters": [ - { - "description": "修改", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateBadge" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/uploadImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "上传图片", - "parameters": [ - { - "description": "上传图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UploadFile" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "配置植物", - "parameters": [ - { - "description": "添加", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateClaimPlant" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/cancelUnion": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "取消关联百科植物", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"取消关联成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/claim": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "认养", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "addressId", - "name": "addressId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"认养成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "删除ByIds", - "parameters": [ - { - "description": "删除", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "获取列表", - "parameters": [ - { - "description": "获取列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageClaimPlant" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/myClaims": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "我的认养", - "parameters": [ - { - "description": "获取列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageClaimPlant" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/unionLibrary": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "关联百科植物", - "parameters": [ - { - "description": "关联", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UnionLibrary" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"关联成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "修改植物", - "parameters": [ - { - "description": "修改", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateClaimPlant" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "新增分类", - "parameters": [ - { - "description": "新增分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateClassification" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"新增成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "删除分类", - "parameters": [ - { - "description": "删除分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "分类详情", - "parameters": [ - { - "type": "string", - "description": "分类id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "分类列表", - "parameters": [ - { - "description": "分类列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageInfo" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "修改分类", - "parameters": [ - { - "description": "修改分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateClassification" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/client/delete": { "post": { "security": [ @@ -1562,1101 +496,6 @@ const docTemplate = `{ } } }, - "/comment/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子评论" - ], - "summary": "发表评论", - "parameters": [ - { - "description": "添加评论", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateComment" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/comment/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子评论" - ], - "summary": "删除评论", - "parameters": [ - { - "description": "删除评论", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "配置邀请码", - "parameters": [ - { - "description": "配置邀请码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateInvitationConfig" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"配置成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "删除邀请码配置", - "parameters": [ - { - "description": "删除邀请码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "获取邀请码配置", - "parameters": [ - { - "type": "string", - "description": "邀请码id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "获取邀请码列表", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "更新邀请码配置", - "parameters": [ - { - "description": "更新邀请码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateInvitationConfig" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "配置二维码", - "parameters": [ - { - "description": "配置二维码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateQrcode" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"配置成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "删除二维码", - "parameters": [ - { - "description": "二维码id", - "name": "ids", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "获取二维码详情", - "parameters": [ - { - "type": "string", - "description": "二维码id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "配置中心" - ], - "summary": "获取二维码", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "更新二维码", - "parameters": [ - { - "description": "更新二维码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateQrcode" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/uploadImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "上传二维码图片", - "parameters": [ - { - "description": "上传二维码图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UploadFile" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/library/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "新增植物库", - "parameters": [ - { - "description": "新增植物库", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateLibrary" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/all": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "获取所有植物库列表", - "parameters": [ - { - "description": "获取所有植物库列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.LibraryList" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/alterClass": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "修改分类", - "parameters": [ - { - "description": "修改分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.AlterClass" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "删除植物库", - "parameters": [ - { - "description": "删除植物库", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/deleteClass": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "取消关联分类", - "parameters": [ - { - "description": "取消关联分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.DeleteClass" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/deleteImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "上传图片", - "parameters": [ - { - "description": "上传图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.DeleteOss" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/deleteRelateLibrary": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "删除关联植物", - "parameters": [ - { - "description": "删除关联", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.DeleteRelatedLibrary" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "获取植物库详情", - "parameters": [ - { - "type": "string", - "description": "获取植物库详情", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/hot": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "设置或取消热门", - "parameters": [ - { - "description": "设置热门", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/page": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "获取植物库列表", - "parameters": [ - { - "description": "获取植物库列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.LibraryPage" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/reateLibrary": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "添加关联植物", - "parameters": [ - { - "description": "添加关联", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.AlterRelatedLibrary" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "修改植物库", - "parameters": [ - { - "description": "修改植物库", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateLibrary" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/uploadImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "上传图片", - "parameters": [ - { - "description": "上传图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UploadOss" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, "/menu/delete": { "get": { "security": [ @@ -3038,257 +877,6 @@ const docTemplate = `{ } } }, - "/ocr/url": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "识别相关" - ], - "summary": "url植物识别", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "文件OCR", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/order/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "删除订单", - "parameters": [ - { - "description": "删除订单", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/order/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "订单详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/order/export": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "导出订单", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "current", - "in": "query" - }, - { - "type": "integer", - "description": "是否发货 0 1", - "name": "isShipped", - "in": "query" - }, - { - "type": "string", - "description": "关键字", - "name": "keyword", - "in": "query" - }, - { - "type": "integer", - "description": "每页大小", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "支付状态 1.SUCCESS 2.REFUND 3.NOTPAY 4.CLOSED", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/order/page": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "订单列表", - "parameters": [ - { - "description": "获取列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.OrderPage" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/order/ship": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "发货", - "parameters": [ - { - "description": "发货", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/oss/delete": { "post": { "security": [ @@ -3482,373 +1070,11 @@ const docTemplate = `{ } } }, - "/pay/prePay": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "微信支付" - ], - "summary": "支付", - "parameters": [ - { - "type": "string", - "description": "支付", - "name": "orderId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"支付成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "添加地址", - "parameters": [ - { - "description": "添加地址", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateAddress" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "删除地址", - "parameters": [ - { - "description": "删除地址", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "地址详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "地址列表", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/setDefault": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "设置默认地址", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"设置成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "修改地址", - "parameters": [ - { - "description": "修改地址", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateAddress" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/centerCount": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "个人中心统计", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/inviteCode/accept": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "接受邀请", - "parameters": [ - { - "type": "string", - "description": "inviteCode", - "name": "inviteCode", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"接受成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/inviteCode/code": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "生成邀请码", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"生成成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/inviteCode/records": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "邀请记录", - "parameters": [ - { - "description": "分页参数", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageInfo" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/plant/add": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -3882,76 +1108,11 @@ const docTemplate = `{ } } }, - "/plant/carePlant": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "立即养护", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/careRecords": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "养护记录", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/delete": { + "/plant/completeTask": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -3963,10 +1124,48 @@ const docTemplate = `{ "tags": [ "我的植物" ], - "summary": "删除ByIds", + "summary": "完成任务", "parameters": [ { - "description": "删除ByIds", + "description": "完成任务", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CompleteTask" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"完成任务\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/plant/deletePlan": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "我的植物" + ], + "summary": "删除任务", + "parameters": [ + { + "description": "删除植物", "name": "data", "in": "body", "required": true, @@ -3985,11 +1184,11 @@ const docTemplate = `{ } } }, - "/plant/deleteImg": { + "/plant/deletePlant": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4001,15 +1200,15 @@ const docTemplate = `{ "tags": [ "我的植物" ], - "summary": "删除图片", + "summary": "删除植物", "parameters": [ { - "description": "删除图片", + "description": "删除植物", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.DeleteOss" + "$ref": "#/definitions/request.IdsReq" } } ], @@ -4027,7 +1226,7 @@ const docTemplate = `{ "get": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "produces": [ @@ -4036,7 +1235,7 @@ const docTemplate = `{ "tags": [ "我的植物" ], - "summary": "获取ById", + "summary": "ById植物详情", "parameters": [ { "type": "string", @@ -4048,210 +1247,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/grow/addRecord": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "添加成长记录", - "parameters": [ - { - "description": "添加成长记录", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateGrowRecord" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/grow/recordDetail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "成长记录详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/grow/recordList": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "成长记录列表", - "parameters": [ - { - "description": "成长记录列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageGrowRecord" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/makeCare": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "根据任务完成养护", - "parameters": [ - { - "description": "养护操作", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.MakeCare" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/myPlants": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "植物列表不分页", - "parameters": [ - { - "type": "string", - "description": "name", - "name": "name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/needCare": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "待养护", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取ById成功\"}", "schema": { "type": "string" } @@ -4263,7 +1259,7 @@ const docTemplate = `{ "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4278,12 +1274,12 @@ const docTemplate = `{ "summary": "植物列表", "parameters": [ { - "description": "获取植物列表", + "description": "分页获取植物列表", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.PagePlant" + "$ref": "#/definitions/request.PageInfo" } } ], @@ -4297,44 +1293,26 @@ const docTemplate = `{ } } }, - "/plant/taskProgress": { + "/plant/todayTask": { "get": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ "我的植物" ], - "summary": "任务进度", + "summary": "今日任务", "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/todayCare": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "我的植物" - ], - "summary": "今日养护", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } @@ -4346,7 +1324,7 @@ const docTemplate = `{ "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4358,10 +1336,10 @@ const docTemplate = `{ "tags": [ "我的植物" ], - "summary": "修改植物", + "summary": "修改ById植物", "parameters": [ { - "description": "修改植物", + "description": "修改ById植物", "name": "data", "in": "body", "required": true, @@ -4372,7 +1350,7 @@ const docTemplate = `{ ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改ById成功\"}", "schema": { "type": "string" } @@ -4380,87 +1358,11 @@ const docTemplate = `{ } } }, - "/plant/updateCarePlan": { + "/post/comment": { "post": { "security": [ { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "修改养护事项周期", - "parameters": [ - { - "description": "修改养护周期", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateCarePlan" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/uploadImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "上传图片", - "parameters": [ - { - "description": "上传图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UploadOss" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4472,163 +1374,21 @@ const docTemplate = `{ "tags": [ "帖子" ], - "summary": "发布", + "summary": "评论帖子", "parameters": [ { - "description": "创建帖子", + "description": "评论帖子", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.CreatePost" + "$ref": "#/definitions/request.CreateComment" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/cancelLike": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "取消点赞", - "parameters": [ - { - "type": "string", - "description": "帖子id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"取消点赞成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "删除帖子", - "parameters": [ - { - "description": "删除帖子", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/deleteImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "删除帖子图片", - "parameters": [ - { - "description": "删除帖子图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.DeleteOss" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "帖子详情", - "parameters": [ - { - "type": "string", - "description": "帖子id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"评论成功\"}", "schema": { "type": "string" } @@ -4640,7 +1400,7 @@ const docTemplate = `{ "get": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "produces": [ @@ -4657,6 +1417,13 @@ const docTemplate = `{ "name": "id", "in": "query", "required": true + }, + { + "type": "string", + "description": "点赞类型 1 点赞 2 取消点赞", + "name": "type", + "in": "query", + "required": true } ], "responses": { @@ -4669,11 +1436,11 @@ const docTemplate = `{ } } }, - "/post/myPosts": { + "/post/myPost": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4685,57 +1452,10 @@ const docTemplate = `{ "tags": [ "帖子" ], - "summary": "我的帖子", + "summary": "我的发布", "parameters": [ { - "type": "integer", - "description": "页码", - "name": "current", - "in": "query" - }, - { - "type": "string", - "description": "关键字", - "name": "keyword", - "in": "query" - }, - { - "type": "integer", - "description": "每页大小", - "name": "pageSize", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/page": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "帖子列表", - "parameters": [ - { - "description": "帖子列表", + "description": "分页获取帖子列表", "name": "data", "in": "body", "required": true, @@ -4754,11 +1474,11 @@ const docTemplate = `{ } } }, - "/post/update": { + "/post/page": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4770,21 +1490,21 @@ const docTemplate = `{ "tags": [ "帖子" ], - "summary": "修改帖子", + "summary": "帖子列表", "parameters": [ { - "description": "修改帖子", + "description": "分页获取帖子列表", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.UpdatePost" + "$ref": "#/definitions/request.PostPage" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } @@ -4792,11 +1512,11 @@ const docTemplate = `{ } } }, - "/post/uploadImg": { + "/post/publish": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4808,21 +1528,21 @@ const docTemplate = `{ "tags": [ "帖子" ], - "summary": "上传帖子图片", + "summary": "发布帖子", "parameters": [ { - "description": "上传帖子图片", + "description": "发布帖子", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.UploadOss" + "$ref": "#/definitions/request.CreatePost" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", "schema": { "type": "string" } @@ -5084,6 +1804,177 @@ const docTemplate = `{ } } }, + "/topic/add": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "修改话题", + "parameters": [ + { + "description": "修改话题", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateTopic" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/topic/delete": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "删除任务", + "parameters": [ + { + "description": "删除话题", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/topic/detail": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "话题详情", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/topic/list": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "话题列表", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/topic/page": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "话题分页", + "parameters": [ + { + "description": "分页获取话题列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/user/changePassword": { "post": { "security": [ @@ -5396,59 +2287,370 @@ const docTemplate = `{ } } } + }, + "/wiki-class/add": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "添加分类", + "parameters": [ + { + "description": "添加分类", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CreateWikiClass" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/delete": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "删除分类", + "parameters": [ + { + "description": "删除分类", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/detail": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "分类详情", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/list": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "分类列表", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/page": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "分类分页", + "parameters": [ + { + "description": "分页获取分类列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/update": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "修改分类(可直接传入ossId修改图片)", + "parameters": [ + { + "description": "修改分类", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateWikiClass" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki/add": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科" + ], + "summary": "添加百科", + "parameters": [ + { + "description": "添加百科", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CreateWiki" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki/detail": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科" + ], + "summary": "百科详情", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki/page": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科" + ], + "summary": "分页", + "parameters": [ + { + "description": "百科分页", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.WikiPage" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki/update": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科" + ], + "summary": "修改百科", + "parameters": [ + { + "description": "修改百科", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateWiki" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } } }, "definitions": { - "request.AlterClass": { - "type": "object", - "properties": { - "id": { - "description": "植物id", - "type": "string" - }, - "ids": { - "description": "要关联的分类ids", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "request.AlterRelatedLibrary": { - "type": "object", - "properties": { - "id": { - "description": "植物id", - "type": "string" - }, - "ids": { - "description": "要关联的植物ids", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "request.CareItem": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "name": { - "type": "string" - }, - "period": { - "type": "integer" - } - } - }, "request.CarePlan": { "type": "object", "properties": { - "desc": { + "icon": { + "description": "icon信息", "type": "string" }, "name": { @@ -5461,30 +2663,6 @@ const docTemplate = `{ } } }, - "request.CareSchedule": { - "type": "object", - "properties": { - "careItems": { - "description": "养护项目", - "type": "array", - "items": { - "$ref": "#/definitions/request.CareItem" - } - }, - "desc": { - "description": "描述", - "type": "string" - }, - "season": { - "description": "季节", - "type": "string" - }, - "sort": { - "description": "排序", - "type": "integer" - } - } - }, "request.ChangePwd": { "type": "object", "properties": { @@ -5496,118 +2674,16 @@ const docTemplate = `{ } } }, - "request.CreateAddress": { - "type": "object", - "properties": { - "detail": { - "type": "string" - }, - "isDefault": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "phone": { - "type": "string" - } - } - }, - "request.CreateBadge": { + "request.CompleteTask": { "type": "object", "required": [ - "countLimit" + "taskId" ], "properties": { - "categoryId": { + "remark": { "type": "string" }, - "countLimit": { - "description": "获取徽章需要完成的操作次数", - "type": "integer" - }, - "desc": { - "type": "string" - }, - "keyword": { - "type": "string" - }, - "name": { - "type": "string" - }, - "ossId": { - "type": "string" - } - } - }, - "request.CreateBadgeCategory": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "desc": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "request.CreateClaimPlant": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "libraryId": { - "description": "百科id", - "type": "string" - }, - "name": { - "type": "string" - }, - "ossIds": { - "type": "array", - "items": { - "type": "string" - } - }, - "points": { - "type": "integer" - }, - "postage": { - "description": "邮费 单位(分)", - "type": "integer" - }, - "stock": { - "description": "库存", - "type": "integer" - }, - "tag": { - "type": "string" - }, - "videoUrl": { - "type": "string" - } - } - }, - "request.CreateClassification": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "description": "分类名称", - "type": "string" - }, - "ossId": { - "description": "图片id", - "type": "string" - }, - "tag": { - "description": "标签", + "taskId": { "type": "string" } } @@ -5616,228 +2692,16 @@ const docTemplate = `{ "type": "object", "required": [ "content", - "parentId", - "postId", - "rootId" + "postId" ], "properties": { "content": { "description": "评论内容", "type": "string" }, - "parentId": { - "description": "父级评论id\" 默认为0", - "type": "string" - }, "postId": { "description": "帖子id", "type": "string" - }, - "rootId": { - "description": "根评论id 默认为0 如评论1 评论2 评论3 1是根评论 2是1的子评论 3是2的子评论 那么2和3的rootId都是1的主键id", - "type": "string" - } - } - }, - "request.CreateGrowRecord": { - "type": "object", - "required": [ - "plantId" - ], - "properties": { - "content": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "name": { - "type": "string" - }, - "ossIds": { - "type": "array", - "items": { - "type": "string" - } - }, - "plantId": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "request.CreateInvitationConfig": { - "type": "object", - "properties": { - "codeExpireDays": { - "description": "邀请码有效期(天)", - "type": "integer" - }, - "codeLength": { - "description": "邀请码长度", - "type": "integer" - }, - "enableAutoAward": { - "description": "是否自动发放积分", - "type": "integer" - }, - "isActive": { - "description": "是否启用", - "type": "integer" - }, - "maxInvitesPerDay": { - "description": "每日最大邀请奖励次数", - "type": "integer" - }, - "maxPointsPerUser": { - "description": "单用户最大邀请奖励积分", - "type": "integer" - }, - "name": { - "description": "配置名称", - "type": "string" - }, - "pointsPerInvite": { - "description": "每成功邀请奖励积分", - "type": "integer" - } - } - }, - "request.CreateLibrary": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "aliases": { - "description": "别名", - "type": "string" - }, - "careSchedule": { - "description": "养护计划", - "type": "array", - "items": { - "$ref": "#/definitions/request.CareSchedule" - } - }, - "classIds": { - "description": "分类id", - "type": "array", - "items": { - "type": "string" - } - }, - "difficulty": { - "description": "种植难度 1-5级", - "type": "integer" - }, - "distributionArea": { - "description": "分布区域", - "type": "string" - }, - "flowerDiameter": { - "description": "花直径(cm)", - "type": "integer" - }, - "floweringColor": { - "description": "花色", - "type": "string" - }, - "floweringPeriod": { - "description": "开花特征", - "type": "string" - }, - "floweringShape": { - "description": "花形", - "type": "string" - }, - "foliageColor": { - "description": "叶色", - "type": "string" - }, - "foliageShape": { - "description": "叶形", - "type": "string" - }, - "foliageType": { - "description": "植物特征", - "type": "string" - }, - "fruit": { - "description": "果", - "type": "string" - }, - "genus": { - "description": "属", - "type": "string" - }, - "growthHabit": { - "description": "生长习性", - "type": "string" - }, - "height": { - "description": "高度(cm)", - "type": "integer" - }, - "isHot": { - "description": "是否热门", - "type": "integer" - }, - "latinName": { - "description": "拉丁名", - "type": "string" - }, - "lifeCycle": { - "description": "生命周期", - "type": "string" - }, - "lightIntensity": { - "description": "光照强度", - "type": "string" - }, - "lightType": { - "description": "光照类型(直射,散射等)", - "type": "string" - }, - "name": { - "description": "基本信息", - "type": "string" - }, - "optimalTempPeriod": { - "description": "最佳温度区间", - "type": "string" - }, - "ossIds": { - "description": "图片", - "type": "array", - "items": { - "type": "string" - } - }, - "pestsDiseases": { - "description": "常见病虫害", - "type": "string" - }, - "relatedLibraryIds": { - "description": "相关推荐 library", - "type": "array", - "items": { - "type": "string" - } - }, - "reproductionMethod": { - "description": "繁殖方法", - "type": "string" - }, - "stem": { - "description": "茎", - "type": "string" - }, - "tag": { - "description": "标签", - "type": "string" } } }, @@ -5856,7 +2720,7 @@ const docTemplate = `{ "type": "string" }, "ossIds": { - "description": "图片", + "description": "图片ids", "type": "array", "items": { "type": "string" @@ -5912,68 +2776,161 @@ const docTemplate = `{ } } }, - "request.CreateQrcode": { + "request.CreateTopic": { "type": "object", "properties": { - "name": { + "end_time": { "type": "string" }, - "ossId": { + "remark": { "type": "string" }, - "url": { + "start_time": { + "type": "string" + }, + "title": { "type": "string" } } }, - "request.DeleteClass": { + "request.CreateWiki": { "type": "object", + "required": [ + "name" + ], "properties": { - "id": { - "description": "植物id", + "aliases": { + "description": "别名", "type": "string" }, - "ids": { - "description": "要取消关联的分类ids", + "classIds": { + "description": "分类id", "type": "array", "items": { "type": "string" } - } - } - }, - "request.DeleteOss": { - "type": "object", - "required": [ - "id", - "ossIds" - ], - "properties": { - "id": { - "description": "数据主键", + }, + "difficulty": { + "description": "种植难度 1-5级", + "type": "integer" + }, + "distributionArea": { + "description": "分布区域", + "type": "string" + }, + "flowerDiameter": { + "description": "花直径(cm)", + "type": "integer" + }, + "floweringColor": { + "description": "花色", + "type": "string" + }, + "floweringPeriod": { + "description": "开花期", + "type": "string" + }, + "floweringShape": { + "description": "花形", + "type": "string" + }, + "foliageColor": { + "description": "叶色", + "type": "string" + }, + "foliageShape": { + "description": "叶形", + "type": "string" + }, + "foliageType": { + "description": "叶型", + "type": "string" + }, + "fruit": { + "description": "果", + "type": "string" + }, + "genus": { + "description": "属", + "type": "string" + }, + "growthHabit": { + "description": "生长习性", + "type": "string" + }, + "height": { + "description": "高度(cm)", + "type": "integer" + }, + "isHot": { + "description": "是否热门", + "type": "integer" + }, + "latinName": { + "description": "拉丁名", + "type": "string" + }, + "lifeCycle": { + "description": "生命周期", + "type": "string" + }, + "lightIntensity": { + "description": "光照强度", + "type": "string" + }, + "lightType": { + "description": "光照类型(直射,散射等)", + "type": "string" + }, + "name": { + "description": "名称", + "type": "string" + }, + "optimalTempPeriod": { + "description": "最佳温度区间", "type": "string" }, "ossIds": { + "description": "图片", "type": "array", "items": { "type": "string" } + }, + "pestsDiseases": { + "description": "常见病虫害", + "type": "string" + }, + "relatedWikiIds": { + "description": "相关推荐", + "type": "array", + "items": { + "type": "string" + } + }, + "reproductionMethod": { + "description": "繁殖方法", + "type": "string" + }, + "stem": { + "description": "茎", + "type": "string" } } }, - "request.DeleteRelatedLibrary": { + "request.CreateWikiClass": { "type": "object", + "required": [ + "name" + ], "properties": { - "id": { - "description": "植物id", + "name": { + "description": "分类名称", "type": "string" }, - "ids": { - "description": "要取消关联的植物ids", - "type": "array", - "items": { - "type": "string" - } + "ossId": { + "description": "图片id", + "type": "string" } } }, @@ -6116,48 +3073,6 @@ const docTemplate = `{ } } }, - "request.LibraryList": { - "type": "object", - "properties": { - "isHot": { - "description": "是否热门 0否 1是", - "type": "integer" - }, - "name": { - "description": "植物名称", - "type": "string" - } - } - }, - "request.LibraryPage": { - "type": "object", - "properties": { - "classId": { - "description": "分类id", - "type": "string" - }, - "current": { - "description": "页码", - "type": "integer" - }, - "isHot": { - "description": "是否热门 0否 1是", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "description": "植物名称", - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, "request.Login": { "type": "object", "properties": { @@ -6175,136 +3090,6 @@ const docTemplate = `{ } } }, - "request.MakeCare": { - "type": "object", - "required": [ - "id", - "status" - ], - "properties": { - "id": { - "description": "今日养护id(任务id)", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "status": { - "description": "状态 1:未完成 2:完成 3:跳过 4:逾期", - "type": "integer" - } - } - }, - "request.OrderPage": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "isShipped": { - "description": "是否发货 0 1", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - }, - "status": { - "description": "支付状态 1.SUCCESS 2.REFUND 3.NOTPAY 4.CLOSED", - "type": "integer" - } - } - }, - "request.PageBadge": { - "type": "object", - "properties": { - "categoryId": { - "type": "string" - }, - "current": { - "description": "页码", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, - "request.PageCategory": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, - "request.PageClaimPlant": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, - "request.PageGrowRecord": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "id": { - "description": "植物id", - "type": "string" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, "request.PageInfo": { "type": "object", "properties": { @@ -6322,26 +3107,6 @@ const docTemplate = `{ } } }, - "request.PagePlant": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, "request.PostPage": { "type": "object", "properties": { @@ -6367,328 +3132,18 @@ const docTemplate = `{ } } }, - "request.UnionLibrary": { - "type": "object", - "properties": { - "id": { - "description": "植物id", - "type": "string" - }, - "libraryId": { - "description": "百科植物id", - "type": "string" - } - } - }, - "request.UpdateAddress": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "detail": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isDefault": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "phone": { - "type": "string" - } - } - }, - "request.UpdateBadge": { - "type": "object", - "required": [ - "countLimit", - "id" - ], - "properties": { - "categoryId": { - "type": "string" - }, - "countLimit": { - "description": "获取徽章需要完成的操作次数", - "type": "integer" - }, - "desc": { - "type": "string" - }, - "id": { - "type": "string" - }, - "keyword": { - "type": "string" - }, - "name": { - "type": "string" - }, - "ossId": { - "type": "string" - } - } - }, - "request.UpdateBadgeCategory": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "desc": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "request.UpdateCarePlan": { - "type": "object", - "required": [ - "id", - "period" - ], - "properties": { - "id": { - "description": "养护计划id", - "type": "string" - }, - "period": { - "description": "周期", - "type": "integer" - } - } - }, - "request.UpdateClaimPlant": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "content": { - "type": "string" - }, - "id": { - "type": "string" - }, - "libraryId": { - "description": "百科id", - "type": "string" - }, - "name": { - "type": "string" - }, - "points": { - "type": "integer" - }, - "postage": { - "description": "邮费 单位(分)", - "type": "integer" - }, - "stock": { - "description": "库存", - "type": "integer" - }, - "tag": { - "type": "string" - }, - "videoUrl": { - "type": "string" - } - } - }, - "request.UpdateClassification": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "description": "分类名称", - "type": "string" - }, - "ossId": { - "description": "图片id", - "type": "string" - }, - "tag": { - "description": "标签", - "type": "string" - } - } - }, - "request.UpdateInvitationConfig": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "codeExpireDays": { - "description": "邀请码有效期(天)", - "type": "integer" - }, - "codeLength": { - "description": "邀请码长度", - "type": "integer" - }, - "enableAutoAward": { - "description": "是否自动发放积分", - "type": "integer" - }, - "id": { - "type": "string" - }, - "isActive": { - "description": "是否启用", - "type": "integer" - }, - "maxInvitesPerDay": { - "description": "每日最大邀请奖励次数", - "type": "integer" - }, - "maxPointsPerUser": { - "description": "单用户最大邀请奖励积分", - "type": "integer" - }, - "name": { - "description": "配置名称", - "type": "string" - }, - "pointsPerInvite": { - "description": "每成功邀请奖励积分", - "type": "integer" - } - } - }, - "request.UpdateLibrary": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "aliases": { - "description": "别名", - "type": "string" - }, - "difficulty": { - "description": "种植难度 1-5级", - "type": "integer" - }, - "distributionArea": { - "description": "分布区域", - "type": "string" - }, - "flowerDiameter": { - "description": "花直径(cm)", - "type": "integer" - }, - "floweringColor": { - "description": "花色", - "type": "string" - }, - "floweringPeriod": { - "description": "开花特征", - "type": "string" - }, - "floweringShape": { - "description": "花形", - "type": "string" - }, - "foliageColor": { - "description": "叶色", - "type": "string" - }, - "foliageShape": { - "description": "叶形", - "type": "string" - }, - "foliageType": { - "description": "植物特征", - "type": "string" - }, - "fruit": { - "description": "果", - "type": "string" - }, - "genus": { - "description": "属", - "type": "string" - }, - "growthHabit": { - "description": "生长习性", - "type": "string" - }, - "height": { - "description": "高度(cm)", - "type": "integer" - }, - "id": { - "type": "string" - }, - "isHot": { - "description": "是否热门", - "type": "integer" - }, - "latinName": { - "description": "拉丁名", - "type": "string" - }, - "lifeCycle": { - "description": "生命周期", - "type": "string" - }, - "lightIntensity": { - "description": "光照强度", - "type": "string" - }, - "lightType": { - "description": "光照类型(直射,散射等)", - "type": "string" - }, - "name": { - "description": "名称", - "type": "string" - }, - "optimalTempPeriod": { - "description": "温度", - "type": "string" - }, - "ossId": { - "description": "ossId", - "type": "string" - }, - "pestsDiseases": { - "description": "常见病虫害", - "type": "string" - }, - "stem": { - "description": "茎", - "type": "string" - }, - "tag": { - "description": "标签", - "type": "string" - } - } - }, "request.UpdateMyPlant": { "type": "object", "required": [ "id" ], "properties": { + "carePlans": { + "type": "array", + "items": { + "$ref": "#/definitions/request.UpdatePlan" + } + }, "id": { "type": "string" }, @@ -6718,26 +3173,152 @@ const docTemplate = `{ } } }, - "request.UpdatePost": { + "request.UpdatePlan": { "type": "object", "required": [ "id" ], "properties": { - "content": { - "description": "内容", + "icon": { + "description": "icon信息", "type": "string" }, "id": { "type": "string" }, + "name": { + "description": "农事名称", + "type": "string" + }, + "period": { + "description": "周期", + "type": "integer" + } + } + }, + "request.UpdateTopic": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "end_time": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "start_time": { + "type": "string" + }, "title": { - "description": "标题", "type": "string" } } }, - "request.UpdateQrcode": { + "request.UpdateWiki": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "aliases": { + "description": "别名", + "type": "string" + }, + "difficulty": { + "description": "种植难度 1-5级", + "type": "integer" + }, + "distributionArea": { + "description": "分布区域", + "type": "string" + }, + "flowerDiameter": { + "description": "花直径(cm)", + "type": "integer" + }, + "floweringColor": { + "description": "花色", + "type": "string" + }, + "floweringPeriod": { + "description": "开花期", + "type": "string" + }, + "floweringShape": { + "description": "花形", + "type": "string" + }, + "foliageColor": { + "description": "叶色", + "type": "string" + }, + "foliageShape": { + "description": "叶形", + "type": "string" + }, + "foliageType": { + "description": "叶型", + "type": "string" + }, + "fruit": { + "description": "果", + "type": "string" + }, + "genus": { + "description": "属", + "type": "string" + }, + "growthHabit": { + "description": "生长习性", + "type": "string" + }, + "height": { + "description": "高度(cm)", + "type": "integer" + }, + "id": { + "type": "string" + }, + "latinName": { + "description": "拉丁名", + "type": "string" + }, + "lifeCycle": { + "description": "生命周期", + "type": "string" + }, + "lightIntensity": { + "description": "光照强度", + "type": "string" + }, + "lightType": { + "description": "光照类型(直射,散射等)", + "type": "string" + }, + "name": { + "description": "名称", + "type": "string" + }, + "optimalTempPeriod": { + "description": "最佳温度区间", + "type": "string" + }, + "pestsDiseases": { + "description": "常见病虫害", + "type": "string" + }, + "stem": { + "description": "茎", + "type": "string" + } + } + }, + "request.UpdateWikiClass": { "type": "object", "required": [ "id" @@ -6747,47 +3328,44 @@ const docTemplate = `{ "type": "string" }, "name": { + "description": "分类名称", "type": "string" }, - "url": { + "ossId": { + "description": "图片id", "type": "string" } } }, - "request.UploadFile": { + "request.WikiPage": { "type": "object", - "required": [ - "id", - "ossIds" - ], "properties": { - "id": { - "description": "数据主键", - "type": "string" - }, - "ossIds": { - "description": "ossId", - "type": "string" - } - } - }, - "request.UploadOss": { - "type": "object", - "required": [ - "id", - "ossIds" - ], - "properties": { - "id": { - "description": "数据主键", - "type": "string" - }, - "ossIds": { - "description": "ossIds", + "classId": { + "description": "分类id", "type": "array", "items": { "type": "string" } + }, + "current": { + "description": "页码", + "type": "integer" + }, + "isHot": { + "description": "是否热门 0否 1是", + "type": "integer" + }, + "keyword": { + "description": "关键字", + "type": "string" + }, + "name": { + "description": "植物名称", + "type": "string" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" } } }, @@ -6936,9 +3514,6 @@ const docTemplate = `{ "createdAtStr": { "type": "string" }, - "height": { - "type": "integer" - }, "id": { "description": "主键ID", "type": "string" @@ -6963,9 +3538,6 @@ const docTemplate = `{ }, "url": { "type": "string" - }, - "width": { - "type": "integer" } } }, @@ -7028,17 +3600,18 @@ const docTemplate = `{ "type": "string" }, "miniOpenId": { - "description": "植趣小程序openid", "type": "string" }, "name": { "type": "string" }, + "nickName": { + "type": "string" + }, "phone": { "type": "string" }, "saOpenId": { - "description": "植趣服务号openid", "type": "string" }, "sessionKey": { @@ -7057,7 +3630,7 @@ const docTemplate = `{ } }, "securityDefinitions": { - "ApiKeyAuth": { + "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" diff --git a/docs/swagger.json b/docs/swagger.json index f412c2f..82d5f0b 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -236,1072 +236,6 @@ } } }, - "/badge/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "添加", - "parameters": [ - { - "description": "添加", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateBadge" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/all": { - "get": { - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "获取所有无分页", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "添加分类", - "parameters": [ - { - "description": "添加分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateBadgeCategory" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "删除分类", - "parameters": [ - { - "description": "删除分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "分类详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "分类列表", - "parameters": [ - { - "description": "分类列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageCategory" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/class/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "修改分类", - "parameters": [ - { - "description": "修改分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateBadgeCategory" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "删除ByIds", - "parameters": [ - { - "description": "删除ByIds", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "获取列表有分页", - "parameters": [ - { - "description": "获取列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageBadge" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/listByKeyword": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "获取列表byKeyword无分页", - "parameters": [ - { - "type": "string", - "description": "keyword", - "name": "keyword", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/my/all": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "我的所有徽章", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/my/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "我的徽章详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/my/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "我的徽章", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "修改", - "parameters": [ - { - "description": "修改", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateBadge" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/badge/uploadImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "徽章" - ], - "summary": "上传图片", - "parameters": [ - { - "description": "上传图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UploadFile" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "配置植物", - "parameters": [ - { - "description": "添加", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateClaimPlant" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/cancelUnion": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "取消关联百科植物", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"取消关联成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/claim": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "认养", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - }, - { - "type": "string", - "description": "addressId", - "name": "addressId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"认养成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "删除ByIds", - "parameters": [ - { - "description": "删除", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "获取列表", - "parameters": [ - { - "description": "获取列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageClaimPlant" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/myClaims": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "我的认养", - "parameters": [ - { - "description": "获取列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageClaimPlant" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/unionLibrary": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "关联百科植物", - "parameters": [ - { - "description": "关联", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UnionLibrary" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"关联成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/claim/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "兑换植物" - ], - "summary": "修改植物", - "parameters": [ - { - "description": "修改", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateClaimPlant" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "新增分类", - "parameters": [ - { - "description": "新增分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateClassification" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"新增成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "删除分类", - "parameters": [ - { - "description": "删除分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "分类详情", - "parameters": [ - { - "type": "string", - "description": "分类id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "分类列表", - "parameters": [ - { - "description": "分类列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageInfo" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/class/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库分类" - ], - "summary": "修改分类", - "parameters": [ - { - "description": "修改分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateClassification" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/client/delete": { "post": { "security": [ @@ -1554,1101 +488,6 @@ } } }, - "/comment/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子评论" - ], - "summary": "发表评论", - "parameters": [ - { - "description": "添加评论", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateComment" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/comment/delete": { - "delete": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子评论" - ], - "summary": "删除评论", - "parameters": [ - { - "description": "删除评论", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "配置邀请码", - "parameters": [ - { - "description": "配置邀请码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateInvitationConfig" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"配置成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "删除邀请码配置", - "parameters": [ - { - "description": "删除邀请码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "获取邀请码配置", - "parameters": [ - { - "type": "string", - "description": "邀请码id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "获取邀请码列表", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/invitation/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "更新邀请码配置", - "parameters": [ - { - "description": "更新邀请码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateInvitationConfig" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "配置二维码", - "parameters": [ - { - "description": "配置二维码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateQrcode" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"配置成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "删除二维码", - "parameters": [ - { - "description": "二维码id", - "name": "ids", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "获取二维码详情", - "parameters": [ - { - "type": "string", - "description": "二维码id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/list": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "配置中心" - ], - "summary": "获取二维码", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "更新二维码", - "parameters": [ - { - "description": "更新二维码", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateQrcode" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"更新成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/config/qrcode/uploadImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "配置中心" - ], - "summary": "上传二维码图片", - "parameters": [ - { - "description": "上传二维码图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UploadFile" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/library/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "新增植物库", - "parameters": [ - { - "description": "新增植物库", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateLibrary" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/all": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "获取所有植物库列表", - "parameters": [ - { - "description": "获取所有植物库列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.LibraryList" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/alterClass": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "修改分类", - "parameters": [ - { - "description": "修改分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.AlterClass" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "删除植物库", - "parameters": [ - { - "description": "删除植物库", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/deleteClass": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "取消关联分类", - "parameters": [ - { - "description": "取消关联分类", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.DeleteClass" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/deleteImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "上传图片", - "parameters": [ - { - "description": "上传图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.DeleteOss" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/deleteRelateLibrary": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "删除关联植物", - "parameters": [ - { - "description": "删除关联", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.DeleteRelatedLibrary" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "获取植物库详情", - "parameters": [ - { - "type": "string", - "description": "获取植物库详情", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/hot": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "设置或取消热门", - "parameters": [ - { - "description": "设置热门", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/page": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "获取植物库列表", - "parameters": [ - { - "description": "获取植物库列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.LibraryPage" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/reateLibrary": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "添加关联植物", - "parameters": [ - { - "description": "添加关联", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.AlterRelatedLibrary" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "修改植物库", - "parameters": [ - { - "description": "修改植物库", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateLibrary" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/library/uploadImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "植物库" - ], - "summary": "上传图片", - "parameters": [ - { - "description": "上传图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UploadOss" - } - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, "/menu/delete": { "get": { "security": [ @@ -3030,257 +869,6 @@ } } }, - "/ocr/url": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "识别相关" - ], - "summary": "url植物识别", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "文件OCR", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/response.Response" - }, - { - "type": "object", - "properties": { - "msg": { - "type": "string" - } - } - } - ] - } - } - } - } - }, - "/order/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "删除订单", - "parameters": [ - { - "description": "删除订单", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/order/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "订单详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/order/export": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "导出订单", - "parameters": [ - { - "type": "integer", - "description": "页码", - "name": "current", - "in": "query" - }, - { - "type": "integer", - "description": "是否发货 0 1", - "name": "isShipped", - "in": "query" - }, - { - "type": "string", - "description": "关键字", - "name": "keyword", - "in": "query" - }, - { - "type": "integer", - "description": "每页大小", - "name": "pageSize", - "in": "query" - }, - { - "type": "integer", - "description": "支付状态 1.SUCCESS 2.REFUND 3.NOTPAY 4.CLOSED", - "name": "status", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/order/page": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "订单列表", - "parameters": [ - { - "description": "获取列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.OrderPage" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/order/ship": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "订单" - ], - "summary": "发货", - "parameters": [ - { - "description": "发货", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/oss/delete": { "post": { "security": [ @@ -3474,373 +1062,11 @@ } } }, - "/pay/prePay": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "微信支付" - ], - "summary": "支付", - "parameters": [ - { - "type": "string", - "description": "支付", - "name": "orderId", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"支付成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "添加地址", - "parameters": [ - { - "description": "添加地址", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateAddress" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "删除地址", - "parameters": [ - { - "description": "删除地址", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "地址详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/list": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "地址列表", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/setDefault": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "设置默认地址", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"设置成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/address/update": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "修改地址", - "parameters": [ - { - "description": "修改地址", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateAddress" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/centerCount": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "个人中心统计", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/inviteCode/accept": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "接受邀请", - "parameters": [ - { - "type": "string", - "description": "inviteCode", - "name": "inviteCode", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"接受成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/inviteCode/code": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "生成邀请码", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"生成成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/personal/inviteCode/records": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "个人中心" - ], - "summary": "邀请记录", - "parameters": [ - { - "description": "分页参数", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageInfo" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, "/plant/add": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -3874,76 +1100,11 @@ } } }, - "/plant/carePlant": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "立即养护", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/careRecords": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "养护记录", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/delete": { + "/plant/completeTask": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -3955,10 +1116,48 @@ "tags": [ "我的植物" ], - "summary": "删除ByIds", + "summary": "完成任务", "parameters": [ { - "description": "删除ByIds", + "description": "完成任务", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CompleteTask" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"完成任务\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/plant/deletePlan": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "我的植物" + ], + "summary": "删除任务", + "parameters": [ + { + "description": "删除植物", "name": "data", "in": "body", "required": true, @@ -3977,11 +1176,11 @@ } } }, - "/plant/deleteImg": { + "/plant/deletePlant": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -3993,15 +1192,15 @@ "tags": [ "我的植物" ], - "summary": "删除图片", + "summary": "删除植物", "parameters": [ { - "description": "删除图片", + "description": "删除植物", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.DeleteOss" + "$ref": "#/definitions/request.IdsReq" } } ], @@ -4019,7 +1218,7 @@ "get": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "produces": [ @@ -4028,7 +1227,7 @@ "tags": [ "我的植物" ], - "summary": "获取ById", + "summary": "ById植物详情", "parameters": [ { "type": "string", @@ -4040,210 +1239,7 @@ ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/grow/addRecord": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "添加成长记录", - "parameters": [ - { - "description": "添加成长记录", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.CreateGrowRecord" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/grow/recordDetail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "成长记录详情", - "parameters": [ - { - "type": "string", - "description": "id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/grow/recordList": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "成长记录列表", - "parameters": [ - { - "description": "成长记录列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageGrowRecord" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/makeCare": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "根据任务完成养护", - "parameters": [ - { - "description": "养护操作", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.MakeCare" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/myPlants": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "植物列表不分页", - "parameters": [ - { - "type": "string", - "description": "name", - "name": "name", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/needCare": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "待养护", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取ById成功\"}", "schema": { "type": "string" } @@ -4255,7 +1251,7 @@ "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4270,12 +1266,12 @@ "summary": "植物列表", "parameters": [ { - "description": "获取植物列表", + "description": "分页获取植物列表", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.PagePlant" + "$ref": "#/definitions/request.PageInfo" } } ], @@ -4289,44 +1285,26 @@ } } }, - "/plant/taskProgress": { + "/plant/todayTask": { "get": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ "我的植物" ], - "summary": "任务进度", + "summary": "今日任务", "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/todayCare": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "tags": [ - "我的植物" - ], - "summary": "今日养护", - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"操作成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } @@ -4338,7 +1316,7 @@ "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4350,10 +1328,10 @@ "tags": [ "我的植物" ], - "summary": "修改植物", + "summary": "修改ById植物", "parameters": [ { - "description": "修改植物", + "description": "修改ById植物", "name": "data", "in": "body", "required": true, @@ -4364,7 +1342,7 @@ ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改ById成功\"}", "schema": { "type": "string" } @@ -4372,87 +1350,11 @@ } } }, - "/plant/updateCarePlan": { + "/post/comment": { "post": { "security": [ { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "修改养护事项周期", - "parameters": [ - { - "description": "修改养护周期", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UpdateCarePlan" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/plant/uploadImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "我的植物" - ], - "summary": "上传图片", - "parameters": [ - { - "description": "上传图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.UploadOss" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/add": { - "post": { - "security": [ - { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4464,163 +1366,21 @@ "tags": [ "帖子" ], - "summary": "发布", + "summary": "评论帖子", "parameters": [ { - "description": "创建帖子", + "description": "评论帖子", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.CreatePost" + "$ref": "#/definitions/request.CreateComment" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"添加成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/cancelLike": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "取消点赞", - "parameters": [ - { - "type": "string", - "description": "帖子id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"取消点赞成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/delete": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "删除帖子", - "parameters": [ - { - "description": "删除帖子", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.IdsReq" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/deleteImg": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "删除帖子图片", - "parameters": [ - { - "description": "删除帖子图片", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.DeleteOss" - } - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/detail": { - "get": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "帖子详情", - "parameters": [ - { - "type": "string", - "description": "帖子id", - "name": "id", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"评论成功\"}", "schema": { "type": "string" } @@ -4632,7 +1392,7 @@ "get": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "produces": [ @@ -4649,6 +1409,13 @@ "name": "id", "in": "query", "required": true + }, + { + "type": "string", + "description": "点赞类型 1 点赞 2 取消点赞", + "name": "type", + "in": "query", + "required": true } ], "responses": { @@ -4661,11 +1428,11 @@ } } }, - "/post/myPosts": { + "/post/myPost": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4677,57 +1444,10 @@ "tags": [ "帖子" ], - "summary": "我的帖子", + "summary": "我的发布", "parameters": [ { - "type": "integer", - "description": "页码", - "name": "current", - "in": "query" - }, - { - "type": "string", - "description": "关键字", - "name": "keyword", - "in": "query" - }, - { - "type": "integer", - "description": "每页大小", - "name": "pageSize", - "in": "query" - } - ], - "responses": { - "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", - "schema": { - "type": "string" - } - } - } - } - }, - "/post/page": { - "post": { - "security": [ - { - "ApiKeyAuth": [] - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "帖子" - ], - "summary": "帖子列表", - "parameters": [ - { - "description": "帖子列表", + "description": "分页获取帖子列表", "name": "data", "in": "body", "required": true, @@ -4746,11 +1466,11 @@ } } }, - "/post/update": { + "/post/page": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4762,21 +1482,21 @@ "tags": [ "帖子" ], - "summary": "修改帖子", + "summary": "帖子列表", "parameters": [ { - "description": "修改帖子", + "description": "分页获取帖子列表", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.UpdatePost" + "$ref": "#/definitions/request.PostPage" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } @@ -4784,11 +1504,11 @@ } } }, - "/post/uploadImg": { + "/post/publish": { "post": { "security": [ { - "ApiKeyAuth": [] + "BearerAuth": [] } ], "consumes": [ @@ -4800,21 +1520,21 @@ "tags": [ "帖子" ], - "summary": "上传帖子图片", + "summary": "发布帖子", "parameters": [ { - "description": "上传帖子图片", + "description": "发布帖子", "name": "data", "in": "body", "required": true, "schema": { - "$ref": "#/definitions/request.UploadOss" + "$ref": "#/definitions/request.CreatePost" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", "schema": { "type": "string" } @@ -5076,6 +1796,177 @@ } } }, + "/topic/add": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "修改话题", + "parameters": [ + { + "description": "修改话题", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateTopic" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/topic/delete": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "删除任务", + "parameters": [ + { + "description": "删除话题", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/topic/detail": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "话题详情", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/topic/list": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "话题列表", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/topic/page": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "帖子话题" + ], + "summary": "话题分页", + "parameters": [ + { + "description": "分页获取话题列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/user/changePassword": { "post": { "security": [ @@ -5388,59 +2279,370 @@ } } } + }, + "/wiki-class/add": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "添加分类", + "parameters": [ + { + "description": "添加分类", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CreateWikiClass" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/delete": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "删除分类", + "parameters": [ + { + "description": "删除分类", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.IdsReq" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"删除成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/detail": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "分类详情", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/list": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "分类列表", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/page": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "分类分页", + "parameters": [ + { + "description": "分页获取分类列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki-class/update": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科分类" + ], + "summary": "修改分类(可直接传入ossId修改图片)", + "parameters": [ + { + "description": "修改分类", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateWikiClass" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki/add": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科" + ], + "summary": "添加百科", + "parameters": [ + { + "description": "添加百科", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.CreateWiki" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki/detail": { + "get": { + "security": [ + { + "BearerAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科" + ], + "summary": "百科详情", + "parameters": [ + { + "type": "string", + "description": "id", + "name": "id", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki/page": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科" + ], + "summary": "分页", + "parameters": [ + { + "description": "百科分页", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.WikiPage" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/wiki/update": { + "post": { + "security": [ + { + "BearerAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "百科" + ], + "summary": "修改百科", + "parameters": [ + { + "description": "修改百科", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.UpdateWiki" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"发布成功\"}", + "schema": { + "type": "string" + } + } + } + } } }, "definitions": { - "request.AlterClass": { - "type": "object", - "properties": { - "id": { - "description": "植物id", - "type": "string" - }, - "ids": { - "description": "要关联的分类ids", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "request.AlterRelatedLibrary": { - "type": "object", - "properties": { - "id": { - "description": "植物id", - "type": "string" - }, - "ids": { - "description": "要关联的植物ids", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "request.CareItem": { - "type": "object", - "properties": { - "desc": { - "type": "string" - }, - "name": { - "type": "string" - }, - "period": { - "type": "integer" - } - } - }, "request.CarePlan": { "type": "object", "properties": { - "desc": { + "icon": { + "description": "icon信息", "type": "string" }, "name": { @@ -5453,30 +2655,6 @@ } } }, - "request.CareSchedule": { - "type": "object", - "properties": { - "careItems": { - "description": "养护项目", - "type": "array", - "items": { - "$ref": "#/definitions/request.CareItem" - } - }, - "desc": { - "description": "描述", - "type": "string" - }, - "season": { - "description": "季节", - "type": "string" - }, - "sort": { - "description": "排序", - "type": "integer" - } - } - }, "request.ChangePwd": { "type": "object", "properties": { @@ -5488,118 +2666,16 @@ } } }, - "request.CreateAddress": { - "type": "object", - "properties": { - "detail": { - "type": "string" - }, - "isDefault": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "phone": { - "type": "string" - } - } - }, - "request.CreateBadge": { + "request.CompleteTask": { "type": "object", "required": [ - "countLimit" + "taskId" ], "properties": { - "categoryId": { + "remark": { "type": "string" }, - "countLimit": { - "description": "获取徽章需要完成的操作次数", - "type": "integer" - }, - "desc": { - "type": "string" - }, - "keyword": { - "type": "string" - }, - "name": { - "type": "string" - }, - "ossId": { - "type": "string" - } - } - }, - "request.CreateBadgeCategory": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "desc": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "request.CreateClaimPlant": { - "type": "object", - "properties": { - "content": { - "type": "string" - }, - "libraryId": { - "description": "百科id", - "type": "string" - }, - "name": { - "type": "string" - }, - "ossIds": { - "type": "array", - "items": { - "type": "string" - } - }, - "points": { - "type": "integer" - }, - "postage": { - "description": "邮费 单位(分)", - "type": "integer" - }, - "stock": { - "description": "库存", - "type": "integer" - }, - "tag": { - "type": "string" - }, - "videoUrl": { - "type": "string" - } - } - }, - "request.CreateClassification": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "description": "分类名称", - "type": "string" - }, - "ossId": { - "description": "图片id", - "type": "string" - }, - "tag": { - "description": "标签", + "taskId": { "type": "string" } } @@ -5608,228 +2684,16 @@ "type": "object", "required": [ "content", - "parentId", - "postId", - "rootId" + "postId" ], "properties": { "content": { "description": "评论内容", "type": "string" }, - "parentId": { - "description": "父级评论id\" 默认为0", - "type": "string" - }, "postId": { "description": "帖子id", "type": "string" - }, - "rootId": { - "description": "根评论id 默认为0 如评论1 评论2 评论3 1是根评论 2是1的子评论 3是2的子评论 那么2和3的rootId都是1的主键id", - "type": "string" - } - } - }, - "request.CreateGrowRecord": { - "type": "object", - "required": [ - "plantId" - ], - "properties": { - "content": { - "type": "string" - }, - "desc": { - "type": "string" - }, - "name": { - "type": "string" - }, - "ossIds": { - "type": "array", - "items": { - "type": "string" - } - }, - "plantId": { - "type": "string" - }, - "tag": { - "type": "string" - } - } - }, - "request.CreateInvitationConfig": { - "type": "object", - "properties": { - "codeExpireDays": { - "description": "邀请码有效期(天)", - "type": "integer" - }, - "codeLength": { - "description": "邀请码长度", - "type": "integer" - }, - "enableAutoAward": { - "description": "是否自动发放积分", - "type": "integer" - }, - "isActive": { - "description": "是否启用", - "type": "integer" - }, - "maxInvitesPerDay": { - "description": "每日最大邀请奖励次数", - "type": "integer" - }, - "maxPointsPerUser": { - "description": "单用户最大邀请奖励积分", - "type": "integer" - }, - "name": { - "description": "配置名称", - "type": "string" - }, - "pointsPerInvite": { - "description": "每成功邀请奖励积分", - "type": "integer" - } - } - }, - "request.CreateLibrary": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "aliases": { - "description": "别名", - "type": "string" - }, - "careSchedule": { - "description": "养护计划", - "type": "array", - "items": { - "$ref": "#/definitions/request.CareSchedule" - } - }, - "classIds": { - "description": "分类id", - "type": "array", - "items": { - "type": "string" - } - }, - "difficulty": { - "description": "种植难度 1-5级", - "type": "integer" - }, - "distributionArea": { - "description": "分布区域", - "type": "string" - }, - "flowerDiameter": { - "description": "花直径(cm)", - "type": "integer" - }, - "floweringColor": { - "description": "花色", - "type": "string" - }, - "floweringPeriod": { - "description": "开花特征", - "type": "string" - }, - "floweringShape": { - "description": "花形", - "type": "string" - }, - "foliageColor": { - "description": "叶色", - "type": "string" - }, - "foliageShape": { - "description": "叶形", - "type": "string" - }, - "foliageType": { - "description": "植物特征", - "type": "string" - }, - "fruit": { - "description": "果", - "type": "string" - }, - "genus": { - "description": "属", - "type": "string" - }, - "growthHabit": { - "description": "生长习性", - "type": "string" - }, - "height": { - "description": "高度(cm)", - "type": "integer" - }, - "isHot": { - "description": "是否热门", - "type": "integer" - }, - "latinName": { - "description": "拉丁名", - "type": "string" - }, - "lifeCycle": { - "description": "生命周期", - "type": "string" - }, - "lightIntensity": { - "description": "光照强度", - "type": "string" - }, - "lightType": { - "description": "光照类型(直射,散射等)", - "type": "string" - }, - "name": { - "description": "基本信息", - "type": "string" - }, - "optimalTempPeriod": { - "description": "最佳温度区间", - "type": "string" - }, - "ossIds": { - "description": "图片", - "type": "array", - "items": { - "type": "string" - } - }, - "pestsDiseases": { - "description": "常见病虫害", - "type": "string" - }, - "relatedLibraryIds": { - "description": "相关推荐 library", - "type": "array", - "items": { - "type": "string" - } - }, - "reproductionMethod": { - "description": "繁殖方法", - "type": "string" - }, - "stem": { - "description": "茎", - "type": "string" - }, - "tag": { - "description": "标签", - "type": "string" } } }, @@ -5848,7 +2712,7 @@ "type": "string" }, "ossIds": { - "description": "图片", + "description": "图片ids", "type": "array", "items": { "type": "string" @@ -5904,68 +2768,161 @@ } } }, - "request.CreateQrcode": { + "request.CreateTopic": { "type": "object", "properties": { - "name": { + "end_time": { "type": "string" }, - "ossId": { + "remark": { "type": "string" }, - "url": { + "start_time": { + "type": "string" + }, + "title": { "type": "string" } } }, - "request.DeleteClass": { + "request.CreateWiki": { "type": "object", + "required": [ + "name" + ], "properties": { - "id": { - "description": "植物id", + "aliases": { + "description": "别名", "type": "string" }, - "ids": { - "description": "要取消关联的分类ids", + "classIds": { + "description": "分类id", "type": "array", "items": { "type": "string" } - } - } - }, - "request.DeleteOss": { - "type": "object", - "required": [ - "id", - "ossIds" - ], - "properties": { - "id": { - "description": "数据主键", + }, + "difficulty": { + "description": "种植难度 1-5级", + "type": "integer" + }, + "distributionArea": { + "description": "分布区域", + "type": "string" + }, + "flowerDiameter": { + "description": "花直径(cm)", + "type": "integer" + }, + "floweringColor": { + "description": "花色", + "type": "string" + }, + "floweringPeriod": { + "description": "开花期", + "type": "string" + }, + "floweringShape": { + "description": "花形", + "type": "string" + }, + "foliageColor": { + "description": "叶色", + "type": "string" + }, + "foliageShape": { + "description": "叶形", + "type": "string" + }, + "foliageType": { + "description": "叶型", + "type": "string" + }, + "fruit": { + "description": "果", + "type": "string" + }, + "genus": { + "description": "属", + "type": "string" + }, + "growthHabit": { + "description": "生长习性", + "type": "string" + }, + "height": { + "description": "高度(cm)", + "type": "integer" + }, + "isHot": { + "description": "是否热门", + "type": "integer" + }, + "latinName": { + "description": "拉丁名", + "type": "string" + }, + "lifeCycle": { + "description": "生命周期", + "type": "string" + }, + "lightIntensity": { + "description": "光照强度", + "type": "string" + }, + "lightType": { + "description": "光照类型(直射,散射等)", + "type": "string" + }, + "name": { + "description": "名称", + "type": "string" + }, + "optimalTempPeriod": { + "description": "最佳温度区间", "type": "string" }, "ossIds": { + "description": "图片", "type": "array", "items": { "type": "string" } + }, + "pestsDiseases": { + "description": "常见病虫害", + "type": "string" + }, + "relatedWikiIds": { + "description": "相关推荐", + "type": "array", + "items": { + "type": "string" + } + }, + "reproductionMethod": { + "description": "繁殖方法", + "type": "string" + }, + "stem": { + "description": "茎", + "type": "string" } } }, - "request.DeleteRelatedLibrary": { + "request.CreateWikiClass": { "type": "object", + "required": [ + "name" + ], "properties": { - "id": { - "description": "植物id", + "name": { + "description": "分类名称", "type": "string" }, - "ids": { - "description": "要取消关联的植物ids", - "type": "array", - "items": { - "type": "string" - } + "ossId": { + "description": "图片id", + "type": "string" } } }, @@ -6108,48 +3065,6 @@ } } }, - "request.LibraryList": { - "type": "object", - "properties": { - "isHot": { - "description": "是否热门 0否 1是", - "type": "integer" - }, - "name": { - "description": "植物名称", - "type": "string" - } - } - }, - "request.LibraryPage": { - "type": "object", - "properties": { - "classId": { - "description": "分类id", - "type": "string" - }, - "current": { - "description": "页码", - "type": "integer" - }, - "isHot": { - "description": "是否热门 0否 1是", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "description": "植物名称", - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, "request.Login": { "type": "object", "properties": { @@ -6167,136 +3082,6 @@ } } }, - "request.MakeCare": { - "type": "object", - "required": [ - "id", - "status" - ], - "properties": { - "id": { - "description": "今日养护id(任务id)", - "type": "string" - }, - "remark": { - "description": "备注", - "type": "string" - }, - "status": { - "description": "状态 1:未完成 2:完成 3:跳过 4:逾期", - "type": "integer" - } - } - }, - "request.OrderPage": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "isShipped": { - "description": "是否发货 0 1", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - }, - "status": { - "description": "支付状态 1.SUCCESS 2.REFUND 3.NOTPAY 4.CLOSED", - "type": "integer" - } - } - }, - "request.PageBadge": { - "type": "object", - "properties": { - "categoryId": { - "type": "string" - }, - "current": { - "description": "页码", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, - "request.PageCategory": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, - "request.PageClaimPlant": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, - "request.PageGrowRecord": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "id": { - "description": "植物id", - "type": "string" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, "request.PageInfo": { "type": "object", "properties": { @@ -6314,26 +3099,6 @@ } } }, - "request.PagePlant": { - "type": "object", - "properties": { - "current": { - "description": "页码", - "type": "integer" - }, - "keyword": { - "description": "关键字", - "type": "string" - }, - "name": { - "type": "string" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, "request.PostPage": { "type": "object", "properties": { @@ -6359,328 +3124,18 @@ } } }, - "request.UnionLibrary": { - "type": "object", - "properties": { - "id": { - "description": "植物id", - "type": "string" - }, - "libraryId": { - "description": "百科植物id", - "type": "string" - } - } - }, - "request.UpdateAddress": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "detail": { - "type": "string" - }, - "id": { - "type": "string" - }, - "isDefault": { - "type": "integer" - }, - "name": { - "type": "string" - }, - "phone": { - "type": "string" - } - } - }, - "request.UpdateBadge": { - "type": "object", - "required": [ - "countLimit", - "id" - ], - "properties": { - "categoryId": { - "type": "string" - }, - "countLimit": { - "description": "获取徽章需要完成的操作次数", - "type": "integer" - }, - "desc": { - "type": "string" - }, - "id": { - "type": "string" - }, - "keyword": { - "type": "string" - }, - "name": { - "type": "string" - }, - "ossId": { - "type": "string" - } - } - }, - "request.UpdateBadgeCategory": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "desc": { - "type": "string" - }, - "id": { - "type": "string" - }, - "name": { - "type": "string" - } - } - }, - "request.UpdateCarePlan": { - "type": "object", - "required": [ - "id", - "period" - ], - "properties": { - "id": { - "description": "养护计划id", - "type": "string" - }, - "period": { - "description": "周期", - "type": "integer" - } - } - }, - "request.UpdateClaimPlant": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "content": { - "type": "string" - }, - "id": { - "type": "string" - }, - "libraryId": { - "description": "百科id", - "type": "string" - }, - "name": { - "type": "string" - }, - "points": { - "type": "integer" - }, - "postage": { - "description": "邮费 单位(分)", - "type": "integer" - }, - "stock": { - "description": "库存", - "type": "integer" - }, - "tag": { - "type": "string" - }, - "videoUrl": { - "type": "string" - } - } - }, - "request.UpdateClassification": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "id": { - "type": "string" - }, - "name": { - "description": "分类名称", - "type": "string" - }, - "ossId": { - "description": "图片id", - "type": "string" - }, - "tag": { - "description": "标签", - "type": "string" - } - } - }, - "request.UpdateInvitationConfig": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "codeExpireDays": { - "description": "邀请码有效期(天)", - "type": "integer" - }, - "codeLength": { - "description": "邀请码长度", - "type": "integer" - }, - "enableAutoAward": { - "description": "是否自动发放积分", - "type": "integer" - }, - "id": { - "type": "string" - }, - "isActive": { - "description": "是否启用", - "type": "integer" - }, - "maxInvitesPerDay": { - "description": "每日最大邀请奖励次数", - "type": "integer" - }, - "maxPointsPerUser": { - "description": "单用户最大邀请奖励积分", - "type": "integer" - }, - "name": { - "description": "配置名称", - "type": "string" - }, - "pointsPerInvite": { - "description": "每成功邀请奖励积分", - "type": "integer" - } - } - }, - "request.UpdateLibrary": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "aliases": { - "description": "别名", - "type": "string" - }, - "difficulty": { - "description": "种植难度 1-5级", - "type": "integer" - }, - "distributionArea": { - "description": "分布区域", - "type": "string" - }, - "flowerDiameter": { - "description": "花直径(cm)", - "type": "integer" - }, - "floweringColor": { - "description": "花色", - "type": "string" - }, - "floweringPeriod": { - "description": "开花特征", - "type": "string" - }, - "floweringShape": { - "description": "花形", - "type": "string" - }, - "foliageColor": { - "description": "叶色", - "type": "string" - }, - "foliageShape": { - "description": "叶形", - "type": "string" - }, - "foliageType": { - "description": "植物特征", - "type": "string" - }, - "fruit": { - "description": "果", - "type": "string" - }, - "genus": { - "description": "属", - "type": "string" - }, - "growthHabit": { - "description": "生长习性", - "type": "string" - }, - "height": { - "description": "高度(cm)", - "type": "integer" - }, - "id": { - "type": "string" - }, - "isHot": { - "description": "是否热门", - "type": "integer" - }, - "latinName": { - "description": "拉丁名", - "type": "string" - }, - "lifeCycle": { - "description": "生命周期", - "type": "string" - }, - "lightIntensity": { - "description": "光照强度", - "type": "string" - }, - "lightType": { - "description": "光照类型(直射,散射等)", - "type": "string" - }, - "name": { - "description": "名称", - "type": "string" - }, - "optimalTempPeriod": { - "description": "温度", - "type": "string" - }, - "ossId": { - "description": "ossId", - "type": "string" - }, - "pestsDiseases": { - "description": "常见病虫害", - "type": "string" - }, - "stem": { - "description": "茎", - "type": "string" - }, - "tag": { - "description": "标签", - "type": "string" - } - } - }, "request.UpdateMyPlant": { "type": "object", "required": [ "id" ], "properties": { + "carePlans": { + "type": "array", + "items": { + "$ref": "#/definitions/request.UpdatePlan" + } + }, "id": { "type": "string" }, @@ -6710,26 +3165,152 @@ } } }, - "request.UpdatePost": { + "request.UpdatePlan": { "type": "object", "required": [ "id" ], "properties": { - "content": { - "description": "内容", + "icon": { + "description": "icon信息", "type": "string" }, "id": { "type": "string" }, + "name": { + "description": "农事名称", + "type": "string" + }, + "period": { + "description": "周期", + "type": "integer" + } + } + }, + "request.UpdateTopic": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "end_time": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "remark": { + "type": "string" + }, + "start_time": { + "type": "string" + }, "title": { - "description": "标题", "type": "string" } } }, - "request.UpdateQrcode": { + "request.UpdateWiki": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "aliases": { + "description": "别名", + "type": "string" + }, + "difficulty": { + "description": "种植难度 1-5级", + "type": "integer" + }, + "distributionArea": { + "description": "分布区域", + "type": "string" + }, + "flowerDiameter": { + "description": "花直径(cm)", + "type": "integer" + }, + "floweringColor": { + "description": "花色", + "type": "string" + }, + "floweringPeriod": { + "description": "开花期", + "type": "string" + }, + "floweringShape": { + "description": "花形", + "type": "string" + }, + "foliageColor": { + "description": "叶色", + "type": "string" + }, + "foliageShape": { + "description": "叶形", + "type": "string" + }, + "foliageType": { + "description": "叶型", + "type": "string" + }, + "fruit": { + "description": "果", + "type": "string" + }, + "genus": { + "description": "属", + "type": "string" + }, + "growthHabit": { + "description": "生长习性", + "type": "string" + }, + "height": { + "description": "高度(cm)", + "type": "integer" + }, + "id": { + "type": "string" + }, + "latinName": { + "description": "拉丁名", + "type": "string" + }, + "lifeCycle": { + "description": "生命周期", + "type": "string" + }, + "lightIntensity": { + "description": "光照强度", + "type": "string" + }, + "lightType": { + "description": "光照类型(直射,散射等)", + "type": "string" + }, + "name": { + "description": "名称", + "type": "string" + }, + "optimalTempPeriod": { + "description": "最佳温度区间", + "type": "string" + }, + "pestsDiseases": { + "description": "常见病虫害", + "type": "string" + }, + "stem": { + "description": "茎", + "type": "string" + } + } + }, + "request.UpdateWikiClass": { "type": "object", "required": [ "id" @@ -6739,47 +3320,44 @@ "type": "string" }, "name": { + "description": "分类名称", "type": "string" }, - "url": { + "ossId": { + "description": "图片id", "type": "string" } } }, - "request.UploadFile": { + "request.WikiPage": { "type": "object", - "required": [ - "id", - "ossIds" - ], "properties": { - "id": { - "description": "数据主键", - "type": "string" - }, - "ossIds": { - "description": "ossId", - "type": "string" - } - } - }, - "request.UploadOss": { - "type": "object", - "required": [ - "id", - "ossIds" - ], - "properties": { - "id": { - "description": "数据主键", - "type": "string" - }, - "ossIds": { - "description": "ossIds", + "classId": { + "description": "分类id", "type": "array", "items": { "type": "string" } + }, + "current": { + "description": "页码", + "type": "integer" + }, + "isHot": { + "description": "是否热门 0否 1是", + "type": "integer" + }, + "keyword": { + "description": "关键字", + "type": "string" + }, + "name": { + "description": "植物名称", + "type": "string" + }, + "pageSize": { + "description": "每页大小", + "type": "integer" } } }, @@ -6928,9 +3506,6 @@ "createdAtStr": { "type": "string" }, - "height": { - "type": "integer" - }, "id": { "description": "主键ID", "type": "string" @@ -6955,9 +3530,6 @@ }, "url": { "type": "string" - }, - "width": { - "type": "integer" } } }, @@ -7020,17 +3592,18 @@ "type": "string" }, "miniOpenId": { - "description": "植趣小程序openid", "type": "string" }, "name": { "type": "string" }, + "nickName": { + "type": "string" + }, "phone": { "type": "string" }, "saOpenId": { - "description": "植趣服务号openid", "type": "string" }, "sessionKey": { @@ -7049,7 +3622,7 @@ } }, "securityDefinitions": { - "ApiKeyAuth": { + "BearerAuth": { "type": "apiKey", "name": "Authorization", "in": "header" diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 93884a8..299f0dd 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,38 +1,8 @@ definitions: - request.AlterClass: - properties: - id: - description: 植物id - type: string - ids: - description: 要关联的分类ids - items: - type: string - type: array - type: object - request.AlterRelatedLibrary: - properties: - id: - description: 植物id - type: string - ids: - description: 要关联的植物ids - items: - type: string - type: array - type: object - request.CareItem: - properties: - desc: - type: string - name: - type: string - period: - type: integer - type: object request.CarePlan: properties: - desc: + icon: + description: icon信息 type: string name: description: 农事名称 @@ -41,23 +11,6 @@ definitions: description: 周期 type: integer type: object - request.CareSchedule: - properties: - careItems: - description: 养护项目 - items: - $ref: '#/definitions/request.CareItem' - type: array - desc: - description: 描述 - type: string - season: - description: 季节 - type: string - sort: - description: 排序 - type: integer - type: object request.ChangePwd: properties: id: @@ -65,249 +18,26 @@ definitions: newPwd: type: string type: object - request.CreateAddress: + request.CompleteTask: properties: - detail: + remark: type: string - isDefault: - type: integer - name: - type: string - phone: - type: string - type: object - request.CreateBadge: - properties: - categoryId: - type: string - countLimit: - description: 获取徽章需要完成的操作次数 - type: integer - desc: - type: string - keyword: - type: string - name: - type: string - ossId: + taskId: type: string required: - - countLimit - type: object - request.CreateBadgeCategory: - properties: - desc: - type: string - name: - type: string - required: - - name - type: object - request.CreateClaimPlant: - properties: - content: - type: string - libraryId: - description: 百科id - type: string - name: - type: string - ossIds: - items: - type: string - type: array - points: - type: integer - postage: - description: 邮费 单位(分) - type: integer - stock: - description: 库存 - type: integer - tag: - type: string - videoUrl: - type: string - type: object - request.CreateClassification: - properties: - name: - description: 分类名称 - type: string - ossId: - description: 图片id - type: string - tag: - description: 标签 - type: string - required: - - name + - taskId type: object request.CreateComment: properties: content: description: 评论内容 type: string - parentId: - description: 父级评论id" 默认为0 - type: string postId: description: 帖子id type: string - rootId: - description: 根评论id 默认为0 如评论1 评论2 评论3 1是根评论 2是1的子评论 3是2的子评论 那么2和3的rootId都是1的主键id - type: string required: - content - - parentId - postId - - rootId - type: object - request.CreateGrowRecord: - properties: - content: - type: string - desc: - type: string - name: - type: string - ossIds: - items: - type: string - type: array - plantId: - type: string - tag: - type: string - required: - - plantId - type: object - request.CreateInvitationConfig: - properties: - codeExpireDays: - description: 邀请码有效期(天) - type: integer - codeLength: - description: 邀请码长度 - type: integer - enableAutoAward: - description: 是否自动发放积分 - type: integer - isActive: - description: 是否启用 - type: integer - maxInvitesPerDay: - description: 每日最大邀请奖励次数 - type: integer - maxPointsPerUser: - description: 单用户最大邀请奖励积分 - type: integer - name: - description: 配置名称 - type: string - pointsPerInvite: - description: 每成功邀请奖励积分 - type: integer - type: object - request.CreateLibrary: - properties: - aliases: - description: 别名 - type: string - careSchedule: - description: 养护计划 - items: - $ref: '#/definitions/request.CareSchedule' - type: array - classIds: - description: 分类id - items: - type: string - type: array - difficulty: - description: 种植难度 1-5级 - type: integer - distributionArea: - description: 分布区域 - type: string - flowerDiameter: - description: 花直径(cm) - type: integer - floweringColor: - description: 花色 - type: string - floweringPeriod: - description: 开花特征 - type: string - floweringShape: - description: 花形 - type: string - foliageColor: - description: 叶色 - type: string - foliageShape: - description: 叶形 - type: string - foliageType: - description: 植物特征 - type: string - fruit: - description: 果 - type: string - genus: - description: 属 - type: string - growthHabit: - description: 生长习性 - type: string - height: - description: 高度(cm) - type: integer - isHot: - description: 是否热门 - type: integer - latinName: - description: 拉丁名 - type: string - lifeCycle: - description: 生命周期 - type: string - lightIntensity: - description: 光照强度 - type: string - lightType: - description: 光照类型(直射,散射等) - type: string - name: - description: 基本信息 - type: string - optimalTempPeriod: - description: 最佳温度区间 - type: string - ossIds: - description: 图片 - items: - type: string - type: array - pestsDiseases: - description: 常见病虫害 - type: string - relatedLibraryIds: - description: 相关推荐 library - items: - type: string - type: array - reproductionMethod: - description: 繁殖方法 - type: string - stem: - description: 茎 - type: string - tag: - description: 标签 - type: string - required: - - name type: object request.CreateMyPlant: properties: @@ -320,7 +50,7 @@ definitions: description: 植物名称 type: string ossIds: - description: 图片 + description: 图片ids items: type: string type: array @@ -360,49 +90,119 @@ definitions: description: 标题 必须 type: string type: object - request.CreateQrcode: + request.CreateTopic: properties: - name: + end_time: type: string - ossId: + remark: type: string - url: + start_time: + type: string + title: type: string type: object - request.DeleteClass: + request.CreateWiki: properties: - id: - description: 植物id + aliases: + description: 别名 type: string - ids: - description: 要取消关联的分类ids + classIds: + description: 分类id items: type: string type: array - type: object - request.DeleteOss: - properties: - id: - description: 数据主键 + difficulty: + description: 种植难度 1-5级 + type: integer + distributionArea: + description: 分布区域 + type: string + flowerDiameter: + description: 花直径(cm) + type: integer + floweringColor: + description: 花色 + type: string + floweringPeriod: + description: 开花期 + type: string + floweringShape: + description: 花形 + type: string + foliageColor: + description: 叶色 + type: string + foliageShape: + description: 叶形 + type: string + foliageType: + description: 叶型 + type: string + fruit: + description: 果 + type: string + genus: + description: 属 + type: string + growthHabit: + description: 生长习性 + type: string + height: + description: 高度(cm) + type: integer + isHot: + description: 是否热门 + type: integer + latinName: + description: 拉丁名 + type: string + lifeCycle: + description: 生命周期 + type: string + lightIntensity: + description: 光照强度 + type: string + lightType: + description: 光照类型(直射,散射等) + type: string + name: + description: 名称 + type: string + optimalTempPeriod: + description: 最佳温度区间 type: string ossIds: + description: 图片 items: type: string type: array - required: - - id - - ossIds - type: object - request.DeleteRelatedLibrary: - properties: - id: - description: 植物id + pestsDiseases: + description: 常见病虫害 type: string - ids: - description: 要取消关联的植物ids + relatedWikiIds: + description: 相关推荐 items: type: string type: array + reproductionMethod: + description: 繁殖方法 + type: string + stem: + description: 茎 + type: string + required: + - name + type: object + request.CreateWikiClass: + properties: + name: + description: 分类名称 + type: string + ossId: + description: 图片id + type: string + required: + - name type: object request.GetClientList: properties: @@ -498,36 +298,6 @@ definitions: type: string type: array type: object - request.LibraryList: - properties: - isHot: - description: 是否热门 0否 1是 - type: integer - name: - description: 植物名称 - type: string - type: object - request.LibraryPage: - properties: - classId: - description: 分类id - type: string - current: - description: 页码 - type: integer - isHot: - description: 是否热门 0否 1是 - type: integer - keyword: - description: 关键字 - type: string - name: - description: 植物名称 - type: string - pageSize: - description: 每页大小 - type: integer - type: object request.Login: properties: account: @@ -539,98 +309,6 @@ definitions: password: type: string type: object - request.MakeCare: - properties: - id: - description: 今日养护id(任务id) - type: string - remark: - description: 备注 - type: string - status: - description: 状态 1:未完成 2:完成 3:跳过 4:逾期 - type: integer - required: - - id - - status - type: object - request.OrderPage: - properties: - current: - description: 页码 - type: integer - isShipped: - description: 是否发货 0 1 - type: integer - keyword: - description: 关键字 - type: string - pageSize: - description: 每页大小 - type: integer - status: - description: 支付状态 1.SUCCESS 2.REFUND 3.NOTPAY 4.CLOSED - type: integer - type: object - request.PageBadge: - properties: - categoryId: - type: string - current: - description: 页码 - type: integer - keyword: - description: 关键字 - type: string - name: - type: string - pageSize: - description: 每页大小 - type: integer - type: object - request.PageCategory: - properties: - current: - description: 页码 - type: integer - keyword: - description: 关键字 - type: string - name: - type: string - pageSize: - description: 每页大小 - type: integer - type: object - request.PageClaimPlant: - properties: - current: - description: 页码 - type: integer - keyword: - description: 关键字 - type: string - name: - type: string - pageSize: - description: 每页大小 - type: integer - type: object - request.PageGrowRecord: - properties: - current: - description: 页码 - type: integer - id: - description: 植物id - type: string - keyword: - description: 关键字 - type: string - pageSize: - description: 每页大小 - type: integer - type: object request.PageInfo: properties: current: @@ -643,20 +321,6 @@ definitions: description: 每页大小 type: integer type: object - request.PagePlant: - properties: - current: - description: 页码 - type: integer - keyword: - description: 关键字 - type: string - name: - type: string - pageSize: - description: 每页大小 - type: integer - type: object request.PostPage: properties: current: @@ -675,231 +339,12 @@ definitions: description: 标题 type: string type: object - request.UnionLibrary: - properties: - id: - description: 植物id - type: string - libraryId: - description: 百科植物id - type: string - type: object - request.UpdateAddress: - properties: - detail: - type: string - id: - type: string - isDefault: - type: integer - name: - type: string - phone: - type: string - required: - - id - type: object - request.UpdateBadge: - properties: - categoryId: - type: string - countLimit: - description: 获取徽章需要完成的操作次数 - type: integer - desc: - type: string - id: - type: string - keyword: - type: string - name: - type: string - ossId: - type: string - required: - - countLimit - - id - type: object - request.UpdateBadgeCategory: - properties: - desc: - type: string - id: - type: string - name: - type: string - required: - - id - type: object - request.UpdateCarePlan: - properties: - id: - description: 养护计划id - type: string - period: - description: 周期 - type: integer - required: - - id - - period - type: object - request.UpdateClaimPlant: - properties: - content: - type: string - id: - type: string - libraryId: - description: 百科id - type: string - name: - type: string - points: - type: integer - postage: - description: 邮费 单位(分) - type: integer - stock: - description: 库存 - type: integer - tag: - type: string - videoUrl: - type: string - required: - - id - type: object - request.UpdateClassification: - properties: - id: - type: string - name: - description: 分类名称 - type: string - ossId: - description: 图片id - type: string - tag: - description: 标签 - type: string - required: - - id - type: object - request.UpdateInvitationConfig: - properties: - codeExpireDays: - description: 邀请码有效期(天) - type: integer - codeLength: - description: 邀请码长度 - type: integer - enableAutoAward: - description: 是否自动发放积分 - type: integer - id: - type: string - isActive: - description: 是否启用 - type: integer - maxInvitesPerDay: - description: 每日最大邀请奖励次数 - type: integer - maxPointsPerUser: - description: 单用户最大邀请奖励积分 - type: integer - name: - description: 配置名称 - type: string - pointsPerInvite: - description: 每成功邀请奖励积分 - type: integer - required: - - id - type: object - request.UpdateLibrary: - properties: - aliases: - description: 别名 - type: string - difficulty: - description: 种植难度 1-5级 - type: integer - distributionArea: - description: 分布区域 - type: string - flowerDiameter: - description: 花直径(cm) - type: integer - floweringColor: - description: 花色 - type: string - floweringPeriod: - description: 开花特征 - type: string - floweringShape: - description: 花形 - type: string - foliageColor: - description: 叶色 - type: string - foliageShape: - description: 叶形 - type: string - foliageType: - description: 植物特征 - type: string - fruit: - description: 果 - type: string - genus: - description: 属 - type: string - growthHabit: - description: 生长习性 - type: string - height: - description: 高度(cm) - type: integer - id: - type: string - isHot: - description: 是否热门 - type: integer - latinName: - description: 拉丁名 - type: string - lifeCycle: - description: 生命周期 - type: string - lightIntensity: - description: 光照强度 - type: string - lightType: - description: 光照类型(直射,散射等) - type: string - name: - description: 名称 - type: string - optimalTempPeriod: - description: 温度 - type: string - ossId: - description: ossId - type: string - pestsDiseases: - description: 常见病虫害 - type: string - stem: - description: 茎 - type: string - tag: - description: 标签 - type: string - required: - - id - type: object request.UpdateMyPlant: properties: + carePlans: + items: + $ref: '#/definitions/request.UpdatePlan' + type: array id: type: string name: @@ -923,55 +368,145 @@ definitions: required: - id type: object - request.UpdatePost: + request.UpdatePlan: properties: - content: - description: 内容 + icon: + description: icon信息 type: string id: type: string + name: + description: 农事名称 + type: string + period: + description: 周期 + type: integer + required: + - id + type: object + request.UpdateTopic: + properties: + end_time: + type: string + id: + type: integer + remark: + type: string + start_time: + type: string title: - description: 标题 type: string required: - id type: object - request.UpdateQrcode: + request.UpdateWiki: + properties: + aliases: + description: 别名 + type: string + difficulty: + description: 种植难度 1-5级 + type: integer + distributionArea: + description: 分布区域 + type: string + flowerDiameter: + description: 花直径(cm) + type: integer + floweringColor: + description: 花色 + type: string + floweringPeriod: + description: 开花期 + type: string + floweringShape: + description: 花形 + type: string + foliageColor: + description: 叶色 + type: string + foliageShape: + description: 叶形 + type: string + foliageType: + description: 叶型 + type: string + fruit: + description: 果 + type: string + genus: + description: 属 + type: string + growthHabit: + description: 生长习性 + type: string + height: + description: 高度(cm) + type: integer + id: + type: string + latinName: + description: 拉丁名 + type: string + lifeCycle: + description: 生命周期 + type: string + lightIntensity: + description: 光照强度 + type: string + lightType: + description: 光照类型(直射,散射等) + type: string + name: + description: 名称 + type: string + optimalTempPeriod: + description: 最佳温度区间 + type: string + pestsDiseases: + description: 常见病虫害 + type: string + stem: + description: 茎 + type: string + required: + - id + type: object + request.UpdateWikiClass: properties: id: type: string name: + description: 分类名称 type: string - url: + ossId: + description: 图片id type: string required: - id type: object - request.UploadFile: + request.WikiPage: properties: - id: - description: 数据主键 - type: string - ossIds: - description: ossId - type: string - required: - - id - - ossIds - type: object - request.UploadOss: - properties: - id: - description: 数据主键 - type: string - ossIds: - description: ossIds + classId: + description: 分类id items: type: string type: array - required: - - id - - ossIds + current: + description: 页码 + type: integer + isHot: + description: 是否热门 0否 1是 + type: integer + keyword: + description: 关键字 + type: string + name: + description: 植物名称 + type: string + pageSize: + description: 每页大小 + type: integer type: object response.CaptchaRes: properties: @@ -1069,8 +604,6 @@ definitions: type: string createdAtStr: type: string - height: - type: integer id: description: 主键ID type: string @@ -1088,8 +621,6 @@ definitions: type: string url: type: string - width: - type: integer type: object system.Role: properties: @@ -1131,14 +662,14 @@ definitions: description: 主键ID type: string miniOpenId: - description: 植趣小程序openid type: string name: type: string + nickName: + type: string phone: type: string saOpenId: - description: 植趣服务号openid type: string sessionKey: type: string @@ -1292,652 +823,6 @@ paths: summary: 小程序登录 tags: - 登录相关 - /badge/add: - post: - consumes: - - application/json - parameters: - - description: 添加 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateBadge' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"添加成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 添加 - tags: - - 徽章 - /badge/all: - get: - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - summary: 获取所有无分页 - tags: - - 徽章 - /badge/class/add: - post: - consumes: - - application/json - parameters: - - description: 添加分类 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateBadgeCategory' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"添加成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 添加分类 - tags: - - 徽章 - /badge/class/delete: - post: - consumes: - - application/json - parameters: - - description: 删除分类 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除分类 - tags: - - 徽章 - /badge/class/detail: - get: - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 分类详情 - tags: - - 徽章 - /badge/class/list: - post: - consumes: - - application/json - parameters: - - description: 分类列表 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.PageCategory' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 分类列表 - tags: - - 徽章 - /badge/class/update: - post: - consumes: - - application/json - parameters: - - description: 修改分类 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UpdateBadgeCategory' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"修改成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 修改分类 - tags: - - 徽章 - /badge/delete: - post: - consumes: - - application/json - parameters: - - description: 删除ByIds - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除ByIds - tags: - - 徽章 - /badge/detail: - get: - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 详情 - tags: - - 徽章 - /badge/list: - post: - consumes: - - application/json - parameters: - - description: 获取列表 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.PageBadge' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 获取列表有分页 - tags: - - 徽章 - /badge/listByKeyword: - get: - parameters: - - description: keyword - in: query - name: keyword - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 获取列表byKeyword无分页 - tags: - - 徽章 - /badge/my/all: - get: - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 我的所有徽章 - tags: - - 徽章 - /badge/my/detail: - get: - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 我的徽章详情 - tags: - - 徽章 - /badge/my/list: - post: - consumes: - - application/json - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 我的徽章 - tags: - - 徽章 - /badge/update: - post: - consumes: - - application/json - parameters: - - description: 修改 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UpdateBadge' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"修改成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 修改 - tags: - - 徽章 - /badge/uploadImg: - post: - consumes: - - application/json - parameters: - - description: 上传图片 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UploadFile' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"上传成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 上传图片 - tags: - - 徽章 - /claim/add: - post: - consumes: - - application/json - parameters: - - description: 添加 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateClaimPlant' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"添加成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 配置植物 - tags: - - 兑换植物 - /claim/cancelUnion: - post: - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"取消关联成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 取消关联百科植物 - tags: - - 兑换植物 - /claim/claim: - get: - consumes: - - application/json - parameters: - - description: id - in: query - name: id - required: true - type: string - - description: addressId - in: query - name: addressId - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"认养成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 认养 - tags: - - 兑换植物 - /claim/delete: - post: - consumes: - - application/json - parameters: - - description: 删除 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除ByIds - tags: - - 兑换植物 - /claim/detail: - get: - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 详情 - tags: - - 兑换植物 - /claim/list: - post: - consumes: - - application/json - parameters: - - description: 获取列表 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.PageClaimPlant' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 获取列表 - tags: - - 兑换植物 - /claim/myClaims: - get: - consumes: - - application/json - parameters: - - description: 获取列表 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.PageClaimPlant' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 我的认养 - tags: - - 兑换植物 - /claim/unionLibrary: - post: - consumes: - - application/json - parameters: - - description: 关联 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UnionLibrary' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"关联成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 关联百科植物 - tags: - - 兑换植物 - /claim/update: - post: - consumes: - - application/json - parameters: - - description: 修改 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UpdateClaimPlant' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"修改成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 修改植物 - tags: - - 兑换植物 - /class/add: - post: - consumes: - - application/json - parameters: - - description: 新增分类 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateClassification' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"新增成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 新增分类 - tags: - - 植物库分类 - /class/delete: - post: - consumes: - - application/json - parameters: - - description: 删除分类 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除分类 - tags: - - 植物库分类 - /class/detail: - get: - parameters: - - description: 分类id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 分类详情 - tags: - - 植物库分类 - /class/list: - post: - consumes: - - application/json - parameters: - - description: 分类列表 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.PageInfo' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 分类列表 - tags: - - 植物库分类 - /class/update: - post: - consumes: - - application/json - parameters: - - description: 修改分类 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UpdateClassification' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"修改成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 修改分类 - tags: - - 植物库分类 /client/delete: post: consumes: @@ -2080,638 +965,6 @@ paths: summary: 更新client tags: - 客户端管理 - /comment/add: - post: - consumes: - - application/json - parameters: - - description: 添加评论 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateComment' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"添加成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 发表评论 - tags: - - 帖子评论 - /comment/delete: - delete: - consumes: - - application/json - parameters: - - description: 删除评论 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除评论 - tags: - - 帖子评论 - /config/invitation/add: - post: - consumes: - - application/json - parameters: - - description: 配置邀请码 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateInvitationConfig' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"配置成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 配置邀请码 - tags: - - 配置中心 - /config/invitation/delete: - post: - consumes: - - application/json - parameters: - - description: 删除邀请码 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除邀请码配置 - tags: - - 配置中心 - /config/invitation/detail: - get: - parameters: - - description: 邀请码id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 获取邀请码配置 - tags: - - 配置中心 - /config/invitation/list: - post: - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 获取邀请码列表 - tags: - - 配置中心 - /config/invitation/update: - post: - consumes: - - application/json - parameters: - - description: 更新邀请码 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UpdateInvitationConfig' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"更新成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 更新邀请码配置 - tags: - - 配置中心 - /config/qrcode/add: - post: - consumes: - - application/json - parameters: - - description: 配置二维码 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateQrcode' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"配置成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 配置二维码 - tags: - - 配置中心 - /config/qrcode/delete: - post: - parameters: - - description: 二维码id - in: body - name: ids - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除二维码 - tags: - - 配置中心 - /config/qrcode/detail: - get: - parameters: - - description: 二维码id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 获取二维码详情 - tags: - - 配置中心 - /config/qrcode/list: - post: - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 获取二维码 - tags: - - 配置中心 - /config/qrcode/update: - post: - consumes: - - application/json - parameters: - - description: 更新二维码 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UpdateQrcode' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"更新成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 更新二维码 - tags: - - 配置中心 - /config/qrcode/uploadImg: - post: - consumes: - - application/json - parameters: - - description: 上传二维码图片 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UploadFile' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"上传成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 上传二维码图片 - tags: - - 配置中心 - /library/add: - post: - consumes: - - application/json - parameters: - - description: 新增植物库 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateLibrary' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 新增植物库 - tags: - - 植物库 - /library/all: - post: - consumes: - - application/json - parameters: - - description: 获取所有植物库列表 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.LibraryList' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 获取所有植物库列表 - tags: - - 植物库 - /library/alterClass: - post: - consumes: - - application/json - parameters: - - description: 修改分类 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.AlterClass' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 修改分类 - tags: - - 植物库 - /library/delete: - post: - consumes: - - application/json - parameters: - - description: 删除植物库 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 删除植物库 - tags: - - 植物库 - /library/deleteClass: - post: - consumes: - - application/json - parameters: - - description: 取消关联分类 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.DeleteClass' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 取消关联分类 - tags: - - 植物库 - /library/deleteImg: - post: - consumes: - - application/json - parameters: - - description: 上传图片 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.DeleteOss' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 上传图片 - tags: - - 植物库 - /library/deleteRelateLibrary: - post: - consumes: - - application/json - parameters: - - description: 删除关联 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.DeleteRelatedLibrary' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 删除关联植物 - tags: - - 植物库 - /library/detail: - get: - parameters: - - description: 获取植物库详情 - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 获取植物库详情 - tags: - - 植物库 - /library/hot: - post: - consumes: - - application/json - parameters: - - description: 设置热门 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 设置或取消热门 - tags: - - 植物库 - /library/page: - post: - consumes: - - application/json - parameters: - - description: 获取植物库列表 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.LibraryPage' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 获取植物库列表 - tags: - - 植物库 - /library/reateLibrary: - post: - consumes: - - application/json - parameters: - - description: 添加关联 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.AlterRelatedLibrary' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 添加关联植物 - tags: - - 植物库 - /library/update: - post: - consumes: - - application/json - parameters: - - description: 修改植物库 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UpdateLibrary' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 修改植物库 - tags: - - 植物库 - /library/uploadImg: - post: - consumes: - - application/json - parameters: - - description: 上传图片 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UploadOss' - produces: - - application/json - responses: - "200": - description: OK - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: 上传图片 - tags: - - 植物库 /menu/delete: get: description: 删除menu @@ -2925,157 +1178,6 @@ paths: summary: base64植物识别 tags: - 识别相关 - /ocr/url: - get: - consumes: - - multipart/form-data - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: 文件OCR - schema: - allOf: - - $ref: '#/definitions/response.Response' - - properties: - msg: - type: string - type: object - security: - - ApiKeyAuth: [] - summary: url植物识别 - tags: - - 识别相关 - /order/delete: - post: - consumes: - - application/json - parameters: - - description: 删除订单 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除订单 - tags: - - 订单 - /order/detail: - get: - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 订单详情 - tags: - - 订单 - /order/export: - post: - parameters: - - description: 页码 - in: query - name: current - type: integer - - description: 是否发货 0 1 - in: query - name: isShipped - type: integer - - description: 关键字 - in: query - name: keyword - type: string - - description: 每页大小 - in: query - name: pageSize - type: integer - - description: 支付状态 1.SUCCESS 2.REFUND 3.NOTPAY 4.CLOSED - in: query - name: status - type: integer - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 导出订单 - tags: - - 订单 - /order/page: - post: - consumes: - - application/json - parameters: - - description: 获取列表 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.OrderPage' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 订单列表 - tags: - - 订单 - /order/ship: - post: - consumes: - - application/json - parameters: - - description: 发货 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 发货 - tags: - - 订单 /oss/delete: post: consumes: @@ -3184,224 +1286,6 @@ paths: summary: 文件上传 tags: - 文件相关 - /pay/prePay: - get: - consumes: - - application/json - parameters: - - description: 支付 - in: query - name: orderId - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"支付成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 支付 - tags: - - 微信支付 - /personal/address/add: - post: - consumes: - - application/json - parameters: - - description: 添加地址 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateAddress' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"添加成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 添加地址 - tags: - - 个人中心 - /personal/address/delete: - post: - consumes: - - application/json - parameters: - - description: 删除地址 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除地址 - tags: - - 个人中心 - /personal/address/detail: - get: - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 地址详情 - tags: - - 个人中心 - /personal/address/list: - get: - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 地址列表 - tags: - - 个人中心 - /personal/address/setDefault: - post: - consumes: - - application/json - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"设置成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 设置默认地址 - tags: - - 个人中心 - /personal/address/update: - post: - consumes: - - application/json - parameters: - - description: 修改地址 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UpdateAddress' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"修改成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 修改地址 - tags: - - 个人中心 - /personal/centerCount: - get: - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 个人中心统计 - tags: - - 个人中心 - /personal/inviteCode/accept: - get: - parameters: - - description: inviteCode - in: query - name: inviteCode - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"接受成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 接受邀请 - tags: - - 个人中心 - /personal/inviteCode/code: - get: - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"生成成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 生成邀请码 - tags: - - 个人中心 - /personal/inviteCode/records: - post: - consumes: - - application/json - parameters: - - description: 分页参数 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.PageInfo' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 邀请记录 - tags: - - 个人中心 /plant/add: post: consumes: @@ -3421,55 +1305,39 @@ paths: schema: type: string security: - - ApiKeyAuth: [] + - BearerAuth: [] summary: 添加植物 tags: - 我的植物 - /plant/carePlant: - get: - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"操作成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 立即养护 - tags: - - 我的植物 - /plant/careRecords: - get: - parameters: - - description: id - in: query - name: id - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"操作成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 养护记录 - tags: - - 我的植物 - /plant/delete: + /plant/completeTask: post: consumes: - application/json parameters: - - description: 删除ByIds + - description: 完成任务 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.CompleteTask' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"完成任务"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 完成任务 + tags: + - 我的植物 + /plant/deletePlan: + post: + consumes: + - application/json + parameters: + - description: 删除植物 in: body name: data required: true @@ -3483,21 +1351,21 @@ paths: schema: type: string security: - - ApiKeyAuth: [] - summary: 删除ByIds + - BearerAuth: [] + summary: 删除任务 tags: - 我的植物 - /plant/deleteImg: + /plant/deletePlant: post: consumes: - application/json parameters: - - description: 删除图片 + - description: 删除植物 in: body name: data required: true schema: - $ref: '#/definitions/request.DeleteOss' + $ref: '#/definitions/request.IdsReq' produces: - application/json responses: @@ -3506,8 +1374,8 @@ paths: schema: type: string security: - - ApiKeyAuth: [] - summary: 删除图片 + - BearerAuth: [] + summary: 删除植物 tags: - 我的植物 /plant/detail: @@ -3522,134 +1390,12 @@ paths: - application/json responses: "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' + description: '{"success":true,"data":{},"msg":"获取ById成功"}' schema: type: string security: - - ApiKeyAuth: [] - summary: 获取ById - tags: - - 我的植物 - /plant/grow/addRecord: - post: - consumes: - - application/json - parameters: - - description: 添加成长记录 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreateGrowRecord' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"操作成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 添加成长记录 - tags: - - 我的植物 - /plant/grow/recordDetail: - get: - parameters: - - description: id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"操作成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 成长记录详情 - tags: - - 我的植物 - /plant/grow/recordList: - post: - consumes: - - application/json - parameters: - - description: 成长记录列表 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.PageGrowRecord' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"操作成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 成长记录列表 - tags: - - 我的植物 - /plant/makeCare: - post: - consumes: - - application/json - parameters: - - description: 养护操作 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.MakeCare' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"操作成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 根据任务完成养护 - tags: - - 我的植物 - /plant/myPlants: - get: - parameters: - - description: name - in: query - name: name - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 植物列表不分页 - tags: - - 我的植物 - /plant/needCare: - get: - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"操作成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 待养护 + - BearerAuth: [] + summary: ById植物详情 tags: - 我的植物 /plant/page: @@ -3657,12 +1403,12 @@ paths: consumes: - application/json parameters: - - description: 获取植物列表 + - description: 分页获取植物列表 in: body name: data required: true schema: - $ref: '#/definitions/request.PagePlant' + $ref: '#/definitions/request.PageInfo' produces: - application/json responses: @@ -3671,34 +1417,24 @@ paths: schema: type: string security: - - ApiKeyAuth: [] + - BearerAuth: [] summary: 植物列表 tags: - 我的植物 - /plant/taskProgress: + /plant/todayTask: get: + consumes: + - application/json produces: - application/json responses: "200": - description: '{"success":true,"data":{},"msg":"操作成功"}' + description: '{"success":true,"data":{},"msg":"获取成功"}' schema: type: string security: - - ApiKeyAuth: [] - summary: 任务进度 - tags: - - 我的植物 - /plant/todayCare: - get: - responses: - "200": - description: '{"success":true,"data":{},"msg":"操作成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 今日养护 + - BearerAuth: [] + summary: 今日任务 tags: - 我的植物 /plant/update: @@ -3706,7 +1442,7 @@ paths: consumes: - application/json parameters: - - description: 修改植物 + - description: 修改ById植物 in: body name: data required: true @@ -3716,167 +1452,35 @@ paths: - application/json responses: "200": - description: '{"success":true,"data":{},"msg":"修改成功"}' + description: '{"success":true,"data":{},"msg":"修改ById成功"}' schema: type: string security: - - ApiKeyAuth: [] - summary: 修改植物 + - BearerAuth: [] + summary: 修改ById植物 tags: - 我的植物 - /plant/updateCarePlan: + /post/comment: post: consumes: - application/json parameters: - - description: 修改养护周期 + - description: 评论帖子 in: body name: data required: true schema: - $ref: '#/definitions/request.UpdateCarePlan' + $ref: '#/definitions/request.CreateComment' produces: - application/json responses: "200": - description: '{"success":true,"data":{},"msg":"修改成功"}' + description: '{"success":true,"data":{},"msg":"评论成功"}' schema: type: string security: - - ApiKeyAuth: [] - summary: 修改养护事项周期 - tags: - - 我的植物 - /plant/uploadImg: - post: - consumes: - - application/json - parameters: - - description: 上传图片 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UploadOss' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"上传成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 上传图片 - tags: - - 我的植物 - /post/add: - post: - consumes: - - application/json - parameters: - - description: 创建帖子 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.CreatePost' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"添加成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 发布 - tags: - - 帖子 - /post/cancelLike: - get: - parameters: - - description: 帖子id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"取消点赞成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 取消点赞 - tags: - - 帖子 - /post/delete: - post: - consumes: - - application/json - parameters: - - description: 删除帖子 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.IdsReq' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除帖子 - tags: - - 帖子 - /post/deleteImg: - post: - consumes: - - application/json - parameters: - - description: 删除帖子图片 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.DeleteOss' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"删除成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 删除帖子图片 - tags: - - 帖子 - /post/detail: - get: - parameters: - - description: 帖子id - in: query - name: id - required: true - type: string - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 帖子详情 + - BearerAuth: [] + summary: 评论帖子 tags: - 帖子 /post/like: @@ -3887,6 +1491,11 @@ paths: name: id required: true type: string + - description: 点赞类型 1 点赞 2 取消点赞 + in: query + name: type + required: true + type: string produces: - application/json responses: @@ -3895,45 +1504,16 @@ paths: schema: type: string security: - - ApiKeyAuth: [] + - BearerAuth: [] summary: 点赞帖子 tags: - 帖子 - /post/myPosts: + /post/myPost: post: consumes: - application/json parameters: - - description: 页码 - in: query - name: current - type: integer - - description: 关键字 - in: query - name: keyword - type: string - - description: 每页大小 - in: query - name: pageSize - type: integer - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"获取成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 我的帖子 - tags: - - 帖子 - /post/page: - post: - consumes: - - application/json - parameters: - - description: 帖子列表 + - description: 分页获取帖子列表 in: body name: data required: true @@ -3947,54 +1527,54 @@ paths: schema: type: string security: - - ApiKeyAuth: [] + - BearerAuth: [] + summary: 我的发布 + tags: + - 帖子 + /post/page: + post: + consumes: + - application/json + parameters: + - description: 分页获取帖子列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.PostPage' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - BearerAuth: [] summary: 帖子列表 tags: - 帖子 - /post/update: + /post/publish: post: consumes: - application/json parameters: - - description: 修改帖子 + - description: 发布帖子 in: body name: data required: true schema: - $ref: '#/definitions/request.UpdatePost' + $ref: '#/definitions/request.CreatePost' produces: - application/json responses: "200": - description: '{"success":true,"data":{},"msg":"修改成功"}' + description: '{"success":true,"data":{},"msg":"发布成功"}' schema: type: string security: - - ApiKeyAuth: [] - summary: 修改帖子 - tags: - - 帖子 - /post/uploadImg: - post: - consumes: - - application/json - parameters: - - description: 上传帖子图片 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.UploadOss' - produces: - - application/json - responses: - "200": - description: '{"success":true,"data":{},"msg":"上传成功"}' - schema: - type: string - security: - - ApiKeyAuth: [] - summary: 上传帖子图片 + - BearerAuth: [] + summary: 发布帖子 tags: - 帖子 /role/delete: @@ -4147,6 +1727,109 @@ paths: summary: 修改角色 tags: - 角色管理 + /topic/add: + post: + consumes: + - application/json + parameters: + - description: 修改话题 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.UpdateTopic' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"发布成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 修改话题 + tags: + - 帖子话题 + /topic/delete: + post: + consumes: + - application/json + parameters: + - description: 删除话题 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 删除任务 + tags: + - 帖子话题 + /topic/detail: + get: + parameters: + - description: id + in: query + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 话题详情 + tags: + - 帖子话题 + /topic/list: + get: + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 话题列表 + tags: + - 帖子话题 + /topic/page: + post: + consumes: + - application/json + parameters: + - description: 分页获取话题列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.PageInfo' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 话题分页 + tags: + - 帖子话题 /user/changePassword: post: consumes: @@ -4328,8 +2011,223 @@ paths: summary: 更新用户 tags: - 用户管理 + /wiki-class/add: + post: + consumes: + - application/json + parameters: + - description: 添加分类 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.CreateWikiClass' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"发布成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 添加分类 + tags: + - 百科分类 + /wiki-class/delete: + post: + consumes: + - application/json + parameters: + - description: 删除分类 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.IdsReq' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"删除成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 删除分类 + tags: + - 百科分类 + /wiki-class/detail: + get: + parameters: + - description: id + in: query + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 分类详情 + tags: + - 百科分类 + /wiki-class/list: + get: + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 分类列表 + tags: + - 百科分类 + /wiki-class/page: + post: + consumes: + - application/json + parameters: + - description: 分页获取分类列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.PageInfo' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 分类分页 + tags: + - 百科分类 + /wiki-class/update: + post: + consumes: + - application/json + parameters: + - description: 修改分类 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.UpdateWikiClass' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"发布成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 修改分类(可直接传入ossId修改图片) + tags: + - 百科分类 + /wiki/add: + post: + consumes: + - application/json + parameters: + - description: 添加百科 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.CreateWiki' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"发布成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 添加百科 + tags: + - 百科 + /wiki/detail: + get: + parameters: + - description: id + in: query + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 百科详情 + tags: + - 百科 + /wiki/page: + post: + consumes: + - application/json + parameters: + - description: 百科分页 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.WikiPage' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"发布成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 分页 + tags: + - 百科 + /wiki/update: + post: + consumes: + - application/json + parameters: + - description: 修改百科 + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.UpdateWiki' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"发布成功"}' + schema: + type: string + security: + - BearerAuth: [] + summary: 修改百科 + tags: + - 百科 securityDefinitions: - ApiKeyAuth: + BearerAuth: in: header name: Authorization type: apiKey diff --git a/initialize/router.go b/initialize/router.go index 4951584..031ed1e 100644 --- a/initialize/router.go +++ b/initialize/router.go @@ -54,6 +54,7 @@ func Routers() { plantGroup.InitPostRouter(NeedAuthGroup) // 帖子相关 plantGroup.InitWikiClassRouter(NeedAuthGroup) //百科分类 plantGroup.InitWikiRouter(NeedAuthGroup) //百科 + plantGroup.InitOcrRouter(NeedAuthGroup) // ocr识别 } diff --git a/main.go b/main.go index 17798d4..f884c5a 100644 --- a/main.go +++ b/main.go @@ -13,7 +13,7 @@ import ( // @title Swagger API接口文档 // @version v1.0.0 // @description 使用gin + gorm进行极速开发的全栈开发基础平台 -// @securityDefinitions.apikey ApiKeyAuth +// @securityDefinitions.apikey BearerAuth // @in header // @name Authorization // @BasePath / diff --git a/model/system/oss.go b/model/system/oss.go index dc84216..bb508f3 100644 --- a/model/system/oss.go +++ b/model/system/oss.go @@ -12,6 +12,4 @@ type Oss struct { Key string `json:"key" form:"key" gorm:"column:key;comment:文件key"` Suffix string `json:"suffix" form:"suffix" gorm:"column:suffix;comment:文件后缀"` MD5 string `json:"md5" form:"md5" gorm:"column:md5;comment:文件md5"` - Height int `json:"height" form:"height" gorm:"column:height;comment:图片高度"` - Width int `json:"width" form:"width" gorm:"column:width;comment:图片宽度"` } diff --git a/router/plant/enter.go b/router/plant/enter.go index d878ea4..35814fa 100644 --- a/router/plant/enter.go +++ b/router/plant/enter.go @@ -8,6 +8,7 @@ type RouterGroup struct { PostRouter WikiClassRouter WikiRouter + OcrRouter } // 初始化路由 @@ -17,4 +18,5 @@ var ( postApi = v1.ApiGroupApp.PlantApiGroup.PostApi wikiClassApi = v1.ApiGroupApp.PlantApiGroup.WikiClassApi wikiApi = v1.ApiGroupApp.PlantApiGroup.WikiApi + ocrApi = v1.ApiGroupApp.PlantApiGroup.OcrApi ) diff --git a/router/plant/ocr_router.go b/router/plant/ocr_router.go new file mode 100644 index 0000000..218ca9a --- /dev/null +++ b/router/plant/ocr_router.go @@ -0,0 +1,13 @@ +package plant + +import "github.com/gin-gonic/gin" + +type OcrRouter struct{} + +func (c *OcrRouter) InitOcrRouter(Router *gin.RouterGroup) { + badgeRouter := Router.Group("classify") + { + badgeRouter.POST("/plant", ocrApi.ClassifyPlant) + } + +} diff --git a/router/plant/post_router.go b/router/plant/post_router.go index e435737..1d370c0 100644 --- a/router/plant/post_router.go +++ b/router/plant/post_router.go @@ -10,6 +10,7 @@ func (p *PostRouter) InitPostRouter(Router *gin.RouterGroup) { // 帖子 postRouter.POST("publish", postApi.PublishPost) // 发布帖子 postRouter.POST("page", postApi.PostPage) // 帖子列表 + postRouter.POST("myPost", postApi.MyPost) // 我的发布 postRouter.GET("like", postApi.LikePost) // 点赞或者取消点赞 postRouter.POST("comment", postApi.CommentPost) // 评论 //postRouter.POST("deleteComment", postApi.delementComment) // 取消评论 diff --git a/service/plant/enter.go b/service/plant/enter.go index b2e363d..411de13 100644 --- a/service/plant/enter.go +++ b/service/plant/enter.go @@ -6,4 +6,5 @@ type ServiceGroup struct { PostService WikiClassService WikiService + OcrService } diff --git a/service/plant/ocr.go b/service/plant/ocr.go new file mode 100644 index 0000000..2774e0c --- /dev/null +++ b/service/plant/ocr.go @@ -0,0 +1,78 @@ +package plant + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "strings" + "sundynix-go/global" + "sundynix-go/model/plant/response" + "sundynix-go/pkg/httpclient" + + "go.uber.org/zap" +) + +type OcrService struct{} + +// ClassifyPlant 植物识别 +func (s *OcrService) ClassifyPlant(file multipart.File, header *multipart.FileHeader) (response.PlantRecognitionResponse, error) { + reqUrl := "https://aip.baidubce.com/rest/2.0/image-classify/v1/plant?access_token=" + getAccessToken() + // 3. 读取文件的全部字节 + fileBytes, err := io.ReadAll(file) + if err != nil { + global.Logger.Error("读取文件失败!", zap.Error(err)) + } + // 4. 将字节流编码为 Base64 字符串(可选 URLEncoding,根据场景选择) + // 去掉编码头进行urlencode + base64Str := base64.StdEncoding.EncodeToString(fileBytes) + escapedBase64 := url.QueryEscape(base64Str) + payload := strings.NewReader("image=" + escapedBase64 + "&baike_num=1") + myHttpClient := httpclient.GetClient() + req, err := http.NewRequest("POST", reqUrl, payload) + if err != nil { + global.Logger.Error("创建请求失败!", zap.Error(err)) + return response.PlantRecognitionResponse{}, err + } + req.Header.Add("Content-Type", "application/x-www-form-urlencoded") + req.Header.Add("Accept", "application/json") + resp, err := myHttpClient.Do(req) + if err != nil { + global.Logger.Error("请求百度接口失败!", zap.Error(err)) + return response.PlantRecognitionResponse{}, err + } + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + global.Logger.Error("解析百度接口响应失败!", zap.Error(err)) + return response.PlantRecognitionResponse{}, err + } + // 3. 解析JSON到结构体 + var plantResp response.PlantRecognitionResponse + if err = json.Unmarshal(body, &plantResp); err != nil { + global.Logger.Error("解析识别JSON失败!", zap.Error(err)) + } + return plantResp, err +} + +func getAccessToken() string { + rpcUrl := "https://aip.baidubce.com/oauth/2.0/token" + postData := fmt.Sprintf("grant_type=client_credentials&client_id=%s&client_secret=%s", global.Config.BaiduImgClassify.ApiKey, global.Config.BaiduImgClassify.SecretKey) + resp, err := http.Post(rpcUrl, "application/x-www-form-urlencoded", strings.NewReader(postData)) + if err != nil { + fmt.Println(err) + return "" + } + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + fmt.Println(err) + return "" + } + accessTokenObj := map[string]any{} + _ = json.Unmarshal([]byte(body), &accessTokenObj) + return accessTokenObj["access_token"].(string) +} diff --git a/service/plant/post.go b/service/plant/post.go index 55da30a..73a653a 100644 --- a/service/plant/post.go +++ b/service/plant/post.go @@ -111,6 +111,67 @@ func (s *PostService) PostPage(req plantReq.PostPage, userId string) (list inter return posts, total, err } +// MyPost 我的帖子 +func (s *PostService) MyPost(req plantReq.PostPage, userId string) (list interface{}, total int64, err error) { + limit := req.PageSize + offset := req.PageSize * (req.Current - 1) + db := global.DB.Model(&plant.Post{}). + Preload("ImgList", func(db *gorm.DB) *gorm.DB { + return db.Order("created_at desc") + }). + Preload("Publisher", func(db *gorm.DB) *gorm.DB { + return db.Preload("Avatar") + }). + Preload("LikeList", func(db *gorm.DB) *gorm.DB { + return db.Preload("Liker", func(db *gorm.DB) *gorm.DB { + return db.Preload("Avatar") + }) + }). + Preload("CommentList", func(db *gorm.DB) *gorm.DB { + return db.Preload("Commentator", func(db *gorm.DB) *gorm.DB { + return db.Preload("Avatar") + }) + }) + var posts []plant.Post + db = db.Where("user_id = ?", userId) + if req.Title != "" { + db = db.Where("title like ?", "%"+req.Title+"%") + } + //todo 审核帖子 + err = db.Count(&total).Error + if err != nil { + return + } + err = db.Limit(limit).Offset(offset).Order("created_at desc").Find(&posts).Error + // 优化 N+1 查询 + var postIds []string + for _, v := range posts { + postIds = append(postIds, v.Id) + } + // 批量查询当前用户点赞的记录 + var postLikeList []*plant.PostLike + err = global.DB.Where("user_id = ? and post_id in ?", userId, postIds).Find(&postLikeList).Error + if err != nil { + return + } + // 构建id映射 + likesMap := make(map[string]bool) + for _, v := range postLikeList { + likesMap[v.PostId] = true + } + // 是否点赞 + for i := range posts { + if likesMap[posts[i].Id] { + posts[i].HasLiked = 1 + } else { + posts[i].HasLiked = 0 + } + + } + + return posts, total, err +} + // LikePost 点赞帖或取消赞 func (s *PostService) LikePost(userId, postId, class string) error { // class = 1点赞 diff --git a/service/plant/wiki.go b/service/plant/wiki.go index 18738b0..6fac675 100644 --- a/service/plant/wiki.go +++ b/service/plant/wiki.go @@ -153,7 +153,7 @@ func (s *WikiService) WikiPage(req plantReq.WikiPage) (list interface{}, total i limit := req.PageSize offset := req.PageSize * (req.Current - 1) db := global.DB.Model(&plant.Wiki{}).Preload("ImgList", func(db *gorm.DB) *gorm.DB { - return db.Order("created_at desc").Limit(1) + return db.Order("created_at desc") }).Preload("Classes", func(db *gorm.DB) *gorm.DB { return db.Order("created_at desc") }) @@ -165,7 +165,7 @@ func (s *WikiService) WikiPage(req plantReq.WikiPage) (list interface{}, total i db = db.Where("is_hot = ?", *req.IsHot) } if len(req.ClassIdIs) > 0 { - db = db.Joins("inner join sundynix_wiki_class on sundynix_wiki_class.class.id = sundynix_wiki.id"). + db = db.Joins("inner join sundynix_wiki_class on sundynix_wiki_class.wiki_id = sundynix_wiki.id"). Where("sundynix_wiki_class.class_id IN (?)", req.ClassIdIs) } err = db.Count(&total).Error diff --git a/service/plant/wiki_class.go b/service/plant/wiki_class.go index 1389f94..b1379d0 100644 --- a/service/plant/wiki_class.go +++ b/service/plant/wiki_class.go @@ -21,8 +21,10 @@ func (s *WikiClassService) AddClass(req plantReq.CreateWikiClass) error { if !errors.Is(global.DB.Where("name = ?", req.Name).First(&plant.Class{}).Error, gorm.ErrRecordNotFound) { return errors.New("存在重复分类名称,请修改名称") } - if errors.Is(global.DB.Where("id = ?", req.OssId).First(&system.Oss{}).Error, gorm.ErrRecordNotFound) { - return errors.New("不存在此图片") + if req.OssId != "" { + if errors.Is(global.DB.Where("id = ?", req.OssId).First(&system.Oss{}).Error, gorm.ErrRecordNotFound) { + return errors.New("不存在此图片") + } } return global.DB.Create(&plant.Class{ Name: req.Name, @@ -42,8 +44,8 @@ func (s *WikiClassService) UpdateClass(req plantReq.UpdateWikiClass) error { func (s *WikiClassService) ClassPage(req common.PageInfo) (list interface{}, total int64, err error) { limit := req.PageSize offset := req.PageSize * (req.Current - 1) - db := global.DB.Model(&plant.Class{}).Preload("Oss") - var classes []*plant.Class + db := global.DB.Model(&plant.Class{}) + var classes []plant.Class err = db.Count(&total).Error if err != nil { return @@ -65,7 +67,7 @@ func (s *WikiClassService) DeleteClass(req common.IdsReq) error { // ClassList 列表 func (s *WikiClassService) ClassList() (list interface{}, err error) { var classes []plant.Class - err = global.DB.Order("created_at desc").Find(&classes).Error + err = global.DB.Preload("Oss").Order("created_at desc").Find(&classes).Error if err != nil { return } diff --git a/service/system/oss.go b/service/system/oss.go index 87258f5..50e9b78 100644 --- a/service/system/oss.go +++ b/service/system/oss.go @@ -4,7 +4,6 @@ import ( "crypto/md5" "errors" "fmt" - "image" _ "image/jpeg" _ "image/png" "io" @@ -58,24 +57,7 @@ func (o *OssService) Upload(multipartFile multipart.File, header *multipart.File } //文件后缀 s := strings.Split(header.Filename, ".") - height := 0 - width := 0 - //mime类型 - contentType := header.Header.Get("Content-Type") - allowedImageTypes := map[string]bool{ - "image/jpeg": true, - "image/png": true, - } - isPossibleImage := allowedImageTypes[contentType] //仅当可能是图片时 才计算图片宽高 - if isPossibleImage { - img, _, err1 := image.Decode(multipartFile) - if err1 != nil { - return file, err - } - height = img.Bounds().Max.Y - width = img.Bounds().Max.X - } f := system.Oss{ Key: key, // uploads/2025-09-17/ Name: header.Filename, @@ -83,8 +65,6 @@ func (o *OssService) Upload(multipartFile multipart.File, header *multipart.File Tag: s[len(s)-1], Url: filepath, // http://127.0.0.1:9000/planting-fun/uploads/2025-09-17/211476f3837fc7acbaebf0f901c1bd68.png MD5: hashString, - Height: height, - Width: width, } return f, global.DB.Create(&f).Error } diff --git a/service/system/sys_menu.go b/service/system/sys_menu.go index 4b833ca..9dd376e 100644 --- a/service/system/sys_menu.go +++ b/service/system/sys_menu.go @@ -96,7 +96,7 @@ func (s *MenuService) GetUserRoutes(userId string) (menus []*system.Menu, err er var menuIds []string err = global.DB.Model(&system.RoleMenu{}).Where("role_id in ?", roleIds).Pluck("menu_id", &menuIds).Error var menuList []*system.Menu - err = global.DB.Model(&system.Menu{}).Where("id in ?", menuIds).Order("sort asc").Find(&menuList).Error + err = global.DB.Model(&system.Menu{}).Where("id in ? and category = 1 ", menuIds).Order("sort asc").Find(&menuList).Error return buildMenuTree(menuList), nil }