Bladeren bron

Merge remote-tracking branch 'origin/master'

hym 4 jaren geleden
bovenliggende
commit
31673c33db

+ 14 - 0
user_center/src/main/java/com/huaxu/controller/TenantController.java

@@ -59,6 +59,20 @@ public class TenantController {
         return new AjaxMessage<>(ResultStatus.OK, result);
     }
 
+     /**
+      * 通过租户标识查询单条数据
+      *
+      * @param code
+      * @return 单条数据
+      */
+     @RequestMapping(value = "getByCode", method = RequestMethod.POST)
+     @ApiOperation(value = "根据id查询租户")
+     public AjaxMessage<TenantDto> selectOneByCode(
+             @ApiParam(value = "租户标识", required = true) @RequestParam String code) {
+         TenantDto result = tenantService.selectByCode(code);
+
+         return new AjaxMessage<>(ResultStatus.OK, result);
+     }
     /**
      * 查询租户信息
      *

+ 7 - 1
user_center/src/main/java/com/huaxu/dao/TenantMapper.java

@@ -25,7 +25,13 @@ public interface TenantMapper  {
      * @return 实例对象
      */
     TenantDto selectById(Integer id);
-    
+    /**
+     * 通过租户标识查询单条数据
+     *
+     * @param code 主键
+     * @return 实例对象
+     */
+    TenantDto selectByCode(String code);
     /**
      * 查询全部
      *

+ 2 - 0
user_center/src/main/java/com/huaxu/logAdvice/OperateLogAdvice.java

@@ -60,6 +60,8 @@ public class OperateLogAdvice {
             MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
 
             String module = null;//ApiOperation注解的模块名
+            LogAnnotation logAnnotation = methodSignature.getMethod().getDeclaredAnnotation(LogAnnotation.class);
+            module = logAnnotation.module();
             ApiOperation methodApiOperation = methodSignature.getMethod().getDeclaredAnnotation(ApiOperation.class);
             if (methodApiOperation != null) {
                 module =methodApiOperation.value();

+ 7 - 2
user_center/src/main/java/com/huaxu/service/TenantService.java

@@ -20,8 +20,13 @@ public interface TenantService {
      * @return 实例对象
      */
     TenantDto selectById(Integer id);
-
-
+    /**
+     * 通过租户标识查询单条数据
+     *
+     * @param tenantCode 租户标识
+     * @return 实例对象
+     */
+    TenantDto selectByCode(String code);
     /**
      * 查询全部
      *

+ 10 - 1
user_center/src/main/java/com/huaxu/service/impl/TenantServiceImpl.java

@@ -78,7 +78,16 @@ public class TenantServiceImpl implements TenantService {
         }
         return tenantDto;
     }
-
+    /**
+     * 通过租户标识查询单条数据
+     *
+     * @param code 租户标识
+     * @return 实例对象
+     */
+    public TenantDto selectByCode(String code){
+        TenantDto tenantDto = tenantMapper.selectByCode(code);
+        return tenantDto;
+    }
 
     /**
      * 查询所有

+ 7 - 0
user_center/src/main/resources/mapper/TenantMapper.xml

@@ -32,6 +32,13 @@
         <include refid="tenantJoins"/>
         where t.ID = #{id} and t.status = 1
     </select>
+    <select id="selectByCode" resultType="com.huaxu.dto.TenantDto">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_tenant t
+        <include refid="tenantJoins"/>
+        where t.code = #{code} and t.status = 1
+    </select>
 
     <!-- 查询全部 -->
     <select id="selectAll" resultType="com.huaxu.dto.TenantDto">