forked from niefy/wx-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
154 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/main/java/com/github/niefy/modules/wx/manage/UserManageController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package com.github.niefy.modules.wx.manage; | ||
|
||
import java.util.Arrays; | ||
import java.util.Map; | ||
|
||
import org.apache.shiro.authz.annotation.RequiresPermissions; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.github.niefy.modules.wx.entity.User; | ||
import com.github.niefy.modules.wx.service.UserService; | ||
import com.github.niefy.common.utils.PageUtils; | ||
import com.github.niefy.common.utils.R; | ||
|
||
|
||
|
||
/** | ||
* 用户表 | ||
* | ||
* @author niefy | ||
* @email [email protected] | ||
* @date 2020-03-07 13:55:23 | ||
*/ | ||
@RestController | ||
@RequestMapping("/manage/user") | ||
public class UserManageController { | ||
@Autowired | ||
private UserService userService; | ||
|
||
/** | ||
* 列表 | ||
*/ | ||
@RequestMapping("/list") | ||
@RequiresPermissions("wx:user:list") | ||
public R list(@RequestParam Map<String, Object> params){ | ||
PageUtils page = userService.queryPage(params); | ||
|
||
return R.ok().put("page", page); | ||
} | ||
|
||
|
||
/** | ||
* 信息 | ||
*/ | ||
@RequestMapping("/info/{openid}") | ||
@RequiresPermissions("wx:user:info") | ||
public R info(@PathVariable("openid") String openid){ | ||
User user = userService.getById(openid); | ||
|
||
return R.ok().put("user", user); | ||
} | ||
|
||
/** | ||
* 保存 | ||
*/ | ||
@RequestMapping("/save") | ||
@RequiresPermissions("wx:user:save") | ||
public R save(@RequestBody User user){ | ||
userService.save(user); | ||
|
||
return R.ok(); | ||
} | ||
|
||
/** | ||
* 修改 | ||
*/ | ||
@RequestMapping("/update") | ||
@RequiresPermissions("wx:user:update") | ||
public R update(@RequestBody User user){ | ||
userService.updateById(user); | ||
|
||
return R.ok(); | ||
} | ||
|
||
/** | ||
* 删除 | ||
*/ | ||
@RequestMapping("/delete") | ||
@RequiresPermissions("wx:user:delete") | ||
public R delete(@RequestBody String[] ids){ | ||
userService.removeByIds(Arrays.asList(ids)); | ||
|
||
return R.ok(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters