From e659097eb480834802e66cbbb884c7b337c4d547 Mon Sep 17 00:00:00 2001 From: p87sjbg3f <1239676507@qq.com> Date: Fri, 28 Jun 2024 20:28:10 +0800 Subject: [PATCH] ADD file via upload --- SystemUserController.java | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 SystemUserController.java diff --git a/SystemUserController.java b/SystemUserController.java new file mode 100644 index 0000000..1395188 --- /dev/null +++ b/SystemUserController.java @@ -0,0 +1,41 @@ +package com.qsd.orange.controller; + +import com.qsd.orange.global.R; +import com.qsd.orange.po.SysUser; +import com.qsd.orange.service.UserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.validation.Valid; + +@RestController +@RequestMapping("system/user") +public class SystemUserController { + + @Autowired + private UserService userService; + + @GetMapping("all") + public R all(){ + return R.success().data("items", userService.all()); + } + + @PostMapping("add") + public R add(@Valid SysUser user){ + return R.choose(userService.add(user) > 0); + } + + @PostMapping("update") + public R update(@Valid SysUser user){ + return R.choose(userService.update(user) > 0); + } + + @GetMapping("reset") + public R reset(String username){ + return R.choose(userService.reset(username) > 0); + } + +}