|
@@ -2,6 +2,7 @@ package cn.efunbox.audio.controller;
|
|
|
|
|
|
import cn.efunbox.audio.consts.Consts;
|
|
|
import cn.efunbox.audio.entity.Admin;
|
|
|
+import cn.efunbox.audio.entity.Channel;
|
|
|
import cn.efunbox.audio.service.AdminService;
|
|
|
import cn.efunbox.audio.utils.ApiCode;
|
|
|
import cn.efunbox.audio.utils.Common;
|
|
@@ -39,7 +40,7 @@ public class AdminController {
|
|
|
int tokenExpire = 24*30;
|
|
|
|
|
|
@RequestMapping(value = "/login" ,method = RequestMethod.POST)
|
|
|
- public void Search(HttpServletRequest request, HttpServletResponse response){
|
|
|
+ public void Login(HttpServletRequest request, HttpServletResponse response){
|
|
|
String name = request.getParameter("name");
|
|
|
String pwd = request.getParameter("pwd");
|
|
|
if(name==null && pwd==null){
|
|
@@ -103,8 +104,21 @@ public class AdminController {
|
|
|
// return;
|
|
|
// }
|
|
|
|
|
|
+ @RequestMapping(value = "/search" ,method = RequestMethod.POST)
|
|
|
+ public void Search(HttpServletRequest request, HttpServletResponse response){
|
|
|
+ List<Admin> adminList = adminService.SearchAll();
|
|
|
+
|
|
|
+ HttpUtil.responseOkData(request, response, adminList);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/update", method = RequestMethod.POST)
|
|
|
+ public void Update(HttpServletRequest request, HttpServletResponse response, @RequestBody Admin admin){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
@RequestMapping(value = "/register", method = RequestMethod.POST)
|
|
|
- public void Insert(HttpServletRequest request, HttpServletResponse response, @RequestBody Admin admin){
|
|
|
+ public void Insert(HttpServletRequest request, HttpServletResponse response, Admin admin){
|
|
|
String name = admin.getName();
|
|
|
String pwd = admin.getPwd();
|
|
|
|
|
@@ -124,7 +138,6 @@ public class AdminController {
|
|
|
admin.setPwd(pwdMD5);
|
|
|
admin.setSalt(salt);
|
|
|
admin.setToken(token);
|
|
|
- admin.setCreated(new Date());
|
|
|
admin = adminService.Insert(admin);
|
|
|
SaveRedis(admin);
|
|
|
|