|
|
@@ -11,6 +11,8 @@ import com.jzg.util.AssertionUtils;
|
|
|
import com.jzg.util.StringUtils;
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import jakarta.validation.constraints.NotEmpty;
|
|
|
+import org.apache.ibatis.annotations.Param;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
@@ -77,7 +79,7 @@ public class SysSystemController {
|
|
|
*/
|
|
|
@Log(title = "租户管理", businessType = BusinessType.UPDATE)
|
|
|
@Operation(summary = "租户修改")
|
|
|
- @PostMapping("/sysEdit")
|
|
|
+ @PutMapping("/sysEdit")
|
|
|
public HttpResult sysEdit(@Validated @RequestBody SysSystemVo sysSystemVo) {
|
|
|
AssertionUtils.isFail(StringUtils.isNull(sysSystemVo.getId()),"租户id不能为空!");
|
|
|
// 编码和名称不允许重复
|
|
|
@@ -88,4 +90,27 @@ public class SysSystemController {
|
|
|
return HttpResult.ok(sysSystemService.sysEdit(sysSystemVo));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 批量启用
|
|
|
+ */
|
|
|
+ @Log(title = "租户管理", businessType = BusinessType.UPDATE)
|
|
|
+ @Operation(summary = "状态修改 0-停用 1-在用")
|
|
|
+ @PutMapping("/changeStatus")
|
|
|
+ public HttpResult changeStatus(@RequestBody SysSystemVo sysSystemVo) {
|
|
|
+ AssertionUtils.isFail(StringUtils.isNull(sysSystemVo.getId()),"租户id不能为空!");
|
|
|
+ return HttpResult.ok(sysSystemService.changeStatus(sysSystemVo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除租户
|
|
|
+ *
|
|
|
+ * @param ids 主键串
|
|
|
+ */
|
|
|
+ @Log(title = "租户", businessType = BusinessType.DELETE)
|
|
|
+ @Operation(summary = "删除租户")
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public HttpResult remove(@NotEmpty(message = "主键不能为空")
|
|
|
+ @PathVariable Long[] ids) {
|
|
|
+ return HttpResult.ok(sysSystemService.deleteWithValidByIds(List.of(ids)));
|
|
|
+ }
|
|
|
}
|