From 2b5991ea7572ca3bb39eaa1738659f5d6618d5e9 Mon Sep 17 00:00:00 2001 From: zhangjian <178459446@qq.com> Date: Fri, 12 May 2023 09:14:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/controller/EntrysController.java | 289 ++++++++++++++++++ .../controller/FeedbackTypeController.java | 261 ++++++++++++++++ .../wx/application/core/entity/Entrys.java | 31 ++ .../application/core/entity/FeedbackType.java | 27 ++ .../application/core/mapper/EntrysMapper.java | 18 ++ .../core/mapper/FeedbackTypeMapper.java | 18 ++ .../core/service/EntrysService.java | 28 ++ .../core/service/FeedbackTypeService.java | 28 ++ .../com/wx/application/gorse4j/Feedback.java | 58 ++++ .../com/wx/application/gorse4j/Gorse.java | 83 +++++ .../java/com/wx/application/gorse4j/Item.java | 71 +++++ .../wx/application/gorse4j/RowAffected.java | 22 ++ .../com/wx/application/gorse4j/Score.java | 19 ++ .../java/com/wx/application/gorse4j/User.java | 45 +++ .../tool/generator/DefaultGenerator.java | 6 +- .../main/resources/mapper/EntrysMapper.xml | 6 + .../resources/mapper/FeedbackTypeMapper.xml | 6 + 17 files changed, 1013 insertions(+), 3 deletions(-) create mode 100644 api/src/main/java/com/wx/application/core/controller/EntrysController.java create mode 100644 api/src/main/java/com/wx/application/core/controller/FeedbackTypeController.java create mode 100644 api/src/main/java/com/wx/application/core/entity/Entrys.java create mode 100644 api/src/main/java/com/wx/application/core/entity/FeedbackType.java create mode 100644 api/src/main/java/com/wx/application/core/mapper/EntrysMapper.java create mode 100644 api/src/main/java/com/wx/application/core/mapper/FeedbackTypeMapper.java create mode 100644 api/src/main/java/com/wx/application/core/service/EntrysService.java create mode 100644 api/src/main/java/com/wx/application/core/service/FeedbackTypeService.java create mode 100644 api/src/main/java/com/wx/application/gorse4j/Feedback.java create mode 100644 api/src/main/java/com/wx/application/gorse4j/Gorse.java create mode 100644 api/src/main/java/com/wx/application/gorse4j/Item.java create mode 100644 api/src/main/java/com/wx/application/gorse4j/RowAffected.java create mode 100644 api/src/main/java/com/wx/application/gorse4j/Score.java create mode 100644 api/src/main/java/com/wx/application/gorse4j/User.java create mode 100644 api/src/main/resources/mapper/EntrysMapper.xml create mode 100644 api/src/main/resources/mapper/FeedbackTypeMapper.xml diff --git a/api/src/main/java/com/wx/application/core/controller/EntrysController.java b/api/src/main/java/com/wx/application/core/controller/EntrysController.java new file mode 100644 index 0000000..d541865 --- /dev/null +++ b/api/src/main/java/com/wx/application/core/controller/EntrysController.java @@ -0,0 +1,289 @@ +package com.wx.application.core.controller; + +import org.springframework.web.bind.annotation.*; +import com.wx.application.base.BaseController; +import org.springframework.beans.factory.annotation.Autowired; +import com.wx.application.core.service.EntrysService; +import com.wx.application.core.entity.Entrys; + import com.wx.application.base.ResponseData; +import java.util.Map; +import java.io.Serializable; +/** + * @description : Entrys 默认控制器,仅供生成器使用 + * --------------------------------- + * @since 2023-05-12 + */ +/*@Slf4j*/ +@RestController("coreEntrysController") +@RequestMapping("/entrys") +public class EntrysController extends BaseController { + + @Autowired + private EntrysService entrysService; + + /** + * 定义一些通用的错误信息,供其他 api引用 + * @apiDefine DefaultException + * @apiError {String} code 错误码 + * @apiError {String} msg 错误描述 + * @apiError {String} requestId 请求id标识 + * + * @apiErrorExample Error-Response: + * HTTP/1.1 200 + * { + * "code": "UNAUTHORIZED", + * "msg": "未授权,请先登录", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + */ + + /** + * 定义标准对象请求的结构体,供api引用 + * @apiDefine EntrysReq + * @apiParam {String} fid + * @apiParam {Boolean} isHidden + * @apiParam {String} categories + * @apiParam {String} labels + * @apiParam {String} description + */ + + + /** + * 定义标准对象返回的结构体,供api引用 + * @apiDefine EntrysResp + * @apiSuccess {String} fid + * @apiSuccess {Boolean} isHidden + * @apiSuccess {String} categories + * @apiSuccess {String} labels + * @apiSuccess {String} description + */ + + /** + * 定义标准头部,供api引用 + * @apiDefine EntrysHeader + * @apiHeader {String} Authorization 用户授权token + * @apiHeaderExample {json} Header-Example: + * { + * "Authorization": "Bearer 1eyJhbGciOiJIUzI1NiJ9....tzNK43MPVQWYYhDwihCAZa88zXzar7KLdgiBBDuUpBM", + * } + */ + + /** + * + * @api {post} //entrys/query_unique 通过条件查询对象 + * @apiName 通过条件查询对象 + * @apiGroup Entrys + * + * @apiUse EntrysHeader + * @apiUse EntrysResp + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": { + + "fid": null, + + "isHidden": null, + + "categories": null, + + "labels": null, + + "description": null, + * }, + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过条件查询对象 + * 仅查询第一条 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/query_unique") + public ResponseData queryUnique(@RequestBody Map entrysQ) { + return success(entrysService.queryUnique(entrysQ)); + } + + /** + * + * @api {post} //entrys/query_pages 通过条件分页查询列表 + * @apiName 通过条件分页查询列表 + * @apiGroup Entrys + * + * @apiUse EntrysHeader + * @apiUse EntrysResp + * @apiSuccess {Long} total 总数 + * @apiSuccess {Long} size 分页大小 + * @apiSuccess {Long} current 当前页 + * @apiSuccess {Long} orders 排序 + * @apiSuccess {Long} pages 总页数 + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": { + * "records": [{ + + "fid": null, + "isHidden": null, + "categories": null, + "labels": null, + "description": null, * }], + * "total": 1, + * "size": 10, + * "current": 1, + * "orders": [], + * "searchCount": true, + * "pages": 1 + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过条件分页查询列表 + * 默认第一页 分页长度为10 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/query_pages") + public ResponseData queryPages(@RequestBody Map entrysQ) { + return success(entrysService.queryPage(entrysQ)); + } + + /** + * + * @api {post} //entrys/query_list 通过条件查询列表 + * @apiName 通过条件查询列表 + * @apiGroup Entrys + * + * @apiUse EntrysHeader + * @apiUse EntrysResp + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": [{ + + "fid": null, + + "isHidden": null, + + "categories": null, + + "labels": null, + + "description": null, + * }], + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过条件查询列表 + * 不分页直接返回list + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/query_list") + public ResponseData queryList(@RequestBody Map entrysQ) { + return success(entrysService.queryList(entrysQ)); + } + + /** + * + * @api {post} //entrys/remove/:id 通过id删除单个记录 + * @apiName 通过id删除单个记录 + * @apiGroup Entrys + * + * @apiUse EntrysHeader + * @apiParam {PK} id 记录主键 + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": true, + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过id删除单个记录 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/remove/{id}") + public ResponseData remove(@PathVariable("id") Serializable id) { + return success(entrysService.remove(id)); + } + + /** + * + * @api {post} //entrys/modify 通过id更新单个记录 + * @apiName 通过id更新单个记录 + * @apiGroup Entrys + * + * @apiUse EntrysHeader + * @apiParam {PK} id 记录主键 + * @apiUse EntrysReq + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": true, + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过id更新单个记录 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/modify") + public ResponseData modify(@RequestBody Entrys entrys) { + return success(entrysService.modify(entrys)); + } + + /** + * + * @api {post} //entrys/create 新增 + * @apiName 新增 + * @apiGroup Entrys + * + * @apiUse EntrysHeader + * @apiUse EntrysReq + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": true, + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 新增 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/create") + public ResponseData create(@RequestBody Entrys entrys) { + return success(entrysService.create(entrys)); + } +} diff --git a/api/src/main/java/com/wx/application/core/controller/FeedbackTypeController.java b/api/src/main/java/com/wx/application/core/controller/FeedbackTypeController.java new file mode 100644 index 0000000..b385072 --- /dev/null +++ b/api/src/main/java/com/wx/application/core/controller/FeedbackTypeController.java @@ -0,0 +1,261 @@ +package com.wx.application.core.controller; + +import org.springframework.web.bind.annotation.*; +import com.wx.application.base.BaseController; +import org.springframework.beans.factory.annotation.Autowired; +import com.wx.application.core.service.FeedbackTypeService; +import com.wx.application.core.entity.FeedbackType; + import com.wx.application.base.ResponseData; +import java.util.Map; +import java.io.Serializable; +/** + * @description : FeedbackType 默认控制器,仅供生成器使用 + * --------------------------------- + * @since 2023-05-12 + */ +/*@Slf4j*/ +@RestController("coreFeedbackTypeController") +@RequestMapping("//feedback-type") +public class FeedbackTypeController extends BaseController { + + @Autowired + private FeedbackTypeService feedbackTypeService; + + /** + * 定义一些通用的错误信息,供其他 api引用 + * @apiDefine DefaultException + * @apiError {String} code 错误码 + * @apiError {String} msg 错误描述 + * @apiError {String} requestId 请求id标识 + * + * @apiErrorExample Error-Response: + * HTTP/1.1 200 + * { + * "code": "UNAUTHORIZED", + * "msg": "未授权,请先登录", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + */ + + /** + * 定义标准对象请求的结构体,供api引用 + * @apiDefine FeedbackTypeReq + * @apiParam {String} name + */ + + + /** + * 定义标准对象返回的结构体,供api引用 + * @apiDefine FeedbackTypeResp + * @apiSuccess {String} name + */ + + /** + * 定义标准头部,供api引用 + * @apiDefine FeedbackTypeHeader + * @apiHeader {String} Authorization 用户授权token + * @apiHeaderExample {json} Header-Example: + * { + * "Authorization": "Bearer 1eyJhbGciOiJIUzI1NiJ9....tzNK43MPVQWYYhDwihCAZa88zXzar7KLdgiBBDuUpBM", + * } + */ + + /** + * + * @api {post} //feedback-type/query_unique 通过条件查询对象 + * @apiName 通过条件查询对象 + * @apiGroup FeedbackType + * + * @apiUse FeedbackTypeHeader + * @apiUse FeedbackTypeResp + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": { + + "name": null, + * }, + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过条件查询对象 + * 仅查询第一条 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/query_unique") + public ResponseData queryUnique(@RequestBody Map feedbackTypeQ) { + return success(feedbackTypeService.queryUnique(feedbackTypeQ)); + } + + /** + * + * @api {post} //feedback-type/query_pages 通过条件分页查询列表 + * @apiName 通过条件分页查询列表 + * @apiGroup FeedbackType + * + * @apiUse FeedbackTypeHeader + * @apiUse FeedbackTypeResp + * @apiSuccess {Long} total 总数 + * @apiSuccess {Long} size 分页大小 + * @apiSuccess {Long} current 当前页 + * @apiSuccess {Long} orders 排序 + * @apiSuccess {Long} pages 总页数 + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": { + * "records": [{ + + "name": null, * }], + * "total": 1, + * "size": 10, + * "current": 1, + * "orders": [], + * "searchCount": true, + * "pages": 1 + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过条件分页查询列表 + * 默认第一页 分页长度为10 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/query_pages") + public ResponseData queryPages(@RequestBody Map feedbackTypeQ) { + return success(feedbackTypeService.queryPage(feedbackTypeQ)); + } + + /** + * + * @api {post} //feedback-type/query_list 通过条件查询列表 + * @apiName 通过条件查询列表 + * @apiGroup FeedbackType + * + * @apiUse FeedbackTypeHeader + * @apiUse FeedbackTypeResp + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": [{ + + "name": null, + * }], + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过条件查询列表 + * 不分页直接返回list + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/query_list") + public ResponseData queryList(@RequestBody Map feedbackTypeQ) { + return success(feedbackTypeService.queryList(feedbackTypeQ)); + } + + /** + * + * @api {post} //feedback-type/remove/:id 通过id删除单个记录 + * @apiName 通过id删除单个记录 + * @apiGroup FeedbackType + * + * @apiUse FeedbackTypeHeader + * @apiParam {PK} id 记录主键 + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": true, + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过id删除单个记录 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/remove/{id}") + public ResponseData remove(@PathVariable("id") Serializable id) { + return success(feedbackTypeService.remove(id)); + } + + /** + * + * @api {post} //feedback-type/modify 通过id更新单个记录 + * @apiName 通过id更新单个记录 + * @apiGroup FeedbackType + * + * @apiUse FeedbackTypeHeader + * @apiParam {PK} id 记录主键 + * @apiUse FeedbackTypeReq + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": true, + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 通过id更新单个记录 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/modify") + public ResponseData modify(@RequestBody FeedbackType feedbackType) { + return success(feedbackTypeService.modify(feedbackType)); + } + + /** + * + * @api {post} //feedback-type/create 新增 + * @apiName 新增 + * @apiGroup FeedbackType + * + * @apiUse FeedbackTypeHeader + * @apiUse FeedbackTypeReq + * @apiSuccessExample Success-Response: + * HTTP/1.1 200 OK + * { + * "data": true, + * "code": "SUCCESS", + * "msg": "请求成功", + * "requestId": "163e2f67-5306-4b10-bcbe-a1579d589446" + * } + * + * @apiUse DefaultException + * + * @description : 新增 + * --------------------------------- + * @author : zj + * @since : Create in 2023-05-12 + */ + @PostMapping(value = "/create") + public ResponseData create(@RequestBody FeedbackType feedbackType) { + return success(feedbackTypeService.create(feedbackType)); + } +} diff --git a/api/src/main/java/com/wx/application/core/entity/Entrys.java b/api/src/main/java/com/wx/application/core/entity/Entrys.java new file mode 100644 index 0000000..649db21 --- /dev/null +++ b/api/src/main/java/com/wx/application/core/entity/Entrys.java @@ -0,0 +1,31 @@ +package com.wx.application.core.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.wx.application.base.BaseEntity; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *
+ * + *
+ * + * @author zj + * @since 2023-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("re_entrys") +public class Entrys extends BaseEntity+ * + *
+ * + * @author zj + * @since 2023-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("re_feedback_type") +public class FeedbackType extends BaseEntity+ * Mapper 接口 + *
+ * + * @author zj + * @since 2023-05-12 + */ +@Repository +public interface EntrysMapper extends BaseMapper+ * Mapper 接口 + *
+ * + * @author zj + * @since 2023-05-12 + */ +@Repository +public interface FeedbackTypeMapper extends BaseMapper+ * 服务类 + *
+ * + * @author zj + * @since 2023-05-12 + */ +/*@Slf4j*/ +@Service("coreEntrysService") +@Transactional +public class EntrysService extends BaseService+ * 服务类 + *
+ * + * @author zj + * @since 2023-05-12 + */ +/*@Slf4j*/ +@Service("coreFeedbackTypeService") +@Transactional +public class FeedbackTypeService extends BaseService