|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
import com.qmth.boot.api.annotation.Aac;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.demo.api.db.*;
|
|
import com.qmth.demo.api.db.*;
|
|
|
|
+import com.qmth.demo.api.service.DemoLockService;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -21,6 +22,9 @@ public class UserController {
|
|
@Resource
|
|
@Resource
|
|
private UserMapper userMapper;
|
|
private UserMapper userMapper;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private DemoLockService demoLockService;
|
|
|
|
+
|
|
@RequestMapping("/list")
|
|
@RequestMapping("/list")
|
|
public Object list(@Validated UserQuery query) {
|
|
public Object list(@Validated UserQuery query) {
|
|
return userMapper.findByEnable(query.getEnable() != null ? query.getEnable() : true);
|
|
return userMapper.findByEnable(query.getEnable() != null ? query.getEnable() : true);
|
|
@@ -53,4 +57,14 @@ public class UserController {
|
|
userMapper.insert(u);
|
|
userMapper.insert(u);
|
|
return u;
|
|
return u;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @RequestMapping("/lock/add")
|
|
|
|
+ public Object lockAdd(@RequestParam String name, @RequestParam Gender gender) {
|
|
|
|
+ User u = new User();
|
|
|
|
+ u.setName(name);
|
|
|
|
+ u.setGender(gender);
|
|
|
|
+ u.setEnable(true);
|
|
|
|
+ demoLockService.insert(u);
|
|
|
|
+ return userMapper.findByName(name);
|
|
|
|
+ }
|
|
}
|
|
}
|