|
@@ -6,12 +6,11 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.usky.common.core.bean.ApiResult;
|
|
|
import com.usky.common.core.bean.CommonPage;
|
|
|
+import com.usky.common.tenant.core.aop.TenantIgnore;
|
|
|
import com.usky.dm.domain.Test;
|
|
|
import com.usky.dm.service.TestService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -48,10 +47,12 @@ public class TestController {
|
|
|
* list
|
|
|
* @return
|
|
|
*/
|
|
|
+ @TenantIgnore
|
|
|
@GetMapping("/list")
|
|
|
public ApiResult<List<Test>> list(){
|
|
|
LambdaQueryWrapper<Test> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(Test::getNameValue,1);
|
|
|
+ queryWrapper
|
|
|
+ .eq(Test::getNameValue,1);
|
|
|
return ApiResult.success(testService.list(queryWrapper));
|
|
|
}
|
|
|
|
|
@@ -64,5 +65,36 @@ public class TestController {
|
|
|
return ApiResult.success(testService.listMapper());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ @GetMapping("/delete")
|
|
|
+ public ApiResult<Void> delete(){
|
|
|
+ LambdaQueryWrapper<Test> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(Test::getNameValue,"2");
|
|
|
+ testService.remove(queryWrapper);
|
|
|
+ return ApiResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping()
|
|
|
+ public void add(){
|
|
|
+ Test test = new Test();
|
|
|
+ test.setNameValue("1");
|
|
|
+ test.setId(8L);
|
|
|
+
|
|
|
+ testService.save(test);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PutMapping()
|
|
|
+ public void update(){
|
|
|
+ Test test = new Test();
|
|
|
+ test.setNameValue("1");
|
|
|
+ test.setId(5L);
|
|
|
+ testService.updateById(test);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|