Sfoglia il codice sorgente

登陆页面配置添加接口:根据id修改status

sl 7 mesi fa
parent
commit
f22b4c9ae0

+ 22 - 6
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockLoginConfig/controller/InterlockLoginConfigController.java

@@ -49,7 +49,7 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 public class InterlockLoginConfigController extends JeecgController<InterlockLoginConfig, IInterlockLoginConfigService> {
 	@Autowired
 	private IInterlockLoginConfigService interlockLoginConfigService;
-	
+
 	/**
 	 * 分页列表查询
 	 *
@@ -71,7 +71,7 @@ public class InterlockLoginConfigController extends JeecgController<InterlockLog
 		IPage<InterlockLoginConfig> pageList = interlockLoginConfigService.page(page, queryWrapper);
 		return Result.OK(pageList);
 	}
-	
+
 	/**
 	 *   添加
 	 *
@@ -86,7 +86,7 @@ public class InterlockLoginConfigController extends JeecgController<InterlockLog
 		interlockLoginConfigService.save(interlockLoginConfig);
 		return Result.OK("添加成功!");
 	}
-	
+
 	/**
 	 *  编辑
 	 *
@@ -101,7 +101,7 @@ public class InterlockLoginConfigController extends JeecgController<InterlockLog
 		interlockLoginConfigService.updateById(interlockLoginConfig);
 		return Result.OK("编辑成功!");
 	}
-	
+
 	/**
 	 *   通过id删除
 	 *
@@ -116,7 +116,7 @@ public class InterlockLoginConfigController extends JeecgController<InterlockLog
 		interlockLoginConfigService.removeById(id);
 		return Result.OK("删除成功!");
 	}
-	
+
 	/**
 	 *  批量删除
 	 *
@@ -131,7 +131,7 @@ public class InterlockLoginConfigController extends JeecgController<InterlockLog
 		this.interlockLoginConfigService.removeByIds(Arrays.asList(ids.split(",")));
 		return Result.OK("批量删除成功!");
 	}
-	
+
 	/**
 	 * 通过id查询
 	 *
@@ -174,4 +174,20 @@ public class InterlockLoginConfigController extends JeecgController<InterlockLog
         return super.importExcel(request, response, InterlockLoginConfig.class);
     }
 
+	 /**
+	  *  编辑状态  是否使用 id和status
+	  *
+	  * @param interlockLoginConfig
+	  * @return
+	  */
+	 @AutoLog(value = "联锁登陆页配置表-编辑使用状态")
+	 @ApiOperation(value="联锁登陆页配置表-编辑使用状态", notes="联锁登陆页配置表-编辑使用状态")
+	 //@RequiresPermissions("org.jeecg.modules:interlock_login_config:edit")
+	 @RequestMapping(value = "/editStatus", method = {RequestMethod.PUT,RequestMethod.POST})
+	 public Result<String> editStatus(@RequestBody InterlockLoginConfig interlockLoginConfig) {
+		 interlockLoginConfigService.updateStatusById(interlockLoginConfig);
+		 return Result.OK("编辑成功!");
+	 }
+
+
 }

+ 6 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockLoginConfig/mapper/InterlockLoginConfigMapper.java

@@ -3,6 +3,8 @@ package org.jeecg.modules.interlockLoginConfig.mapper;
 import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
 import org.jeecg.modules.interlockLoginConfig.entity.InterlockLoginConfig;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
@@ -14,4 +16,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface InterlockLoginConfigMapper extends BaseMapper<InterlockLoginConfig> {
 
+    //根据id修改状态
+    @Update("update interlock_login_config set status=#{interlockLoginConfig.status} where id=#{interlockLoginConfig.id}")
+    void updateStatusById(@Param("interlockLoginConfig") InterlockLoginConfig interlockLoginConfig);
+
 }

+ 4 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockLoginConfig/service/IInterlockLoginConfigService.java

@@ -2,6 +2,7 @@ package org.jeecg.modules.interlockLoginConfig.service;
 
 import org.jeecg.modules.interlockLoginConfig.entity.InterlockLoginConfig;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.springframework.beans.factory.annotation.Autowired;
 
 /**
  * @Description: 联锁登陆页配置表
@@ -11,4 +12,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IInterlockLoginConfigService extends IService<InterlockLoginConfig> {
 
+    //根据id修改状态
+    void updateStatusById(InterlockLoginConfig interlockLoginConfig);
+
 }

+ 12 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/interlockLoginConfig/service/impl/InterlockLoginConfigServiceImpl.java

@@ -1,8 +1,10 @@
 package org.jeecg.modules.interlockLoginConfig.service.impl;
 
+import org.checkerframework.checker.units.qual.A;
 import org.jeecg.modules.interlockLoginConfig.entity.InterlockLoginConfig;
 import org.jeecg.modules.interlockLoginConfig.mapper.InterlockLoginConfigMapper;
 import org.jeecg.modules.interlockLoginConfig.service.IInterlockLoginConfigService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -16,4 +18,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class InterlockLoginConfigServiceImpl extends ServiceImpl<InterlockLoginConfigMapper, InterlockLoginConfig> implements IInterlockLoginConfigService {
 
+    @Autowired
+    @SuppressWarnings("all")
+    private InterlockLoginConfigMapper interlockLoginConfigMapper;
+
+    //根据id修改状态
+    public void updateStatusById(InterlockLoginConfig interlockLoginConfig){
+        interlockLoginConfigMapper.updateStatusById(interlockLoginConfig);
+        return;
+    }
+
 }