FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

adminModel · JavaCodeMood/SpringBootUnity@a3259e7 · GitHub

Repository navigation

Commit a3259e7

Browse files
committed
adminModel
1 parent 72887b5 commit a3259e7

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

‎website/src/main/java/info/xiaomo/website/controller/AdminUserController.java‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public Result login(@RequestBody AdminModel model) {
7474
*
7575
* @return Result
7676
*/
77+
@ApiOperation(value = "添加后台用户", notes = "传一个管理员用户模型过来然后保存到数据库",httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
7778
@RequestMapping(value = "add", method = RequestMethod.POST)
7879
public Result add(@RequestBody AdminModel model) {
7980
AdminModel adminModel = service.findAdminUserByUserName(model.getUserName());
@@ -93,6 +94,7 @@ public Result add(@RequestBody AdminModel model) {
9394
* @param id id
9495
* @return Result
9596
*/
97+
@ApiOperation(value = "查找用户", notes = "根据传来的id查找用户并返回",httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
9698
@RequestMapping(value = "findById/{id}", method = RequestMethod.GET)
9799
public Result findUserById(@PathVariable("id") Long id) {
98100
AdminModel adminModel = service.findAdminUserById(id);
@@ -108,6 +110,7 @@ public Result findUserById(@PathVariable("id") Long id) {
108110
* @param userName userName
109111
* @return Result
110112
*/
113+
@ApiOperation(value = "查找用户", notes = "根据传来的用户名查找用户并返回",httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
111114
@RequestMapping(value = "findByName/{userName}", method = RequestMethod.GET)
112115
public Result findByName(@PathVariable("userName") String userName) {
113116
AdminModel adminModel = service.findAdminUserByUserName(userName);
@@ -123,6 +126,7 @@ public Result findByName(@PathVariable("userName") String userName) {
123126
* @return model
124127
* @throws UserNotFoundException UserNotFoundException
125128
*/
129+
@ApiOperation(value = "修改用户密码", notes = "传来模型验证并修改密码",httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
126130
@RequestMapping(value = "changePassword", method = RequestMethod.POST)
127131
public Result changePassword(@RequestBody AdminModel model) throws UserNotFoundException {
128132
AdminModel adminModel = service.findAdminUserByUserName(model.getUserName());
@@ -140,8 +144,9 @@ public Result changePassword(@RequestBody AdminModel model) throws UserNotFoundE
140144
/**
141145
* 返回所有
142146
*
143-
* @return 分页
147+
* @return 不分页
144148
*/
149+
@ApiOperation(value = "返回所有用户信息", notes = "不分页",httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
145150
@RequestMapping(value = "findAll", method = RequestMethod.GET)
146151
public Result getAll() {
147152
List<AdminModel> pages = service.getAdminUsers();
@@ -158,6 +163,7 @@ public Result getAll() {
158163
* @return model
159164
* @throws UserNotFoundException UserNotFoundException
160165
*/
166+
@ApiOperation(value = "删除用户", notes = "根据传入的id删除对应的用户",httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
161167
@RequestMapping(value = "delete/{id}", method = RequestMethod.GET)
162168
public Result deleteUserById(@PathVariable("id") Long id) throws UserNotFoundException {
163169
AdminModel adminModel = service.findAdminUserById(id);
@@ -175,6 +181,7 @@ public Result deleteUserById(@PathVariable("id") Long id) throws UserNotFoundExc
175181
* @return model
176182
* @throws UserNotFoundException UserNotFoundException
177183
*/
184+
@ApiOperation(value = "更新用户信息", notes = "根据传入的模型更新用户信息",httpMethod = "POST", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
178185
@RequestMapping(value = "update", method = RequestMethod.POST)
179186
public Result update(
180187
@RequestParam("userName") String userName
@@ -195,6 +202,7 @@ public Result update(
195202
* @return model
196203
* @throws UserNotFoundException UserNotFoundException
197204
*/
205+
@ApiOperation(value = "封号", notes = "根据传入的id对修改对应帐号状态",httpMethod = "GET", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
198206
@RequestMapping(value = "forbid/{id}", method = RequestMethod.GET)
199207
public Result forbid(@PathVariable("id") Long id) throws UserNotFoundException {
200208
AdminModel model = service.findAdminUserById(id);

‎website/src/main/resources/public/index.html‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@
1919
<script src='lib/handlebars-4.0.5.js' type='text/javascript'></script>
2020
<script src='lib/lodash.min.js' type='text/javascript'></script>
2121
<script src='lib/backbone-min.js' type='text/javascript'></script>
22-
<script src='swagger-ui.js' type='text/javascript'></script>
22+
<script src='swagger-ui.min.js' type='text/javascript'></script>
2323
<script src='lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
2424
<script src='lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
2525
<script src='lib/jsoneditor.min.js' type='text/javascript'></script>
2626
<script src='lib/marked.js' type='text/javascript'></script>
2727
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
2828

2929
<!-- Some basic translations -->
30-
<!-- <script src='lang/translator.js' type='text/javascript'></script> -->
31-
<!-- <script src='lang/ru.js' type='text/javascript'></script> -->
32-
<!-- <script src='lang/en.js' type='text/javascript'></script> -->
30+
<!--<script src='lang/translator.js' type='text/javascript'></script>-->
31+
<!--<script src='lang/ru.js' type='text/javascript'></script>-->
32+
<!--<script src='lang/en.js' type='text/javascript'></script>-->
3333

3434
<script type="text/javascript">
3535
$(function () {
@@ -84,18 +84,18 @@
8484
console.log.apply(console, arguments);
8585
}
8686
}
87-
});
87+
});
8888
</script>
8989
</head>
9090

9191
<body class="swagger-section">
9292
<div id='header'>
9393
<div class="swagger-ui-wrap">
94-
<a id="logo" href="http://swagger.io"><img class="logo__img" alt="swagger" height="30" width="30" src="images/logo_small.png" /><span class="logo__title">swagger</span></a>
94+
<a id="logo" href="http://swagger.io"><img class="logo__img" alt="swagger" height="30" width="30" src="images/logo_small.png" /><span class="logo__title">小莫</span></a>
9595
<form id='api_selector'>
9696
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
9797
<div id='auth_container'></div>
98-
<div class='input'><a id="explore" class="header__btn" href="#" data-sw-translate>Explore</a></div>
98+
<div class='input'><a id="explore" class="header__btn" href="#" data-sw-translate>搜索</a></div>
9999
</form>
100100
</div>
101101
</div>

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL