Commit 89171f3c by lihui.wang

更改

parent cd2f1eab
package com.freemud.api;
import com.freemud.model.Admin;
import com.freemud.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title:
* @Package com.freemud.pay
* @Description:
* @author: lihui.wang
* @date:
* @Copyright: 2017 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Controller
@RequestMapping(value = "admin")
public class AdminController {
@Autowired
private AdminService adminService;
@ResponseBody
@RequestMapping(value = "/add",produces = {"application/json;charset=UTF-8"},method = RequestMethod.POST)
public int addAdmin(Admin admin){
return adminService.addAdmin(admin);
}
@ResponseBody
@RequestMapping(value = "/delete",produces = {"application/json;charset=UTF-8"},method = RequestMethod.POST)
public int deleteAdmin(Integer uId){
return adminService.deleteAdmin(uId);
}
@ResponseBody
@RequestMapping(value = "/update",produces = {"application/json;charset=UTF-8"},method = RequestMethod.POST)
public int updateAdmin(Admin admin){
return adminService.updateByPrimaryKey(admin);
}
}
\ No newline at end of file
......@@ -31,13 +31,13 @@ public class UserController {
}
@ResponseBody
@RequestMapping(value = "/add",produces = {"application/json;charset=UTF-8"},method = RequestMethod.POST)
@RequestMapping(value = "/delete",produces = {"application/json;charset=UTF-8"},method = RequestMethod.POST)
public int deleteUser(Integer userId){
return userService.deleteUser(userId);
}
@ResponseBody
@RequestMapping(value = "/add",produces = {"application/json;charset=UTF-8"},method = RequestMethod.POST)
@RequestMapping(value = "/update",produces = {"application/json;charset=UTF-8"},method = RequestMethod.POST)
public int updateUser(User user){
return userService.updateByPrimaryKey(user);
}
......
package com.freemud.service;
import com.freemud.model.Admin;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title:
* @Package com.freemud.pay
* @Description:
* @author: lihui.wang
* @date:
* @Copyright: 2017 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
public interface AdminService {
int addAdmin(Admin admin);
int deleteAdmin(Integer uId);
int updateByPrimaryKey(Admin admin);
}
......@@ -22,8 +22,4 @@ public interface UserService {
int updateByPrimaryKey(User user);
// List<User> selectUser(Integer userId);
}
package com.freemud.service.impl;
import com.freemud.mapper.AdminMapper;
import com.freemud.model.Admin;
import com.freemud.service.AdminService;
import org.springframework.stereotype.Service;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title:
* @Package com.freemud.pay
* @Description:
* @author: lihui.wang
* @date:
* @Copyright: 2017 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
@Service(value = "adminService")
public class AdminServiceImpl implements AdminService{
private AdminMapper adminMapper;
@Override
public int addAdmin(Admin admin) {
return adminMapper.insert(admin);
}
@Override
public int deleteAdmin(Integer uId) {
return adminMapper.deleteByPrimaryKey(uId);
}
@Override
public int updateByPrimaryKey(Admin admin) {
return adminMapper.updateByPrimaryKey(admin);
}
}
\ No newline at end of file
......@@ -6,8 +6,6 @@ import com.freemud.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* All rights Reserved, Designed By www.freemud.cn
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment