Răsfoiți Sursa

添加注解

林健华 2 ani în urmă
părinte
comite
1fdcdcf3cd

+ 4 - 15
src/main/java/com/benyun/controller/ApplyController.java

@@ -2,16 +2,13 @@ package com.benyun.controller;
 
 
 import com.benyun.boot.core.vo.Result;
-import com.benyun.vo.ApplyEventVo;
+import com.benyun.vo.ApplyVo;
 import lombok.RequiredArgsConstructor;
 import com.benyun.entity.Apply;
 import com.benyun.service.ApplyService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
@@ -21,6 +18,8 @@ import org.beetl.sql.core.engine.PageQuery;
 import java.util.List;
 
 /**
+ * 应用信息表
+ *
  * @author makejava
  * create on 2023-03-17 10:03:25
  */
@@ -49,7 +48,7 @@ public class ApplyController {
      * @return 所有数据
      */
     @GetMapping("/queryList")
-    public Result<List<Apply>> queryList(@RequestParam(required = false) String applyName) {
+    public Result<List<ApplyVo>> queryList(@RequestParam(required = false) String applyName) {
         return Result.success(applyService.queryList(applyName));
     }
     
@@ -111,14 +110,4 @@ public class ApplyController {
     public Result<Boolean> delete(@RequestParam("id") String id) {
       return Result.success(this.applyService.deleteById(id));
     }
-
-    /**
-     * 通过应用id查询应用的事件数据
-     *
-     * @return 所有数据
-     */
-    @GetMapping("/queryApplyEventByUUId")
-    public Result<ApplyEventVo> queryApplyEventByUUId(@RequestParam("uuid") String uuid) {
-        return Result.success(applyService.queryApplyEventByUUId(uuid));
-    }
 }

+ 2 - 0
src/main/java/com/benyun/controller/EventAppendixController.java

@@ -16,6 +16,8 @@ import java.net.URLEncoder;
 import java.util.List;
 
 /**
+ * 事件附件表
+ *
  * @author makejava
  * create on 2023-03-27 08:55:05
  */

+ 2 - 0
src/main/java/com/benyun/controller/EventController.java

@@ -14,6 +14,8 @@ import org.springframework.web.bind.annotation.*;
 import java.util.List;
 
 /**
+ * 事件信息表
+ *
  * @author makejava
  * create on 2023-03-17 09:06:58
  */

+ 2 - 0
src/main/java/com/benyun/controller/EventLogController.java

@@ -26,6 +26,8 @@ import java.util.List;
 import java.util.Map;
 
 /**
+ * 事件日志信息表(埋点操作)
+ *
  * @author makejava
  * create on 2023-03-22 09:25:07
  */

+ 2 - 0
src/main/java/com/benyun/controller/UserController.java

@@ -20,6 +20,8 @@ import org.beetl.sql.core.engine.PageQuery;
 import java.util.List;
 
 /**
+ * 用户管理
+ *
  * @author makejava
  * create on 2023-03-17 09:06:58
  */

+ 6 - 2
src/main/java/com/benyun/dao/ApplyDao.java

@@ -1,12 +1,14 @@
 package com.benyun.dao;
 
 import com.benyun.entity.Apply;
-import com.benyun.vo.ApplyEventVo;
+import com.benyun.vo.ApplyVo;
 import org.beetl.sql.core.mapper.BaseMapper;
 import org.beetl.sql.core.engine.PageQuery;
 import org.beetl.sql.core.annotatoin.SqlResource;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 /**
  * 应用表(Apply)表数据库访问层
  *
@@ -21,5 +23,7 @@ public interface ApplyDao extends BaseMapper<Apply> {
      */
     void queryByPage(PageQuery<Apply> pageQuery);
 
-    ApplyEventVo queryApplyEventByUUId(String uuid);
+    ApplyVo queryApplyEventByUUId(String uuid);
+
+    List<ApplyVo> queryList(String applyName);
 }

+ 4 - 0
src/main/java/com/benyun/entity/Apply.java

@@ -36,5 +36,9 @@ public class Apply extends TailBean {
      * 应用类型 如web、Android、小程序
      */
     private String applyType;
+    /**
+     * 应用令牌ID
+     */
+    private String tokenId;
 
 }

+ 2 - 5
src/main/java/com/benyun/service/ApplyService.java

@@ -5,7 +5,7 @@ import java.util.List;
 
 import com.benyun.entity.Apply;
 import com.benyun.boot.core.vo.Result;
-import com.benyun.vo.ApplyEventVo;
+import com.benyun.vo.ApplyVo;
 import org.beetl.sql.core.engine.PageQuery;
 
 /**
@@ -45,8 +45,5 @@ public interface ApplyService {
      */
     Result<List<Apply>> queryByPage(PageQuery<Apply> pageQuery);
 
-
-    ApplyEventVo queryApplyEventByUUId(String uuid);
-
-    List<Apply> queryList(String applyName);
+    List<ApplyVo> queryList(String applyName);
 }

+ 3 - 11
src/main/java/com/benyun/service/impl/ApplyServiceImpl.java

@@ -1,12 +1,11 @@
 package com.benyun.service.impl;
 
 
-import cn.hutool.core.util.StrUtil;
 import com.benyun.boot.core.vo.Result;
 import com.benyun.dao.ApplyDao;
 import com.benyun.entity.Apply;
 import com.benyun.service.ApplyService;
-import com.benyun.vo.ApplyEventVo;
+import com.benyun.vo.ApplyVo;
 import lombok.RequiredArgsConstructor;
 import org.beetl.sql.core.engine.PageQuery;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -14,7 +13,6 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
-import java.util.UUID;
 
 /**
  * 应用表(Apply)表服务实现
@@ -39,8 +37,8 @@ public class ApplyServiceImpl implements ApplyService {
     }
 
     @Override
-    public List<Apply> queryList(String applyName) {
-        return applyDao.createLambdaQuery().andLike(Apply::getApplyName, "%" + (StrUtil.isNotBlank(applyName)? applyName: "") + "%").select();
+    public List<ApplyVo> queryList(String applyName) {
+        return applyDao.queryList(applyName);
     }
 
     @Override
@@ -85,10 +83,4 @@ public class ApplyServiceImpl implements ApplyService {
         result.setCount((int) pageQuery.getTotalRow());
         return result;
     }
-
-    @Override
-    public ApplyEventVo queryApplyEventByUUId(String uuid) {
-        ApplyEventVo applyEventVo = applyDao.queryApplyEventByUUId(uuid);
-        return applyEventVo;
-    }
 }

+ 1 - 17
src/main/java/com/benyun/vo/ApplyEventVo.java → src/main/java/com/benyun/vo/ApplyVo.java

@@ -1,15 +1,8 @@
 package com.benyun.vo;
 
 
-import com.benyun.entity.Event;
 import lombok.*;
 import org.beetl.sql.core.TailBean;
-import org.beetl.sql.core.annotatoin.Table;
-import org.beetl.sql.core.annotatoin.AutoID;
-import org.beetl.sql.core.orm.OrmCondition;
-import org.beetl.sql.core.orm.OrmQuery;
-
-import java.util.List;
 
 /**
  * 应用表(Apply)实体类
@@ -22,10 +15,7 @@ import java.util.List;
 @NoArgsConstructor
 @AllArgsConstructor
 @EqualsAndHashCode(callSuper = false)
-@OrmQuery({
-        @OrmCondition(target = Event.class, attr = "uuid", targetAttr = "applyId", alias ="eventList", type = OrmQuery.Type.MANY),
-})
-public class ApplyEventVo extends TailBean {
+public class ApplyVo extends TailBean {
     private static final long serialVersionUID = 313104691699963778L;
     /**
      * 应用id
@@ -39,10 +29,4 @@ public class ApplyEventVo extends TailBean {
      * 应用类型 如web、Android、小程序
      */
     private String applyType;
-
-    /**
-     * 应用-事件列表
-     */
-    private List<Event> eventList;
-
 }

+ 1 - 0
src/main/resources/application-dev.yml

@@ -68,6 +68,7 @@ knife4j:
     username: admin
     password: benyun
 
+# 附件前缀目录
 event:
   appendix:
     # prefixPath: ../appendix/

+ 16 - 2
src/main/resources/sql/Apply.md

@@ -2,11 +2,25 @@ queryByPage
 ===
 SELECT 
 @pageTag(){
- * 
+ a.*,
+ at.token token
 @}
-FROM apply 
+FROM apply a
+LEFT JOIN `apply_token` at on at.id = a.token_id
 WHERE 1=1
 
+queryList
+===
+SELECT 
+    a.*,
+    at.token token
+FROM apply a
+LEFT JOIN `apply_token` at on at.id = a.token_id
+WHERE 1=1
+@if(!isEmpty(applyName)){
+and a.apply_name = #applyName#
+@}
+
 queryApplyEventByUUId
 ===
 SELECT a.*

+ 8 - 0
src/main/resources/sql/ApplyToken.md

@@ -0,0 +1,8 @@
+queryByPage
+===
+SELECT 
+@pageTag(){
+ * 
+@}
+FROM apply_token 
+WHERE 1=1